From 117899ed59fa20ed3cdba121858816e4a646141a Mon Sep 17 00:00:00 2001 From: matt1432 Date: Sun, 6 Aug 2023 23:01:18 -0400 Subject: [PATCH] feat: add sub rows on quick settings --- config/eww/quick-settings/quick-settings.scss | 15 ++++++++ config/eww/quick-settings/quick-settings.yuck | 35 +++++++++++++++++-- config/eww/scripts/network.sh | 11 ++++++ config/eww/variables.yuck | 3 ++ config/hypr/main.conf | 4 +-- nixos/home/packages.nix | 1 + 6 files changed, 65 insertions(+), 4 deletions(-) create mode 100755 config/eww/scripts/network.sh diff --git a/config/eww/quick-settings/quick-settings.scss b/config/eww/quick-settings/quick-settings.scss index 868ccd4f..4c1b8873 100644 --- a/config/eww/quick-settings/quick-settings.scss +++ b/config/eww/quick-settings/quick-settings.scss @@ -53,6 +53,21 @@ min-width: 50px; } +.sub-label { + font-size: 14px; + margin-top: -10px; + margin-left: -10px; + margin-bottom: 10px; + padding: 6px; + border: 2px solid $contrastbg; + border-top-right-radius: 20px; + border-top-left-radius: 10px; + border-bottom-left-radius: 10px; + border-bottom-right-radius: 20px; + min-width: 90px; + background: #1b1b1b; +} + .grid-chev { margin-left: 0px; diff --git a/config/eww/quick-settings/quick-settings.yuck b/config/eww/quick-settings/quick-settings.yuck index 9b343bc1..b79c67fd 100644 --- a/config/eww/quick-settings/quick-settings.yuck +++ b/config/eww/quick-settings/quick-settings.yuck @@ -71,7 +71,7 @@ :width 0 :height 0 :halign "center" - :space-evenly true + :space-evenly false ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Row ONE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -93,7 +93,6 @@ (eventbox :class "left-part" :cursor "pointer" :onclick "rfkill toggle wlan" - (label :text " 󰖩 " :class "grid-label" ) @@ -153,6 +152,38 @@ ) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; SUB ROW + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + (box :orientation "h" + :space-evenly true + :spacing 54 + :width 0 + :height 0 + :halign "center" + + + (label :text "${network_ssid}" + :class "sub-label" + :width 0 + :height 0 + :limit-width 10 + ) + + (label :text "todo" + :class "sub-label" + :width 0 + :height 0 + :limit-width 10 + ) + + (label :text "" + :class "" + :width 0 + :height 0 + :limit-width 10 + ) + ) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Row TWO ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (box :class "button-row" diff --git a/config/eww/scripts/network.sh b/config/eww/scripts/network.sh new file mode 100755 index 00000000..7589e18b --- /dev/null +++ b/config/eww/scripts/network.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +get_ssid() { + if nmcli -t -f NAME c show --active | grep -v lo; then + true + else + echo "Disconnected" + fi +} + +[[ "$1" == "ssid" ]] && get_ssid diff --git a/config/eww/variables.yuck b/config/eww/variables.yuck index f2f3a53c..9a76dd69 100644 --- a/config/eww/variables.yuck +++ b/config/eww/variables.yuck @@ -2,6 +2,9 @@ (deflisten heart_icon "tail -f $HOME/.config/.heart") (deflisten mic_icon "$EWW_PATH/mic.sh icon") +(deflisten network_ssid "zscroll -l 10 -u true \"$EWW_PATH/network.sh ssid\"") + + (deflisten volume_icon "$EWW_PATH/volume.sh icon") (defpoll volume :interval "1s" "$EWW_PATH/volume.sh percentage") (defpoll volume_value :interval "1s" "$EWW_PATH/volume.sh vol") diff --git a/config/hypr/main.conf b/config/hypr/main.conf index 8c21a70b..8c0877c9 100644 --- a/config/hypr/main.conf +++ b/config/hypr/main.conf @@ -28,9 +28,9 @@ exec-once = eww open quick-settings-toggle exec-once = $HYPR_PATH/osk-toggle.sh getState # sometimes waybar starts after and stops me from pressing eww buttons -exec-once = bash -c "sleep 0.5; eww reload" +exec-once = bash -c "sleep 0.8; eww reload" -exec-once = bash -c "grep -q 󰣐 $HOME/.config/.heart && sleep 0.6 && eww open heart && eww update heart-ts=true" +exec-once = bash -c "grep -q 󰣐 $HOME/.config/.heart && sleep 0.9 && eww open heart && eww update heart-ts=true" exec-once = gnome-keyring-daemon --start --components=secrets exec-once = squeekboard diff --git a/nixos/home/packages.nix b/nixos/home/packages.nix index beb283a1..0072778f 100644 --- a/nixos/home/packages.nix +++ b/nixos/home/packages.nix @@ -81,6 +81,7 @@ qt5.qtwayland qt6.qtwayland bottles-unwrapped + zscroll httrack lisgd zeal