From 438eb54ceafa6f20e449a23bb138500213690ab5 Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Sun, 23 Mar 2025 00:32:09 +1100 Subject: [PATCH] user/eww: remove res --- res/eww/eww.scss | 72 ---------------------------- res/eww/eww.yuck | 77 ------------------------------ res/eww/scripts/line-workspaces.sh | 43 ----------------- res/eww/scripts/scroll.sh | 3 -- res/eww/scripts/title.sh | 10 ---- res/eww/scripts/workspaces.sh | 47 ------------------ 6 files changed, 252 deletions(-) delete mode 100644 res/eww/eww.scss delete mode 100644 res/eww/eww.yuck delete mode 100755 res/eww/scripts/line-workspaces.sh delete mode 100755 res/eww/scripts/scroll.sh delete mode 100755 res/eww/scripts/title.sh delete mode 100755 res/eww/scripts/workspaces.sh diff --git a/res/eww/eww.scss b/res/eww/eww.scss deleted file mode 100644 index 08b2270..0000000 --- a/res/eww/eww.scss +++ /dev/null @@ -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; - } -} - diff --git a/res/eww/eww.yuck b/res/eww/eww.yuck deleted file mode 100644 index a0a433b..0000000 --- a/res/eww/eww.yuck +++ /dev/null @@ -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 : ""}) - ))) - diff --git a/res/eww/scripts/line-workspaces.sh b/res/eww/scripts/line-workspaces.sh deleted file mode 100755 index 960c444..0000000 --- a/res/eww/scripts/line-workspaces.sh +++ /dev/null @@ -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 diff --git a/res/eww/scripts/scroll.sh b/res/eww/scripts/scroll.sh deleted file mode 100755 index f76b6b0..0000000 --- a/res/eww/scripts/scroll.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env sh -translated=$([ "$1" == "up" ] && echo "prev" || echo "next") -bspc desktop -f $translated diff --git a/res/eww/scripts/title.sh b/res/eww/scripts/title.sh deleted file mode 100755 index 26664ba..0000000 --- a/res/eww/scripts/title.sh +++ /dev/null @@ -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 diff --git a/res/eww/scripts/workspaces.sh b/res/eww/scripts/workspaces.sh deleted file mode 100755 index 3eb9b52..0000000 --- a/res/eww/scripts/workspaces.sh +++ /dev/null @@ -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