user/eww: remove res

This commit is contained in:
LavaDesu 2025-03-23 00:32:09 +11:00
parent 2e74aa5f00
commit 438eb54cea
Signed by: cilly
GPG key ID: 6500251E087653C9
6 changed files with 0 additions and 252 deletions

View file

@ -1,72 +0,0 @@
$background: #1a1b26;
$accent: #9d7cd8;
$foreground: #c0caf5;
* {
all: unset;
}
window {
background: transparent;
}
.bar {
margin: 5px 20px 0px 20px;
}
.widget {
background: $background;
color: $foreground;
font-family: "Noto Sans";
font-weight: 600;
font-size: 15px;
padding: 5px 15px;
border-radius: 50px;
}
.time {
.base {
font-weight: 700;
}
.extension {
font-weight: 500;
color: rgba($foreground, .7);
}
}
.workspaces {
padding: 5px 10px;
font-size: 22px;
button {
padding: 0px 2px;
}
.empty, .occupied {
color: $accent;
}
}
.widget.line-workspaces {
color: transparent;
padding: 0;
border-radius: 0;
font-size: 0;
button {
padding: 0 13px;
}
.empty {
background-color: $background;
}
.occupied {
background-color: $accent;
}
.focused {
background-color: $foreground;
}
}

View file

@ -1,77 +0,0 @@
(defwindow linebar :monitor 0
:geometry (geometry :x "30px"
:y "0%"
:width "100%"
:height "2px"
:anchor "top center")
:stacking "fg"
:windowtype "dock"
:wm-ignore false
(wlinebar))
(defwindow mainbar :monitor 0
:geometry (geometry :x "0%"
:y "0%"
:width "100%"
:height "30px"
:anchor "top center")
:stacking "fg"
:windowtype "dock"
:wm-ignore false
(bar))
(defvar time-extended false) ; for :run-while property of below variable
; when this turns true, the polling starts and
; var gets updated with given interval
(defpoll ptime :interval "1s"
:run-while !time-extended
`date +%H:%M`)
(defpoll petimea :interval "1s"
:run-while time-extended
`date "+%A, %d %B %Y "`)
(defpoll petimeb :interval "1s"
:run-while time-extended
`date "+:%S"`)
(deflisten lworkspaces "./scripts/workspaces.sh")
(deflisten llineworkspaces "./scripts/line-workspaces.sh")
(deflisten ltitle "./scripts/title.sh")
(defwidget bar []
(eventbox :onscroll "./scripts/scroll.sh {}"
(centerbox :orientation "h"
:class "bar"
(workspaces)
(title)
(time))))
(defwidget wlinebar []
(eventbox :onscroll "./scripts/scroll.sh {}"
(line_workspaces)))
(defwidget workspaces []
(literal :content lworkspaces))
(defwidget line_workspaces []
(literal :content llineworkspaces))
(defwidget title []
(literal :content ltitle))
(defwidget time_extension [text]
(label :text text
:class "extension"))
(defwidget time []
(button :onclick `eww update time-extended=${time-extended ? "false" : "true"}`
(box :orientation "horizontal"
:space-evenly false
:halign "end"
:class "widget time"
(time_extension :text {time-extended ? petimea : ""})
(label :text ptime
:class "base")
(time_extension :text {time-extended ? petimeb : ""})
)))

View file

@ -1,43 +0,0 @@
#!/usr/bin/env sh
# Checks if a list ($1) contains an element ($2)
contains() {
for e in $1; do
[ "$e" -eq "$2" ] && echo 1 && return
done
echo 0
}
print_workspaces() {
buf=""
desktops=$(bspc query -D --names)
focused_desktop=$(bspc query -D -d focused --names)
occupied_desktops=$(bspc query -D -d .occupied --names)
urgent_desktops=$(bspc query -D -d .urgent --names)
for d in $desktops; do
if [ "$(contains "$focused_desktop" "$d")" -eq 1 ]; then
ws=$d
class="focused"
elif [ "$(contains "$occupied_desktops" "$d")" -eq 1 ]; then
ws=$d
class="occupied"
elif [ "$(contains "$urgent_desktops" "$d")" -eq 1 ]; then
ws=$d
class="urgent"
else
ws=$d
class="empty"
fi
buf="$buf (eventbox :cursor \"hand\" (button :class \"$class\" :onclick \"bspc desktop -f $ws\" \"\"))"
done
echo "(box :class \"widget line-workspaces\" :halign \"start\" :valign \"center\" :vexpand true :hexpand true $buf)"
}
# Listen to bspwm changes
print_workspaces
bspc subscribe desktop node_transfer | while read -r _ ; do
print_workspaces
done

View file

@ -1,3 +0,0 @@
#!/usr/bin/env sh
translated=$([ "$1" == "up" ] && echo "prev" || echo "next")
bspc desktop -f $translated

View file

@ -1,10 +0,0 @@
#!/usr/bin/env sh
xtitle -s | while read -r line ; do
trunc=$(echo $line | cut -c-85)
if [ -z "$line" ]; then
echo ""
else
echo "(box :class \"widget title\" :halign \"center\" :valign \"center\" :vexpand true :hexpand true (label :text \"${trunc}\"))"
fi
done

View file

@ -1,47 +0,0 @@
#!/usr/bin/env sh
# Checks if a list ($1) contains an element ($2)
contains() {
for e in $1; do
[ "$e" -eq "$2" ] && echo 1 && return
done
echo 0
}
print_workspaces() {
buf=""
desktops=$(bspc query -D --names)
focused_desktop=$(bspc query -D -d focused --names)
occupied_desktops=$(bspc query -D -d .occupied --names)
urgent_desktops=$(bspc query -D -d .urgent --names)
for d in $desktops; do
if [ "$(contains "$focused_desktop" "$d")" -eq 1 ]; then
ws=$d
icon=""
class="focused"
elif [ "$(contains "$occupied_desktops" "$d")" -eq 1 ]; then
ws=$d
icon=""
class="occupied"
elif [ "$(contains "$urgent_desktops" "$d")" -eq 1 ]; then
ws=$d
icon=""
class="urgent"
else
ws=$d
icon=""
class="empty"
fi
buf="$buf (eventbox :cursor \"hand\" (button :class \"$class\" :onclick \"bspc desktop -f $ws\" \"$icon\"))"
done
echo "(box :class \"widget workspaces\" :halign \"start\" :valign \"center\" :vexpand true :hexpand true $buf)"
}
# Listen to bspwm changes
print_workspaces
bspc subscribe desktop node_transfer | while read -r _ ; do
print_workspaces
done