fix(waybar): use iwgtk
This commit is contained in:
parent
41aca71983
commit
0766b48b80
4 changed files with 8 additions and 39 deletions
|
|
@ -191,4 +191,7 @@ windowrule = match:class ^(xdg-desktop-portal-hyprland)$, size monitor_w * 0.5 m
|
||||||
windowrule = match:class ^(org.pulseaudio.pavucontrol)$, float on
|
windowrule = match:class ^(org.pulseaudio.pavucontrol)$, float on
|
||||||
windowrule = match:class ^(org.pulseaudio.pavucontrol)$, size 600 450
|
windowrule = match:class ^(org.pulseaudio.pavucontrol)$, size 600 450
|
||||||
|
|
||||||
|
windowrule = match:class ^(iwgtk)$, float on
|
||||||
|
windowrule = match:class ^(iwgtk)$, size 400 500
|
||||||
|
|
||||||
windowrule = match:class ^([Ss]ioyek)$, tile on
|
windowrule = match:class ^([Ss]ioyek)$, tile on
|
||||||
|
|
|
||||||
|
|
@ -227,6 +227,7 @@ return {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'malewicz1337/oil-git.nvim',
|
'malewicz1337/oil-git.nvim',
|
||||||
|
dir = '~/dev/oil-git.nvim',
|
||||||
ft = 'oil',
|
ft = 'oil',
|
||||||
opts = {
|
opts = {
|
||||||
symbol_position = 'signcolumn',
|
symbol_position = 'signcolumn',
|
||||||
|
|
|
||||||
|
|
@ -92,6 +92,7 @@ in
|
||||||
gsettings-desktop-schemas
|
gsettings-desktop-schemas
|
||||||
(python3.withPackages (ps: [ ps.pillow ]))
|
(python3.withPackages (ps: [ ps.pillow ]))
|
||||||
pavucontrol
|
pavucontrol
|
||||||
|
iwgtk
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.waybar = {
|
programs.waybar = {
|
||||||
|
|
@ -194,8 +195,8 @@ in
|
||||||
tooltip-format-wifi = "SSID: {essid}\nSignal: {signalStrength}%\nDownload: {bandwidthDownBits}\nUpload: {bandwidthUpBits}\nIP: {ipaddr}";
|
tooltip-format-wifi = "SSID: {essid}\nSignal: {signalStrength}%\nDownload: {bandwidthDownBits}\nUpload: {bandwidthUpBits}\nIP: {ipaddr}";
|
||||||
tooltip-format-ethernet = "Interface: {ifname}\nIP: {ipaddr}/{cidr}\nDownload: {bandwidthDownBits}\nUpload: {bandwidthUpBits}";
|
tooltip-format-ethernet = "Interface: {ifname}\nIP: {ipaddr}/{cidr}\nDownload: {bandwidthDownBits}\nUpload: {bandwidthUpBits}";
|
||||||
tooltip-format-disconnected = "Wireless LAN disconnected";
|
tooltip-format-disconnected = "Wireless LAN disconnected";
|
||||||
on-click = "rfkill toggle wlan";
|
on-click = "pgrep iwgtk && pkill iwgtk || iwgtk";
|
||||||
on-click-right = "ctl wifi pick";
|
on-click-right = "rfkill toggle wlan";
|
||||||
};
|
};
|
||||||
|
|
||||||
battery = {
|
battery = {
|
||||||
|
|
|
||||||
38
scripts/ctl
38
scripts/ctl
|
|
@ -136,42 +136,6 @@ volume)
|
||||||
fi
|
fi
|
||||||
notify-send -a ctl -t 2500 -r 5556 "$icon $bar"
|
notify-send -a ctl -t 2500 -r 5556 "$icon $bar"
|
||||||
;;
|
;;
|
||||||
wifi)
|
|
||||||
case "$2" in
|
|
||||||
pick)
|
|
||||||
require fuzzel
|
|
||||||
station=$(iwctl device list 2>/dev/null | sed 's/\x1b\[[0-9;]*[a-zA-Z]//g' | awk '/station/{print $1}')
|
|
||||||
[ -z "$station" ] && { echo "ctl: no wifi device found" >&2; exit 1; }
|
|
||||||
iwctl station "$station" scan 2>/dev/null
|
|
||||||
sleep 1
|
|
||||||
networks=$(iwctl station "$station" get-networks 2>/dev/null | \
|
|
||||||
sed 's/\x1b\[[0-9;]*[a-zA-Z]//g' | \
|
|
||||||
awk 'NR>4 && /\S/' | \
|
|
||||||
sed 's/^[[:space:]>]*//' | \
|
|
||||||
sed 's/[[:space:]]\{3,\}.*//' | \
|
|
||||||
sed 's/[[:space:]]*$//' | \
|
|
||||||
grep -v '^-')
|
|
||||||
[ -z "$networks" ] && exit 0
|
|
||||||
count=$(printf '%s\n' "$networks" | wc -l)
|
|
||||||
ssid=$(printf '%s\n' "$networks" | fuzzel --dmenu --prompt="wifi: " --no-icons --lines="$count")
|
|
||||||
[ -z "$ssid" ] && exit 0
|
|
||||||
known=$(iwctl known-networks list 2>/dev/null | sed 's/\x1b\[[0-9;]*[a-zA-Z]//g')
|
|
||||||
if printf '%s' "$known" | grep -qF "$ssid"; then
|
|
||||||
iwctl station "$station" connect "$ssid"
|
|
||||||
elif iwctl station "$station" get-networks 2>/dev/null | sed 's/\x1b\[[0-9;]*[a-zA-Z]//g' | grep -F "$ssid" | grep -qi "open"; then
|
|
||||||
iwctl station "$station" connect "$ssid"
|
|
||||||
else
|
|
||||||
pass=$(printf '' | fuzzel --dmenu --prompt="passphrase: " --no-icons --password --lines=0)
|
|
||||||
[ -z "$pass" ] && exit 0
|
|
||||||
iwctl station "$station" connect "$ssid" --passphrase "$pass"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Usage: ctl wifi {pick}" >&2
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
media)
|
media)
|
||||||
if pgrep -x wf-recorder >/dev/null 2>&1; then
|
if pgrep -x wf-recorder >/dev/null 2>&1; then
|
||||||
pkill -INT wf-recorder
|
pkill -INT wf-recorder
|
||||||
|
|
@ -411,7 +375,7 @@ idle)
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Usage: ctl {screenshot|keyboard|audio|wifi|brightness|volume|media|wallpaper|power|idle}" >&2
|
echo "Usage: ctl {screenshot|keyboard|audio|brightness|volume|media|wallpaper|power|idle}" >&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue