mirror of
https://github.com/elkowar/dots-of-war.git
synced 2024-12-25 13:42:23 +00:00
add eww stuff
This commit is contained in:
parent
211c367427
commit
43002a929b
6 changed files with 92 additions and 1 deletions
13
eww-laptop/.config/eww/eww.scss
Normal file
13
eww-laptop/.config/eww/eww.scss
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
* {
|
||||||
|
all: unset;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bar {
|
||||||
|
background-color: #1d2021;
|
||||||
|
color: #ebdbb2;
|
||||||
|
margin-left: 10px;
|
||||||
|
margin-right: 10px;
|
||||||
|
font-family: "CozetteVector";
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
31
eww-laptop/.config/eww/eww.yuck
Normal file
31
eww-laptop/.config/eww/eww.yuck
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
(deflisten workspaces :initial "[]" "bash ~/.config/eww/scripts/get-workspaces")
|
||||||
|
(deflisten current_workspace :initial "1" "bash ~/.config/eww/scripts/get-active-workspace")
|
||||||
|
(defpoll time :interval "1s" "date '+%d.%m.%Y - %H:%M'")
|
||||||
|
|
||||||
|
(defwidget workspaces []
|
||||||
|
(eventbox :halign "start"
|
||||||
|
:onscroll "bash ${EWW_CONFIG_DIR}/scripts/change-active-workspace {} ${current_workspace}"
|
||||||
|
:class "workspaces-widget"
|
||||||
|
(box :space-evenly true
|
||||||
|
(for workspace in workspaces
|
||||||
|
(eventbox :onclick "hyprctl dispatch workspace ${workspace.id}"
|
||||||
|
(box :class "workspace-entry ${workspace.id == current_workspace ? "current" : ""} ${workspace.windows > 0 ? "occupied" : "empty"}"
|
||||||
|
(label :text " ${workspace.id == current_workspace ? "◆" : "◇"} ")))))))
|
||||||
|
|
||||||
|
(defwidget bar []
|
||||||
|
(centerbox :class "bar"
|
||||||
|
(workspaces)
|
||||||
|
"${time}"
|
||||||
|
(box :halign "end"
|
||||||
|
:space-evenly true
|
||||||
|
:width "150"
|
||||||
|
" ${EWW_BATTERY["BAT1"].capacity}%"
|
||||||
|
" ${round(EWW_RAM.used_mem_perc, 0)}%"
|
||||||
|
" ${round(EWW_CPU.avg, 0)}%")))
|
||||||
|
|
||||||
|
(defwindow bar
|
||||||
|
:monitor 0
|
||||||
|
:geometry (geometry :x 0 :y 0 :width "100%" :height "30px" :anchor "top center")
|
||||||
|
:stacking "fg"
|
||||||
|
:exclusive true
|
||||||
|
(bar))
|
21
eww-laptop/.config/eww/scripts/change-active-workspace.sh
Executable file
21
eww-laptop/.config/eww/scripts/change-active-workspace.sh
Executable file
|
@ -0,0 +1,21 @@
|
||||||
|
#! /bin/bash
|
||||||
|
function clamp {
|
||||||
|
min=$1
|
||||||
|
max=$2
|
||||||
|
val=$3
|
||||||
|
python -c "print(max($min, min($val, $max)))"
|
||||||
|
}
|
||||||
|
|
||||||
|
direction=$1
|
||||||
|
current=$2
|
||||||
|
if test "$direction" = "down"
|
||||||
|
then
|
||||||
|
target=$(clamp 1 10 $(($current+1)))
|
||||||
|
echo "jumping to $target"
|
||||||
|
hyprctl dispatch workspace $target
|
||||||
|
elif test "$direction" = "up"
|
||||||
|
then
|
||||||
|
target=$(clamp 1 10 $(($current-1)))
|
||||||
|
echo "jumping to $target"
|
||||||
|
hyprctl dispatch workspace $target
|
||||||
|
fi
|
3
eww-laptop/.config/eww/scripts/get-active-workspace
Executable file
3
eww-laptop/.config/eww/scripts/get-active-workspace
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/bash
|
||||||
|
hyprctl monitors -j | jq --raw-output .[0].activeWorkspace.id
|
||||||
|
socat -u UNIX-CONNECT:/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - | stdbuf -o0 grep '^workspace>>' | stdbuf -o0 awk -F '>>|,' '{print $2}'
|
11
eww-laptop/.config/eww/scripts/get-workspaces
Executable file
11
eww-laptop/.config/eww/scripts/get-workspaces
Executable file
|
@ -0,0 +1,11 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
spaces (){
|
||||||
|
WORKSPACE_WINDOWS=$(hyprctl workspaces -j | jq 'map({key: .id | tostring, value: .windows}) | from_entries')
|
||||||
|
seq 1 10 | 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
|
|
@ -1,6 +1,10 @@
|
||||||
monitor=,preferred,auto,1
|
monitor=,preferred,auto,1
|
||||||
|
|
||||||
exec-once = swaybg -m fill --image /home/leon/Pictures/green_leaves.jpg & mako
|
exec-once = swaybg -m fill --image /home/leon/Pictures/green_leaves.jpg & mako
|
||||||
|
env = $WOBSOCK,$XDG_RUNTIME_DIR/wob.sock
|
||||||
|
exec-once = mkfifo $WOBSOCK && tail -f $WOBSOCK | wob
|
||||||
|
exec-once = eww open bar
|
||||||
|
|
||||||
|
|
||||||
# Source a file (multi-file configs)
|
# Source a file (multi-file configs)
|
||||||
# source = ~/.config/hypr/myColors.conf
|
# source = ~/.config/hypr/myColors.conf
|
||||||
|
@ -12,7 +16,7 @@ input {
|
||||||
kb_layout = us
|
kb_layout = us
|
||||||
kb_variant =
|
kb_variant =
|
||||||
kb_model =
|
kb_model =
|
||||||
kb_options =
|
kb_options = compose:ralt
|
||||||
kb_rules =
|
kb_rules =
|
||||||
|
|
||||||
follow_mouse = 1
|
follow_mouse = 1
|
||||||
|
@ -90,6 +94,14 @@ bind = $mainMod SHIFT, P, exec, rofi -show drun
|
||||||
bind = $mainMod, P, pseudo, # dwindle
|
bind = $mainMod, P, pseudo, # dwindle
|
||||||
bind = $mainMod, v, togglesplit, # dwindle
|
bind = $mainMod, v, togglesplit, # dwindle
|
||||||
bind = $mainMod, f, fullscreen, # dwindle
|
bind = $mainMod, f, fullscreen, # dwindle
|
||||||
|
|
||||||
|
bind = ,XF86AudioRaiseVolume, exec, pamixer -ui 2 && pamixer --get-volume > $WOBSOCK
|
||||||
|
bind = ,XF86AudioLowerVolume, exec, pamixer -ud 2 && pamixer --get-volume > $WOBSOCK
|
||||||
|
bind = ,XF86AudioMute, exec, pamixer --toggle-mute && ( pamixer --get-mute && echo 0 > $WOBSOCK ) || pamixer --get-volume > $WOBSOCK
|
||||||
|
bind = ,XF86MonBrightnessDown, exec, brightnessctl set 5%- | sed -En 's/.*\(([0-9]+)%\).*/\1/p' | tee /tmp/brightness > $WOBSOCK
|
||||||
|
bind = ,XF86MonBrightnessUp, exec, brightnessctl set +5% | sed -En 's/.*\(([0-9]+)%\).*/\1/p' | tee /tmp/brightness > $WOBSOCK
|
||||||
|
|
||||||
|
|
||||||
bind = $mainMod, h, movefocus, l
|
bind = $mainMod, h, movefocus, l
|
||||||
bind = $mainMod, l, movefocus, r
|
bind = $mainMod, l, movefocus, r
|
||||||
bind = $mainMod, k, movefocus, u
|
bind = $mainMod, k, movefocus, u
|
||||||
|
|
Loading…
Reference in a new issue