diff --git a/desktopenvs/hyprland/eww-nobattery/eww.yuck b/desktopenvs/hyprland/eww-nobattery/eww.yuck index 76057fe..9c9bd5f 100644 --- a/desktopenvs/hyprland/eww-nobattery/eww.yuck +++ b/desktopenvs/hyprland/eww-nobattery/eww.yuck @@ -21,7 +21,7 @@ (defwidget winsworks [monitor] (box :orientation "h" :space-evenly false :halign "start" (workspaceWidget :monitor monitor) - (button :onclick "scripts/drawer.sh" :class "music" {" ${activewindow}"}) + (button :onclick "~/Dotfiles/desktopenvs/hyprland/scripts/drawer.sh" :class "music" {" ${activewindow}"}) ) ) @@ -42,7 +42,7 @@ :orientation "h" :space-evenly false :halign "center" - :onclick "scripts/playpause.sh" + :onclick "~/Dotfiles/desktopenvs/hyprland/scripts/playpause.sh" {music != "" ? " ${music}" : " None"})) @@ -72,23 +72,23 @@ {i.name == "special:magic" ? "󱂬" : "󱂬${i.name}"}))))) -(deflisten workspace-old "scripts/workspace") +(deflisten workspace-old "~/Dotfiles/desktopenvs/hyprland/scripts/workspace") (defwidget workspaces-old [] (literal :content workspace-old)) (defpoll music :interval "0.5s" - "scripts/playerget") + "~/Dotfiles/desktopenvs/hyprland/scripts/playerget") (defpoll activewindow :interval "0.5s" - "scripts/activewindow") + "~/Dotfiles/desktopenvs/hyprland/scripts/activewindow") (defpoll IP :interval "5s" - "scripts/ip") + "~/Dotfiles/desktopenvs/hyprland/scripts/ip") (defpoll volume :interval "0.5s" - "scripts/getvol") + "~/Dotfiles/desktopenvs/hyprland/scripts/getvol") (defpoll time :interval "1s" "date '+%H:%M:%S|%d.%m.%Y'") diff --git a/desktopenvs/hyprland/eww/eww.yuck b/desktopenvs/hyprland/eww/eww.yuck index 5dc45ac..07bf87d 100644 --- a/desktopenvs/hyprland/eww/eww.yuck +++ b/desktopenvs/hyprland/eww/eww.yuck @@ -12,7 +12,7 @@ (bar :monitor_ monitor)) (defpoll battery :interval "2s" - "scripts/batteryperc") + "~/Dotfiles/desktopenvs/hyprland/scripts/batteryperc") @@ -26,7 +26,7 @@ (box :orientation "h" :space-evenly false :halign "start" (box :class "music" {"${battery}"}) (workspaceWidget :monitor monitor) - (button :onclick "scripts/drawer.sh" :class "music" {" ${activewindow}"}) + (button :onclick "~/Dotfiles/desktopenvs/hyprland/scripts/drawer.sh" :class "music" {" ${activewindow}"}) ) ) @@ -47,7 +47,7 @@ :orientation "h" :space-evenly false :halign "center" - :onclick "scripts/playpause.sh" + :onclick "~/Dotfiles/desktopenvs/hyprland/scripts/playpause.sh" {music != "" ? " ${music}" : " None"})) @@ -77,23 +77,23 @@ {i.name == "special:magic" ? "󱂬" : "󱂬${i.name}"}))))) -(deflisten workspace-old "scripts/workspace") +(deflisten workspace-old "~/Dotfiles/desktopenvs/hyprland/scripts/workspace") (defwidget workspaces-old [] (literal :content workspace-old)) (defpoll music :interval "0.5s" - "scripts/playerget") + "~/Dotfiles/desktopenvs/hyprland/scripts/playerget") (defpoll activewindow :interval "0.5s" - "scripts/activewindow") + "~/Dotfiles/desktopenvs/hyprland/scripts/activewindow") (defpoll IP :interval "5s" - "scripts/ip") + "~/Dotfiles/desktopenvs/hyprland/scripts/ip") (defpoll volume :interval "0.5s" - "scripts/getvol") + "~/Dotfiles/desktopenvs/hyprland/scripts/getvol") (defpoll time :interval "1s" "date '+%H:%M:%S|%d.%m.%Y'") diff --git a/desktopenvs/hyprland/eww/scripts/activewindow b/desktopenvs/hyprland/eww/scripts/activewindow deleted file mode 100755 index 8b16732..0000000 --- a/desktopenvs/hyprland/eww/scripts/activewindow +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -trunc=16 -sample=$(hyprctl activewindow | grep title: | awk -F: '{print $2}') - -#echo ${sample} - -if [ ${#sample} -gt $trunc ]; then - echo $sample | head -c $trunc | sed 's/$/…/' -else - if [ ${#sample} -ne 0 ]; then - echo $sample - else - echo None - fi -fi - -#hyprctl activewindow | grep title: | awk -F: '{print $2}' | head -c $trunc | sed 's/$/.../' - diff --git a/desktopenvs/hyprland/eww/scripts/batteryperc b/desktopenvs/hyprland/eww/scripts/batteryperc deleted file mode 100755 index 6e13890..0000000 --- a/desktopenvs/hyprland/eww/scripts/batteryperc +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash - -# Get percentage and remove the % sign cleanly -perc=$(upower -i /org/freedesktop/UPower/devices/battery_BAT0 | awk '/percentage/ {gsub("%",""); print $2}') -state=$(upower -i /org/freedesktop/UPower/devices/battery_BAT0 | awk '/state/ {print $2}') - -# Check if values are not empty -if [ -z "$perc" ] || [ -z "$state" ]; then - echo "Battery info unavailable" - exit 1 -fi - -# Convert to integer -num=${perc%%.*} # In case perc is float - -if [ "$state" == "charging" ]; then - echo "󰂄 ${perc}%" -else - if [ "$num" -gt 95 ]; then - echo "󰁹 ${perc}%" - elif [ "$num" -gt 90 ]; then - echo "󰂂 ${perc}%" - elif [ "$num" -gt 80 ]; then - echo "󰂁 ${perc}%" - elif [ "$num" -gt 70 ]; then - echo "󰂀 ${perc}%" - elif [ "$num" -gt 60 ]; then - echo "󰁿 ${perc}%" - elif [ "$num" -gt 50 ]; then - echo "󰁾 ${perc}%" - elif [ "$num" -gt 40 ]; then - echo "󰁽 ${perc}%" - elif [ "$num" -gt 30 ]; then - echo "󰁼 ${perc}%" - elif [ "$num" -gt 20 ]; then - echo "󰁻 ${perc}%" - elif [ "$num" -gt 10 ]; then - echo "󰁺 ${perc}%" - else - notify-send --urgency=critical -t 2000 "󱃍 low battery, please charge" - echo "󰂎 ${perc}%" - fi -fi - diff --git a/desktopenvs/hyprland/eww/scripts/batteryperc.old b/desktopenvs/hyprland/eww/scripts/batteryperc.old deleted file mode 100644 index d72cb8b..0000000 --- a/desktopenvs/hyprland/eww/scripts/batteryperc.old +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash - -perc=$(upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep percentage | awk -F: '{print $2}' | xargs) -state=$(upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep state | awk -F: '{print $2}' | xargs) - -num=$(echo ${perc::-1}) - -if [ $state == "charging" ]; then - echo "󰂄 ${perc}" -else - #echo "󰁹 ${perc}" - - if [ $num -gt 95 ]; then - echo "󰁹 ${perc}" - elif [ $num -gt 90 ]; then - echo "󰂂 ${perc}" - elif [ $num -gt 80 ]; then - echo "󰂁 ${perc}" - elif [ $num -gt 70 ]; then - echo "󰂀 ${perc}" - elif [ $num -gt 60 ]; then - echo "󰁿 ${perc}" - elif [ $num -gt 50 ]; then - echo "󰁾 ${perc}" - elif [ $num -gt 40 ]; then - echo "󰁽 ${perc}" - elif [ $num -gt 30 ]; then - echo "󰁼 ${perc}" - elif [ $num -gt 20 ]; then - echo "󰁻 ${perc}" - elif [ $num -gt 10 ]; then - echo "󰁺 ${perc}" - else - notify-send --urgency=critical -t 2000 "󱃍 low battery, please charge" - echo "󰂎 ${perc}" - fi -fi diff --git a/desktopenvs/hyprland/eww/scripts/drawer.sh b/desktopenvs/hyprland/eww/scripts/drawer.sh deleted file mode 100755 index 90d7420..0000000 --- a/desktopenvs/hyprland/eww/scripts/drawer.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -nwg-drawer -fm "kitty -e yazi" -term kitty -wm hyprland -mb 20 -ml 20 -mr 20 -mt 20 -pblock hyprlock -pbpoweroff poweroff -pbexit "hyprctl dispatch exit" -pbreboot reboot - diff --git a/desktopenvs/hyprland/eww/scripts/getvol b/desktopenvs/hyprland/eww/scripts/getvol deleted file mode 100755 index 86b6270..0000000 --- a/desktopenvs/hyprland/eww/scripts/getvol +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -perc=$(pactl get-sink-volume @DEFAULT_SINK@ | awk -F/ '{print $2}' | xargs) -num=$(echo ${perc::-1}) -echo $num diff --git a/desktopenvs/hyprland/eww/scripts/ip b/desktopenvs/hyprland/eww/scripts/ip deleted file mode 100755 index cf1aded..0000000 --- a/desktopenvs/hyprland/eww/scripts/ip +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -hostname -i | tr ' ' '\n' | head -n1 | tail -n1 - diff --git a/desktopenvs/hyprland/eww/scripts/playerget b/desktopenvs/hyprland/eww/scripts/playerget deleted file mode 100755 index 80a5e01..0000000 --- a/desktopenvs/hyprland/eww/scripts/playerget +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash -truncs=13 -trunca=10 -song=$(playerctl metadata --format '{{ title }}') -artist=$(playerctl metadata --format '{{ artist }}') -#echo ${sample} - -if [ ${#song} -gt $truncs ]; then - songt=$(echo $song | head -c $truncs | sed 's/$/…/') -else - if [ ${#song} -ne 0 ]; then - songt=$(echo ${song}) - else - songt=$(echo None) - fi -fi - -if [ ${#artist} -gt $trunca ]; then - artistt=$(echo $artist | head -c $trunca | sed 's/$/…/') -else - if [ ${#artist} -ne 0 ]; then - artistt=$(echo ${artist}) - else - artistt=$(echo None) - fi -fi -echo "${songt}|${artistt}" - - -#hyprctl activewindow | grep title: | awk -F: '{print $2}' | head -c $trunc | sed 's/$/.../' - diff --git a/desktopenvs/hyprland/eww/scripts/playpause.sh b/desktopenvs/hyprland/eww/scripts/playpause.sh deleted file mode 100755 index bb8d075..0000000 --- a/desktopenvs/hyprland/eww/scripts/playpause.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -playerctl play-pause -p spotify, vlc, firefox diff --git a/desktopenvs/hyprland/eww/scripts/windowswitcher b/desktopenvs/hyprland/eww/scripts/windowswitcher deleted file mode 100755 index 2ca011b..0000000 --- a/desktopenvs/hyprland/eww/scripts/windowswitcher +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash - hyprctl dispatch focuswindow address:"$(hyprctl -j clients | jq 'map("\(.workspace.id) ∴ \(.workspace.name) ┇ \(.title) ┇ \(.address)")' | sed "s/,$//; s/^\[//; s/^\]//; s/^[[:blank:]]*//; s/^\"//; s/\"$//" | grep -v "^$" | wofi -dO alphabetical | grep -o "0x.*$")" diff --git a/desktopenvs/hyprland/eww/scripts/workspace b/desktopenvs/hyprland/eww/scripts/workspace deleted file mode 100755 index 7fff597..0000000 --- a/desktopenvs/hyprland/eww/scripts/workspace +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash - -#define icons for workspaces 1-9 -ic=("W0" "W1" "W2" "W3" "W4" "W5" "W6" "W7" "W8" "W9") - -#initial check for occupied workspaces -for num in $(hyprctl workspaces | grep ID | sed 's/()/(1)/g' | awk 'NR>1{print $1}' RS='(' FS=')'); do - export o"$num"="$num" -done - -#initial check for focused workspace -for num in $(hyprctl monitors | grep active | sed 's/()/(1)/g' | awk 'NR>1{print $1}' RS='(' FS=')'); do - export f"$num"="$num" - export fnum=f"$num" -done - -workspaces() { -if [[ ${1:0:9} == "workspace" ]]; then #set focused workspace - unset -v "$fnum" - num=${1:11} - export f"$num"="$num" - export fnum=f"$num" - -elif [[ ${1:0:15} == "createworkspace" ]]; then #set Occupied workspace - num=${1:17} - export o"$num"="$num" - export f"$num"="$num" - -elif [[ ${1:0:16} == "destroyworkspace" ]]; then #unset unoccupied workspace - num=${1:18} - unset -v o"$num" f"$num" -fi - -#output eww widget -echo "(eventbox :onscroll \"echo {} | sed -e 's/up/-1/g' -e 's/down/+1/g' | xargs hyprctl dispatch workspace\" \ - (box :class \"works\" :orientation \"h\" :spacing 5 :space-evenly \"true\" \ - (button :onclick \"hyprctl dispatch workspace 1\" :onrightclick \"hyprctl dispatch workspace 1 && /home/taylor/.config/hypr/default_app\" :class \"0$o1$f1\" \"${ic[1]}\") \ - (button :onclick \"hyprctl dispatch workspace 2\" :onrightclick \"hyprctl dispatch workspace 2 && /home/taylor/.config/hypr/default_app\" :class \"0$o2$f2\" \"${ic[2]}\") \ - (button :onclick \"hyprctl dispatch workspace 3\" :onrightclick \"hyprctl dispatch workspace 3 && /home/taylor/.config/hypr/default_app\" :class \"0$o3$f3\" \"${ic[3]}\") \ - (button :onclick \"hyprctl dispatch workspace 4\" :onrightclick \"hyprctl dispatch workspace 4 && /home/taylor/.config/hypr/default_app\" :class \"0$o4$f4\" \"${ic[4]}\") \ - (button :onclick \"hyprctl dispatch workspace 5\" :onrightclick \"hyprctl dispatch workspace 5 && /home/taylor/.config/hypr/default_app\" :class \"0$o5$f5\" \"${ic[5]}\") \ - (button :onclick \"hyprctl dispatch workspace 6\" :onrightclick \"hyprctl dispatch workspace 6 && /home/taylor/.config/hypr/default_app\" :class \"0$o6$f6\" \"${ic[6]}\") \ - (button :onclick \"hyprctl dispatch workspace 7\" :onrightclick \"hyprctl dispatch workspace 7 && /home/taylor/.config/hypr/default_app\" :class \"0$o7$f7\" \"${ic[7]}\") \ - )\ - )" -} - -workspaces - -socat -u UNIX-CONNECT:/tmp/hypr/"$HYPRLAND_INSTANCE_SIGNATURE"/.socket2.sock - | while read -r event; do -workspaces "$event" -done diff --git a/desktopenvs/hyprland/hypr-usr/monitors.conf b/desktopenvs/hyprland/hypr-usr/monitors.conf index 566859f..3d794ab 100644 --- a/desktopenvs/hyprland/hypr-usr/monitors.conf +++ b/desktopenvs/hyprland/hypr-usr/monitors.conf @@ -2,7 +2,7 @@ monitor = , highres, auto, 2 #monitor handling -exec-once = /usr/bin/hyprland-monitor-attached /home/themiro/Dotfiles/desktopenvs/hyprland/hypr/ [monitorhandler.sh] +exec-once = ~/Dotfiles/desktopenvs/hyprland/scripts/monitorhandler.sh # unscale XWayland xwayland { diff --git a/desktopenvs/hyprland/hypr/scripts/drawer.sh b/desktopenvs/hyprland/hypr/scripts/drawer.sh deleted file mode 100755 index 90d7420..0000000 --- a/desktopenvs/hyprland/hypr/scripts/drawer.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -nwg-drawer -fm "kitty -e yazi" -term kitty -wm hyprland -mb 20 -ml 20 -mr 20 -mt 20 -pblock hyprlock -pbpoweroff poweroff -pbexit "hyprctl dispatch exit" -pbreboot reboot - diff --git a/desktopenvs/hyprland/eww-nobattery/scripts/activewindow b/desktopenvs/hyprland/scripts/activewindow similarity index 100% rename from desktopenvs/hyprland/eww-nobattery/scripts/activewindow rename to desktopenvs/hyprland/scripts/activewindow diff --git a/desktopenvs/hyprland/eww-nobattery/scripts/batteryperc b/desktopenvs/hyprland/scripts/batteryperc similarity index 100% rename from desktopenvs/hyprland/eww-nobattery/scripts/batteryperc rename to desktopenvs/hyprland/scripts/batteryperc diff --git a/desktopenvs/hyprland/eww-nobattery/scripts/batteryperc.old b/desktopenvs/hyprland/scripts/batteryperc.old similarity index 100% rename from desktopenvs/hyprland/eww-nobattery/scripts/batteryperc.old rename to desktopenvs/hyprland/scripts/batteryperc.old diff --git a/desktopenvs/hyprland/hypr/scripts/date.sh b/desktopenvs/hyprland/scripts/date.sh similarity index 100% rename from desktopenvs/hyprland/hypr/scripts/date.sh rename to desktopenvs/hyprland/scripts/date.sh diff --git a/desktopenvs/hyprland/eww-nobattery/scripts/drawer.sh b/desktopenvs/hyprland/scripts/drawer.sh similarity index 100% rename from desktopenvs/hyprland/eww-nobattery/scripts/drawer.sh rename to desktopenvs/hyprland/scripts/drawer.sh diff --git a/desktopenvs/hyprland/hypr/scripts/ewwstart.sh b/desktopenvs/hyprland/scripts/ewwstart.sh similarity index 100% rename from desktopenvs/hyprland/hypr/scripts/ewwstart.sh rename to desktopenvs/hyprland/scripts/ewwstart.sh diff --git a/desktopenvs/hyprland/eww-nobattery/scripts/getvol b/desktopenvs/hyprland/scripts/getvol similarity index 100% rename from desktopenvs/hyprland/eww-nobattery/scripts/getvol rename to desktopenvs/hyprland/scripts/getvol diff --git a/desktopenvs/hyprland/eww-nobattery/scripts/ip b/desktopenvs/hyprland/scripts/ip similarity index 100% rename from desktopenvs/hyprland/eww-nobattery/scripts/ip rename to desktopenvs/hyprland/scripts/ip diff --git a/desktopenvs/hyprland/eww/scripts/ispeedtest.py b/desktopenvs/hyprland/scripts/ispeedtest.py similarity index 100% rename from desktopenvs/hyprland/eww/scripts/ispeedtest.py rename to desktopenvs/hyprland/scripts/ispeedtest.py diff --git a/desktopenvs/hyprland/hypr/scripts/menu.sh b/desktopenvs/hyprland/scripts/menu.sh similarity index 100% rename from desktopenvs/hyprland/hypr/scripts/menu.sh rename to desktopenvs/hyprland/scripts/menu.sh diff --git a/desktopenvs/hyprland/scripts/monitorhandler.sh b/desktopenvs/hyprland/scripts/monitorhandler.sh new file mode 100755 index 0000000..11387cb --- /dev/null +++ b/desktopenvs/hyprland/scripts/monitorhandler.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +swww restore + +~/Dotfiles/desktopenvs/hyprland/scripts/ewwstart.sh diff --git a/desktopenvs/hyprland/eww-nobattery/scripts/playerget b/desktopenvs/hyprland/scripts/playerget similarity index 100% rename from desktopenvs/hyprland/eww-nobattery/scripts/playerget rename to desktopenvs/hyprland/scripts/playerget diff --git a/desktopenvs/hyprland/eww-nobattery/scripts/playpause.sh b/desktopenvs/hyprland/scripts/playpause.sh similarity index 100% rename from desktopenvs/hyprland/eww-nobattery/scripts/playpause.sh rename to desktopenvs/hyprland/scripts/playpause.sh diff --git a/desktopenvs/hyprland/hypr/scripts/screenshot.sh b/desktopenvs/hyprland/scripts/screenshot.sh similarity index 100% rename from desktopenvs/hyprland/hypr/scripts/screenshot.sh rename to desktopenvs/hyprland/scripts/screenshot.sh diff --git a/desktopenvs/hyprland/hypr/scripts/time.sh b/desktopenvs/hyprland/scripts/time.sh similarity index 100% rename from desktopenvs/hyprland/hypr/scripts/time.sh rename to desktopenvs/hyprland/scripts/time.sh diff --git a/desktopenvs/hyprland/hypr/scripts/uptime.sh b/desktopenvs/hyprland/scripts/uptime.sh similarity index 100% rename from desktopenvs/hyprland/hypr/scripts/uptime.sh rename to desktopenvs/hyprland/scripts/uptime.sh diff --git a/desktopenvs/hyprland/eww-nobattery/scripts/windowswitcher b/desktopenvs/hyprland/scripts/windowswitcher similarity index 100% rename from desktopenvs/hyprland/eww-nobattery/scripts/windowswitcher rename to desktopenvs/hyprland/scripts/windowswitcher diff --git a/desktopenvs/hyprland/eww-nobattery/scripts/workspace b/desktopenvs/hyprland/scripts/workspace similarity index 100% rename from desktopenvs/hyprland/eww-nobattery/scripts/workspace rename to desktopenvs/hyprland/scripts/workspace