Commit fe10900
Changed files (4)
.config
hypr
modules
.wraith
.config/hypr/modules/keybinds.conf
@@ -14,7 +14,6 @@ bind = $mainMod CTRL, s,swapwindow, d
bind = $mainMod CTRL, d, swapwindow, r
bind = $mainMod, TAB, hyprexpo:expo, toggle
-bind = $mainMod, S, togglespecialworkspace, temp
bind = $mainMod SHIFT, TAB, movetoworkspace, special:temp
#CUSTOM SCRIPTS and Commands
@@ -27,6 +26,7 @@ bind = $mainMod, R, exec, killall -9 waybar && waybar
bind = $mainMod, V, exec, $cliphistMenu
bind = $mainMod, period, exec, $emojiMenu
bind = $mainMod SHIFT,S,exec, $screenshotMenu
+bind = $mainMod, S, exec, $cycleSpecial
# Switch workspaces with mainMod + [0-9]
bind = $mainMod, 1, workspace, 1
.config/hypr/modules/vars.conf
@@ -2,9 +2,11 @@ $terminal = uwsm-app -- xdg-terminal-exec
$fileManager = thunar
$menu = rofi -show drun
$cliphistMenu = cliphist list | rofi -dmenu -p "" -no-show-icons| cliphist decode | wl-copy
-$screenshotMenu = $HOME/.wraith/scripts/screenshot.sh
$emojiMenu = rofimoji -a type copy type-numerical
+$screenshotMenu = $HOME/.wraith/scripts/screenshot.sh
+$cycleSpecial = $HOME/.wraith/scripts/cycle-special-workspace.sh
+
env = LIBVA_DRIVER_NAME,nvidia
env = __GLX_VENDOR_LIBRARY_NAME,nvidia
.wraith/scripts/brightness.sh
@@ -1,6 +1,6 @@
#!/bin/zsh
-STATE_FILE="$HOME/.wraith/states/brightness.state"
+STATE_FILE="$HOME/.local/state/wraith/brightness.state"
LOCK_FILE="/tmp/brightness.lock"
DEFAULT_STEP=5
DEFAULT_FALLBACK=10
.wraith/scripts/cycle-special-workspace.sh
@@ -0,0 +1,45 @@
+#!/usr/bin/env zsh
+
+STATE_FILE="$HOME/.local/state/wraith/cycle-special.state"
+
+# Get all special workspaces, sorted and exit if none found
+specials=(
+ ${(on)$(
+ hyprctl workspaces -j \
+ | jq -r '.[] | select(.name | startswith("special:")) | .name'
+ )}
+)
+
+(( ${#specials[@]} == 0 )) && exit 0
+
+# empty entry → means "hide"
+specials+=("")
+
+if [[ ! -f "$STATE_FILE" ]]; then
+ print -r -- "${specials[1]}" > "$STATE_FILE"
+fi
+
+current=$(<"$STATE_FILE")
+
+current_index=0
+for i in {1..${#specials[@]}}; do
+ if [[ "${specials[$i]}" == "$current" ]]; then
+ current_index=$i
+ break
+ fi
+done
+
+(( current_index == 0 )) && current_index=1
+
+next_index=$(( current_index + 1 ))
+(( next_index > ${#specials[@]} )) && next_index=1
+
+next="${specials[$next_index]}"
+
+if [[ -z "$next" ]]; then
+ hyprctl dispatch togglespecialworkspace "${current#*:}"
+else
+ hyprctl dispatch workspace "$next"
+fi
+
+print -r -- "$next" > "$STATE_FILE"