From 9b2bd7ad99509ddafcbefc8622d2d73522d72ec9 Mon Sep 17 00:00:00 2001 From: Leni Aniva Date: Sun, 2 Jun 2024 18:23:39 -0700 Subject: [PATCH] feat: Simplification and time display --- eww/bar/eww.scss | 26 ++++++++++++++++++-------- eww/bar/eww.yuck | 24 ++++++++++++------------ hypr/hyprland.conf | 1 - sway/launch.conf | 10 +++++----- 4 files changed, 35 insertions(+), 26 deletions(-) diff --git a/eww/bar/eww.scss b/eww/bar/eww.scss index be13cdf..d5cf9ea 100644 --- a/eww/bar/eww.scss +++ b/eww/bar/eww.scss @@ -23,9 +23,9 @@ $status_bg: rgba(0, 0, 0, 0.3); $tray_bg: rgba(204, 204, 204, 0.1); $tray: #c9cbff; $keyboard: #f2cdcd; -$language: #e8a2af; $idle_inhibitor: #f28fad; -$audio: #fae3b0; +$volume: #fae3b0; +$microphone: #e8a2af; $network: #f8bd96; $backlight: #bd93f9; $cpu_bg: #333333; @@ -136,15 +136,25 @@ box .weather { color: mix($weather_end, $weather, 100%); } } -.audio { +.volume { background-color: transparent; - .icon { - color: $audio; - } - color: $audio; - border-left: 2px solid $audio; + color: $volume; + border-left: 2px solid $volume; margin-bottom: 1px; margin-top: 1px; + highlight { + background-color: $volume; + } +} +.microphone { + background-color: transparent; + color: $microphone; + border-left: 2px solid $microphone; + margin-bottom: 1px; + margin-top: 1px; + highlight { + background-color: $microphone; + } } .media { diff --git a/eww/bar/eww.yuck b/eww/bar/eww.yuck index 124a503..e051cf1 100644 --- a/eww/bar/eww.yuck +++ b/eww/bar/eww.yuck @@ -1,4 +1,3 @@ -(defvar eww-flags "--config $HOME/.config/eww/bar") (defvar amixer "amixer -D pulse") (defwindow vbar @@ -97,11 +96,11 @@ (defwidget widget-volume [] (eventbox - :onhover "${EWW_EXECUTABLE} ${eww-flags} update show-volume=true" - :onhoverlost "${EWW_EXECUTABLE} ${eww-flags} update show-volume=false" + :onhover "${EWW_CMD} update show-volume=true" + :onhoverlost "${EWW_CMD} update show-volume=false" :onclick "${amixer} sset Master toggle" (box - :class "audio" + :class "volume" :orientation "v" :space-evenly "false" :spacing "2" @@ -121,14 +120,14 @@ :width 20 :height 20 :xalign 0.5 :yalign 0.5 :noindent true - :text { current-volume-state == "off" ? "" : (current-volume > 80 ? "" : "") })))) + :text { current-volume-state == "off" ? "" : (current-volume > 50 ? "" : "") })))) (defwidget widget-microphone [] (eventbox - :onhover "${EWW_EXECUTABLE} ${eww-flags} update show-microphone=true" - :onhoverlost "${EWW_EXECUTABLE} ${eww-flags} update show-microphone=false" + :onhover "${EWW_CMD} update show-microphone=true" + :onhoverlost "${EWW_CMD} update show-microphone=false" :onclick "${amixer} sset Capture toggle" (box - :class "audio" + :class "microphone" :orientation "v" :space-evenly "false" :spacing "2" @@ -149,10 +148,10 @@ :xalign 0.5 :yalign 0.5 :noindent true :text { current-microphone-state == "off" ? "" : "" })))) -(defpoll current-volume :interval "1s" "amixer -D pulse sget Master | grep 'Left:' | awk -F'[][]' '{ print $2 }' | tr -d '%'") -(defpoll current-volume-state :interval "1s" "amixer -D pulse sget Master | grep 'Left:' | awk -F'[][]' '{ print $4 }'") -(defpoll current-microphone :interval "1s" "amixer -D pulse sget Capture | grep 'Left:' | awk -F'[][]' '{ print $2 }' | tr -d '%'") -(defpoll current-microphone-state :interval "1s" "amixer -D pulse sget Capture | grep 'Left:' | awk -F'[][]' '{ print $4 }'") +(defpoll current-volume :interval "1s" "amixer sget Master | grep 'Left:' | awk -F'[][]' '{ print $2 }' | tr -d '%'") +(defpoll current-volume-state :interval "1s" "amixer sget Master | grep 'Left:' | awk -F'[][]' '{ print $4 }'") +(defpoll current-microphone :interval "1s" "amixer sget Capture | grep 'Left:' | awk -F'[][]' '{ print $2 }' | tr -d '%'") +(defpoll current-microphone-state :interval "1s" "amixer sget Capture | grep 'Left:' | awk -F'[][]' '{ print $4 }'") (defvar show-volume false) (defvar show-microphone false) @@ -204,6 +203,7 @@ :valign "end" :spacing 1 :width 20 + :tooltip {formattime(EWW_TIME, "%F (%a) %T [%Z]")} ;(box :class "icon" "") "${clock.m}" "${clock.d}" (box :class "icon" "") diff --git a/hypr/hyprland.conf b/hypr/hyprland.conf index 4f4d002..a0865ec 100644 --- a/hypr/hyprland.conf +++ b/hypr/hyprland.conf @@ -10,7 +10,6 @@ monitor=,preferred,auto,auto # See https://wiki.hyprland.org/Configuring/Keywords/ for more -# waybar is executed after eww to have the intersection effect at top left exec-once = hyprpaper & swaync & fcitx5 & flameshot & eww --config ~/.config/eww/bar open vbar # Source a file (multi-file configs) diff --git a/sway/launch.conf b/sway/launch.conf index ddd1921..f835fc7 100644 --- a/sway/launch.conf +++ b/sway/launch.conf @@ -1,9 +1,9 @@ exec /usr/share/swayfx/scripts/inactive-windows-transparency --opacity 0.8 -exec_always eww --config ~/.config/eww/bar open bar -bar { - position top - swaybar_command waybar -} +exec_always eww --config ~/.config/eww/bar open vbar +#bar { +# position top +# swaybar_command waybar +#} exec_always multibg-sway ~/.config/sway/wallpapers exec swaync exec fcitx5