mirror of
https://github.com/elkowar/dots-of-war.git
synced 2024-12-25 13:42:23 +00:00
add eww bar
This commit is contained in:
parent
5946ad4314
commit
48850415d8
5 changed files with 227 additions and 0 deletions
10
eww-bar/.config/eww-bar/audio.sh
Normal file
10
eww-bar/.config/eww-bar/audio.sh
Normal file
|
@ -0,0 +1,10 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
|
||||
|
||||
|
||||
speaker_sink_id=$(pamixer --list-sinks | grep "Komplete_Audio_6" | awk '{print $1}')
|
||||
game_sink_id=$(pamixer --list-sinks | grep "stereo-game" | awk '{print $1}')
|
||||
|
||||
volume=$(pamixer --get-volume)
|
||||
|
79
eww-bar/.config/eww-bar/eww.scss
Normal file
79
eww-bar/.config/eww-bar/eww.scss
Normal file
|
@ -0,0 +1,79 @@
|
|||
* {
|
||||
all: unset;
|
||||
}
|
||||
|
||||
window {
|
||||
background: #282828;
|
||||
color: #ebdbb2;
|
||||
|
||||
& > * {
|
||||
margin: 3px;
|
||||
}
|
||||
}
|
||||
|
||||
.workspaces {
|
||||
button {
|
||||
background: none;
|
||||
margin: 3px;
|
||||
&.inactive {
|
||||
color: #888974;
|
||||
}
|
||||
&.active {
|
||||
color: #8ec07c;
|
||||
}
|
||||
&.occupied {
|
||||
font-size: 1.01rem;
|
||||
}
|
||||
&.empty {
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.segment-top {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.segment-bottom {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.volume-metric {
|
||||
background-color: #1d2021;
|
||||
color: #ebdbb2;
|
||||
padding: 0;
|
||||
|
||||
.volume-top > scale {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
slider {
|
||||
all: unset;
|
||||
}
|
||||
|
||||
scale trough highlight {
|
||||
all: unset;
|
||||
background-color: #8ec07c;
|
||||
border-bottom-right-radius: 5px;
|
||||
}
|
||||
scale trough {
|
||||
all: unset;
|
||||
background-color: #1d2021;
|
||||
min-width: 34px;
|
||||
min-height: 2px;
|
||||
}
|
||||
}
|
||||
|
||||
.large-symbol {
|
||||
font-size: 0.8em;
|
||||
}
|
||||
|
||||
.metric {
|
||||
background-color: #1d2021;
|
||||
padding: 5px 2px;
|
||||
}
|
||||
|
||||
.time {
|
||||
padding-top: 7px;
|
||||
padding-bottom: 7px;
|
||||
}
|
103
eww-bar/.config/eww-bar/eww.yuck
Normal file
103
eww-bar/.config/eww-bar/eww.yuck
Normal file
|
@ -0,0 +1,103 @@
|
|||
(defwidget bar [screen]
|
||||
(box :orientation "v"
|
||||
(box
|
||||
(box :valign "start"
|
||||
:halign "center"
|
||||
:class "segment-top"
|
||||
(top :screen screen)))
|
||||
(box
|
||||
(box :valign "center"
|
||||
:class "middle"
|
||||
(middle)))
|
||||
(box
|
||||
(box :valign "end"
|
||||
:class "segment-bottom"
|
||||
(bottom)))))
|
||||
|
||||
|
||||
|
||||
(defwidget top []
|
||||
(workspaces :wsp_yuck {screen == 0 ? workspaces_0_yuck : screen == 1 ? workspaces_1_yuck : workspaces_2_yuck}))
|
||||
|
||||
(defwidget workspaces [wsp_yuck]
|
||||
(literal :content wsp_yuck))
|
||||
|
||||
(defwidget middle [] (time))
|
||||
(defwidget time []
|
||||
(box :orientation "v"
|
||||
:class "metric time"
|
||||
hour min sec))
|
||||
|
||||
(defwidget bottom []
|
||||
(box :orientation "v"
|
||||
:valign "end"
|
||||
:space-evenly true
|
||||
:spacing "5"
|
||||
(volume)
|
||||
(box :class "metric" :orientation "v"
|
||||
(large-sym :sym "" ) "${round((1 - (EWW_DISK["/"].free / EWW_DISK["/"].total)) * 100, 0)}%")
|
||||
(box :class "metric" :orientation "v"
|
||||
"" "${round(EWW_RAM, 0)}%")
|
||||
(box :class "metric" :orientation "v"
|
||||
"" "${round(EWW_CPU_USAGE.avg, 0)}%")
|
||||
(box :class "metric"
|
||||
(date))))
|
||||
|
||||
(defwidget volume []
|
||||
(box :class "volume-metric"
|
||||
:orientation "v"
|
||||
:space-evenly false
|
||||
:valign "fill"
|
||||
:vexpand false
|
||||
(scale :orientation "h"
|
||||
:min 0
|
||||
:max 100
|
||||
:onchange "pamixer --set-volume $(echo {} | sed 's/\\..*//g')"
|
||||
:value volume)
|
||||
(box :orientation "v"
|
||||
:valign "fill"
|
||||
:vexpand true
|
||||
(large-sym :sym "🎧")
|
||||
"${volume}%")))
|
||||
|
||||
|
||||
(defwidget large-sym [sym]
|
||||
(label :class "large-symbol" :text sym))
|
||||
|
||||
(defwidget date []
|
||||
(box :orientation "v"
|
||||
:halign "center"
|
||||
day_word day month year))
|
||||
|
||||
(deflisten volume
|
||||
`
|
||||
pamixer --get-volume;
|
||||
pactl subscribe | grep --line-buffered "Event 'change' on sink " | while read -r evt;
|
||||
do pamixer --get-volume;
|
||||
done`)
|
||||
|
||||
(defpoll hour :interval "1s" "date +%H")
|
||||
(defpoll min :interval "1s" "date +%M")
|
||||
(defpoll sec :interval "1s" "date +%S")
|
||||
|
||||
(defpoll day_word :interval "10m" "date +%a")
|
||||
(defpoll day :interval "10m" "date +%d")
|
||||
(defpoll month :interval "1h" "date +%m")
|
||||
(defpoll year :interval "1h" "date +%y")
|
||||
|
||||
(deflisten workspaces_0_yuck "./workspaces.sh 0")
|
||||
(deflisten workspaces_1_yuck "./workspaces.sh 1")
|
||||
(deflisten workspaces_2_yuck "./workspaces.sh 2")
|
||||
|
||||
(defwindow bar_1
|
||||
:monitor 1
|
||||
:geometry (geometry :x 0 :y 0 :width "40px" :height "100%")
|
||||
:anchor "top left"
|
||||
:reserve (struts :distance "40px" :side "left")
|
||||
(bar :screen 1))
|
||||
(defwindow bar_2
|
||||
:monitor 2
|
||||
:geometry (geometry :x 0 :y 0 :width "40px" :height "100%")
|
||||
:anchor "top left"
|
||||
:reserve (struts :distance "40px" :side "left")
|
||||
(bar :screen 2))
|
34
eww-bar/.config/eww-bar/workspaces.sh
Executable file
34
eww-bar/.config/eww-bar/workspaces.sh
Executable file
|
@ -0,0 +1,34 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
monitor="$1"
|
||||
|
||||
gib_workspace_names() {
|
||||
wmctrl -d \
|
||||
| awk '{ print $1 " " $2 " " $9 }' \
|
||||
| grep -v NSP \
|
||||
| grep "${monitor}_"
|
||||
}
|
||||
|
||||
gib_workspace_yuck() {
|
||||
gib_workspace_names | while read -r id active name; do
|
||||
name="${name#*_}"
|
||||
if [ "$active" == '*' ]; then
|
||||
active_class="active"
|
||||
else
|
||||
active_class="inactive"
|
||||
fi
|
||||
|
||||
if wmctrl -l | grep --regexp '.*\s\+'"$id"'\s\+.*' >/dev/null; then
|
||||
button_class="occupied"
|
||||
button_name="◆"
|
||||
else
|
||||
button_class="empty"
|
||||
button_name="◇"
|
||||
fi
|
||||
echo -n '(button :class "'$button_class' '$active_class'" :onclick "wmctrl -s '$id'" "'$button_name'")'
|
||||
done
|
||||
}
|
||||
|
||||
xprop -spy -root _NET_CURRENT_DESKTOP | while read -r; do
|
||||
echo '(box :orientation "v" :class "workspaces" :space-evenly true :halign "start" :valign "center" :vexpand true '"$(gib_workspace_yuck)"')'
|
||||
done
|
|
@ -61,6 +61,7 @@
|
|||
(init-lsp :hls {:settings {:languageServerHaskell {:formattingProvider "stylish-haskell"}}})
|
||||
(init-lsp :ocamllsp)
|
||||
(init-lsp :vimls)
|
||||
(init-lsp :gopls)
|
||||
(init-lsp :bashls)
|
||||
(init-lsp :erlangls)
|
||||
(init-lsp :yamlls)
|
||||
|
|
Loading…
Reference in a new issue