Hyprland dotfiles
feat: minimize script
3 files changed, +34 -1
+1-0UserConfigs/UserKeybinds.conf
| @@ -103,3 +103,4 @@ bind = $mainMod SHIFT, C, exec, gnome-calendar | ||
| 103 | 103 | # to unbind |
| 104 | 104 | #bind = $mainMod ALT, P, submap, reset |
| 105 | 105 | #submap = reset |
| 106 | +bind = $mainMod, h, exec, $UserScripts/ToggleMinimize.sh hubstaff # Move hubstaff to minimized window or current window |
+10-1UserConfigs/WindowRules.conf
| @@ -13,8 +13,17 @@ windowrule = center on, float on, size monitor_w*0.8 monitor_h*0.8, match:title | ||
| 13 | 13 | |
| 14 | 14 | # Files |
| 15 | 15 | windowrule = tag +files, match:initial_class ^(org.gnome.Nautilus)$ |
| 16 | -windowrule = tag +files, match:title ^(Save As.*|All Files.*).*$ | |
| 16 | +windowrule = tag +files, match:title ^(Save As.*|All Files.*|.*Files.*).*$ | |
| 17 | 17 | windowrule = float on, center on, size monitor_w*0.8 monitor_h*0.8, match:tag files |
| 18 | 18 | |
| 19 | 19 | # Chrome Browser |
| 20 | 20 | windowrule = workspace 3, match:class google-chrome |
| 21 | + | |
| 22 | +# Slack | |
| 23 | +windowrule = workspace 4, match:class Slack | |
| 24 | + | |
| 25 | +# Postman | |
| 26 | +windowrule = workspace 6, match:class Postman | |
| 27 | + | |
| 28 | +# Hubstaff | |
| 29 | +windowrule = float on, center on, match:class Netsoft-com.netsoft.hubstaff |
+23-0UserScripts/ToggleMinimize.sh
| @@ -0,0 +1,23 @@ | ||
| 1 | +#!/bin/bash | |
| 2 | + | |
| 3 | +details=$(hyprctl clients | grep -i "$1" -B 2 -A 15) | |
| 4 | +class=$(echo "$details" | grep -oP '(?<=class: ).*') | |
| 5 | + | |
| 6 | +# Launch hubstaff and exit if not open | |
| 7 | +if [ -z "$details" ]; then | |
| 8 | + /home/huncho/Hubstaff/HubstaffClient.bin.x86_64 &>/dev/null & | |
| 9 | + exit 0 | |
| 10 | +fi | |
| 11 | + | |
| 12 | +cur_workspace=$(hyprctl activeworkspace -j | jq '.id') | |
| 13 | + | |
| 14 | +# Toggle minimized | |
| 15 | +if echo "$details" | grep -q "special:minimized"; then | |
| 16 | + # Bring to current workspace | |
| 17 | + echo "moving to workspace: $cur_workspace" | |
| 18 | + hyprctl dispatch movetoworkspace "$cur_workspace", "class:$class" | |
| 19 | +else | |
| 20 | + # Move to special:minimized | |
| 21 | + echo "moving to minimized workspace" | |
| 22 | + hyprctl dispatch movetoworkspacesilent special:minimized, "class:$class" | |
| 23 | +fi |