mirror of
https://github.com/m-housh/dotfiles.git
synced 2026-02-17 07:32:37 +00:00
Compare commits
4 Commits
cefdf21fc8
...
026a998fc4
| Author | SHA1 | Date | |
|---|---|---|---|
|
026a998fc4
|
|||
|
a7033b749e
|
|||
|
7d4e518479
|
|||
|
2d878f8c63
|
204
env/.config/hypr/keybinds.conf
vendored
204
env/.config/hypr/keybinds.conf
vendored
@@ -3,131 +3,122 @@
|
||||
##############################
|
||||
|
||||
# See https://wiki.hyprland.org/Configuring/Keywords/
|
||||
$mainMod = SUPER # Sets "Command/Windows" key as main modifier
|
||||
$HYPER = ALT SHIFT WIN CTRL
|
||||
|
||||
###################
|
||||
### MY PROGRAMS ###
|
||||
###################
|
||||
$mainMod = SUPER # "Command/Windows" key as main modifier
|
||||
$windowMod = CTRL ALT # Control + Option for window controls.
|
||||
$HYPER = ALT SHIFT SUPER CTRL
|
||||
|
||||
# See https://wiki.hyprland.org/Configuring/Keywords/
|
||||
#
|
||||
# Set programs that you use
|
||||
|
||||
$terminal = ghostty
|
||||
$browser = zen-browser
|
||||
$fileManager = $terminal -e yazi
|
||||
$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
|
||||
$scripts = ~/.local/scripts
|
||||
$pwa = $scripts/launch-webapp
|
||||
$launchOrFocusWebapp = $scripts/launch-or-focus-webapp
|
||||
$tmuxSessionator = $scripts/tmux-sessionator
|
||||
$clipboardHistory = $terminal --class=com.ghostty.float -e $scripts/uninstall-desktop-app
|
||||
$uninstallDesktop = $terminal --class=com.ghostty.float -e $scripts/uninstall-desktop-app
|
||||
$housecallPro = $pwa "https://pro.housecallpro.com/app/calendar_new"
|
||||
|
||||
# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
|
||||
|
||||
# NOTE: TUI's / window rules aren't working with ghostty when you try to target the class
|
||||
# or title so those should be opened with kitty until I can figure out what's happening.
|
||||
|
||||
# Apps
|
||||
bind = $mainMod, Space, exec, $menu # launcher (set above)
|
||||
bind = $mainMod, Return, exec, $terminal
|
||||
bind = $mainMod, A, exec, $pwa "https://chatgpt.com" --class com.chromium.chatgpt
|
||||
bind = $mainMod, B, exec, $browser
|
||||
bind = $mainMod SHIFT, B, exec, $browser --private-window
|
||||
bind = $mainMod, C, exec, $terminal -e ~/.local/share/scripts/tmux-sessionator ~/.config
|
||||
bind = $mainMod, D, exec, $pwa "https://pro.housecallpro.com/app/calendar_new"
|
||||
bind = $mainMod SHIFT, D, exec, ~/.local/scripts/toggle-desktop
|
||||
bind = $mainMod, E, exec, $pwa "https://mail.proton.me"
|
||||
bind = $mainMod SHIFT, E, exec, uwsm app -- thunderbird
|
||||
bind = $mainMod, F, exec, $fileManager
|
||||
#bind = $mainMod, K, exec, $launch Komodo
|
||||
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, $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, ~/.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"
|
||||
bind = $mainMod, U, exec, $pwa "https://unifi.ui.com"
|
||||
bind = $mainMod SHIFT, U, exec, $terminal --class=com.ghostty.float -e ~/.local/scripts/uninstall-desktop-app
|
||||
bind = $mainMod, V, exec, $terminal --class=com.ghostty.clipse -e clipse
|
||||
bind = $mainMod, W, killactive,
|
||||
|
||||
# TODO: change modifier key.
|
||||
#bind = $mainMod SHIFT, L, exec, hyprlock
|
||||
# TODO: change modifier key.
|
||||
#bind = $mainMod, V, togglefloating
|
||||
#bind = $mainMod, P, pseudo, # dwindle
|
||||
######################################################
|
||||
# Apps / hyprland controls
|
||||
#
|
||||
# Screenshots
|
||||
bind = $mainMod SHIFT ALT, 4, exec, hyprshot -m region -o ~/Pictures
|
||||
bind = $mainMod SHIFT ALT, 3, exec, hyprshot -m window -o ~/Pictures
|
||||
# These should in general use the $mainMod prefix
|
||||
######################################################
|
||||
# MOD # KEY # DESC # Action #
|
||||
######################################################
|
||||
|
||||
bind = CTRL, F, fullscreen,
|
||||
bind = ctrl shift, f, exec, ~/.local/scripts/window-toggle-floating
|
||||
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, exec, $pwa "https://chatgpt.com" --class com.chromium.chatgpt
|
||||
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, exec, $housecallPro
|
||||
bindd = $mainMod SHIFT, D, Show [d]esktop / hide all windows, exec, $scripts/toggle-desktop
|
||||
bindd = $mainMod, E, [E]mail - personal, exec, $pwa "https://mail.proton.me"
|
||||
bindd = $mainMod SHIFT, E, [E]mail - work, exec, 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 "https://music.apple.com"
|
||||
bindd = $mainMod SHIFT, M, [M]enu bar - toggle visible, exec, ~/.local/scripts/toggle-waybar
|
||||
bindd = $mainMod, P, [P]assword manager, exec, ~/.local/scripts/proton-pass-manager
|
||||
bindd = $mainMod SHIFT, P, Toggle [p]seudo window mode, pseudo, # dwindle
|
||||
bindd = $mainMod SHIFT, R, [R]estart menu bar, exec, ~/.local/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 "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,
|
||||
|
||||
# Move focus with mainMod + arrow keys
|
||||
bind = $mainMod, H, movefocus, l
|
||||
bind = $mainMod, L, movefocus, r
|
||||
bind = $mainMod, K, movefocus, u
|
||||
bind = $mainMod, J, movefocus, d
|
||||
# Switch to workspaces with mainMod + [0-9]
|
||||
bindd = $mainMod, 1, Switch to workspace [1], workspace, 1
|
||||
bindd = $mainMod, 2, Switch to workspace [2], workspace, 2
|
||||
bindd = $mainMod, 3, Switch to workspace [3], workspace, 3
|
||||
bindd = $mainMod, 4, Switch to workspace [4], workspace, 4
|
||||
bindd = $mainMod, 5, Switch to workspace [5], workspace, 5
|
||||
bindd = $mainMod, 6, Switch to workspace [6], workspace, 6
|
||||
bindd = $mainMod, 7, Switch to workspace [7], workspace, 7
|
||||
bindd = $mainMod, 8, Switch to workspace [8], workspace, 8
|
||||
bindd = $mainMod, 9, Switch to workspace [9], workspace, 9
|
||||
bindd = $mainMod, 0, Switch to workspace 1[0], workspace, 10
|
||||
|
||||
# Move windows with mainMod + Shift
|
||||
bind = $mainMod SHIFT, H, movewindow, l
|
||||
#bind = $mainMod SHIFT, H, swapsplit
|
||||
bind = $mainMod SHIFT, L, movewindow, r
|
||||
bind = $mainMod SHIFT, K, movewindow, u
|
||||
bind = $mainMod SHIFT, J, movewindow, d
|
||||
# Move all workspaces to a monitor
|
||||
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
|
||||
|
||||
bind = $HYPER, J, togglesplit # dwindle
|
||||
####################################################
|
||||
# Window controls
|
||||
#
|
||||
# These should in general use the $windowMod prefix
|
||||
######################################################
|
||||
# MOD # KEY # DESC # Action #
|
||||
######################################################
|
||||
bindd = CTRL SHIFT, F, Toggle [f]loating, exec, $scripts/window-toggle-floating
|
||||
# TODO: Decide which is prefered to switch to fullscreen.
|
||||
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 = $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 = $HYPER, J, Toggle split orientation, togglesplit # dwindle
|
||||
bindd = $windowMod, S, Move window to [s]pecial workspace, movetoworkspacesilent, special:magic
|
||||
|
||||
# FIX: Changes size of window, this works a different depending on if
|
||||
# the window is on the right or left of the screen.
|
||||
#
|
||||
# Resize horizontally
|
||||
bind = $mainMod, EQUAL, resizeactive, 20 0
|
||||
bind = $mainMod, MINUS, resizeactive, -20 0
|
||||
bindd = $windowMod, EQUAL, Increase window size - horizontal, resizeactive, 20 0
|
||||
bindd = $windowMod, MINUS, Decrease window size - horizontal, resizeactive, -20 0
|
||||
# Resize vertically
|
||||
bind = $mainMod SHIFT, EQUAL, resizeactive, 0 20
|
||||
bind = $mainMod SHIFT, MINUS, resizeactive, 0 -20
|
||||
|
||||
# Switch to workspaces with mainMod + [0-9]
|
||||
bind = $mainMod, 1, workspace, 1
|
||||
bind = $mainMod, 2, workspace, 2
|
||||
bind = $mainMod, 3, workspace, 3
|
||||
bind = $mainMod, 4, workspace, 4
|
||||
bind = $mainMod, 5, workspace, 5
|
||||
bind = $mainMod, 6, workspace, 6
|
||||
bind = $mainMod, 7, workspace, 7
|
||||
bind = $mainMod, 8, workspace, 8
|
||||
bind = $mainMod, 9, workspace, 9
|
||||
bind = $mainMod, 0, workspace, 10
|
||||
|
||||
# Move all workspaces to a monitor
|
||||
bind = $HYPER, 0, exec, ~/.local/scripts/mv-all-workspaces-to-monitor 0
|
||||
bind = $HYPER, 1, exec, ~/.local/scripts/mv-all-workspaces-to-monitor 1
|
||||
|
||||
# Move current workspace.
|
||||
# bind = $HYPER, H, movecurrentworkspacetomonitor, 1
|
||||
# bind = $HYPER, L, movecurrentworkspacetomonitor, 0
|
||||
bindd = $windowMod SHIFT, EQUAL, Increase window size - vertical, resizeactive, 0 20
|
||||
bindd = $windowMod SHIFT, MINUS, Decrease window size - vertical, resizeactive, 0 -20
|
||||
|
||||
# Move active window to a workspace with mainMod + SHIFT + [0-9]
|
||||
bind = $mainMod SHIFT, 1, movetoworkspace, 1
|
||||
bind = $mainMod SHIFT, 2, movetoworkspace, 2
|
||||
bind = $mainMod SHIFT, 3, movetoworkspace, 3
|
||||
bind = $mainMod SHIFT, 4, movetoworkspace, 4
|
||||
bind = $mainMod SHIFT, 5, movetoworkspace, 5
|
||||
bind = $mainMod SHIFT, 6, movetoworkspace, 6
|
||||
bind = $mainMod SHIFT, 7, movetoworkspace, 7
|
||||
bind = $mainMod SHIFT, 8, movetoworkspace, 8
|
||||
bind = $mainMod SHIFT, 9, movetoworkspace, 9
|
||||
bind = $mainMod SHIFT, 0, movetoworkspace, 10
|
||||
|
||||
# Example special workspace (scratchpad)
|
||||
bind = $mainMod, S, togglespecialworkspace, magic
|
||||
bind = $mainMod SHIFT, S, movetoworkspacesilent, special:magic
|
||||
bindd = $windowMod, 1, Move window to workspace [1], movetoworkspace, 1
|
||||
bindd = $windowMod, 2, Move window to workspace [2], movetoworkspace, 2
|
||||
bindd = $windowMod, 3, Move window to workspace [3], movetoworkspace, 3
|
||||
bindd = $windowMod, 4, Move window to workspace [4], movetoworkspace, 4
|
||||
bindd = $windowMod, 5, Move window to workspace [5], movetoworkspace, 5
|
||||
bindd = $windowMod, 6, Move window to workspace [6], movetoworkspace, 6
|
||||
bindd = $windowMod, 7, Move window to workspace [7], movetoworkspace, 7
|
||||
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
|
||||
|
||||
# Scroll through existing workspaces with mainMod + scroll
|
||||
bind = $mainMod, mouse_down, workspace, e+1
|
||||
@@ -138,7 +129,9 @@ bindm = $mainMod, mouse:272, movewindow
|
||||
bindm = $mainMod, mouse:273, resizewindow
|
||||
bindm = $mainMod SHIFT, mouse_down, resizewindow
|
||||
|
||||
|
||||
##################################################
|
||||
# Multi-media keys
|
||||
##################################################
|
||||
# Laptop multimedia keys for volume and LCD brightness
|
||||
bindel = ,XF86AudioRaiseVolume, exec, wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+
|
||||
bindel = ,XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-
|
||||
@@ -153,8 +146,3 @@ bindl = , XF86AudioPause, exec, playerctl play-pause
|
||||
bindl = , XF86AudioPlay, exec, playerctl play-pause
|
||||
bindl = , XF86AudioPrev, exec, playerctl previous
|
||||
|
||||
# Shut off laptop monitor when lid is closed and on when lid is open.
|
||||
# bindl = , switch:on:Lid Switch, exec, hyprctl dispatch dpms off
|
||||
# bindl = , switch:off:Lid Switch, exec, hyprctl dispatch dpms on
|
||||
|
||||
|
||||
|
||||
102
env/.local/scripts/launch-webapp
vendored
102
env/.local/scripts/launch-webapp
vendored
@@ -1,7 +1,103 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Adapted from https://github.com/basecamp/omarchy/tree/master?tab=readme-ov-file
|
||||
#
|
||||
browser="chromium.desktop"
|
||||
# Launch a web application, can handle "singleton" applications in special
|
||||
# workspaces using the '--special <name>' option, focus an existing window
|
||||
# matching the url using '--focus' option, or always launch a new instance
|
||||
# if only the url is passed in.
|
||||
#
|
||||
|
||||
exec setsid uwsm app -- $(sed -n 's/^Exec=\([^ ]*\).*/\1/p' {~/.local,~/.nix-profile,/usr}/share/applications/$browser 2>/dev/null | head -1) --app="$1" "${@:2}"
|
||||
browser="chromium.desktop"
|
||||
special=""
|
||||
special_flag="0"
|
||||
focus_flag="0"
|
||||
url=""
|
||||
args=()
|
||||
SCRIPTS="${SCRIPTS}"
|
||||
|
||||
if [[ -z $SCRIPTS ]]; then
|
||||
echo "scripts directory not set"
|
||||
echo "using ~/.local/scripts"
|
||||
SCRIPTS=~/.local/scripts
|
||||
fi
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
if [[ $1 =~ ^--special ]] || [[ $1 =~ ^-s ]]; then
|
||||
shift
|
||||
special_flag="1"
|
||||
special=$1
|
||||
elif [[ $1 =~ ^--focus ]] || [[ $1 =~ ^-f ]]; then
|
||||
focus_flag="1"
|
||||
elif [[ -z $url ]]; then
|
||||
url=$1
|
||||
else
|
||||
args+=($1)
|
||||
fi
|
||||
shift
|
||||
done
|
||||
|
||||
launch() {
|
||||
exec setsid uwsm app -- $(sed -n 's/^Exec=\([^ ]*\).*/\1/p' {~/.local,~/.nix-profile,/usr}/share/applications/$browser 2>/dev/null | head -1) --app="$1" "$2"
|
||||
}
|
||||
|
||||
pattern() {
|
||||
pattern=${url/#https:\/\//}
|
||||
pattern=${pattern/#http:\/\//}
|
||||
pattern=${pattern%/*}
|
||||
echo $pattern
|
||||
}
|
||||
|
||||
getWindowProp() {
|
||||
echo $(hyprctl clients -j | jq -r ".[] | select((.class | contains(\"$(pattern)\"))) | .$1")
|
||||
}
|
||||
|
||||
handleSpecial() {
|
||||
local window_addr=$(getWindowProp address)
|
||||
local window_workspace=$(getWindowProp workspace.id)
|
||||
local special_workspace_id=$(hyprctl workspaces -j | jq -r ".[] | select(.name | contains(\"$special\")) | .id")
|
||||
|
||||
echo "Window: address: $window_addr workspace: $window_workspace"
|
||||
echo "Special workspace: $special_workspace_id"
|
||||
|
||||
# Check if we don't have a window address, or if the window is not on the expected special workspace.
|
||||
if [[ -z $window_addr ]] || ([[ -n $window_workspace ]] && [[ $window_workspace != $special_workspace_id ]]); then
|
||||
echo "No window, launching..."
|
||||
hyprctl dispatch togglespecialworkspace $special
|
||||
launch $url $args
|
||||
else
|
||||
echo "We have a window, toggling special workspace"
|
||||
hyprctl dispatch togglespecialworkspace pass
|
||||
fi
|
||||
}
|
||||
|
||||
if [[ -z $url ]]; then
|
||||
# TODO: Usage message.
|
||||
echo "Must supply a url."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $special_flag == "1" ]]; then
|
||||
echo "Handling special workspace..."
|
||||
if [[ -z $special ]]; then
|
||||
echo "Must supply special workspace name."
|
||||
exit 1
|
||||
fi
|
||||
handleSpecial
|
||||
exit 0
|
||||
fi
|
||||
|
||||
window_addr=""
|
||||
|
||||
if [[ $focus_flag == "1" ]]; then
|
||||
echo "Received focus flag, checking for window address."
|
||||
window_addr=$(getWindowProp address)
|
||||
echo "addr: $window_addr"
|
||||
fi
|
||||
|
||||
if [[ -n $window_addr ]]; then
|
||||
hyprctl dispatch focuswindow "address:$window_addr"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
launch $url $args
|
||||
|
||||
Reference in New Issue
Block a user