irongit

refactor: toggle minimize uses jq, add gmail

huncholanehuncholaneauthored
parent 1f6e12dcommit 83615cdcf274e98f9125685014e3ca6b0b52c378Browse files

4 files changed, +19 -6

+6-1UserConfigs/UserKeybinds.conf
@@ -54,7 +54,7 @@ bind = $mainMod ALT, R, exec, $scriptsDir/Refresh.sh # Refresh waybar, swaync, r
5454 bind = $mainMod ALT, E, exec, $scriptsDir/RofiEmoji.sh # emoji menu
5555 # bind = $mainMod, S, exec, $scriptsDir/RofiSearch.sh # Google search using rofi
5656 bind = $mainMod ALT, O, exec, $scriptsDir/ChangeBlur.sh # Toggle blur settings
57-bind = $mainMod SHIFT, G, exec, $scriptsDir/GameMode.sh # Toggle animations ON/OFF
57+# bind = $mainMod SHIFT, G, exec, $scriptsDir/GameMode.sh # Toggle animations ON/OFF
5858 bind = $mainMod ALT, L, exec, $scriptsDir/ChangeLayout.sh # Toggle Master or Dwindle Layout
5959 bind = $mainMod ALT, V, exec, $scriptsDir/ClipManager.sh # Clipboard Manager
6060 bind = $mainMod CTRL, R, exec, $scriptsDir/RofiThemeSelector.sh # KooL Rofi Menu Theme Selector
@@ -103,8 +103,13 @@ bind = $mainMod SHIFT, C, exec, gnome-calendar
103103 # to unbind
104104 #bind = $mainMod ALT, P, submap, reset
105105 #submap = reset
106+
107+# Easy access (Minimized Popups)
106108 bind = $mainMod, o, exec, $UserScripts/ToggleMinimize.sh hubstaff /home/huncho/Hubstaff/HubstaffClient.bin.x86_64
107109 bind = $mainMod shift, p, exec, $UserScripts/ToggleMinimize.sh proton protonvpn-app
108110 bind = $mainMod, x, exec, $UserScripts/ToggleMinimize.sh ledger ledger
111+bind = $mainMod, z, exec, $UserScripts/ToggleMinimize.sh zoho zoho-mail-desktop
112+bind = $mainMod, g, exec, $UserScripts/ToggleMinimize.sh chrome-fmgjjmmmlfnkbppncabfkddbjimcfncm-Default 'gtk-launch gmail'
113+# bind = $mainMod, g, exec, gtk-launch gmail
109114
110115 bind = $mainMod, i, exec, foot -a floating-term sh -c 'hyprctl clients | nvim' # Show the current hyprland client info
+6-0UserConfigs/WindowRules.conf
@@ -41,3 +41,9 @@ windowrule = float on, center on, size monitor_w*0.95 monitor_h*0.9, match:class
4141
4242 # Crypto wallets
4343 windowrule = float on, center on, size 500 800, match:title ^(_crx_nkbihfbeogaeaoehlefnkodbefgpgknn|_crx_bhhhlbepdkbapadjdnnojkbgioiodbic|_crx_bfnaelmomeimhlpmgjnjophhpkkoljpa)$
44+
45+# Zoho
46+windowrule = float on, center on, size monitor_w*0.95 monitor_h*0.9, match:class Zoho Mail - Desktop
47+
48+# Gmail
49+windowrule = float on, center on, size monitor_w*0.95 monitor_h*0.9, match:class chrome-fmgjjmmmlfnkbppncabfkddbjimcfncm-Default
+6-4UserScripts/ToggleMinimize.sh
@@ -1,9 +1,11 @@
11 #!/bin/bash
22
3-details=$(hyprctl clients | grep -i "$1" -B 2 -A 15)
4-class=$(echo "$details" | grep -oP '(?<=class: ).*')
3+details=$(hyprctl clients -j | jq -r '.[] | select(.class | test("'"$1"'"; "i"))')
4+class=$(echo "$details" | jq -r '.class')
5+workspace=$(echo "$details" | jq -r '.workspace.name')
6+echo "$class $workspace"
57
6-# Launch hubstaff and exit if not open
8+# Launch app and exit if class is not found
79 if [ -z "$details" ]; then
810 $2 &>/dev/null &
911 exit 0
@@ -12,7 +14,7 @@ fi
1214 cur_workspace=$(hyprctl activeworkspace -j | jq '.id')
1315
1416 # Toggle minimized
15-if echo "$details" | grep -q "special:minimized"; then
17+if [ "$workspace" = "special:minimized" ]; then
1618 # Bring to current workspace
1719 echo "moving to workspace: $cur_workspace"
1820 hyprctl dispatch movetoworkspace "$cur_workspace", "class:$class"
+1-1configs/Keybinds.conf
@@ -31,7 +31,7 @@ bind = $mainMod, P, pseudo, # dwindle
3131 bind = $mainMod, M, exec, hyprctl dispatch splitratio 0.3
3232
3333 # group
34-bind = $mainMod, G, togglegroup # toggle group
34+# bind = $mainMod, G, togglegroup # toggle group
3535 bind = $mainMod CTRL, tab, changegroupactive # change focus to another window
3636
3737 # Cycle windows if floating bring to top