Add files via upload

This commit is contained in:
Sankalp Tharu authored and GitHub committed 2023-02-21 14:27:16 +05:45
1 parent 1c982ba63e
commit 326c2d8820
6 files changed
+560

No files matched your search

+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 "../Themes/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 "../Themes/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 "../Themes/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;
}
+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