remove(wallpapers): redundancies
This commit is contained in:
@@ -1,16 +1,12 @@
|
||||
{pkgs, ...}: let
|
||||
hakase-workspace-switch-force = pkgs.writeShellScriptBin "hakase-workspace-switch-force" ''
|
||||
# Define binary paths to ensure they work regardless of environment PATH
|
||||
HYPRCTL="${pkgs.hyprland}/bin/hyprctl"
|
||||
JQ="${pkgs.jq}/bin/jq"
|
||||
|
||||
# Get the special workspace name
|
||||
special_workspace=$($HYPRCTL monitors -j | $JQ -r '.[] | select(.focused) | .specialWorkspace.name')
|
||||
|
||||
# Strip the "special:" prefix (Nix escape: ''${var#*:})
|
||||
workspace_name=''${special_workspace#*:}
|
||||
|
||||
# Get the target workspace number from argument
|
||||
chosen_workspace_num=$1
|
||||
|
||||
if [[ -z ''${chosen_workspace_num} ]]; then
|
||||
@@ -18,14 +14,11 @@
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if we are actually in a special workspace
|
||||
if [[ "''${special_workspace}" == *"special"* ]]; then
|
||||
echo "[LOG] workspace is ''${special_workspace}"
|
||||
|
||||
# Toggle the special workspace OFF
|
||||
$HYPRCTL dispatch togglespecialworkspace "''${workspace_name}"
|
||||
|
||||
# Switch to the requested normal workspace
|
||||
$HYPRCTL dispatch workspace "''${chosen_workspace_num}"
|
||||
else
|
||||
echo "[LOG] workspace is not special"
|
||||
|
||||
Reference in New Issue
Block a user