feat: Adds proton pass manager script, updates keybinds and window rules for proton pass.

This commit is contained in:
2025-09-30 15:39:05 -04:00
parent c89b0e307c
commit cefdf21fc8
5 changed files with 81 additions and 7 deletions

View File

@@ -20,6 +20,7 @@ $fileBrowser = nautilus
$menu = walker
#$pwa = chromium --profile-directory=Default --enable-features=UseOzonePlatform --ozone-platform=wayland
$pwa = ~/.local/scripts/launch-webapp
$launchOrFocusWebapp = ~/.local/scripts/launch-or-focus-webapp
# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
@@ -42,9 +43,10 @@ bind = $mainMod, F, exec, $fileManager
bind = $mainMod SHIFT, F, exec, $fileBrowser
bind = $mainMod, G, exec, $pwa "https://git.housh.dev"
# NOTE: Do not bind apps to H, J, K, or L!
bind = $mainMod, M, exec, ~/.local/scripts/toggle-waybar
bind = $mainMod, M, exec, $pwa "https://music.apple.com"
bind = $mainMod SHIFT, M, exec, ~/.local/scripts/toggle-waybar
bind = $mainMod, N, exec, $terminal -e nvim
bind = $mainMod, P, exec, $pwa "https://pass.proton.me"
bind = $mainMod, P, exec, ~/.local/scripts/proton-pass-manager
bind = $mainMod SHIFT, P, pseudo, # dwindle
bind = $mainMod SHIFT, R, exec, ~/.local/scripts/waybar-restart
bind = $mainMod, Y, exec, $pwa "https://youtube.com"
@@ -125,7 +127,7 @@ bind = $mainMod SHIFT, 0, movetoworkspace, 10
# Example special workspace (scratchpad)
bind = $mainMod, S, togglespecialworkspace, magic
bind = $mainMod SHIFT, S, movetoworkspace, special:magic
bind = $mainMod SHIFT, S, movetoworkspacesilent, special:magic
# Scroll through existing workspaces with mainMod + scroll
bind = $mainMod, mouse_down, workspace, e+1

View File

@@ -13,10 +13,15 @@ windowrule = size 800 600, tag:floating-window
# Force windows to be a floating window
windowrule = tag +floating-window, class:^(blueberry.py|org.gnome.Nautilus|com.ghostty.float)$
# windowrule = float, class:.*pass.proton.me.*
# windowrule = center, class:.*pass.proton.me.*
# windowrule = size 1200 800, class:.*pass.proton.me.*
#
# Force to stay focused when visible.
windowrule = stayfocused, class:(blueberry.py)
windowrule = stayfocused, class:Pinentry.gtk
windowrule = stayfocused, class:com.ghostty.float
# windowrule = stayfocused, class:.*pass.proton.me.*
# Clipboard history tui in floating window.
windowrule = tag +floating-window, class:.*clipse.*
@@ -33,8 +38,5 @@ windowrule = opacity 1.0, class:.*youtube.com.*
# Fix some dragging issues with XWayland
windowrule = nofocus,class:^$,title:^$,xwayland:1,floating:1,fullscreen:0,pinned:0
#windowrule = float, class:.*pass.proton.me.*
workspace = special:hidden, invisible
#windowrule = size 800 600, title:pinentry
workspace = special:pass, class:.*pass.proton.me.*

34
env/.local/scripts/launch-or-focus-webapp vendored Executable file
View File

@@ -0,0 +1,34 @@
#!/usr/bin/env bash
# Launch a web app or focus if it's already open.
if [[ $# == 0 ]]; then
echo "Usage: launch-or-focus-webapp <url>"
exit 1
fi
SCRIPTS="${SCRIPTS}"
if [[ -z $SCRIPTS ]]; then
echo "scripts directory not set"
echo "using ~/.local/scripts"
SCRIPTS=~/.local/scripts
fi
url=$1
# parse domain pattern from the url
pattern=${url#https:\/\/} # removing leading 'https://'
pattern=${pattern#http:\/\/} # removing leading 'http://'
pattern=${pattern%%/*} # removing everything after '/' that's left (which should leave us with the domain)
window=$(hyprctl clients -j | jq -r ".[] | select((.class | contains(\"$pattern\"))) | .address")
echo "Pattern: \"$pattern\""
echo "Window: \"$window\""
if [[ -n $window ]]; then
hyprctl dispatch focuswindow "address:$window"
else
eval exec "$SCRIPTS/launch-webapp $url"
fi

30
env/.local/scripts/proton-pass-manager vendored Executable file
View File

@@ -0,0 +1,30 @@
#!/usr/bin/env bash
# Manages the proton pass web application. If the app is not open then
# it will launch the app (which has a workspace rule that put's it into a
# special workspace). If the app is open then it will toggle the special
# workspace. This allows the application to not close and be able to hide
# and show it quickly using the same keybind that would launch it.
SCRIPTS="${SCRIPTS}"
if [[ -z $SCRIPTS ]]; then
echo "scripts directory not set"
echo "using ~/.local/scripts"
SCRIPTS=~/.local/scripts
fi
pattern="pass.proton.me"
url="https://$pattern"
# Get the window address if it exists.
window_addr=$(hyprctl clients -j | jq -r ".[] | select((.class | contains(\"$pattern\"))) | .address")
if [[ -z $window_addr ]]; then
echo "No window, launching..."
hyprctl dispatch togglespecialworkspace pass
eval exec $SCRIPTS/launch-webapp $url
else
echo "We have a window, toggling special workspace"
hyprctl dispatch togglespecialworkspace pass
fi

6
env/webapps/applemusic.json vendored Normal file
View File

@@ -0,0 +1,6 @@
{
"name": "Apple Music",
"url": "https://music.apple.com",
"icon": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/apple-music.png"
}