This commit is contained in:
2026-04-19 18:13:23 +01:00
parent aac7c9de0a
commit 77c48b2a79
197 changed files with 28333 additions and 0 deletions
+103
View File
@@ -0,0 +1,103 @@
@import "../shared/colors.rasi"
* {
background-color: @background;
font: "JetBrainsMono Nerd Font 12";
g-spacing: 10px;
g-margin: 0;
b-color: #282828FF;
fg-color: #ebdbb2FF;
fgp-color: #a89984FF;
b-radius: 8px;
g-padding: 8px;
hl-color: #d79921FF;
hlt-color: #282828FF;
alt-color: #3c3836FF;
wbg-color: #282828CC;
w-border: 2px solid;
border-color: @selected;
w-padding: 12px;
}
listview {
columns: 1;
lines: 7;
fixed-height: true;
fixed-columns: true;
cycle: false;
scrollbar: false;
border: 0px solid;
}
window {
transparency: "real";
width: 450px;
border-radius: @b-radius;
background-color: @background;
border: @w-border;
border-color: @selected;
padding: @w-padding;
}
prompt {
text-color: @foreground;
}
inputbar {
children: ["prompt", "entry"];
spacing: @g-spacing;
}
entry {
placeholder: "Type something...";
text-color: @foreground;
placeholder-color: @foreground;
}
mainbox {
spacing: @g-spacing;
margin: @g-margin;
padding: @g-padding;
children: ["inputbar", "listview", "message"];
}
element {
spacing: @g-spacing;
margin: @g-margin;
padding: @g-padding;
border: 0px solid;
border-radius: @b-radius;
border-color: @selected;
background-color: @background;
text-color: @foreground;
}
element normal.normal {
background-color: @background;
text-color: @foreground;
}
element alternate.normal {
background-color: @background;
text-color: @foreground;
}
element selected.active {
background-color: @active;
text-color: @background;
}
element selected.normal {
background-color: @selected;
text-color: @background;
}
message {
background-color: @background;
border: 0px solid;
}
element-text, element-icon {
background-color: inherit;
text-color: inherit;
}
+67
View File
@@ -0,0 +1,67 @@
#!/usr/bin/env bash
connect_wifi() {
current=$(nmcli -t -f active,ssid dev wifi list --rescan no | awk -F: '/^yes/ {print $2}')
wifi_list=$(nmcli --fields "SECURITY,SSID" device wifi list --rescan no | sed 1d | sed 's/ */ /g' | sed -E "s/WPA*.?\S/ /g" | sed "s/^--/ /g" | sed "s/ //g" | sed "/--/d" | awk '!a[$0]++')
if [ -n "$current" ]; then
wifi_list=$(echo "$wifi_list" | grep -v "$current")
wifi_list="󰖩 $current [connected]\n$wifi_list"
fi
choice=$(echo -e "$toggle\n$wifi_list" | uniq -u | rofi -dmenu -theme "$HOME/.config/rofi/wifi/wifi.rasi" -i -selected-row 1 -theme-str 'entry { enabled: false;} prompt { enabled: false; }')
if [ -z "$choice" ]; then
exit
fi
ssid=$(echo "$choice" | awk '{$1=""; print $0}' | sed 's/^ *//' | sed 's/ \[connected\]//')
if [[ "$choice" = "$toggle" ]]; then
nmcli radio wifi off
notify-send "Wi-Fi Disabled" -r 9991 -u normal -t 5000 -i "$HOME/.local/share/icons/custom/wifi-disconnected.svg"
exit
fi
if [[ "$ssid" = "$current" ]]; then
notify-send "Already connected to $ssid" -r 9991 -u normal -t 5000
exit
else
saved=$(nmcli -g NAME connection)
if [[ $(echo "$saved" | grep -w "$ssid") = "$ssid" ]]; then
nmcli connection up id "$ssid" | grep "successfully" && notify-send "Connection Established" "Connected to $ssid" -t 5000 -r 9991 -i "$HOME/.local/share/icons/custom/wifi-connected.svg" && exit
fi
if [[ "$choice" =~ "" ]]; then
password=$(rofi -dmenu -theme "$HOME/.config/rofi/wifi/wifi.rasi" -p "Password: " -l 0)
fi
if nmcli device wifi connect "$ssid" password "$password" | grep "successfully"; then
notify-send "Connection Established" "Connected to $ssid" -t 5000 -r 9991 -i "$HOME/.local/share/icons/custom/wifi-connected.svg"
else
notify-send "Connection Failed" "Could not connect to $ssid" -t 5000 -r 9991 -i "$HOME/.local/share/icons/custom/wifi-locked.svg"
fi
fi
}
status=$(nmcli -fields WIFI g | sed -n 2p)
if [[ "$status" =~ "enabled" ]]; then
toggle="󰖪 Disable Wi-Fi"
flag=1
elif [[ "$status" =~ "disabled" ]]; then
toggle="󰖩 Enable Wi-Fi"
flag=0
fi
if [ "$flag" -eq 1 ]; then
connect_wifi
else
choice=$(echo -e "$toggle" | rofi -dmenu -theme "$HOME/.config/rofi/wifi/wifi.rasi" -i -selected-row 1 -p "Wi-Fi" -theme-str 'entry { enabled: false;} prompt { enabled: false; }')
if [[ "$choice" = "$toggle" ]]; then
nmcli radio wifi on
toggle="󰖪 Disable Wi-Fi"
notify-send "Wi-Fi Enabled" -r 9991 -u normal -i "$HOME/.local/share/icons/custom/wifi-connected.svg" -t 5000
sleep 5
connect_wifi
fi
fi