Update config
This commit is contained in:
parent
9f35c3997a
commit
46c65664f1
10 changed files with 748 additions and 0 deletions
60
config/eww/eww.scss
Normal file
60
config/eww/eww.scss
Normal file
|
@ -0,0 +1,60 @@
|
|||
|
||||
.bar {
|
||||
border-radius: 12px;
|
||||
|
||||
}
|
||||
|
||||
.bat {
|
||||
color: #cac;
|
||||
|
||||
}
|
||||
.circle {
|
||||
margin-top: -2.5rem;
|
||||
color: #cac;
|
||||
}
|
||||
|
||||
.workspace-entry {
|
||||
border-radius: 20px;
|
||||
border-width: 2px;
|
||||
border-style: solid;
|
||||
border-color: #cac;
|
||||
margin: 2px;
|
||||
|
||||
&.empty {
|
||||
|
||||
}
|
||||
|
||||
&.occupied{
|
||||
}
|
||||
|
||||
&.current {
|
||||
background-color: #536;
|
||||
}
|
||||
}
|
||||
|
||||
.power {
|
||||
color: #cac;
|
||||
font-size: 20;
|
||||
padding-top: 2px;
|
||||
padding-right: 4px;
|
||||
padding-left: 0px;
|
||||
padding-bottom: 4px;
|
||||
margin-bottom: 5px;
|
||||
margin-left: 1px;
|
||||
background-color: #515;
|
||||
border-radius: 15px;
|
||||
}
|
||||
|
||||
|
||||
.clock {
|
||||
background-color: #536;
|
||||
border-width: 2px;
|
||||
border-style: solid;
|
||||
border-color: #cac;
|
||||
border-radius: 5px;
|
||||
color: #cac;
|
||||
padding: 2px;
|
||||
margin: 2px;
|
||||
border-radius: 3px;
|
||||
|
||||
}
|
97
config/eww/eww.yuck
Normal file
97
config/eww/eww.yuck
Normal file
|
@ -0,0 +1,97 @@
|
|||
;;;; (defpoll time :interval "1s" 'date +%s')
|
||||
|
||||
(defwidget clock []
|
||||
(box :orientation "vertical"
|
||||
:halign "center"
|
||||
:valign "end"
|
||||
(box :class "clock" {formattime(EWW_TIME, "%H")})
|
||||
(box :class "clock" {formattime(EWW_TIME, "%M")})
|
||||
))
|
||||
|
||||
(deflisten workspaces :initial "[]" "bash ~/.config/eww/scripts/get-workspaces")
|
||||
(deflisten current_workspace :initial "..." "bash ~/.config/eww/scripts/get-active-workspace")
|
||||
(deflisten urgent_workspace :initial "..." "bash ~/.config/eww/scripts/get-urgent-workspaces")
|
||||
(defwidget _workspaces []
|
||||
(eventbox :onscroll "bash ~/.config/eww/scripts/change-active-workspace {} ${current_workspace}" :class "workspaces-widget"
|
||||
(box :space-evenly false :orientation "vertical"
|
||||
(label :text "${workspaces}${current_workspace}${urgent_workspace}" :visible false)
|
||||
(for workspace in workspaces
|
||||
(eventbox :onclick "hyprctl dispatch workspace ${workspace.id}"
|
||||
(box :class "workspace-entry ${workspace.id == current_workspace ? "current" : ""} ${workspace.id == urgent_workspace ? "urgent" : ""} ${workspace.windows > 0 ? "occupied" : "empty" }"
|
||||
(label :text "${workspace.id}")
|
||||
))))))
|
||||
|
||||
|
||||
(defwidget circle [val prog sty char]
|
||||
(box :halign "center"
|
||||
:orientation "vertical"
|
||||
:valign "end"
|
||||
(circular-progress :value prog
|
||||
:start-at 10
|
||||
:clockwise false
|
||||
:thickness 3
|
||||
:width 30
|
||||
:height 30
|
||||
:class "bat"
|
||||
:halign "center"
|
||||
val )
|
||||
(box :class "circle" :style sty char)))
|
||||
|
||||
(defwidget battery []
|
||||
(circle :prog {EWW_BATTERY.BAT1.capacity * (77778 /100000)}
|
||||
:sty "color: ${EWW_BATTERY.BAT1.status == 'Charging' ? '#1a1': EWW_BATTERY.BAT1.capacity < 20 ? '#a11': '#cac'};"
|
||||
:val {EWW_BATTERY.BAT1.capacity}
|
||||
:char ""))
|
||||
|
||||
(deflisten vol "cat ~/.cache/eww/vol && inotifywait -q -m -e close_write ~/.cache/eww/vol | while read -r filename event; do cat ~/.cache/eww/vol; done")
|
||||
|
||||
(defwidget volume []
|
||||
(circle :prog {vol * 7/10}
|
||||
:sty "font-size: 12; margin-right: 2px;"
|
||||
:val {vol + 1 - 1}
|
||||
:char ""))
|
||||
|
||||
(defpoll micvol :interval "1m" "wpctl get-volume @DEFAULT_AUDIO_SOURCE@ | awk '{print $2}'")
|
||||
|
||||
(defwidget mic []
|
||||
(circle :prog {micvol * 70}
|
||||
:sty "margin-left: 1px;"
|
||||
:val {micvol *100}
|
||||
:char ""))
|
||||
|
||||
(deflisten backlight "brightnessctl g && inotifywait -q -m -e modify /sys/class/backlight/intel_backlight/actual_brightness | while read -r filename event; do cat /sys/class/backlight/intel_backlight/actual_brightness; done")
|
||||
|
||||
(defwidget brightness []
|
||||
(circle :prog {(backlight / 960) * 7/10}
|
||||
:sty "font-size: 12; margin-right: 3px;"
|
||||
:val {round( backlight / 960, 0) - 1}
|
||||
:char ""))
|
||||
|
||||
(defwidget power []
|
||||
(box :class "power" :valign "end" "⏻"))
|
||||
|
||||
(defwidget bar []
|
||||
(centerbox :orientation "vertical"
|
||||
:halign "center"
|
||||
:space-evenly false
|
||||
(_workspaces)
|
||||
(clock)
|
||||
(box :orientation "vertical" :spacing -25 :valign "end"
|
||||
(brightness)
|
||||
(mic)
|
||||
(volume)
|
||||
(battery)
|
||||
(power))))
|
||||
|
||||
|
||||
(defwindow bar
|
||||
:monitor 0
|
||||
:geometry (geometry :x "4px"
|
||||
:y "1%"
|
||||
:width "2.5%"
|
||||
:height "98%"
|
||||
:anchor "left center")
|
||||
:stacking "fg"
|
||||
:exclusive true
|
||||
:class "bar"
|
||||
(bar))
|
6
config/eww/scripts/get-active-workspace
Executable file
6
config/eww/scripts/get-active-workspace
Executable file
|
@ -0,0 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
hyprctl monitors -j | jq '.[] | select(.focused) | .activeWorkspace.id'
|
||||
|
||||
socat -u UNIX-CONNECT:/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - |
|
||||
stdbuf -o0 awk -F '>>|,' -e '/^workspace>>/ {print $2}' -e '/^focusedmon>>/ {print $3}'
|
11
config/eww/scripts/get-workspaces
Executable file
11
config/eww/scripts/get-workspaces
Executable file
|
@ -0,0 +1,11 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
spaces (){
|
||||
WORKSPACE_WINDOWS=$(hyprctl workspaces -j | jq 'map({key: .id | tostring, value: .windows}) | from_entries')
|
||||
seq 1 9 | jq --argjson windows "${WORKSPACE_WINDOWS}" --slurp -Mc 'map(tostring) | map({id: ., windows: ($windows[.]//0)})'
|
||||
}
|
||||
|
||||
spaces
|
||||
socat -u UNIX-CONNECT:/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - | while read -r line; do
|
||||
spaces
|
||||
done
|
Loading…
Add table
Add a link
Reference in a new issue