From c0eda75eba998745cc3b945184be1559017bb8a1 Mon Sep 17 00:00:00 2001 From: Justine Smithies Date: Sun, 9 Jun 2024 19:23:31 +0100 Subject: Updated for Chimera Linux use --- .config/eww/eww.scss | 22 ++++++------- .config/eww/eww.yuck | 10 +++--- .config/eww/scripts/workspace.sh | 71 +++++++++++++++++++++++++++++----------- 3 files changed, 67 insertions(+), 36 deletions(-) (limited to '.config/eww') diff --git a/.config/eww/eww.scss b/.config/eww/eww.scss index e9588af..7d83e3c 100644 --- a/.config/eww/eww.scss +++ b/.config/eww/eww.scss @@ -5,7 +5,7 @@ //Global Styles .bar0, .bar1 { background-color: rgba(0, 0, 0, 0); - color: #ffd5cd; + color: #ffffff; font-family: GoMono Nerd Font; font-size: 12px; } @@ -20,30 +20,30 @@ // Styles on classes (see eww.yuck for more information) .sidestuff { - color: #ffd5cd; + color: #ffffff; } .audio { - color: #ffd5cd; + color: #ffffff; padding-right: 10px; } .brightness { - color: #ffd5cd; + color: #ffffff; padding-right: 10px; } .net { - color: #ffd5cd; + color: #ffffff; padding-right: 10px; } -.xbps { +.apk { color: #98971a; padding-right: 10px; } -.xbps-empty { +.apk-empty { color: #98971a; padding-right: 0px; } @@ -59,11 +59,11 @@ } .clock { - color: #ffd5cd; + color: #ffffff; } .idle { - color: #ffd5cd; + color: #ffffff; padding-right: 10px; } @@ -73,12 +73,12 @@ } .battery { - color: #ffd5cd; + color: #ffffff; padding-right: 10px; } .w0, .w01, .w02, .w03, .w04, .w05, .w06, .w07, .w08, .w09, .w011, .w022, .w033, .w044, .w055, .w066, .w077, .w088, .w099 { - padding: 3px 5px; + padding: 3px 10px; box-shadow: inset 0 -2px transparent; } diff --git a/.config/eww/eww.yuck b/.config/eww/eww.yuck index 9d1f4dc..462350d 100644 --- a/.config/eww/eww.yuck +++ b/.config/eww/eww.yuck @@ -92,15 +92,15 @@ (defwidget updates [] (box - :class "${matches(void-updates, '^\s*$')?'xbps-empty':'xbps'}" + :class "${matches(chimera-updates, '^\s*$')?'apk-empty':'apk'}" :orientation "h" :space-evenly false :halign "end" :spacing 10 (button :class "" - :onclick "foot bash -c 'sudo xbps-install -Suv; ~/.config/eww/scripts/void-updates.sh Refresh'&" - void-updates) + :onclick "foot bash -c 'doas apk upgrade; ~/.config/eww/scripts/chimera-updates.sh Refresh'&" + chimera-updates) )) (defwidget scratchpad-indicator [] @@ -169,8 +169,8 @@ (defpoll idle :interval "1s" "scripts/idleinhibit.sh") -(defpoll void-updates :interval "600s" - "scripts/void-updates.sh") +(defpoll chimera-updates :interval "600s" + "scripts/chimera-updates.sh") (defpoll volume :interval "1s" "scripts/volumecontrol") diff --git a/.config/eww/scripts/workspace.sh b/.config/eww/scripts/workspace.sh index a72bc81..305c882 100755 --- a/.config/eww/scripts/workspace.sh +++ b/.config/eww/scripts/workspace.sh @@ -1,42 +1,73 @@ #! /bin/bash -# Define icons for workspaces 1-9 -ic=(0         󰻧) +active() { +if [[ $arg = 0 ]] +then + arg=1 +else + arg=0 +fi +num=$(river-bedload -print outputs | jq -r '.['$arg'] | select(.).view_tags') +num=$(echo $num | awk -F' ' '{print $1}') +b=0 +while [[ $num -gt 0 ]] +do + let temp=$num%2 + if [[ $temp -eq 1 ]] + then + let count=$count+1 + fi + let num=$num/2 + let b=b+1 + if [[ $temp -eq 1 ]] + then + echo $b + fi +done +return $b +} -workspaces() { +#define icons for workspaces 1-9 +ic=(0 1 2 3 4 5 6 7 8 9) +workspaces() { +export arg="$1" unset -v \ o1 o2 o3 o4 o5 o6 o7 o8 o9 \ f1 f2 f3 f4 f5 f6 f7 f8 f9 -# Get occupied workspaces -ows="$(swaymsg -t get_workspaces -r | jq -r -c '.[] | .name')" - +ows="$(active)" for num in $ows; do export o"$num"="$num" done # Get Focused workspace for current monitor ID -arg="$1" -num="$(swaymsg -t get_outputs --raw | jq --argjson arg "$arg" -r -c '.[$arg].current_workspace')" +export arg="$1" +if [[ $arg = 0 ]] +then + arg=1 +else + arg=0 +fi +num=$(river-bedload -print focused | jq -r '.['$arg'] | select(.).focused_id') export f"$num"="$num" -echo "(eventbox :onscroll \"echo {} | sed -e 's/up/-1/g' -e 's/down/+1/g' | xargs swaymsg workspace \" \ +echo "(eventbox :onscroll \"echo {} | sed -e 's/up/-1/g' -e 's/down/+1/g' | xargs hyprctl dispatch workspace\" \ (box :class \"workspace\" :orientation \"h\" :space-evenly \"false\" \ - (button :onclick \"scripts/dispatch.sh 1\" :class \"w0$o1$f1\" \"${ic[1]} ₁\") \ - (button :onclick \"scripts/dispatch.sh 2\" :class \"w0$o2$f2\" \"${ic[2]} ₂\") \ - (button :onclick \"scripts/dispatch.sh 3\" :class \"w0$o3$f3\" \"${ic[3]} ₃\") \ - (button :onclick \"scripts/dispatch.sh 4\" :class \"w0$o4$f4\" \"${ic[4]} ₄\") \ - (button :onclick \"scripts/dispatch.sh 5\" :class \"w0$o5$f5\" \"${ic[5]} ₅\") \ - (button :onclick \"scripts/dispatch.sh 6\" :class \"w0$o6$f6\" \"${ic[6]} ₆\") \ - (button :onclick \"scripts/dispatch.sh 7\" :class \"w0$o7$f7\" \"${ic[7]} ₇\") \ - (button :onclick \"scripts/dispatch.sh 8\" :class \"w0$o8$f8\" \"${ic[8]} ₈\") \ - (button :onclick \"scripts/dispatch.sh 9\" :class \"w0$o9$f9\" \"${ic[9]} ₉\") \ + (button :onclick \"riverctl set-focused-tags $((1 << (1 - 1)))\" :class \"w0$o1$f1\" \"${ic[1]}\") \ + (button :onclick \"riverctl set-focused-tags $((1 << (2 - 1)))\" :class \"w0$o2$f2\" \"${ic[2]}\") \ + (button :onclick \"riverctl set-focused-tags $((1 << (3 - 1)))\" :class \"w0$o3$f3\" \"${ic[3]}\") \ + (button :onclick \"riverctl set-focused-tags $((1 << (4 - 1)))\" :class \"w0$o4$f4\" \"${ic[4]}\") \ + (button :onclick \"riverctl set-focused-tags $((1 << (5 - 1)))\" :class \"w0$o5$f5\" \"${ic[5]}\") \ + (button :onclick \"riverctl set-focused-tags $((1 << (6 - 1)))\" :class \"w0$o6$f6\" \"${ic[6]}\") \ + (button :onclick \"riverctl set-focused-tags $((1 << (7 - 1)))\" :class \"w0$o7$f7\" \"${ic[7]}\") \ + (button :onclick \"riverctl set-focused-tags $((1 << (8 - 1)))\" :class \"w0$o8$f8\" \"${ic[8]}\") \ + (button :onclick \"riverctl set-focused-tags $((1 << (9 - 1)))\" :class \"w0$o9$f9\" \"${ic[9]}\") \ )\ )" } -workspaces $1 -swaymsg -t subscribe -m "['workspace']" | while read -r _ ; do +workspaces $1 +river-bedload -watch active | while read -r; do workspaces $1 done -- cgit v1.2.3