aboutsummaryrefslogtreecommitdiff
path: root/.config/eww
diff options
context:
space:
mode:
Diffstat (limited to '.config/eww')
-rw-r--r--.config/eww/eww.scss107
-rw-r--r--.config/eww/eww.yuck192
-rwxr-xr-x.config/eww/scripts/arch-updates.sh39
-rwxr-xr-x.config/eww/scripts/bar-toggle.sh18
-rwxr-xr-x.config/eww/scripts/battery.sh53
-rwxr-xr-x.config/eww/scripts/brightnesscontrol39
-rwxr-xr-x.config/eww/scripts/calendar.sh26
-rwxr-xr-x.config/eww/scripts/date-time.sh12
-rwxr-xr-x.config/eww/scripts/idleinhibit.sh33
-rwxr-xr-x.config/eww/scripts/keyboardlayout.sh8
-rwxr-xr-x.config/eww/scripts/monitor.sh11
-rwxr-xr-x.config/eww/scripts/network.sh43
-rwxr-xr-x.config/eww/scripts/scratchpad-indicator.sh35
-rwxr-xr-x.config/eww/scripts/start.sh41
-rwxr-xr-x.config/eww/scripts/void-updates.sh39
-rwxr-xr-x.config/eww/scripts/volumecontrol123
-rwxr-xr-x.config/eww/scripts/workspace.sh64
17 files changed, 883 insertions, 0 deletions
diff --git a/.config/eww/eww.scss b/.config/eww/eww.scss
new file mode 100644
index 0000000..d3cba0b
--- /dev/null
+++ b/.config/eww/eww.scss
@@ -0,0 +1,107 @@
+* {
+ all: unset; //Unsets everything so you can style everything from scratch
+}
+
+//Global Styles
+.bar0, .bar1 {
+ background-color: rgba(0, 0, 0, 0);
+ color: #ffffff;
+ font-family: GoMono Nerd Font;
+ font-size: 12px;
+}
+
+.bar {
+ background-color: rgba(0, 0, 0, 0.7);
+ // box-shadow: 2px 4px 2px 1px rgba(0, 0, 0, 0.5);
+ margin: 2px 10px 0px 10px;
+ border-radius: 0px;
+}
+
+// Styles on classes (see eww.yuck for more information)
+
+.sidestuff {
+ color: #ffffff;
+}
+
+.audio {
+ color: #ffffff;
+ padding-right: 10px;
+}
+
+.brightness {
+ color: #ffffff;
+ padding-right: 10px;
+}
+
+.net {
+ color: #ffffff;
+ padding-right: 10px;
+}
+
+.apk {
+ color: #98971a;
+ padding-right: 10px;
+}
+
+.apk-empty {
+ color: #98971a;
+ padding-right: 0px;
+}
+
+.scratchpad {
+ color: #ffd5cd;
+ padding-right: 10px;
+}
+
+.scratchpad-empty {
+ color: #ffd5cd;
+ padding-right: 0px;
+}
+
+.clock {
+ color: #ffffff;
+}
+
+.idle {
+ color: #ffffff;
+ padding-right: 10px;
+}
+
+.language {
+ color: #ffd5cd;
+ padding-right: 10px;
+}
+
+.battery {
+ 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 10px;
+ box-shadow: inset 0 -2px transparent;
+}
+
+/* Unoccupied */
+.w0 {
+ color: #a89984;
+}
+
+/* Occupied */
+.w01, .w02, .w03, .w04, .w05, .w06, .w07, .w08, .w09 {
+ color: #fbf1c7;
+}
+
+/* Focused */
+.w011, .w022, .w033, .w044, .w055, .w066, .w077, .w088, .w099 {
+ color: #fbf1c7;
+ box-shadow: inset 0 -3px #98971a;
+}
+
+.workspace {
+padding: 0 10px;
+}
+
+.workspace button:hover {
+ box-shadow: inset 0 -3px #ffffff;
+}
diff --git a/.config/eww/eww.yuck b/.config/eww/eww.yuck
new file mode 100644
index 0000000..4db3241
--- /dev/null
+++ b/.config/eww/eww.yuck
@@ -0,0 +1,192 @@
+(defwidget bar0 []
+(box :class "bar"
+ (centerbox :orientation "h"
+ (workspaces0)
+ (clock)
+ (sidestuff)))
+)
+
+(defwidget bar1 []
+(box :class "bar"
+ (centerbox :orientation "h"
+ (workspaces1)
+ (clock)
+ (sidestuff)))
+)
+
+(defwidget sidestuff []
+ (box :class "sidestuff" :orientation "h" :space-evenly false :halign "end"
+ (updates)
+ (language)
+ (idleinhibit)
+ (bright)
+ (audio)
+ (net)
+ (battery)
+ ))
+
+(deflisten workspace0
+ "scripts/workspace.sh 0")
+
+(defwidget workspaces0 []
+ (literal :content workspace0))
+
+(deflisten workspace1
+ "scripts/workspace.sh 1")
+
+(defwidget workspaces1 []
+ (literal :content workspace1))
+
+(defwidget language []
+ (box :class "language"
+ :orientation "h"
+ :space-evenly false
+ :halign "end"
+ :spacing 10
+ (button
+ :class ""
+ :onclick "scripts/keyboardlayout.sh toggle"
+ language)
+))
+
+(defwidget clock []
+ (box :class "clock"
+ :orientation "h"
+ :space-evenly false
+ :halign "center"
+ (button
+ :class ""
+ :onclick "scripts/calendar.sh show"
+ date-time)
+ (label :unindent false :text " - ")
+ (label :text time_poll)
+))
+
+(defwidget audio []
+ (box :class "audio"
+ :orientation "h"
+ :space-evenly false
+ :halign "end"
+ :spacing 10
+ (button
+ :class ""
+ :onclick "scripts/volumecontrol down"
+ :onmiddleclick "scripts/volumecontrol mute"
+ :onrightclick "scripts/volumecontrol up"
+ volume)
+))
+
+(defwidget bright []
+ (box :class "brightness"
+ :orientation "h"
+ :space-evenly false
+ :halign "end"
+ :spacing 10
+ (button
+ :class ""
+ :onclick "scripts/brightnesscontrol down"
+ :onrightclick "scripts/brightnesscontrol up"
+ brightness)
+))
+
+(defwidget updates []
+ (box
+ :class "${matches(chimera-updates, '^\s*$')?'apk-empty':'apk'}"
+ :orientation "h"
+ :space-evenly false
+ :halign "end"
+ :spacing 10
+ (button
+ :class ""
+ :onclick "foot bash -c 'doas apk upgrade; ~/.config/eww/scripts/chimera-updates.sh Refresh'&"
+ chimera-updates)
+))
+
+(defwidget idleinhibit []
+ (box :class "idle"
+ :orientation "h"
+ :space-evenly false
+ :halign "end"
+ :spacing 10
+ (button
+ :class ""
+ :onclick "scripts/idleinhibit.sh toggle"
+ idle)
+))
+
+(defwidget net []
+ (box :class "net"
+ :orientation "h"
+ :space-evenly false
+ :halign "end"
+ :spacing 10
+ (button
+ :class ""
+ :timeout 500
+ :onclick "scripts/network.sh ShowInfo"
+ network)
+))
+
+(defwidget battery []
+ (box :class "battery"
+ :orientation "h"
+ :space-evenly false
+ :halign "end"
+ :spacing 10
+ (button
+ :class ""
+ :onclick "scripts/battery.sh left-click"
+ battery)
+))
+
+(defpoll time_poll :interval "1s" "date +%H:%M")
+
+(defpoll battery :interval "10s"
+ "scripts/battery.sh")
+
+(defpoll language :interval "1s"
+ "scripts/keyboardlayout.sh")
+
+(defpoll network :interval "1s"
+ "scripts/network.sh")
+
+(defpoll idle :interval "1s"
+ "scripts/idleinhibit.sh")
+
+(defpoll chimera-updates :interval "600s"
+ "scripts/chimera-updates.sh")
+
+(defpoll volume :interval "1s"
+ "scripts/volumecontrol")
+
+(defpoll brightness :interval "1s"
+ "scripts/brightnesscontrol")
+
+(defpoll date-time :interval "1s"
+ "scripts/date-time.sh")
+
+(defwindow bar0
+ :monitor 0
+ :windowtype "dock"
+ :geometry (geometry :x "0%"
+ :y "5px"
+ :width "100%"
+ :height "20px"
+ :anchor "top center")
+ :stacking "fg"
+ :exclusive true
+ :focusable false
+ (bar0))
+
+(defwindow bar1
+ :monitor 1
+ :windowtype "dock"
+ :geometry (geometry :x "0%"
+ :y "5px"
+ :width "100%"
+ :height "20px"
+ :anchor "top center")
+ :stacking "fg"
+ :exclusive true
+ :focusable false
+ (bar1))
diff --git a/.config/eww/scripts/arch-updates.sh b/.config/eww/scripts/arch-updates.sh
new file mode 100755
index 0000000..e3da71f
--- /dev/null
+++ b/.config/eww/scripts/arch-updates.sh
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+function CheckUpdates() {
+xbps-install -Mun 1> /tmp/void-updates
+updates="$(cat /tmp/void-updates | awk '{ print $1 }')"
+number=$(cat /tmp/void-updates | wc -l)
+
+if [ "$number" -gt 0 ]; then
+ text=" $number"
+else
+ text=""
+fi
+
+echo "$text"
+}
+
+function RefreshUpdates() {
+ value="$(CheckUpdates)"
+ eww update arch-updates="$value"
+}
+
+function Update() {
+ foot bash -c 'sudo xbps-install -Suv'
+ RefreshUpdates
+}
+
+case "$1" in
+ Refresh)
+ RefreshUpdates
+ exit 0
+ ;;
+ Update)
+ Update
+ exit 0
+ ;;
+ *)
+ CheckUpdates
+ exit 0
+esac
diff --git a/.config/eww/scripts/bar-toggle.sh b/.config/eww/scripts/bar-toggle.sh
new file mode 100755
index 0000000..78d0050
--- /dev/null
+++ b/.config/eww/scripts/bar-toggle.sh
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+monitors=$(river-bedload -print outputs | jq -r -c '.[] | .name' | wc -l | xargs)
+
+for ((i = 0 ; i < $monitors ; i++)); do
+ echo $i
+ active_monitor=$(river-bedload -print outputs | jq 'map(.focused)|to_entries|.[]|select(.value)|.key')
+ # Flip value e.g 0 to 1
+ if [ "$monitors" != "1" ]; then
+ ((active_monitor ^= 1))
+ fi
+ bar=$(eww active-windows | grep "bar$i")
+ if [ "$active_monitor" == "$i" ] && [ "$bar" == "bar$i: bar$i" ]; then
+ eww close bar$i
+ elif [ "$active_monitor" == "$i" ]; then
+ eww open bar$i
+ fi
+done
+
diff --git a/.config/eww/scripts/battery.sh b/.config/eww/scripts/battery.sh
new file mode 100755
index 0000000..a984346
--- /dev/null
+++ b/.config/eww/scripts/battery.sh
@@ -0,0 +1,53 @@
+#!/usr/bin/env bash
+
+# Send a notification if battery is low, change status in info file accordingly
+notify_low () {
+
+ # Battery isn't much but is charging (don't notify)
+ [ "$status" = "on-line" ] && return
+
+ # Battery critically low
+ if [ "$capacity" -le 10 ] && ! grep -q critically-low "$lowinfo"; then
+ notify-send -i "$HOME/.config/icons/critical-battery.png" -u critical "Battery critically low!"
+ echo critically-low >"$lowinfo"
+
+ # Battery is low
+ elif [ "$capacity" -le 20 ] && ! grep -q low "$lowinfo"; then
+ notify-send -i "$HOME/.config/icons/low-battery.png" -t 5500 "Battery low!"
+ echo low >"$lowinfo"
+ fi
+}
+
+status="$(apm | grep -E "AC Line status:" | sed -n -e 's/^.*AC Line status: //p')"
+capacity="$(apm | grep -E "Remaining battery life:" | head -1 | sed -n -e 's/^.*Remaining battery life: //p' | sed 's/.$//')"
+
+# Get the low battery status from file ~/.cache/battery-low-status
+lowinfo="$HOME/.cache/battery-low-status"
+[ ! -e "$lowinfo" ] && touch "$lowinfo"
+
+
+case $1 in
+ left-click)
+ ;;
+ *)
+ # Set charging icon and capacity icon
+ [ "$status" = "on-line" ] && charging_icon=" " || charging_icon=""
+ [ "$capacity" -gt 100 ] && capacity=100
+ if [ "$capacity" -lt 15 ]; then capacity_icon=' '
+ elif [ "$capacity" -lt 40 ]; then capacity_icon=' '
+ elif [ "$capacity" -lt 60 ]; then capacity_icon=' '
+ elif [ "$capacity" -lt 90 ]; then capacity_icon=' '
+ else capacity_icon=' '
+ fi
+
+ # Report low battery
+ [ "$capacity" -le 20 ] && notify_low
+
+ # Reset low battery information in these cases
+ { [ "$capacity" -gt 20 ] || [ "$status" = "Charging" ]; } && [ -n "$(cat "$lowinfo")" ] && echo "" >"$lowinfo"
+
+ printf "%s%s%d%%\n" "$charging_icon" "$capacity_icon" "$capacity"
+ ;;
+esac
+
+
diff --git a/.config/eww/scripts/brightnesscontrol b/.config/eww/scripts/brightnesscontrol
new file mode 100755
index 0000000..1e8ea9f
--- /dev/null
+++ b/.config/eww/scripts/brightnesscontrol
@@ -0,0 +1,39 @@
+#!/usr/bin/env bash
+
+# You can call this script like this:
+# brightnessControl up
+# brightnessControl down
+
+# Script inspired by these wonderful people:
+# https://github.com/dastorm/volume-notification-dunst/blob/master/volume.sh
+# https://gist.github.com/sebastiencs/5d7227f388d93374cebdf72e783fbd6a
+
+function send_notification {
+ icon="/usr/share/icons/Adwaita/symbolic/status/daytime-sunrise-symbolic.svg"
+ brightness=$(backlight -q)
+ # Make the bar with the special character ─ (it's not dash -)
+ # https://en.wikipedia.org/wiki/Box-drawing_character
+ bar=$(seq -s "─" 0 $((brightness / 10 )) | sed 's/[0-9]//g')
+ # Send the notification
+ fyi -i "$icon" --hint=string:x-canonical-private-synchronous:brightness -u normal "$bar $brightness"
+}
+
+case $1 in
+ up)
+ backlight + 4
+ backlight > ~/.cache/brightness
+ send_notification
+ # canberra-gtk-play -i audio-volume-change
+ ;;
+ down)
+ backlight - 4
+ backlight > ~/.cache/brightness
+ send_notification
+ # canberra-gtk-play -i audio-volume-change
+ ;;
+ *)
+ brightness=$(backlight -q)
+ icon=""
+ printf "%s" "$icon $brightness" "%"
+ ;;
+esac
diff --git a/.config/eww/scripts/calendar.sh b/.config/eww/scripts/calendar.sh
new file mode 100755
index 0000000..a9e3502
--- /dev/null
+++ b/.config/eww/scripts/calendar.sh
@@ -0,0 +1,26 @@
+#!/usr/bin/env bash
+
+# Calendar script
+
+function ShowCalendar() {
+ fyi -a "Calendar" --hint string:x-canonical-private-synchronous:calendar " 📅 Calendar" "$(cal | sed "s/\<$(date +%-d)\>/<span color='#fabd2f'><b>$(date +%-d)<\/b><\/span>/")"
+}
+
+function EditCalendar() {
+ echo
+}
+
+case "$1" in
+ show)
+ ShowCalendar
+ ;;
+
+ edit)
+ EditCalendar
+ ;;
+
+ *)
+ echo $"Usage: ${0##*/} {show|edit}"
+ exit 1
+
+esac
diff --git a/.config/eww/scripts/date-time.sh b/.config/eww/scripts/date-time.sh
new file mode 100755
index 0000000..9835842
--- /dev/null
+++ b/.config/eww/scripts/date-time.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+DaySuffix() {
+ case `date +%-d` in
+ 1|21|31) echo "st";;
+ 2|22) echo "nd";;
+ 3|23) echo "rd";;
+ *) echo "th";;
+ esac
+}
+date=$(date "+%A %-d`DaySuffix` %B %Y")
+icon=""
+printf "%s" "$date "
diff --git a/.config/eww/scripts/idleinhibit.sh b/.config/eww/scripts/idleinhibit.sh
new file mode 100755
index 0000000..f606ad5
--- /dev/null
+++ b/.config/eww/scripts/idleinhibit.sh
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+# Swayidle toggle
+function toggle {
+ if pgrep "swayidle" > /dev/null
+ then
+ pkill swayidle
+ notify-send --hint=string:x-canonical-private-synchronous:idleinhibit -u normal " Swayidle Inactive"
+else
+ read -r wallpaper<~/.cache/wallpaper
+ export wallpaper=$( echo $wallpaper)
+ swayidle -w \
+ timeout 300 'swaylock -f -i $wallpaper' \
+ timeout 600 'wlopm --off \*;swaylock -F -i $wallpaper' resume 'wlopm --on \*' \
+ before-sleep 'swaylock -f -i $wallpaper' &
+ notify-send --hint=string:x-canonical-private-synchronous:idleinhibit -u normal " Swayidle Active"
+fi
+}
+
+case $1 in
+ toggle)
+ toggle
+ ;;
+ *)
+ if pgrep "swayidle" > /dev/null
+ then
+ icon=""
+ else
+ icon=""
+ fi
+ printf "%s" "$icon "
+ ;;
+esac
diff --git a/.config/eww/scripts/keyboardlayout.sh b/.config/eww/scripts/keyboardlayout.sh
new file mode 100755
index 0000000..aa98833
--- /dev/null
+++ b/.config/eww/scripts/keyboardlayout.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+# Get long name
+# echo "$(hyprctl devices | grep -A 2 "at-translated-set-2-keyboard" | awk 'NR==3 {print $3" "$4}')"
+
+# Get short name
+echo "$(hyprctl devices | grep -A 2 "at-translated-set-2-keyboard" | awk 'NR==3 {print $4}'| grep -Po '(?<=\().*(?=\))' )"
+
diff --git a/.config/eww/scripts/monitor.sh b/.config/eww/scripts/monitor.sh
new file mode 100755
index 0000000..a211054
--- /dev/null
+++ b/.config/eww/scripts/monitor.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+function handle {
+ if [[ ${1:0:12} == "monitoradded" ]]; then
+ ~/.config/eww/scripts/start.sh
+ elif [[ ${1:0:14} == "monitorremoved" ]]; then
+ ~/.config/eww/scripts/start.sh
+ fi
+}
+
+socat - UNIX-CONNECT:/tmp/hypr/$(echo $HYPRLAND_INSTANCE_SIGNATURE)/.socket2.sock | while read line; do handle $line; done
diff --git a/.config/eww/scripts/network.sh b/.config/eww/scripts/network.sh
new file mode 100755
index 0000000..29396aa
--- /dev/null
+++ b/.config/eww/scripts/network.sh
@@ -0,0 +1,43 @@
+#!/bin/bash
+
+# This script requires dnsutils aka bind to fetch the WAN IP address
+
+# Shows the connections names
+# nmcli connection show --active | grep 'ethernet' | awk '{ print $1 }' FS=' '
+# nmcli connection show --active | grep 'wifi' | awk '{ print $1 }' FS=' '
+
+# Show ethernet interface name
+# nmcli connection show --active | grep 'ethernet' | awk '{ print $6 }' FS=' '
+
+# Show wifi interface name
+# nmcli connection show --active | grep 'wifi' | awk '{ print $4 }' FS=' '
+
+function ShowInfo {
+ if [ "$(nmcli connection show --active | grep -oh "\w*ethernet\w*")" == "ethernet" ]; then
+ wan="$(dig @resolver4.opendns.com myip.opendns.com +short)"
+ connection="$(nmcli connection show --active | grep 'ethernet' | awk '{ print $6 }' FS=' '): $(nmcli connection show --active | grep 'ethernet' | awk '{ printf "%s\nLAN IP:",$1 }' FS=' ') $(nmcli -t -f IP4.ADDRESS dev show $(nmcli connection show --active | grep 'ethernet' | awk '{ print $6 }' FS=' ') | awk '{printf "%s\nWAN IP: '$wan'", $2}' FS='[:/]')"
+ elif [ "$(nmcli connection show --active | grep -oh "\w*wifi\w*")" == "wifi" ]; then
+ wan="$(dig @resolver4.opendns.com myip.opendns.com +short)"
+ connection="$(nmcli connection show --active | grep 'wifi' | awk '{ print $4 }' FS=' '): $(nmcli connection show --active | grep 'wifi' | awk '{ printf "%s\nLAN IP:",$1 }' FS=' ') $(nmcli -t -f IP4.ADDRESS dev show $(nmcli connection show --active | grep 'wifi' | awk '{ print $4 }' FS=' ') | awk '{printf "%s/nWAN IP: '$wan'", $2}' FS='[:/]')"
+ else
+ connection="No active connection."
+ fi
+ fyi -i "network-idle" --hint string:x-canonical-private-synchronous:network-status "$connection"
+}
+
+function IconUpdate() {
+ if [ "$(nmcli connection show --active | grep -oh "\w*ethernet\w*")" == "ethernet" ]; then
+ icon="󰈀"
+ elif [ "$(nmcli connection show --active | grep -oh "\w*wifi\w*")" == "wifi" ]; then
+ icon=""
+ else
+ icon="󰲜"
+ fi
+ printf "%s" "$icon"
+}
+
+if [ "$1" = "ShowInfo" ]; then
+ ShowInfo
+else
+ IconUpdate
+fi
diff --git a/.config/eww/scripts/scratchpad-indicator.sh b/.config/eww/scripts/scratchpad-indicator.sh
new file mode 100755
index 0000000..8fd06f4
--- /dev/null
+++ b/.config/eww/scripts/scratchpad-indicator.sh
@@ -0,0 +1,35 @@
+#!/bin/bash
+# Scratchpad indicator for Sway
+
+output="$(swaymsg -t get_tree | jq -r 'recurse(.nodes[]?)|recurse(.floating_nodes[]?)|select(.name == "__i3_scratch").floating_nodes[]|"`<b>"+.name+"`</b> - "+.app_id+" "+(.id|tostring)')"
+number="$(swaymsg -r -t get_tree | jq -r 'recurse(.nodes[]) | first(select(.name=="__i3_scratch")) | .floating_nodes | length')"
+
+if [ "$number" -gt 0 ]; then
+ text=" $number"
+else
+ text=""
+fi
+
+output="$(echo "$output" | sed -r 's/[&]+/and/g')" # Replace unprintable & character with the word 'and'
+tooltip="\n"
+tooltip+="$(echo "$output" | sed -z 's/\n/\\n/g')"
+tooltip=${tooltip::-2}
+
+function ShowInfo() {
+ if [ "$number" -eq 0 ]; then
+ exit
+ else
+ tooltip="$(echo -e $tooltip)"
+ notify-send --hint=string:x-canonical-private-synchronous:scratchpad -u normal " Scratchpad" "$tooltip"
+ fi
+}
+
+function Update() {
+ printf "%s" "$text"
+}
+
+if [ "$1" = "ShowInfo" ]; then
+ ShowInfo
+else
+ Update
+fi
diff --git a/.config/eww/scripts/start.sh b/.config/eww/scripts/start.sh
new file mode 100755
index 0000000..ec305b9
--- /dev/null
+++ b/.config/eww/scripts/start.sh
@@ -0,0 +1,41 @@
+#!/usr/bin/env bash
+
+focusactivetag() {
+ export arg="$1"
+ # Focus the lowest active tag
+ num=$(river-bedload -print outputs | jq -r '.['$arg'] | select(.).focused_tags')
+ 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
+ riverctl set-focused-tags $((1 << ($b - 1)))
+ return
+ fi
+done
+return
+}
+
+# kill any running instances if they exist
+eww kill
+
+# Start Eww daemon
+# eww daemon
+
+# start a bar for each monitor
+monitors=$(wlr-randr | grep "^[^ ]" | awk '{ print$1 }' | wc -l | xargs)
+total=$(wlr-randr | grep "^[^ ]" | awk '{ print$1 }' | wc -l | xargs)
+monitors=$(($monitors-1))
+# for ((i = 0 ; i < $monitors ; i++)); do
+for ((i = $monitors ; i >= 0 ; i-=1)); do
+ eww open bar${i}
+ riverctl focus-output $(wlr-randr | grep "^[^ ]" | awk '{ print$1 }' | awk 'FNR == '$i+1' {print}')
+ focusactivetag $i
+done
diff --git a/.config/eww/scripts/void-updates.sh b/.config/eww/scripts/void-updates.sh
new file mode 100755
index 0000000..b004735
--- /dev/null
+++ b/.config/eww/scripts/void-updates.sh
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+function CheckUpdates() {
+xbps-install -Mun 1> /tmp/void-updates
+updates="$(cat /tmp/void-updates | awk '{ print $1 }')"
+number=$(cat /tmp/void-updates | wc -l)
+
+if [ "$number" -gt 0 ]; then
+ text=" $number"
+else
+ text=""
+fi
+
+echo "$text"
+}
+
+function RefreshUpdates() {
+ value="$(CheckUpdates)"
+ eww update void-updates="$value"
+}
+
+function Update() {
+ foot bash -c 'sudo xbps-install -Suv'
+ RefreshUpdates
+}
+
+case "$1" in
+ Refresh)
+ RefreshUpdates
+ exit 0
+ ;;
+ Update)
+ Update
+ exit 0
+ ;;
+ *)
+ CheckUpdates
+ exit 0
+esac
diff --git a/.config/eww/scripts/volumecontrol b/.config/eww/scripts/volumecontrol
new file mode 100755
index 0000000..7f058c9
--- /dev/null
+++ b/.config/eww/scripts/volumecontrol
@@ -0,0 +1,123 @@
+#!/usr/bin/env bash
+
+# You can call this script like this:
+# volumecontrol up
+# volumecontrol down
+# volumecontrol mute
+
+function get_volume {
+ # amixer get Master | grep '%' | head -n 1 | cut -d '[' -f 2 | cut -d '%' -f 1
+ # pactl get-sink-volume @DEFAULT_SINK@ | grep -Po '\d+(?=%)' | head -n 1
+ pactl get-sink-volume @DEFAULT_SINK@ | grep '%' | cut -d '%' -f 1 | cut -d ' ' -f 6
+}
+
+function is_mute {
+ # amixer get Master | grep '%' | grep -oE '[^ ]+$' | grep off > /dev/null
+ pactl get-sink-mute @DEFAULT_SINK@ | grep 'Mute: yes' >> /dev/null
+}
+
+function send_notification {
+ volume=$(get_volume)
+ # Make the bar with the special character ─ (it's not dash -)
+ # https://en.wikipedia.org/wiki/Box-drawing_character
+ if [[ $volume == "100" ]]; then
+ icon=""
+ elif [[ $volume -ge "89" && $volume -le "100" ]]; then
+ icon=""
+ elif [[ $volume -ge "79" && $volume -le "90" ]]; then
+ icon=""
+ elif [[ $volume -ge "69" && $volume -le "80" ]]; then
+ icon=""
+ elif [[ $volume -ge "59" && $volume -le "70" ]]; then
+ icon=""
+ elif [[ $volume -ge "49" && $volume -le "60" ]]; then
+ icon=""
+ elif [[ $volume -ge "39" && $volume -le "50" ]]; then
+ icon=""
+ elif [[ $volume -ge "29" && $volume -le "40" ]]; then
+ icon=""
+ elif [[ $volume -ge "19" && $volume -le "30" ]]; then
+ icon=""
+ elif [[ $volume -ge "9" && $volume -le "20" ]]; then
+ icon=""
+ elif [[ $volume -gt "0" && $volume -le "10" ]]; then
+ icon=""
+ elif [[ $volume -eq "0" ]]; then
+ icon=""
+ # volume="M "
+ fi
+bar=$(seq -s "─" $(($volume/5)) | sed 's/[0-9]//g')
+# Send the notification
+fyi --hint=string:x-canonical-private-synchronous:volumecontrol -u normal "$icon $bar $volume"
+}
+
+case $1 in
+ up)
+ # Set the volume on (if it was muted)
+ # amixer set Master on > /dev/null
+ pactl set-sink-mute @DEFAULT_SINK@ 0
+ # Up the volume (+ 2%)
+ # amixer sset Master 2%+ > /dev/null
+ pactl set-sink-volume @DEFAULT_SINK@ +2%
+ send_notification
+ # canberra-gtk-play -i audio-volume-change
+ ;;
+ down)
+ # amixer set Master on > /dev/null
+ pactl set-sink-mute @DEFAULT_SINK@ 0
+ # amixer sset Master 2%- > /dev/null
+ pactl set-sink-volume @DEFAULT_SINK@ -2%
+ send_notification
+ # canberra-gtk-play -i audio-volume-change
+ ;;
+ mute)
+ # Toggle mute
+ # amixer set Master 1+ toggle > /dev/null
+ pactl set-sink-mute @DEFAULT_SINK@ toggle
+ if is_mute ; then
+ icon="󰝟"
+ fyi --hint=string:x-canonical-private-synchronous:volumecontrol -u normal "$icon Audio Muted"
+ else
+ send_notification
+ # canberra-gtk-play -i audio-volume-change
+ fi
+ ;;
+ *)
+ volume="$(get_volume)"
+
+ if [[ $volume == "100" ]]; then
+ icon=""
+ elif [[ $volume -ge "89" && $volume -le "100" ]]; then
+ icon=""
+ elif [[ $volume -ge "79" && $volume -le "90" ]]; then
+ icon=""
+ elif [[ $volume -ge "69" && $volume -le "80" ]]; then
+ icon=""
+ elif [[ $volume -ge "59" && $volume -le "70" ]]; then
+ icon=""
+ elif [[ $volume -ge "49" && $volume -le "60" ]]; then
+ icon=""
+ elif [[ $volume -ge "39" && $volume -le "50" ]]; then
+ icon=""
+ elif [[ $volume -ge "29" && $volume -le "40" ]]; then
+ icon=""
+ elif [[ $volume -ge "19" && $volume -le "30" ]]; then
+ icon=""
+ elif [[ $volume -ge "9" && $volume -le "20" ]]; then
+ icon=""
+ elif [[ $volume -gt "0" && $volume -le "10" ]]; then
+ icon=""
+ elif [[ $volume -eq "0" ]]; then
+ icon="󰝟"
+ volume="M "
+ fi
+
+
+if is_mute; then
+ icon="󰝟"
+ volume="M "
+fi
+
+printf "%s" "$icon $volume%"
+ ;;
+esac
diff --git a/.config/eww/scripts/workspace.sh b/.config/eww/scripts/workspace.sh
new file mode 100755
index 0000000..7e48bfa
--- /dev/null
+++ b/.config/eww/scripts/workspace.sh
@@ -0,0 +1,64 @@
+#!/usr/bin/env bash
+
+active() {
+num=$(river-bedload -print outputs | jq -r '.['$arg'] | select(.).view_tags')
+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
+}
+
+#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
+
+if [[ $arg = 0 && $(river-bedload -print outputs | jq -r '.[''] | select(.).name' | wc -l | xargs) -gt 1 ]]
+then
+ arg=1
+else
+ arg=0
+fi
+
+ows="$(active)"
+for num in $ows; do
+ export o"$num"="$num"
+done
+
+# Get Focused workspace for current monitor ID
+num=$(river-bedload -print focused | jq -r '.['$arg'] | select(.).focused_id')
+export f"$num"="$num"
+
+echo "(box :class \"workspace\" :orientation \"h\" :space-evenly \"false\" \
+ (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
+river-bedload -watch active | while read -r; do
+workspaces $1
+done