Changes in eww bar

Addings
- makes the sound volume/mic appears
- makes the correct light appears
- makes the batteries appears

Fix
- The tray widget menu now have a background.
This commit is contained in:
statzitz 2024-09-08 23:51:25 +02:00
parent 7d4fd3710a
commit 4201b4f102
5 changed files with 130 additions and 22 deletions

View file

@ -6,23 +6,25 @@
### dependencies
- hyprland
- alacritty
- blight
- ~~conky~~
- waybar
- hyprpaper
- eww
- gotop
- htop
- alacritty
- ~~swaylock~~
- hyprland
- hyprpaper
- hypridle
- hyprlock
- [swaylock-script](https://gitea.ahur.ac/statzitz/swaylock-script)
- wlclock
- [clock_start](https://gitea.ahur.ac/statzitz/clock-start)
- neofetch
- [nfetch_startup](https://gitea.ahur.ac/statzitz/nfetch-startup)
- hy3
- ~~swaylock~~
- neofetch
- pamixer
- ~~[swaylock-script](https://gitea.ahur.ac/statzitz/swaylock-script)~~
- wlclock
- ~~[clock_start](https://gitea.ahur.ac/statzitz/clock-start)~~
- [nfetch_startup](https://gitea.ahur.ac/statzitz/nfetch-startup)
- ~~waybar~~
+ others suprises
### images_hyprland

View file

@ -54,17 +54,97 @@
}
.sound_box {
padding-top: 2px;
padding-left: 12px;
padding-right: 4px;
transition: none;
color: #99ddff;
border-radius: 13px 0px 0px 13px;
background: #362a28;
}
.mic_box {
padding-top: 2px;
padding-left: 4px;
padding-right: 4px;
transition: none;
color: #99ddff;
border-radius: 0px 0px 0px 0px;
background: #362a28;
}
.light_box {
padding-top: 2px;
padding-left: 4px;
padding-right: 4px;
transition: none;
color: #ff8844;
border-radius: 0px 0px 0px 0px;
background: #362a28;
}
.battery_box {
padding-top: 2px;
padding-left: 4px;
padding-right: 12px;
margin-right: 8px;
transition: none;
color: #ffdd44;
border-radius: 0px 13px 13px 0px;
background: #362a28;
}
.tray {
padding-top: 2px;
padding-left: 12px;
padding-right: 12px;
margin-right: 16px;
transition: none;
color: #bd93f9;
color: #ffa500;
border-radius: 13px 13px 13px 13px;
background: #362a28;
menu {
background: #201010;
border-radius: 10px;
}
menuitem {
border-radius: 13px;
font-size: 14px;
padding: 2px 5px;
&disabled label {
color: #928374;
}
&:hover {
background-color: #282828;
}
separator {
padding-top: 1px;
&:last-child {
padding: unset;
}
}
}
}
// Styles on classes (see eww.yuck for more information)

View file

@ -30,15 +30,27 @@
(defwidget left_pane []
(box :class "left_pane" :orientation "h" :space-evenly false :halign "end"
(metric :label "🔊"
:value volume
:onchange "amixer -D pulse sset Master {}%")
(metric :label ""
:value {EWW_RAM.used_mem_perc}
:onchange "")
(metric :label "💾"
:value {round((1 - (EWW_DISK["/"].free / EWW_DISK["/"].total)) * 100, 0)}
:onchange "")
(box
:class "sound_box"
(label :text "${volume_sound}  "))
(box
:class "mic_box"
(label :text "${volume_mic}%  "))
(box
:class "light_box"
(label :text "${light_value}% ☀ "))
(box
:class "battery_box"
(label :text "${batterie}%  "))
;(metric :label "🔊    "
; :value volume
; :onchange "amixer -D pulse sset Master {}%")
;(metric :label ""
; :value {EWW_RAM.used_mem_perc}
; :onchange "")
;(metric :label "💾"
; :value {round((1 - (EWW_DISK["/"].free / EWW_DISK["/"].total)) * 100, 0)}
; :onchange "")
(systray :class "tray" :orientation "h" :space-evenly true :icon-size "16")
))
@ -76,8 +88,17 @@
(deflisten music :initial ""
"playerctl --follow metadata --format '{{ artist }} - {{ title }}' || true")
(defpoll volume :interval "1s"
"echo 50")
(defpoll volume_sound :interval "0.2s"
"pamixer --get-volume-human")
(defpoll volume_mic :interval "0.2s"
"get_source_volume")
(defpoll light_value :interval "1s"
"get_light_value")
(defpoll batterie :interval "1s"
"cat /sys/class/power_supply/BAT1/capacity")
(defpoll time :interval "1s"
"date '+%I:%M:%S %p'")

2
dotlocal/bin/get_light_value Executable file
View file

@ -0,0 +1,2 @@
#!/bin/sh
echo $(($(blight get)*100/255))

3
dotlocal/bin/get_source_volume Executable file
View file

@ -0,0 +1,3 @@
#!/bin/sh
pactl get-source-volume @DEFAULT_SOURCE@ | grep -Po '\d+(?=%)' | head -n 1