Add files via upload

This commit is contained in:
Sankalp Tharu authored and GitHub committed 2023-02-21 14:25:24 +05:45
1 parent 4e029e1295
commit dde8782285
6 files changed
+560

No files matched your search

+186
View File
@@ -0,0 +1,186 @@
#!/bin/sh
uifont="FiraCode Nerd Font 13"
help() {
cat <<- EOF
Run these script to change theme for rofi.
These script works along with my rofi configs.
run,
colors [options]
to change colors.
options:
nordblue
nordpink
nordblue
nordgreen
nordpurple
catppuccinred
catppuccinblue
catppuccingreen
catppuccinmavue
onedarkblue
onedarkpink
onedarkgreen
onedarkyellow
onedarkpurple
tokyoblue
tokyogreen
tokyopurple
EOF
}
nordblue() {
bg="#2E3440"
fg="#88C0D0"
bgAlt="#3B4252"
button="#3B4252"
}
nordgreen() {
bg="#2E3440"
fg="#A3BE8C"
bgAlt="#3B4252"
button="#3B4252"
}
nordorange() {
bg="#2E3440"
fg="#D08770"
bgAlt="#3B4252"
button="#3B4252"
}
nordpink() {
bg="#2E3440"
fg="#BF616A"
bgAlt="#3B4252"
button="#3B4252"
}
nordpurple() {
bg="#2E3440"
fg="#B48EAD"
bgAlt="#3B4252"
button="#3B4252"
}
catppuccinblue() {
bg="#161320"
fg="#96CDFB"
bgAlt="#1E1E2E"
button="#1E1E2E"
}
catppuccingreen() {
bg="#161320"
fg="#ABE9B3"
bgAlt="#1E1E2E"
button="#1E1E2E"
}
catppuccinmavue() {
bg="#161320"
fg="#DDB6F2"
bgAlt="#1E1E2E"
button="#1E1E2E"
}
catppuccinred() {
bg="#161320"
fg="#F28FAD"
bgAlt="#1E1E2E"
button="#1E1E2E"
}
onedarkblue() {
bg="#1E222A"
bgAlt="#252931"
fg="#61AFEF"
button="#252931"
}
onedarkgreen() {
bg="#1E222A"
bgAlt="#252931"
fg="#7EC7A2"
button="#252931"
}
onedarkpink() {
bg="#1E222A"
bgAlt="#252931"
fg="#D46489"
button="#252931"
}
onedarkpurple() {
bg="#1E222A"
bgAlt="#252931"
fg="#C678DD"
button="#252931"
}
onedarkyellow() {
bg="#1E222A"
bgAlt="#252931"
fg="#EBCB8B"
button="#252931"
}
tokyoblue() {
bg="#1A1B26"
fg="#7DCFFF"
bgAlt="#24283B"
button="#414868"
}
tokyogreen() {
bg="#1A1B26"
fg="#1ABC9C"
bgAlt="#24283B"
button="#414868"
}
tokyopurple() {
bg="#1A1B26"
fg="#BB9AF7"
bgAlt="#24283B"
button="#414868"
}
case "$1" in
"")
echo "
* {
bg: #1E222A;
bgAlt: #252931;
fg: #61AFEF;
button: @bgAlt;
background-color: @bg;
text-color: @fg;
}
configuration {
font: \""$uifont"\";
}
" > style.rasi
help
;;
*)
$1
echo "
* {
bg: $bg;
bgAlt: $bgAlt;
fg: $fg;
button: $button;
background-color: @bg;
text-color: @fg;
}
configuration {
font: \""$uifont"\";
}
" > style.rasi
;;
esac
+79
View File
@@ -0,0 +1,79 @@
configuration {
sort: true;
sorting-method: "normal";
disable-history: false;
scroll-method: 0;
window-thumbnail: true;
}
@theme "/dev/null"
* {
bg: #0C0F09;
fg: #05E289;
bgAlt: #1B1E25;
button: #05E289;
background-color: @bg;
text-color: @fg;
}
@import "../Wifi/style.rasi"
mainbox { children: [ inputbar, listview ]; }
window {
transparency: "real";
width: 600px;
border: 15px 15px 15px 15px;
border-radius: 12px;
border-color: @bg;
height: 500px;
}
inputbar {
children: [ prompt, entry ];
expand: false;
padding: 10px 10px 10px 10px;
}
prompt {
enabled: true;
padding: 10px;
border-radius: 15px;
}
entry {
background-color: @bgAlt;
placeholder: "Search";
expand: true;
padding: 10px;
border-radius: 15px;
}
listview {
columns: 2;
cycle: true;
dynamic: true;
layout: vertical;
scrollbar: false;
}
element {
orientation: vertical;
margin: 4px 4px 4px 4px;
border-radius: 10px;
background-color: @bgAlt;
}
element-text {
expand: true;
margin: 12px 15px 12px 15px;
background-color: inherit;
text-color: inherit;
}
element selected {
background-color: @fg;
text-color: @bgAlt;
border-radius: 10px;
}
+81
View File
@@ -0,0 +1,81 @@
configuration {
font: "AlegreyaSans Bold 16";
sort: true;
sorting-method: "normal";
disable-history: false;
scroll-method: 0;
window-thumbnail: true;
}
@theme "/dev/null"
* {
bg: #0C0F09;
fg: #05E289;
bgAlt: #1B1E25;
button: #05E289;
background-color: @bg;
text-color: @fg;
}
@import "../Wifi/style.rasi"
mainbox { children: [ inputbar, listview ]; }
window {
transparency: "real";
width: 400px;
border: 15px 15px 15px 15px;
border-radius: 15px;
height: 200px;
border-color: @bg;
}
inputbar {
children: [ prompt, entry ];
expand: false;
padding: 10px 10px 10px 10px;
}
prompt {
enabled: true;
background-color: @bg;
padding: 10px;
border-radius: 15px;
}
entry {
background-color: @bgAlt;
placeholder: "Password";
expand: true;
padding: 10px;
border-radius: 15px;
}
listview {
columns: 2;
cycle: true;
dynamic: true;
layout: vertical;
scrollbar: false;
}
element {
orientation: vertical;
margin: 5px 10px 5px 10px;
border-radius: 10px;
background-color: @bgAlt;
}
element-text {
expand: true;
margin: 10px 15px 10px 15px;
background-color: inherit;
text-color: inherit;
}
element selected {
background-color: @fg;
text-color: @bgAlt;
border-radius: 10px;
}
+72
View File
@@ -0,0 +1,72 @@
configuration {
sort: true;
sorting-method: "normal";
disable-history: false;
scroll-method: 0;
window-thumbnail: true;
}
@theme "/dev/null"
* {
bg: #0C0F09;
fg: #05E289;
bgAlt: #1B1E25;
button: #05E289;
background-color: @bg;
text-color: @fg;
}
@import "../Wifi/style.rasi"
mainbox { children: [ inputbar, listview ]; }
window {
transparency: "real";
width: 600px;
border: 15px 15px 15px 15px;
border-radius: 15px;
height: 500px;
border-color: @bg;
}
inputbar {
children: [ prompt ];
expand: false;
padding: 10px 10px 10px 10px;
}
prompt {
enabled: true;
background-color: @bg;
padding: 10px;
border-radius: 15px;
}
listview {
columns: 2;
cycle: true;
dynamic: true;
layout: vertical;
scrollbar: false;
}
element {
orientation: vertical;
margin: 3px 5px 3px 5px;
border-radius: 10px;
background-color: @bgAlt;
}
element-text {
expand: true;
margin: 10px 15px 10px 15px;
background-color: inherit;
text-color: inherit;
}
element selected {
background-color: @fg;
text-color: @bgAlt;
border-radius: 10px;
}
+13
View File
@@ -0,0 +1,13 @@
* {
bg: #1E222A;
bgAlt: #252931;
fg: #61AFEF;
button: #252931;
background-color: @bg;
text-color: @fg;
}
configuration {
font: "FiraCode Nerd Font 13";
}
+129
View File
@@ -0,0 +1,129 @@
#!/bin/sh
# ┬ ┬┬┌─┐┬
# ││││├┤ │
# └┴┘┴└ ┴
# Author Niraj
# Github niraj998
# ┬─┐┌─┐┌─┐┬ ┌─┐┌─┐┌┐┌┌─┐┬┌─┐┌─┐
# ├┬┘│ │├┤ │ │ │ ││││├┤ ││ ┬└─┐
# ┴└─└─┘└ ┴ └─┘└─┘┘└┘└ ┴└─┘└─┘
# rofi config without entry so to make select from available options only
rofiprompt=~/.config/rofi/Wifi/prompt.rasi
# normal rofi menu
rofidmenu=~/.config/rofi/Wifi/dmenu.rasi
# rofi config for password
rofipass=~/.config/rofi/Wifi/passwd.rasi
# ┌─┐┌┬┐┌─┐┌┬┐┬ ┬┌─┐
# └─┐ │ ├─┤ │ │ │└─┐
# └─┘ ┴ ┴ ┴ ┴ └─┘└─┘
# Power Status
flag=$(cat /sys/class/net/wl*/flags)
if [ "$flag" = "0x1003" ]; then
power="On"
else
power="Off"
fi
# Connection Status
state=$(cat /sys/class/net/wl*/operstate)
if [ "$state" = "up" ]; then
status=$(nmcli | grep "^wlp" | sed 's/\ connected\ to/Connected to/' | cut -d ':' -f2)
else
status="Disconnected"
fi
# ┌─┐┌─┐┬ ┬┌─┐┬─┐
# ├─┘│ ││││├┤ ├┬┘
# ┴ └─┘└┴┘└─┘┴└─
powertoggle=$( [ "$flag" = "0x1003" ] && echo "Power Off" || echo "Power On" )
powerswitch() {
if [ "$powertoggle" = "Power Off" ]; then
nmcli radio wifi off
elif [ "$powertoggle" = "Power On" ]; then
nmcli radio wifi on
fi
}
# ┌─┐┌─┐┌┐┌┌┐┌┌─┐┌─┐┌┬┐
# │ │ │││││││├┤ │ │
# └─┘└─┘┘└┘┘└┘└─┘└─┘ ┴
connections() {
list=$(nmcli --fields "SECURITY,SSID" device wifi list | tail -n +2 | sed "s/ */ /g" | sed -E "s/WPA*.?//g" | sed "s/^--//g" | sed "s/ //g")
networks=$(printf "$list" | rofi -config $rofiprompt -dmenu -i -hover-select -p "Select Wifi Network
$status")
wifi=$( echo "$networks" | sed "s/ //g" | sed "s/ //g" | xargs)
[ -z "$networks" ] && exit
nopass="No Password"
pass=$(printf "$nopass\nCancel" | rofi -config $rofipass -dmenu -i -hover-select -password -p "Wifi Password")
if [ "$pass" = "" ]; then
exit
elif [ "$pass" = "$nopass" ]; then
nmcli dev wifi con "$wifi" && printf "exit" | rofi -config $rofiprompt -dmenu -i -only-match -p "Successfully Connected to $wifi" && exit
elif [ "$pass" = "Cancel" ]; then
exit
else
nmcli dev wifi con "$wifi" password "$pass" && printf "exit" | rofi -config $rofiprompt -dmenu -i -only-match -p "Successfully Connected to $wifi" && exit
fi
printf "exit" | rofi -config $rofiprompt -dmenu -i -p -only-match "Failed to Connect $wifi" && exit
}
# ┌┬┐┌─┐┌┐┌┬ ┬┌─┐┬
# │││├─┤││││ │├─┤│
# ┴ ┴┴ ┴┘└┘└─┘┴ ┴┴─┘
manual() {
wifi=$(rofi -config $rofidmenu -dmenu -i -p "Enter Wifi Name")
[ -z "$wifi" ] && exit
nopass="Run Without Password"
pass=$(printf "$nopass\nCancel" | rofi -config $rofipass -dmenu -i -password -p "Wifi Password")
if [ "$pass" = "" ]; then
exit
elif [ "$pass" = "$nopass" ]; then
nmcli dev wifi con "$wifi" && printf "exit" | rofi -config $rofiprompt -dmenu -i -only-match -p "Successfully Connected to $wifi" && exit
elif [ "$pass" = "Cancel" ]; then
exit
else
nmcli dev wifi con "$wifi" password "$pass" && printf "exit" | rofi -config $rofiprompt -dmenu -i -only-match -p "Successfully Connected to $wifi" && exit
fi
printf "exit" | rofi -config $rofiprompt -dmenu -only-match -i -p "Failed to Connect $wifi" && exit
}
# ┌─┐┌─┐┌┬┐┬┌─┐┌┐┌┌─┐
# │ │├─┘ │ ││ ││││└─┐
# └─┘┴ ┴ ┴└─┘┘└┘└─┘
options="$powertoggle\nConnections\nConnect Manually"
rofiwifi=$(printf "$options" | rofi -config $rofiprompt -dmenu -i -hover-select -p "Wifi
Powered: $power
Status: $status")
case $rofiwifi in
$powertoggle)
powerswitch
;;
Connections)
notify-send "Scanning"
connections
;;
"Connect Manually")
manual
esac 2>/dev/null