diff --git a/env/.config/hypr/keybinds.conf b/env/.config/hypr/keybinds.conf index 2f5ff9d..e3f7d08 100644 --- a/env/.config/hypr/keybinds.conf +++ b/env/.config/hypr/keybinds.conf @@ -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,43 +28,44 @@ $housecallPro = https://pro.housecallpro.com/app/calendar_new # Apps / hyprland controls # # These should in general use the $mainMod prefix -####################################################################################### -# MOD # KEY # DESC # Action # -####################################################################################### +############################################################################################## +# MOD # KEY # DESC # Action # +############################################################################################## -bindd = $mainMod, Space, Application launcher, exec, $menu -bindd = $mainMod, Return, New terminal, exec, $terminal -bindd = $mainMod SHIFT, Return, New floating terminal, exec, $terminal --class=com.ghostty.float -bindd = $mainMod, A, Chat-gpt [a]i - launch / focus, exec, $pwa --focus "https://chatgpt.com" -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, 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" -bindd = $mainMod SHIFT, E, [E]mail - work, exec, $scripts/launch-or-focus thunderbird uwsm app -- thunderbird -bindd = $mainMod, F, [F]ile manager - terminal, exec, $fileManager -bindd = $mainMod SHIFT, F, [F]ile manager - application, exec, $fileBrowser -bindd = $mainMod, G, [G]itea, exec, $pwa "https://git.housh.dev" -bindd = $mainMod, H, Focus window - left, movefocus, l # move window focus using vim keys -bindd = $mainMod SHIFT, H, Workspace - back, workspace, -1 -bindd = $mainMod, J, Focus window - down, movefocus, d # move window focus using vim keys -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" -bindd = $mainMod SHIFT, P, Toggle [p]seudo window mode, pseudo, # dwindle -bindd = $mainMod SHIFT, R, [R]estart menu bar, exec, $scripts/waybar-restart -bindd = $mainMod, S, Toggle [s]pecial workspace, togglespecialworkspace, magic # use $windowMod S to send window to the special workspace -bindd = $mainMod, Y, [Y]ouTube, exec, $pwa --focus "https://youtube.com" -bindd = $mainMod, U, [U]nifi, exec, $pwa "https://unifi.ui.com" -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, Space, Application launcher, exec, $menu +bindd = $mainMod, Return, New terminal, exec, $terminal +bindd = $mainMod SHIFT, Return, New floating terminal, exec, $terminal --class=com.ghostty.float +bindd = $mainMod, A, Chat-gpt [a]i - launch / focus, exec, $pwa --focus "https://chatgpt.com" +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]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" +bindd = $mainMod SHIFT, E, [E]mail - work, exec, $scripts/launch-or-focus thunderbird uwsm app -- thunderbird +bindd = $mainMod, F, [F]ile manager - terminal, exec, $fileManager +bindd = $mainMod SHIFT, F, [F]ile manager - application, exec, $fileBrowser +bindd = $mainMod, G, [G]itea, exec, $pwa "https://git.housh.dev" +bindd = $mainMod, H, Focus window - left, movefocus, l # move window focus using vim keys +bindd = $mainMod SHIFT, H, Workspace - back, workspace, -1 +bindd = $mainMod, J, Focus window - down, movefocus, d # move window focus using vim keys +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 = $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" +bindd = $mainMod SHIFT, P, Toggle [p]seudo window mode, pseudo, # dwindle +bindd = $mainMod SHIFT, R, [R]estart menu bar, exec, $scripts/waybar-restart +bindd = $mainMod, S, Toggle [s]pecial workspace, togglespecialworkspace, magic # use $windowMod S to send window to the special workspace +bindd = $mainMod, Y, [Y]ouTube, exec, $pwa --focus "https://youtube.com" +bindd = $mainMod, U, [U]nifi, exec, $pwa "https://unifi.ui.com" +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 ################################################## diff --git a/env/.local/scripts/close-all-windows b/env/.local/scripts/close-all-windows index 8e64b99..dc3e233 100755 --- a/env/.local/scripts/close-all-windows +++ b/env/.local/scripts/close-all-windows @@ -1,5 +1,62 @@ -#!/bin/bash +#!/usr/bin/env bash -hyprctl clients -j | \ - jq '.[] | .address' | \ - xargs -I{} hyprctl dispatch closewindow address:{} +usage() { + cat < + +OPTIONS: + -a | --active-workspace: Close all windows in the active workspace. + -s | --special : 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 diff --git a/env/.local/share/applications/icons/calendar.png b/env/.local/share/applications/icons/calendar.png new file mode 100644 index 0000000..5cebec8 Binary files /dev/null and b/env/.local/share/applications/icons/calendar.png differ diff --git a/env/webapps/applecalendar.json b/env/webapps/applecalendar.json new file mode 100644 index 0000000..19868e8 --- /dev/null +++ b/env/webapps/applecalendar.json @@ -0,0 +1,6 @@ +{ + "name": "Apple Calendar", + "url": "https://www.icloud.com/calendar", + "icon": "calendar.png" +} +