feat: Adds apple calendar web app, updates close-all-windows script to work on workspaces.

This commit is contained in:
2025-10-02 09:38:58 -04:00
parent eb4c6990ec
commit 0b166ad757
4 changed files with 126 additions and 50 deletions

View File

@@ -4,6 +4,7 @@
# See https://wiki.hyprland.org/Configuring/Keywords/
$mainMod = SUPER # "Command/Windows" key as main modifier
# TODO: Use 'ALT' as window mod, need to change some tmux keybinds to do so.
$windowMod = CTRL ALT # Control + Option for window controls.
$HYPER = ALT SHIFT SUPER CTRL
@@ -27,9 +28,9 @@ $housecallPro = https://pro.housecallpro.com/app/calendar_new
# Apps / hyprland controls
#
# These should in general use the $mainMod prefix
#######################################################################################
##############################################################################################
# MOD # KEY # DESC # Action #
#######################################################################################
##############################################################################################
bindd = $mainMod, Space, Application launcher, exec, $menu
bindd = $mainMod, Return, New terminal, exec, $terminal
@@ -38,7 +39,8 @@ bindd = $mainMod, A, Chat-gpt [a]i - launch / focus, exec, $pwa -
bindd = $mainMod, A, Chat-gpt [a]i - new window, exec, $pwa "https://chatgpt.com"
bindd = $mainMod, B, New [b]rowser, exec, $browser
bindd = $mainMod SHIFT, B, New private [b]rowser, exec, $browser --private-window
bindd = $mainMod, C, [C]onfig folder in tmux session, exec, $terminal -e $tmuxSessionator ~/.config
bindd = $mainMod, C, [C]alendar, exec, $pwa --focus "https://www.icloud.com/calendar"
bindd = $mainMod SHIFT, C, [C]onfig folder in tmux session, exec, $terminal -e $tmuxSessionator ~/.config
bindd = $mainMod, D, [D]ispatch app - special workspace, exec, $pwa --special dispatch $housecallPro
bindd = $mainMod SHIFT, D, [D]ispatch app - new window, exec, $pwa $housecallPro
bindd = $mainMod, E, [E]mail - personal, exec, $pwa --focus "https://mail.proton.me"
@@ -52,7 +54,6 @@ bindd = $mainMod, J, Focus window - down, movefocus, d
bindd = $mainMod, K, Focus window - up, movefocus, u # move window focus using vim keys
bindd = $mainMod, L, Focus window - right, movefocus, r # move window focus using vim keys
bindd = $mainMod SHIFT, L, Workspace - forward, workspace, +1
bindd = $HYPER, L, [L]ock computer, exec, hyprlock
bindd = $mainMod, M, [M]usic - apple, exec, $pwa --special music "https://music.apple.com"
bindd = $mainMod SHIFT, M, [M]enu bar - toggle visible, exec, $scripts/toggle-waybar
bindd = $mainMod, P, [P]assword manager, exec, $pwa --special pass "https://pass.proton.me"
@@ -64,6 +65,7 @@ bindd = $mainMod, U, [U]nifi, exec, $pwa "
bindd = $mainMod SHIFT, U, [U]ninstall desktop app, exec, $uninstallDesktop
bindd = $mainMod, V, Clipboard history, exec, $clipboardHistory
bindd = $mainMod, W, Close current window, killactive,
bindd = $mainMod SHIFT, W, Close all windows in active workspace, exec, $scrpts/close-all-windows --active-workspace
# Switch to workspaces with mainMod + [0-9]
bindd = $mainMod, 1, Switch to workspace [1], workspace, 1
@@ -81,6 +83,15 @@ bindd = $mainMod, 0, Switch to workspace 1[0], workspace, 10
bindd = $mainMod SHIFT, 1, Switch all workspaces to monitor [1], exec, $scripts/mv-all-workspaces-to-monitor 1
bindd = $mainMod SHIFT, 0, Switch all workspaces to monitor [0], exec, $scripts/mv-all-workspaces-to-monitor 0
# Scroll through existing workspaces with mainMod + scroll
bind = $mainMod, mouse_down, workspace, e+1
bind = $mainMod, mouse_up, workspace, e-1
# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow
bindm = $mainMod SHIFT, mouse_down, resizewindow
#######################################################################################
# Window controls
#
@@ -94,7 +105,6 @@ bindd = CTRL, F, Toggle [f]ullscreen, fullscreen,
bindd = $windowMod, F, Toggle [f]ullscreen, fullscreen,
bindd = $windowMod, H, Move window - left, movewindow, l # move windows with windowMod + vim keys
bindd = $windowMod, J, Move window - down, movewindow, d # move windows with windowMod + vim keys
bindd = $HYPER, J, Toggle split orientation, togglesplit # dwindle
bindd = $windowMod, K, Move window - up, movewindow, u # move windows with windowMod + vim keys
bindd = $windowMod, L, Move window - right , movewindow, r # move windows with windowMod + vim keys
bindd = $windowMod, M, Move window to [m]usic workspace, movetoworkspace, special:music
@@ -121,6 +131,18 @@ bindd = $windowMod, 8, Move window to workspace [8], movetoworkspace, 8
bindd = $windowMod, 9, Move window to workspace [9], movetoworkspace, 9
bindd = $windowMod, 0, Move window to workspace 1[0], movetoworkspace, 10
#######################################################################################
# HYPER controls
#
# These should in general use the $HYPER prefix
#######################################################################################
# MOD # KEY # DESC # Action #
#######################################################################################
bindd = $HYPER, J, Toggle split orientation, togglesplit # dwindle
bindd = $HYPER, L, [L]ock computer, exec, hyprlock
bindd = $HYPER, W, Close all windows, exec, $scripts/close-all-windows
# Move active window to a workspace silently with HYPER + [0-9]
bindd = $HYPER, 1, Move window to workspace silent [1], movetoworkspacesilent, 1
bindd = $HYPER, 2, Move window to workspace silent [2], movetoworkspacesilent, 2
@@ -133,15 +155,6 @@ bindd = $HYPER, 8, Move window to workspace silent [8], movetoworkspacesilent, 8
bindd = $HYPER, 9, Move window to workspace silent [9], movetoworkspacesilent, 9
bindd = $HYPER, 0, Move window to workspace silent 1[0], movetoworkspacesilent, 10
# Scroll through existing workspaces with mainMod + scroll
bind = $mainMod, mouse_down, workspace, e+1
bind = $mainMod, mouse_up, workspace, e-1
# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow
bindm = $mainMod SHIFT, mouse_down, resizewindow
##################################################
# Multi-media keys
##################################################

View File

@@ -1,5 +1,62 @@
#!/bin/bash
#!/usr/bin/env bash
hyprctl clients -j | \
jq '.[] | .address' | \
xargs -I{} hyprctl dispatch closewindow address:{}
usage() {
cat <<EOF
Close all windows for a workspace id, special workspace name, or all windows.
USAGE:
$ close-all-windows [OPTIONS] <ID (optional)>
OPTIONS:
-a | --active-workspace: Close all windows in the active workspace.
-s | --special <name>: The name of the special workspace.
-h | --help: Show this help page.
NOTE:
If no options or workspace id is passed in, it will close all windows in all workspaces.
EOF
}
special_flag="0"
workspace_name=""
workspace_id=""
windows=()
while [[ $# -gt 0 ]]; do
if [[ $1 =~ ^-s ]] || [[ $1 =~ ^--special ]]; then
shift
special_flag="1"
workspace_name=$1
elif [[ $1 =~ ^-h ]] || [[ $1 =~ ^--help ]]; then
usage && exit 0
elif [[ $1 =~ ^-a ]] || [[ $1 =~ ^--active-workspace ]]; then
workspace_id=$(hyprctl activeworkspace -j | jq -r '.id')
else
workspace_id=$1
fi
shift
done
if [[ $special_flag == "1" ]] && [[ -z $workspace_name ]]; then
echo -e "\n[ERROR]: must supply name of the special workspace.\n"
usage && exit 1
fi
if [[ -n $workspace_id ]]; then
windows+=($(hyprctl clients -j | jq -r ".[] | select(.workspace.id == $workspace_id) | .address"))
elif [[ -n $workspace_name ]]; then
windows+=($(hyprctl clients -j | jq -r ".[] | select(.workspace.name | contains(\"$workspace_name\")) | .address"))
else
windows+=($(hyprctl clients -j | jq -r ".[] | .address"))
fi
for w in ${windows[@]}; do
echo "Closing window address: $w"
hyprctl dispatch closewindow address:$w
done

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 KiB

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

@@ -0,0 +1,6 @@
{
"name": "Apple Calendar",
"url": "https://www.icloud.com/calendar",
"icon": "calendar.png"
}