chore: desktop variant

This commit is contained in:
Fabio Lenherr / DashieTM 2023-01-01 23:51:07 +01:00
parent 20deee09db
commit a2011eab8c
51 changed files with 0 additions and 541 deletions

View file

@ -0,0 +1,31 @@
#!/bin/bash
CLIENTS=$(pactl list sink-inputs | grep "application.process.binary" | awk -F '= ' ' { print $2 } ' | tr -d '"')
readarray -t lines <<<"$CLIENTS"
printf "%s\n" "${lines[@]}"
echo ${lines[2]}
#echo "(box :class \"works\" :orientation \"h\" :spacing 5 :space-evenly \"false\" (button :onclick \"hyprctl dispatch workspace 1\" :class \"$un$o1$f1\" \"$ic_1\") (button :onclick \"hyprctl dispatch workspace 2\" :class \"$un$o2$f2\" \"$ic_2\") (button :onclick \"hyprctl dispatch workspace 3\" :class \"$un$o3$f3\" \"$ic_3\") (button :onclick \"hyprctl dispatch workspace 4\" :class \"$un$o4$f4\" \"$ic_4\") (button :onclick \"hyprctl dispatch workspace 5\" :class \"$un$o5$f5\" \"$ic_5\") (button :onclick \"hyprctl dispatch workspace 6\" :class \"$un$o6$f6\" \"$ic_6\") (button :onclick \"hyprctl dispatch workspace 7\" :class \"$un$o7$f7\" \"$ic_7\") (button :onclick \"hyprctl dispatch workspace 8\" :class \"$un$o8$f8\" \"$ic_8\"))"
# (eventbox :onhover "scripts/pop hoverCreate"
# :onhoverlost "scripts/pop hoverGet audio_ctl"
# (box :class "audio-box" :orientation "v" :space-evenly "false" :vexpand "false" :hexpand "false"
# (box :halign "center" :space-evenly "false" :hexpand "false" :vexpand "false"
# (box :class "speaker_icon" :orientation "v")
# (box :orientation "v" :halign "center" :vexpand "false" :hexpand "false"
# (label :class "speaker_text" :text "speaker" :valign "center" :halign "left" )
# (box :class "speaker_bar" :halign "center" :vexpand "false" :hexpand "false"
# (scale :value volume_percent
# :space-evenly "false"
# :orientation "h"
# :onchange "pactl set-sink-volume @DEFAULT_SINK@ {}%"
# :tooltip "volume on ${volume_percent}%"
# :max 100
# :min 0))))
# (label :text "" :class "audio_sep" :halign "center")
# ))))

77
eww_desktop/scripts/battery Executable file
View file

@ -0,0 +1,77 @@
#!/bin/bash
bat=/sys/class/power_supply/BAT0/
per="$(cat "$bat/capacity")"
char="$(cat "$bat/status")"
icon() {
#[ $(cat "$bat/status") = Charging ] && echo "" && exit
if [ "$char" == "Charging" ]; then
if [ "$per" -gt "90" ]; then
icon=""
elif [ "$per" -gt "80" ]; then
icon=""
elif [ "$per" -gt "70" ]; then
icon=""
elif [ "$per" -gt "60" ]; then
icon=""
elif [ "$per" -gt "50" ]; then
icon=""
elif [ "$per" -gt "40" ]; then
icon=""
elif [ "$per" -gt "30" ]; then
icon=""
elif [ "$per" -gt "20" ]; then
icon=""
elif [ "$per" -gt "10" ]; then
icon=""
elif [ "$per" -gt "0" ]; then
icon=""
else
echo  && exit
fi
else
if [ "$per" -gt "90" ]; then
icon=""
elif [ "$per" -gt "80" ]; then
icon=""
elif [ "$per" -gt "70" ]; then
icon=""
elif [ "$per" -gt "60" ]; then
icon=""
elif [ "$per" -gt "50" ]; then
icon=""
elif [ "$per" -gt "40" ]; then
icon=""
elif [ "$per" -gt "30" ]; then
icon=""
elif [ "$per" -gt "20" ]; then
icon=""
elif [ "$per" -gt "10" ]; then
icon=""
notify-send -u critical "Battery Low" "Connect Charger"
elif [ "$per" -gt "0" ]; then
icon=""
notify-send -u critical "Battery Low" "Connect Charger"
else
echo  && exit
fi
fi
echo "$icon"
}
percent() {
echo $per
}
stat() {
echo $char
}
[ "$1" = "icon" ] && icon && exit
[ "$1" = "percent" ] && percent && exit
[ "$1" = 'stat' ] && stat && exit
exit

View file

@ -0,0 +1,37 @@
#! /bin/bash
internal() {
SPEAKER=$(pactl list sinks | grep "Name" | grep "alsa" | awk -F ': ' '{ print $2 }')
if [ "$SPEAKER" != "" ]; then
pactl set-default-sink "$SPEAKER"
pactl set-sink-mute "$SPEAKER" false
DEVICE=$( echo "$SPEAKER" | awk -F '.' ' { print $4 } ')
notify-send "changed audio to "$DEVICE" "
else
notify-send "failed, not available!"
fi
}
bluetooth() {
SPEAKER=$(pactl list sinks | grep "Name" | grep "blue" | awk -F ': ' '{ print $2 }')
if [ "$SPEAKER" != "" ]; then
pactl set-default-sink "$SPEAKER"
pactl set-sink-mute "$SPEAKER" false
DEVICE=$(echo "$SPEAKER" | awk -F '.' ' { print $4 } ')
notify-send "changed audio to "$DEVICE" "
else
notify-send "failed, not available!"
fi
}
if [ "$1" == "internal" ]; then
internal
elif [ "$1" == "bluetooth" ]; then
bluetooth
else
SPEAKER=$(pactl info | grep "Default Sink" | awk -F ': ' ' { print $2 } ')
pactl set-sink-mute "$SPEAKER" false
fi

View file

@ -0,0 +1,12 @@
#! /bin/bash
set_brightness() {
brightnessctl set "$1"
CURRENT=$(brightnessctl -m -d intel_backlight | awk -F, '{print substr($4, 0, length($4)-1)}')
dunstify -a "changeBrightness" -r 3 -u low -i brightness-high -h int:value:"$CURRENT" "Brightness: ${CURRENT}%"
}
if [ "$1" == "brightness" ]; then
set_brightness "$2"
fi

View file

@ -0,0 +1,20 @@
#! /bin/bash
set_volume_sink() {
pactl set-sink-volume @DEFAULT_SINK@ "$1"
CURRENT=$(pactl get-sink-volume @DEFAULT_SINK@ | awk -F'/' '{ print $2 }' | tr -d ' %')
dunstify -a "changeVolume" -r 2 -u low -i audio-volume-high -h int:value:"$CURRENT" "Output Volume: ${CURRENT}%"
}
set_volume_source() {
pactl set-source-volume @DEFAULT_SOURCE@ "$1"
CURRENT=$(pactl get-source-volume @DEFAULT_SOURCE@ | awk -F'/' '{ print $2 }' | tr -d ' %')
dunstify -a "changeMicVolume" -r 2 -u low -i audio-volume-high -h int:value:"$CURRENT" "Input Volume: ${CURRENT}%"
}
if [ "$1" == "sink" ]; then
set_volume_sink "$2"
elif [ "$1" == "source" ]; then
set_volume_source "$2"
fi

View file

@ -0,0 +1,11 @@
#! /bin/bash
ISOPEN=$(eww windows | grep "*cockpit" | tr -d '*')
if [ "$ISOPEN" = "" ]; then
MONITOR=$(hyprctl monitors | grep -B 7 "focused: yes" | grep "ID" | awk -F '(' ' { print $2 } ' | tr -d 'ID ):')
eww open cockpit_window_"$MONITOR"
else
eww close "$ISOPEN"
fi

View file

@ -0,0 +1,9 @@
#!/bin/bash
currentName() {
win=$(hyprctl activewindow | grep class | awk -F ':' '{print $2}' | tr -d ' ')
echo "(box :class \"module_app_text\" :space-evenly \"false\" :orientation \"h\" :spacing \"3\" (label :text \"$win\"))"
}
currentName
tail -f /tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/hyprland.log | grep -E --line-buffered "focus to surface" | while read -r; do
currentName
done

View file

@ -0,0 +1,5 @@
#! /bin/bash
NUM=$(pactl list clients short | grep "firefox" | awk -F 'PipeWire' ' { print $1 } ' | tr -d ' \t\n')
CLIENT=$(pactl list sink-inputs short | grep "$NUM" | awk -F ' ' ' { print $1 }' | tr -d ' \t\n')
pactl set-sink-input-volume "$CLIENT" "$1"

View file

@ -0,0 +1,2 @@
#!/bin/bash
echo -e $(cat $HOME/.cache/weather/weather-quote) | head -n1

View file

@ -0,0 +1,2 @@
#!/bin/bash
echo -e $(cat $HOME/.cache/weather/weather-quote) | tail -n1

View file

@ -0,0 +1 @@
8°C

View file

@ -0,0 +1 @@
#adadff

View file

@ -0,0 +1 @@

View file

@ -0,0 +1 @@
It's cloudy, sort of gloomy \nYou'd better get a book to read...

View file

@ -0,0 +1 @@
Overcast Clouds

15
eww_desktop/scripts/mem-ad Executable file
View file

@ -0,0 +1,15 @@
#!/bin/bash
total="$(free -m | grep Mem: | awk '{ print $2 }')"
used="$(free -m | grep Mem: | awk '{ print $3 }')"
free=$(expr $total - $used)
if [ "$1" = "total" ]; then
echo $total
elif [ "$1" = "used" ]; then
echo $used
elif [ "$1" = "free" ]; then
echo $free
fi

3
eww_desktop/scripts/memory Executable file
View file

@ -0,0 +1,3 @@
#!/bin/bash
printf "%.0f\n" $(free -m | grep Mem | awk '{print ($3/$2)*100}')

View file

@ -0,0 +1,2 @@
#!/bin/bash
echo $(playerctl metadata -p ncspot,%any --format "{{ artist }}\n{{ album }}\n{{ title }}")

View file

@ -0,0 +1,3 @@
#!/bin/bash
echo $(playerctl -p ncspot,%any metadata mpris:artUrl)

98
eww_desktop/scripts/music_info Executable file
View file

@ -0,0 +1,98 @@
#!/bin/bash
# scripts by adi1090x
## Get data
STATUS="$(mpc status)"
COVER="/tmp/.music_cover.png"
MUSIC_DIR="$HOME/Music"
## Get status
get_status() {
if [[ $STATUS == *"[playing]"* ]]; then
echo ""
else
echo "奈"
fi
}
## Get song
get_song() {
song=`mpc -f %title% current`
if [[ -z "$song" ]]; then
echo "Offline"
else
echo "$song"
fi
}
## Get artist
get_artist() {
artist=`mpc -f %artist% current`
if [[ -z "$artist" ]]; then
echo ""
else
echo "$artist"
fi
}
## Get time
get_time() {
time=`mpc status | grep "%)" | awk '{print $4}' | tr -d '(%)'`
if [[ -z "$time" ]]; then
echo "0"
else
echo "$time"
fi
}
get_ctime() {
ctime=`mpc status | grep "#" | awk '{print $3}' | sed 's|/.*||g'`
if [[ -z "$ctime" ]]; then
echo "0:00"
else
echo "$ctime"
fi
}
get_ttime() {
ttime=`mpc -f %time% current`
if [[ -z "$ttime" ]]; then
echo "0:00"
else
echo "$ttime"
fi
}
## Get cover
get_cover() {
ffmpeg -i "${MUSIC_DIR}/$(mpc current -f %file%)" "${COVER}" -y &> /dev/null
STATUS=$?
# Check if the file has a embbeded album art
if [ "$STATUS" -eq 0 ];then
echo "$COVER"
else
echo "images/music.png"
fi
}
## Execute accordingly
if [[ "$1" == "--song" ]]; then
get_song
elif [[ "$1" == "--artist" ]]; then
get_artist
elif [[ "$1" == "--status" ]]; then
get_status
elif [[ "$1" == "--time" ]]; then
get_time
elif [[ "$1" == "--ctime" ]]; then
get_ctime
elif [[ "$1" == "--ttime" ]]; then
get_ttime
elif [[ "$1" == "--cover" ]]; then
get_cover
elif [[ "$1" == "--toggle" ]]; then
mpc -q toggle
elif [[ "$1" == "--next" ]]; then
{ mpc -q next; get_cover; }
elif [[ "$1" == "--prev" ]]; then
{ mpc -q prev; get_cover; }
fi

View file

@ -0,0 +1,5 @@
#! /bin/bash
NUM=$(pactl list clients short | grep "ncspot" | awk -F 'PipeWire' ' { print $1 } ' | tr -d ' \t\n')
CLIENT=$(pactl list sink-inputs short | grep "$NUM" | awk -F ' ' ' { print $1 }' | tr -d ' \t\n')
pactl set-sink-input-volume "$CLIENT" "$1"

134
eww_desktop/scripts/pop Executable file
View file

@ -0,0 +1,134 @@
#!/bin/bash
calendar() {
LOCK_FILE="$HOME/.cache/eww-calendar.lock"
EWW_BIN="$HOME/.local/bin/eww"
run() {
${EWW_BIN} -c $HOME/.config/eww open calendar
}
# Open widgets
if [[ ! -f "$LOCK_FILE" ]]; then
${EWW_BIN} -c $HOME/.config/eww close system music_win audio_ctl brightness
touch "$LOCK_FILE"
run && echo "ok good!"
else
${EWW_BIN} -c $HOME/.config/eww close calendar
rm "$LOCK_FILE" && echo "closed"
fi
}
system() {
LOCK_FILE_MEM="$HOME/.cache/eww-system.lock"
EWW_BIN="$HOME/.local/bin/eww"
run() {
${EWW_BIN} -c $HOME/.config/eww open system
}
# Open system
if [[ ! -f "$LOCK_FILE_MEM" ]]; then
${EWW_BIN} -c $HOME/.config/eww close calendar music_win audio_ctl brightness
touch "$LOCK_FILE_MEM"
run && echo "ok good!"
else
${EWW_BIN} -c $HOME/.config/eww close system
rm "$LOCK_FILE_MEM" && echo "closed"
fi
}
music() {
LOCK_FILE_SONG="$HOME/.cache/eww-song.lock"
EWW_BIN="$HOME/.local/bin/eww"
run() {
${EWW_BIN} -c $HOME/.config/eww open music_win
}
# Open widgets
if [[ ! -f "$LOCK_FILE_SONG" ]]; then
${EWW_BIN} -c $HOME/.config/eww close system calendar brightness
touch "$LOCK_FILE_SONG"
run && echo "ok good!"
else
${EWW_BIN} -c $HOME/.config/eww close music_win
rm "$LOCK_FILE_SONG" && echo "closed"
fi
}
audio() {
LOCK_FILE_AUDIO="$HOME/.cache/eww-audio.lock"
EWW_BIN="$HOME/.local/bin/eww"
run() {
${EWW_BIN} -c $HOME/.config/eww open audio_ctl
}
# Open widgets
if [[ ! -f "$LOCK_FILE_AUDIO" ]]; then
${EWW_BIN} -c $HOME/.config/eww close system calendar music brightness
touch "$LOCK_FILE_AUDIO"
run && echo "ok good!"
else
${EWW_BIN} -c $HOME/.config/eww close audio_ctl
rm "$LOCK_FILE_AUDIO" && echo "closed"
fi
}
brightness() {
LOCK_FILE_AUDIO="$HOME/.cache/eww-brightness.lock"
EWW_BIN="$HOME/.local/bin/eww"
run() {
${EWW_BIN} -c $HOME/.config/eww open brightness_window
}
# Open widgets
if [[ ! -f "$LOCK_FILE_AUDIO" ]]; then
${EWW_BIN} -c $HOME/.config/eww close system calendar music audio_ctl
touch "$LOCK_FILE_AUDIO"
run && echo "ok good!"
else
${EWW_BIN} -c $HOME/.config/eww close brightness_window
rm "$LOCK_FILE_AUDIO" && echo "closed"
fi
}
hoverGet() {
NAME="$1"
EWW_BIN="$HOME/.local/bin/eww"
if [[ -f "$STORE" ]]; then
rm "$STORE"
${EWW_BIN} -c $HOME/.config/eww close "$NAME"
fi
}
hoverCreate() {
if [[ ! -f "$STORE" ]]; then
touch "$STORE"
else
echo "failure!"
fi
}
STORE=true
if [ "$1" = "calendar" ]; then
calendar
elif [ "$1" = "system" ]; then
system
#elif [ "$1" = "music" ]; then
#music
elif [ "$1" = "audio" ]; then
audio
elif [ "$1" = "brightness" ]; then
brightness
elif [ "$1" = "hoverGet" ]; then
hoverGet "$2"
elif [ "$1" = "hoverCreate" ]; then
hoverCreate
fi

125
eww_desktop/scripts/weather Executable file
View file

@ -0,0 +1,125 @@
#!/bin/bash
tmp_weather="$HOME/.cache/weather"
tmp_weather_stat=$tmp_weather/weather-stat
tmp_weather_degree=$tmp_weather/weather-degree
tmp_weather_quote=$tmp_weather/weather-quote
tmp_weather_hex=$tmp_weather/weather-hex
tmp_weather_icon=$tmp_weather/weather-icon
if [ ! -d $tmp_weather ]; then
mkdir -p $tmp_weather
fi
#notify-send -u critical "weather ping" "pangping"
# Put in your api and stuff link here
# If you dunno, head to openweathermap.org, and make and account
#(completely free I swear, and then get your API Key and your City ID)
# I wish I was smart enough to do it like Elena, but this is the top I could do lol
KEY="{key}"
ID="{location}"
UNIT="{metric}" #Options are 'metric' and 'imperial'
weather=$(curl -sf "http://api.openweathermap.org/data/2.5/weather?APPID="$KEY"&q="$ID"&units="$UNIT"")
#echo $weather
if [ ! -z "$weather" ]; then
weather_temp=$(echo "$weather" | jq ".main.temp" | cut -d "." -f 1)
weather_icon_code=$(echo "$weather" | jq -r ".weather[].icon" | head -1)
weather_description=$(echo "$weather" | jq -r ".weather[].description" | head -1 | sed -e "s/\b\(.\)/\u\1/g")
#Big long if statement of doom
if [ "$weather_icon_code" == "50d" ]; then
weather_icon=" "
weather_quote="Forecast says it's misty \nMake sure you don't get lost on your way..."
weather_hex="#84afdb" #a7b8b2
elif [ "$weather_icon_code" == "50n" ]; then
weather_icon=" "
weather_quote="Forecast says it's a misty night \nDon't go anywhere tonight or you might get lost..."
weather_hex="#84afdb"
elif [ "$weather_icon_code" == "01d" ]; then
weather_icon=" "
weather_quote="It's a sunny day, gonna be fun! \nDon't go wandering all by yourself though..."
weather_hex="#ffd86b"
elif [ "$weather_icon_code" == "01n" ]; then
weather_icon=" "
weather_quote="It's a clear night \nYou might want to take a evening stroll to relax..."
weather_hex="#fcdcf6"
elif [ "$weather_icon_code" == "02d" ]; then
weather_icon=" "
weather_quote="It's cloudy, sort of gloomy \nYou'd better get a book to read..."
weather_hex="#adadff"
elif [ "$weather_icon_code" == "02n" ]; then
weather_icon=" "
weather_quote="It's a cloudy night \nHow about some hot chocolate and a warm bed?"
weather_hex="#adadff"
elif [ "$weather_icon_code" == "03d" ]; then
weather_icon=" "
weather_quote="It's cloudy, sort of gloomy \nYou'd better get a book to read..."
weather_hex="#adadff"
elif [ "$weather_icon_code" == "03n" ]; then
weather_icon=" "
weather_quote="It's a cloudy night \nHow about some hot chocolate and a warm bed?"
weather_hex="#adadff"
elif [ "$weather_icon_code" == "04d" ]; then
weather_icon=" "
weather_quote="It's cloudy, sort of gloomy \nYou'd better get a book to read..."
weather_hex="#adadff"
elif [ "$weather_icon_code" == "04n" ]; then
weather_icon=" "
weather_quote="It's a cloudy night \nHow about some hot chocolate and a warm bed?"
weather_hex="#adadff"
elif [ "$weather_icon_code" == "09d" ]; then
weather_icon=" "
weather_quote="It's rainy, it's a great day! \nGet some ramen and watch as the rain falls..."
weather_hex="#6b95ff"
elif [ "$weather_icon_code" == "09n" ]; then
weather_icon=" "
weather_quote=" It's gonna rain tonight it seems \nMake sure your clothes aren't still outside..."
weather_hex="#6b95ff"
elif [ "$weather_icon_code" == "10d" ]; then
weather_icon=" "
weather_quote="It's rainy, it's a great day! \nGet some ramen and watch as the rain falls..."
weather_hex="#6b95ff"
elif [ "$weather_icon_code" == "10n" ]; then
weather_icon=" "
weather_quote=" It's gonna rain tonight it seems \nMake sure your clothes aren't still outside..."
weather_hex="#6b95ff"
elif [ "$weather_icon_code" == "11d" ]; then
weather_icon=""
weather_quote="There's storm for forecast today \nMake sure you don't get blown away..."
weather_hex="#ffeb57"
elif [ "$weather_icon_code" == "11n" ]; then
weather_icon=""
weather_quote="There's gonna be storms tonight \nMake sure you're warm in bed and the windows are shut..."
weather_hex="#ffeb57"
elif [ "$weather_icon_code" == "13d" ]; then
weather_icon=" "
weather_quote="It's gonna snow today \nYou'd better wear thick clothes and make a snowman as well!"
weather_hex="#e3e6fc"
elif [ "$weather_icon_code" == "13n" ]; then
weather_icon=" "
weather_quote="It's gonna snow tonight \nMake sure you get up early tomorrow to see the sights..."
weather_hex="#e3e6fc"
elif [ "$weather_icon_code" == "40d" ]; then
weather_icon=" "
weather_quote="Forecast says it's misty \nMake sure you don't get lost on your way..."
weather_hex="#84afdb"
elif [ "$weather_icon_code" == "40n" ]; then
weather_icon=" "
weather_quote="Forecast says it's a misty night \nDon't go anywhere tonight or you might get lost..."
weather_hex="#84afdb"
else
weather_icon=" "
weather_quote="Sort of odd, I don't know what to forecast \nMake sure you have a good time!"
weather_hex="#adadff"
fi
echo "$weather_icon" > $tmp_weather_icon
echo "$weather_description" > $tmp_weather_stat
echo "$weather_temp""°C" > $tmp_weather_degree
echo "$weather_quote" > $tmp_weather_quote
echo "$weather_hex" > $tmp_weather_hex
else
echo "Weather Unavailable" > $tmp_weather_stat
echo " " > $tmp_weather_icon
echo "Ah well, no weather huh? \nEven if there's no weather, it's gonna be a great day!" > $tmp_weather_quote
echo "-" > $tmp_weather_degree
echo "#adadff" > $tmp_weather_hex
fi

View file

@ -0,0 +1,9 @@
#!/bin/bash
weather=$(cat $HOME/.cache/weather/weather-stat)
weather_count=$(cat $HOME/.cache/weather/weather-stat | wc -c)
if [ "$weather_count" -lt 10 ]; then
echo $weather;
else
echo $(cat $HOME/.cache/weather/weather-stat | cut -c1-6)...
fi

26
eww_desktop/scripts/wifi Executable file
View file

@ -0,0 +1,26 @@
#!/bin/bash
status=$(nmcli g | grep -oE "disconnected")
essid=$(nmcli c | grep wlp2s0 | awk '{print ($1)}')
if [ $status ] ; then
icon=""
text=""
col="#575268"
else
icon=""
text="${essid}"
col="#a1bdce"
fi
if [[ "$1" == "--COL" ]]; then
echo $col
elif [[ "$1" == "--ESSID" ]]; then
echo $text
elif [[ "$1" == "--ICON" ]]; then
echo $icon
fi

99
eww_desktop/scripts/workspace Executable file
View file

@ -0,0 +1,99 @@
#!/bin/bash
workspaces() {
ws1="ID 1"
ws2="ID 2"
ws3="ID 3"
ws4="ID 4"
ws5="ID 5"
ws6="ID 6"
ws7="ID 7"
ws8="ID 8"
# check if Occupied
o1=$(hyprctl workspaces | grep "$ws1" )
o2=$(hyprctl workspaces | grep "$ws2" )
o3=$(hyprctl workspaces | grep "$ws3" )
o4=$(hyprctl workspaces | grep "$ws4" )
o5=$(hyprctl workspaces | grep "$ws5" )
o6=$(hyprctl workspaces | grep "$ws6" )
o7=$(hyprctl workspaces | grep "$ws7" )
o8=$(hyprctl workspaces | grep "$ws8" )
# check if Focused
f1=$(hyprctl monitors | grep "workspace: 1" -A 4 | grep "focused: yes" )
f2=$(hyprctl monitors | grep "workspace: 2" -A 4 | grep "focused: yes" )
f3=$(hyprctl monitors | grep "workspace: 3" -A 4 | grep "focused: yes" )
f4=$(hyprctl monitors | grep "workspace: 4" -A 4 | grep "focused: yes" )
f5=$(hyprctl monitors | grep "workspace: 5" -A 4 | grep "focused: yes" )
f6=$(hyprctl monitors | grep "workspace: 6" -A 4 | grep "focused: yes" )
f7=$(hyprctl monitors | grep "workspace: 7" -A 4 | grep "focused: yes" )
f8=$(hyprctl monitors | grep "workspace: 8" -A 4 | grep "focused: yes" )
if [ "$o1" != "" ]; then
ic_1="①"
else
ic_1=""
fi
if [ "$o2" != "" ]; then
ic_2="②"
else
ic_2=""
fi
if [ "$o3" != "" ]; then
ic_3="③"
else
ic_3=""
fi
if [ "$o4" != "" ]; then
ic_4="④"
else
ic_4=""
fi
if [ "$o5" != "" ]; then
ic_5="⑤"
else
ic_5=""
fi
if [ "$o6" != "" ]; then
ic_6="⑥"
else
ic_6=""
fi
if [ "$o7" != "" ]; then
ic_7="⑦"
else
ic_7=""
fi
if [ "$o8" != "" ]; then
ic_8="⑧"
else
ic_8=""
fi
if [ "$f1" != "" ]; then
ic_1="➊"
elif [ "$f2" != "" ]; then
ic_2="➋"
elif [ "$f3" != "" ]; then
ic_3="➌"
elif [ "$f4" != "" ]; then
ic_4="➍"
elif [ "$f5" != "" ]; then
ic_5="➎"
elif [ "$f6" != "" ]; then
ic_6="➏"
elif [ "$f7" != "" ]; then
ic_7="➐"
elif [ "$f8" != "" ]; then
ic_8="➑"
fi
#ic_1=$(hyprctl workspaces)
#ic_2="t"
echo "(box :class \"works\" :orientation \"h\" :spacing 5 :space-evenly \"false\" (button :onclick \"hyprctl dispatch workspace 1\" :class \"$un$o1$f1\" \"$ic_1\") (button :onclick \"hyprctl dispatch workspace 2\" :class \"$un$o2$f2\" \"$ic_2\") (button :onclick \"hyprctl dispatch workspace 3\" :class \"$un$o3$f3\" \"$ic_3\") (button :onclick \"hyprctl dispatch workspace 4\" :class \"$un$o4$f4\" \"$ic_4\") (button :onclick \"hyprctl dispatch workspace 5\" :class \"$un$o5$f5\" \"$ic_5\") (button :onclick \"hyprctl dispatch workspace 6\" :class \"$un$o6$f6\" \"$ic_6\") (button :onclick \"hyprctl dispatch workspace 7\" :class \"$un$o7$f7\" \"$ic_7\") (button :onclick \"hyprctl dispatch workspace 8\" :class \"$un$o8$f8\" \"$ic_8\"))"
}
workspaces
tail -f /tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/hyprland.log | grep -E --line-buffered "Changed to workspace|focus to surface" | while read -r; do
workspaces
done