aboutsummaryrefslogtreecommitdiff
path: root/roles/home/desktop/eww
diff options
context:
space:
mode:
authorCaroline Larimore <caroline@larimo.re>2024-07-25 22:52:20 -0700
committerCaroline Larimore <caroline@larimo.re>2024-07-25 23:00:44 -0700
commit2f17e369400b9c895b3554008ab3efbc76255428 (patch)
tree172c910e17f14bb8d0d7306fe527c2c79140df64 /roles/home/desktop/eww
parent10c984caf7067656990e5966b4626314f225755f (diff)
roles: home: migrate old home module to roles
Diffstat (limited to 'roles/home/desktop/eww')
-rw-r--r--roles/home/desktop/eww/colors.css36
-rw-r--r--roles/home/desktop/eww/eww.css51
-rw-r--r--roles/home/desktop/eww/eww.yuck1
-rw-r--r--roles/home/desktop/eww/windows/music.yuck86
4 files changed, 174 insertions, 0 deletions
diff --git a/roles/home/desktop/eww/colors.css b/roles/home/desktop/eww/colors.css
new file mode 100644
index 0000000..69a3e5e
--- /dev/null
+++ b/roles/home/desktop/eww/colors.css
@@ -0,0 +1,36 @@
+@define-color accent #cc241d;
+
+@define-color black #282828;
+@define-color red #cc241d;
+@define-color green #98971a;
+@define-color yellow #d79921;
+@define-color blue #458588;
+@define-color magenta #b16286;
+@define-color cyan #689d6a;
+@define-color white #a89984;
+
+@define-color brightBlack #928374;
+@define-color brightRed #fb4934;
+@define-color brightGreen #b8bb26;
+@define-color brightYellow #fabd2f;
+@define-color brightBlue #83a598;
+@define-color brightMagenta #d3869b;
+@define-color brightCyan #8ec07c;
+@define-color brightWhite #ebdbb2;
+
+@define-color bg #282828;
+@define-color bg0 #282828;
+@define-color bg1 #3c3836;
+@define-color bg2 #504945;
+@define-color bg3 #665c54;
+@define-color bg4 #7c6f64;
+
+@define-color fg #ebdbb2;
+@define-color fg0 #fbf1c7;
+@define-color fg1 #ebdbb2;
+@define-color fg2 #d5c4a1;
+@define-color fg3 #bdae93;
+@define-color fg4 #a89984;
+
+@define-color orange #d65d0e;
+@define-color brightOrange #fe8019;
diff --git a/roles/home/desktop/eww/eww.css b/roles/home/desktop/eww/eww.css
new file mode 100644
index 0000000..075beb8
--- /dev/null
+++ b/roles/home/desktop/eww/eww.css
@@ -0,0 +1,51 @@
+@import "colors.css";
+
+window {
+ color: @fg;
+ background-color: @bg;
+ border: 2px solid @bg1;
+ font-family: monospace, sans-serif;
+}
+
+.main {
+ margin: 8px;
+}
+
+.left {
+ margin-top: 8px;
+}
+
+.song-title {
+ font-size: 17px;
+ font-weight: bold;
+}
+
+.song-album {
+ color: @fg2;
+}
+
+.song-artist {
+ color: @fg2;
+}
+
+.control {
+ font-size: 24;
+}
+
+button {
+ color: @fg;
+ background: @bg;
+
+ border: none;
+ border-radius: 0;
+ box-shadow: none;
+ text-shadow: none;
+}
+
+button:hover {
+ background: @bg1;
+}
+
+button:active {
+ background: @bg2;
+} \ No newline at end of file
diff --git a/roles/home/desktop/eww/eww.yuck b/roles/home/desktop/eww/eww.yuck
new file mode 100644
index 0000000..37d2efc
--- /dev/null
+++ b/roles/home/desktop/eww/eww.yuck
@@ -0,0 +1 @@
+(include "./windows/music.yuck") \ No newline at end of file
diff --git a/roles/home/desktop/eww/windows/music.yuck b/roles/home/desktop/eww/windows/music.yuck
new file mode 100644
index 0000000..91ee05f
--- /dev/null
+++ b/roles/home/desktop/eww/windows/music.yuck
@@ -0,0 +1,86 @@
+(defwindow music [pos gaps]
+ :monitor "<primary>"
+ :geometry (geometry
+ :x {
+ pos == "right"
+ ? gaps == "true"
+ ? "-8px" : "2px"
+ : "0px"
+ }
+ :y { gaps == "true" ? "-8px" : "2px" }
+ :height {128 + 16}
+ :anchor { pos == "right" ? "bottom right" : "bottom center" }
+ )
+ :stacking "fg"
+ :windowtype "dock"
+ :wm-ignore true
+
+ (box :class "main"
+ :orientation "h"
+ :spacing 8
+ :space-evenly false
+ :height {128 + 16}
+
+ (image
+ :path song-cover
+ :image-width 128
+ :image-height 128
+ )
+
+ (box :class "left"
+ :orientation "v"
+ :spacing 0
+ :space-evenly true
+ :hexpand true
+
+ (box :class "info"
+ :orientation "v"
+ :space-evenly false
+ :valign "center"
+
+ (label :class "song-title"
+ :text {song.title}
+ :halign "start"
+ )
+ (label :class "song-album"
+ :text {song.album}
+ :halign "start"
+ )
+ (label :class "song-artist"
+ :text {song.artist}
+ :halign "start"
+ )
+ )
+
+ (box :class "control"
+ :space-evenly false
+ :halign "center"
+ :valign "end"
+
+ (button
+ :onclick `playerctl --player=cmus,firefox,%any previous`
+ "󰒮"
+ )
+ (button
+ :onclick `playerctl --player=cmus,firefox,%any play-pause`
+ { song.status == "Playing" ? "󰏤" : "󰐊" }
+ )
+ (button
+ :onclick `playerctl --player=cmus,firefox,%any next`
+ "󰒭"
+ )
+
+ ; Offset controls to center of screen
+ (box :width {128 + 8})
+ )
+ )
+ )
+)
+
+(deflisten song-cover
+ `playerctl --player=cmus,firefox,%any -F metadata title | get-album-art`
+)
+
+(deflisten song
+ `playerctl --player=cmus,firefox,%any -F metadata --format='{"title": "{{title}}", "album": "{{album}}", "artist": "{{artist}}", "status": "{{status}}"}'`
+) \ No newline at end of file