summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.config/eww/assets/raven.pngbin5178 -> 0 bytes
-rw-r--r--.config/eww/eww.scss20
-rw-r--r--.config/eww/eww.yuck4
-rw-r--r--.config/eww/pollers.yuck5
-rwxr-xr-x.config/eww/scripts/update_x_names33
-rw-r--r--.config/eww/widgets.yuck15
6 files changed, 62 insertions, 15 deletions
diff --git a/.config/eww/assets/raven.png b/.config/eww/assets/raven.png
deleted file mode 100644
index 6366d8a..0000000
--- a/.config/eww/assets/raven.png
+++ /dev/null
Binary files differ
diff --git a/.config/eww/eww.scss b/.config/eww/eww.scss
index 29ba1b5..62ae21b 100644
--- a/.config/eww/eww.scss
+++ b/.config/eww/eww.scss
@@ -17,7 +17,7 @@
/* bar */
.bar
{
- background-color: rgba(#090011, 0.48);
+ background-color: rgba(#000B0E, 0.48);
}
/* time*/
@@ -95,14 +95,24 @@
.battery
{
- color: #a0a0a0;
+ color: #d42ea2;
font-family: Iosevka;
font-size: 12px;
}
+.classes
+{
+ margin-left: 10px;
+}
-.icon
+.class
{
- margin-left: -600px;
- color: #7dc4e4;
+ margin-right: 10px;
+ color: #D9E0EE;
+ padding: 4px;
+ margin-top: 0px;
+ border-radius: 0px;
+ background: rgba(#042429, 0.48);
+ font-family: Iosevka;
+ font-size: 12px;
}
diff --git a/.config/eww/eww.yuck b/.config/eww/eww.yuck
index f5011b6..ff5f999 100644
--- a/.config/eww/eww.yuck
+++ b/.config/eww/eww.yuck
@@ -7,9 +7,9 @@
:geometry (geometry :x "0%"
:y "0%"
:width "100%"
- :height "25px"
+ :height "20px"
:anchor "top center")
- :reserve (struts :side "top" :distance "2.4%")
+ :reserve (struts :side "top" :distance "1.9%")
(bar))
;; Local Variables:
diff --git a/.config/eww/pollers.yuck b/.config/eww/pollers.yuck
index a6e40cf..c3cdecf 100644
--- a/.config/eww/pollers.yuck
+++ b/.config/eww/pollers.yuck
@@ -1,10 +1,11 @@
(defpoll volume :interval "2s" "scripts/getvol")
(defpoll time :interval "30s" "date '+%H:%M'")
(defpoll date :interval "30s" "date '+%b %d'")
-(defpoll ws :interval "0.1s" "scripts/update_workspaces")
+(defpoll ws :interval "0.15s" "scripts/update_workspaces")
+(defpoll cs :interval "0.15s" "scripts/update_x_names")
(defpoll mail :interval "60s" "$HOME/.local/bin/mail-string")
(defpoll t1 :interval "60s" "$HOME/.local/bin/t1-string")
-(defpoll weather :interval "3600s" "$HOME/.local/bin/string-weather")
+(defpoll weather :interval "1800s" "$HOME/.local/bin/string-weather")
(defpoll batperc :interval "60s" "echo \"$(cat /sys/class/power_supply/BAT0/capacity)%\"")
;; Local Variables:
diff --git a/.config/eww/scripts/update_x_names b/.config/eww/scripts/update_x_names
new file mode 100755
index 0000000..63117ef
--- /dev/null
+++ b/.config/eww/scripts/update_x_names
@@ -0,0 +1,33 @@
+#!/run/current-system/profile/bin/guile \
+-s
+!#
+
+(use-modules (ice-9 popen)
+ (ice-9 textual-ports)
+ (ice-9 rdelim))
+
+(define cmd "wmctrl -l | awk -v ws=\"$(wmctrl -d | awk '$2 == \"*\" {print $1}')\" '$2 == ws {print}' | cut -d ' ' -f 5-")
+
+(define box-attrs '(:class "classes"
+ :orientation "h"
+ :valign "center"
+ :halign "start"
+ :space-evenly "false"))
+
+(define titles
+ (let* ((process (open-pipe* OPEN_READ "sh" "-c" cmd))
+ (output (get-string-all process)))
+ (close-pipe process)
+ output))
+
+(define labels
+ (map (lambda (t) `(eventbox
+ :onclick ,(string-concatenate `("wmctrl -a \"" ,t "\""))
+ (label :class "class"
+ :text ,t
+ :truncate true
+ :valign "center")))
+ (filter (lambda (s) (not (string=? s "")))
+ (string-split titles #\newline))))
+
+(write `(box ,@box-attrs ,@labels))
diff --git a/.config/eww/widgets.yuck b/.config/eww/widgets.yuck
index 363d778..c7ea4d4 100644
--- a/.config/eww/widgets.yuck
+++ b/.config/eww/widgets.yuck
@@ -1,7 +1,7 @@
(defwidget bar []
(box :class "bar"
:orientation "h"
- (iconwidget)
+ (classeswidget)
(workspaces)
(power-time-cpu-mem)))
@@ -68,12 +68,15 @@
:class "weather"
:text "${weather}"))
+(defwidget classeswidget []
+ (literal :content cs))
+
(defwidget iconwidget []
- (image
- :path "assets/raven.png"
- :class "icon"
- :image-height 20
- :preserve-aspect-ratio true))
+ (image
+ :path "assets/raven.png"
+ :class "icon"
+ :image-height 20
+ :preserve-aspect-ratio true))
(defwidget workspaces []
(literal :content ws))