feat: Simplification and time display

This commit is contained in:
Leni Aniva 2024-06-02 18:23:39 -07:00
parent 664e5ed27a
commit 9b2bd7ad99
Signed by: aniva
GPG Key ID: 4D9B1C8D10EA4C50
4 changed files with 35 additions and 26 deletions

View File

@ -23,9 +23,9 @@ $status_bg: rgba(0, 0, 0, 0.3);
$tray_bg: rgba(204, 204, 204, 0.1); $tray_bg: rgba(204, 204, 204, 0.1);
$tray: #c9cbff; $tray: #c9cbff;
$keyboard: #f2cdcd; $keyboard: #f2cdcd;
$language: #e8a2af;
$idle_inhibitor: #f28fad; $idle_inhibitor: #f28fad;
$audio: #fae3b0; $volume: #fae3b0;
$microphone: #e8a2af;
$network: #f8bd96; $network: #f8bd96;
$backlight: #bd93f9; $backlight: #bd93f9;
$cpu_bg: #333333; $cpu_bg: #333333;
@ -136,15 +136,25 @@ box .weather {
color: mix($weather_end, $weather, 100%); color: mix($weather_end, $weather, 100%);
} }
} }
.audio { .volume {
background-color: transparent; background-color: transparent;
.icon { color: $volume;
color: $audio; border-left: 2px solid $volume;
}
color: $audio;
border-left: 2px solid $audio;
margin-bottom: 1px; margin-bottom: 1px;
margin-top: 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 { .media {

View File

@ -1,4 +1,3 @@
(defvar eww-flags "--config $HOME/.config/eww/bar")
(defvar amixer "amixer -D pulse") (defvar amixer "amixer -D pulse")
(defwindow vbar (defwindow vbar
@ -97,11 +96,11 @@
(defwidget widget-volume [] (defwidget widget-volume []
(eventbox (eventbox
:onhover "${EWW_EXECUTABLE} ${eww-flags} update show-volume=true" :onhover "${EWW_CMD} update show-volume=true"
:onhoverlost "${EWW_EXECUTABLE} ${eww-flags} update show-volume=false" :onhoverlost "${EWW_CMD} update show-volume=false"
:onclick "${amixer} sset Master toggle" :onclick "${amixer} sset Master toggle"
(box (box
:class "audio" :class "volume"
:orientation "v" :orientation "v"
:space-evenly "false" :space-evenly "false"
:spacing "2" :spacing "2"
@ -121,14 +120,14 @@
:width 20 :height 20 :width 20 :height 20
:xalign 0.5 :yalign 0.5 :xalign 0.5 :yalign 0.5
:noindent true :noindent true
:text { current-volume-state == "off" ? "" : (current-volume > 80 ? "" : "") })))) :text { current-volume-state == "off" ? "" : (current-volume > 50 ? "" : "") }))))
(defwidget widget-microphone [] (defwidget widget-microphone []
(eventbox (eventbox
:onhover "${EWW_EXECUTABLE} ${eww-flags} update show-microphone=true" :onhover "${EWW_CMD} update show-microphone=true"
:onhoverlost "${EWW_EXECUTABLE} ${eww-flags} update show-microphone=false" :onhoverlost "${EWW_CMD} update show-microphone=false"
:onclick "${amixer} sset Capture toggle" :onclick "${amixer} sset Capture toggle"
(box (box
:class "audio" :class "microphone"
:orientation "v" :orientation "v"
:space-evenly "false" :space-evenly "false"
:spacing "2" :spacing "2"
@ -149,10 +148,10 @@
:xalign 0.5 :yalign 0.5 :xalign 0.5 :yalign 0.5
:noindent true :noindent true
:text { current-microphone-state == "off" ? "" : "" })))) :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 :interval "1s" "amixer 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-volume-state :interval "1s" "amixer 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 :interval "1s" "amixer 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-microphone-state :interval "1s" "amixer sget Capture | grep 'Left:' | awk -F'[][]' '{ print $4 }'")
(defvar show-volume false) (defvar show-volume false)
(defvar show-microphone false) (defvar show-microphone false)
@ -204,6 +203,7 @@
:valign "end" :valign "end"
:spacing 1 :spacing 1
:width 20 :width 20
:tooltip {formattime(EWW_TIME, "%F (%a) %T [%Z]")}
;(box :class "icon" "") ;(box :class "icon" "")
"${clock.m}" "${clock.d}" "${clock.m}" "${clock.d}"
(box :class "icon" "") (box :class "icon" "")

View File

@ -10,7 +10,6 @@ monitor=,preferred,auto,auto
# See https://wiki.hyprland.org/Configuring/Keywords/ for more # 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 exec-once = hyprpaper & swaync & fcitx5 & flameshot & eww --config ~/.config/eww/bar open vbar
# Source a file (multi-file configs) # Source a file (multi-file configs)

View File

@ -1,9 +1,9 @@
exec /usr/share/swayfx/scripts/inactive-windows-transparency --opacity 0.8 exec /usr/share/swayfx/scripts/inactive-windows-transparency --opacity 0.8
exec_always eww --config ~/.config/eww/bar open bar exec_always eww --config ~/.config/eww/bar open vbar
bar { #bar {
position top # position top
swaybar_command waybar # swaybar_command waybar
} #}
exec_always multibg-sway ~/.config/sway/wallpapers exec_always multibg-sway ~/.config/sway/wallpapers
exec swaync exec swaync
exec fcitx5 exec fcitx5