diff --git a/modules/home/wayland/apps/eww/bar/modules/workspaces.yuck b/modules/home/wayland/apps/eww/bar/modules/workspaces.yuck index 130d870..806f807 100644 --- a/modules/home/wayland/apps/eww/bar/modules/workspaces.yuck +++ b/modules/home/wayland/apps/eww/bar/modules/workspaces.yuck @@ -3,13 +3,14 @@ (defwidget workspace-mod [] (module (eventbox - :onscroll "echo {} | sed -e \"s/up/-1/g\" -e \"s/down/+1/g\" | xargs hyprctl dispatch workspace" + :onscroll "echo {} | sed -e 's/up/-1/' -e 's/down/+1/' | xargs -I % hyprctl eval \"hl.dispatch(hl.dsp.focus({ workspace = '%' }))\"" + (box :class "module workspaces" :orientation "v" (for ws in workspace (button - :onclick "hyprctl dispatch workspace ${ws.number}" + :onclick "hyprctl eval \"hl.dispatch(hl.dsp.focus({ workspace = '${ws.number}' }))\"" (label :show-truncated false :class "icon-text ${ws.color}" diff --git a/modules/home/wayland/apps/eww/bar/scripts/net/net b/modules/home/wayland/apps/eww/bar/scripts/net/net index 35ee48e..aa6935b 100755 --- a/modules/home/wayland/apps/eww/bar/scripts/net/net +++ b/modules/home/wayland/apps/eww/bar/scripts/net/net @@ -6,6 +6,10 @@ function get_time_ms { icons=("󰤯" "󰤟" "󰤢" "󰤥" "󰤨") +function get_wifi_interface() { + awk 'NR > 2 { gsub(":", "", $1); print $1; exit }' /proc/net/wireless +} + function toggle() { status=$(rfkill | grep wlan | awk '{print $4}') @@ -17,7 +21,8 @@ function toggle() { } function gen_wifi() { - signal=$(cat /proc/net/wireless | head -n3 | tail -n1 | awk '{print $3}') + wifi_iface=$(get_wifi_interface) + signal=$(awk -v iface="$wifi_iface" '$1 == iface ":" { print $3; exit }' /proc/net/wireless) level=$(awk -v n="$signal" 'BEGIN{print int((n-1)/20)}') if [ "$level" -gt 4 ]; then level=4 @@ -26,8 +31,8 @@ function gen_wifi() { icon=${icons[$level]} ip="-" class="net-connected" - name_raw=$(wpa_cli status | grep \^ssid= | sed 's/ssid=//g') - name=$(printf "%s" $name_raw) + name_raw=$(wpa_cli -g "/run/wpa_supplicant/$wifi_iface" status | grep \^ssid= | sed 's/ssid=//g') + name=$(printf "%s" "$name_raw") } function gen_ethernet() { @@ -38,9 +43,12 @@ function gen_ethernet() { } function make_content() { - local ethernet wifi + local ethernet wifi wifi_iface ethernet=$(ip link | rg "^[0-9]+: en[po]+" | head -n1 | sed 's/[a-zA-Z0-9_,><:\ -]*state //g' | sed 's/ mode [a-zA-Z0-9 ]*//g') - wifi=$(wpa_cli status | rg "^wpa_state=" | sed 's/wpa_state=//g') + wifi_iface=$(get_wifi_interface) + if [ -n "$wifi_iface" ]; then + wifi=$(wpa_cli -g "/run/wpa_supplicant/$wifi_iface" status | rg "^wpa_state=" | sed 's/wpa_state=//g') + fi # test ethernet first if [[ $ethernet == "UP" ]]; then diff --git a/modules/home/wayland/apps/eww/bar/windows/powermenu.yuck b/modules/home/wayland/apps/eww/bar/windows/powermenu.yuck index 998d754..5d63030 100644 --- a/modules/home/wayland/apps/eww/bar/windows/powermenu.yuck +++ b/modules/home/wayland/apps/eww/bar/windows/powermenu.yuck @@ -25,7 +25,7 @@ (powermenu_entry :label "Sign out" :icon "󰗼" - :onclick "hyprctl dispatch exit 0") + :onclick "hyprctl eval \"hl.dispatch(hl.dsp.exit())\"") (powermenu_entry :label "Cancel" :icon "󰅖" diff --git a/modules/home/wayland/apps/waybar/default.nix b/modules/home/wayland/apps/waybar/default.nix index 5faa43f..1dd6624 100644 --- a/modules/home/wayland/apps/waybar/default.nix +++ b/modules/home/wayland/apps/waybar/default.nix @@ -146,8 +146,8 @@ in { "9" = [ ]; "10" = [ ]; }; - "on-scroll-up" = "hyprctl dispatch workspace r-1"; - "on-scroll-down" = "hyprctl dispatch workspace r+1"; + "on-scroll-up" = "hyprctl eval \"hl.dispatch(hl.dsp.focus({ workspace = '-1' }))\""; + "on-scroll-down" = "hyprctl eval \"hl.dispatch(hl.dsp.focus({ workspace = '+1' }))\""; }; "backlight" = { diff --git a/modules/nixos/system/network/wifi/default.nix b/modules/nixos/system/network/wifi/default.nix index 329f5ea..a670cb8 100644 --- a/modules/nixos/system/network/wifi/default.nix +++ b/modules/nixos/system/network/wifi/default.nix @@ -3,6 +3,7 @@ networking.supplicant = { "${config.syscfg.net.wlp.nif}" = { configFile.path = config.sops.secrets.wifi.path; + userControlled.enable = true; extraConf = '' network={ ssid="test"