5 Commits

12 changed files with 176 additions and 90 deletions

View File

@@ -3,7 +3,7 @@ theme = Catppuccin Mocha
confirm-close-surface = false confirm-close-surface = false
font-family = "Fira Code" font-family = "Fira Code"
font-size = 13 font-size = 18
font-thicken = false font-thicken = false
window-save-state = always window-save-state = always

View File

@@ -41,9 +41,9 @@ bindd = $mainMod, A, [A]i - launch / focus, exec,
bindd = $mainMod SHIFT, A, [A]i - new window, exec, $pwa "https://ollama.housh.dev" bindd = $mainMod SHIFT, A, [A]i - new window, exec, $pwa "https://ollama.housh.dev"
bindd = $mainMod, B, New [b]rowser, exec, $browser bindd = $mainMod, B, New [b]rowser, exec, $browser
bindd = $mainMod SHIFT, B, New private [b]rowser, exec, $browser --incognito bindd = $mainMod SHIFT, B, New private [b]rowser, exec, $browser --incognito
bindd = $mainMod, C, [C]alendar, exec, $pwa --or-focus "https://www.icloud.com/calendar" bindd = $mainMod, C, [C]alendar, togglespecialworkspace, calendar
bindd = $mainMod SHIFT, C, [C]onfig folder in tmux session, exec, $terminal -e $tmuxSessionator ~/.config 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, D, [D]ispatch app - special workspace, togglespecialworkspace, dispatch
bindd = $mainMod SHIFT, D, [D]ispatch app - new window, exec, $pwa --new $housecallPro bindd = $mainMod SHIFT, D, [D]ispatch app - new window, exec, $pwa --new $housecallPro
bindd = $mainMod, E, [E]mail - personal, exec, $pwa --or-focus "https://mail.proton.me" bindd = $mainMod, E, [E]mail - personal, exec, $pwa --or-focus "https://mail.proton.me"
bindd = $mainMod SHIFT, E, [E]mail - work, exec, $scripts/launch --or-focus thunderbird uwsm app -- thunderbird bindd = $mainMod SHIFT, E, [E]mail - work, exec, $scripts/launch --or-focus thunderbird uwsm app -- thunderbird
@@ -58,10 +58,10 @@ bindd = $mainMod, J, Focus window - down, movefo
bindd = $mainMod, K, Focus window - up, movefocus, u # 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, L, Focus window - right, movefocus, r # move window focus using vim keys
bindd = $mainMod SHIFT, L, Workspace - forward, workspace, +1 bindd = $mainMod SHIFT, L, Workspace - forward, workspace, +1
bindd = $mainMod, M, [M]usic - apple, exec, $pwa --special music "https://music.apple.com" bindd = $mainMod, M, [M]usic - jellyfin-tui, togglespecialworkspace, music
bindd = $mainMod SHIFT, M, [M]enu bar - toggle visible, exec, $scripts/waybarctl --toggle bindd = $mainMod SHIFT, M, [M]enu bar - toggle visible, exec, $scripts/waybarctl --toggle
bindd = $mainMod, O, Purchase [o]rders, exec, $pwa --special dispatch "https://po.housh.dev" bindd = $mainMod, O, Purchase [o]rders, exec, $pwa --special dispatch "https://po.housh.dev"
bindd = $mainMod, P, [P]assword manager, exec, $pwa --special pass "https://pass.proton.me" bindd = $mainMod, P, [P]assword manager, togglespecialworkspace, pass
bindd = $mainMod SHIFT, P, [P]hotos, exec, $pwa --or-focus "https://photos.housh.dev" bindd = $mainMod SHIFT, P, [P]hotos, exec, $pwa --or-focus "https://photos.housh.dev"
bindd = $mainMod SHIFT, R, [R]estart menu bar, exec, $scripts/waybarctl --restart bindd = $mainMod SHIFT, R, [R]estart menu bar, exec, $scripts/waybarctl --restart
bindd = $mainMod, S, Toggle [s]pecial workspace, togglespecialworkspace, magic # use $windowMod S to send window to the special workspace bindd = $mainMod, S, Toggle [s]pecial workspace, togglespecialworkspace, magic # use $windowMod S to send window to the special workspace

View File

@@ -9,6 +9,7 @@
source = ~/.config/hypr/hyprenv.conf source = ~/.config/hypr/hyprenv.conf
source = ~/.config/hypr/hyprmonitors.conf source = ~/.config/hypr/hyprmonitors.conf
source = ~/.config/hypr/hyprwindows.conf source = ~/.config/hypr/hyprwindows.conf
source = ~/.config/hypr/hyprworkspaces.conf
source = ~/.config/hypr/hyprkeybinds.conf source = ~/.config/hypr/hyprkeybinds.conf
source = ~/.config/hypr/hyprinput.conf source = ~/.config/hypr/hyprinput.conf
source = ~/.config/hypr/hyprautostart.conf source = ~/.config/hypr/hyprautostart.conf

View File

@@ -1,10 +1,8 @@
############################## ###############
### WINDOWS AND WORKSPACES ### ### WINDOWS ###
############################## ###############
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
# See https://wiki.hyprland.org/Configuring/Workspace-Rules/ for workspace rules
#
windowrule = float, tag:floating-window windowrule = float, tag:floating-window
windowrule = center, tag:floating-window windowrule = center, tag:floating-window
@@ -43,10 +41,6 @@ windowrule = opacity 1.0, class:.*youtube.com.*
# Fix some dragging issues with XWayland # Fix some dragging issues with XWayland
windowrule = nofocus,class:^$,title:^$,xwayland:1,floating:1,fullscreen:0,pinned:0 windowrule = nofocus,class:^$,title:^$,xwayland:1,floating:1,fullscreen:0,pinned:0
workspace = special:hidden, invisible
workspace = special:pass, class:.*pass.proton.me.*
workspace = special:dispatch, class:.*pro.housecallpro.com.*
# To get more information about a windows class, title, XWayland status or its size, you can use `hyprctl clients`. (From Hyprland Wiki) # To get more information about a windows class, title, XWayland status or its size, you can use `hyprctl clients`. (From Hyprland Wiki)
windowrulev2 = float,class:^(one.alynx.showmethekey)$ windowrulev2 = float,class:^(one.alynx.showmethekey)$
windowrulev2 = float,class:^(showmethekey-gtk)$ # make window floating windowrulev2 = float,class:^(showmethekey-gtk)$ # make window floating

15
env/.config/hypr/hyprworkspaces.conf vendored Normal file
View File

@@ -0,0 +1,15 @@
##################
### WORKSPACES ###
##################
# See https://wiki.hyprland.org/Configuring/Workspace-Rules/ for workspace rules
$scripts = ~/.local/scripts/hypr
$pwa = $scripts/webapp launch
$housecallPro = $pwa "https://pro.housecallpro.com/app/calendar_new"
workspace = special:hidden, invisible
workspace = special:pass,on-created-empty: $pwa "https://pass.proton.me"
workspace = special:dispatch,on-created-empty: $housecallPro && $housecallPro
workspace = special:music,on-created-empty: ghostty --class=com.ghostty.music -e jellyfin-tui
workspace = special:calendar,on-created-empty: uwsm app -- gnome-calendar

View File

@@ -11,7 +11,7 @@ THIS=$(basename "$THIS_FILE")
LOG_FILE=${LOG_FILE:-"$LOG_LABEL.log"} LOG_FILE=${LOG_FILE:-"$LOG_LABEL.log"}
usage() { usage() {
cat <<EOF cat <<EOF
Launch or focus / close a window based on pattern contained within the window Launch or focus / close a window based on pattern contained within the window
class name. (Default is to focus the window). class name. (Default is to focus the window).
@@ -61,57 +61,57 @@ special_flag="0"
special="" special=""
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
if [[ $1 == "-c" ]] || [[ $1 == "--or-close" ]]; then if [[ $1 == "-c" ]] || [[ $1 == "--or-close" ]]; then
close_flag="1" close_flag="1"
action="closewindow" action="closewindow"
elif [[ $1 == "-f" ]] || [[ $1 == "--or-focus" ]]; then elif [[ $1 == "-f" ]] || [[ $1 == "--or-focus" ]]; then
focus_flag="1" focus_flag="1"
action="focuswindow" action="focuswindow"
elif [[ $1 == "-s" ]] || [[ $1 == "--special" ]]; then elif [[ $1 == "-s" ]] || [[ $1 == "--special" ]]; then
shift shift
special_flag="1" special_flag="1"
special=$1 special=$1
elif [[ $1 == "-o" ]] || [[ $1 == "--focus-active-only" ]]; then elif [[ $1 == "-o" ]] || [[ $1 == "--focus-active-only" ]]; then
focus_flag="1" focus_flag="1"
focus_active_only_flag="1" focus_active_only_flag="1"
action="focuswindow" action="focuswindow"
elif [[ $1 == "-x" ]] || [[ $1 == "--close-active-only" ]]; then elif [[ $1 == "-x" ]] || [[ $1 == "--close-active-only" ]]; then
close_flag="1" close_flag="1"
close_active_only_flag="1" close_active_only_flag="1"
action="closewindow" action="closewindow"
elif [[ $1 == "-n" ]] || [[ $1 == "--new" ]]; then elif [[ $1 == "-n" ]] || [[ $1 == "--new" ]]; then
new_instance_flag="1" new_instance_flag="1"
elif [[ $1 == "-h" ]] || [[ $1 == "--help" ]]; then elif [[ $1 == "-h" ]] || [[ $1 == "--help" ]]; then
usage && exit 0 usage && exit 0
elif [[ -z $pattern ]]; then elif [[ -z $pattern ]]; then
pattern=$1 pattern=$1
else else
launch_cmd+=("$1") launch_cmd+=("$1")
fi fi
shift shift
done done
log() { log() {
logging log --source "$THIS_FILE" "$@" logging log --source "$THIS_FILE" "$@"
} }
# Redirects all output of hyprctl dispatch commands. # Redirects all output of hyprctl dispatch commands.
hypr_dispatch() { hypr_dispatch() {
hyprctl dispatch "$@" >/dev/null 2>&1 hyprctl dispatch "$@" >/dev/null 2>&1
} }
toggle_special() { toggle_special() {
if [[ -z $special ]]; then if [[ -z $special ]]; then
log --error " No name supplied for special workspace." log --error " No name supplied for special workspace."
exit 1 exit 1
fi fi
hypr_dispatch togglespecialworkspace $special hypr_dispatch togglespecialworkspace $special
} }
launch_application() { launch_application() {
log "Launching..." log "Launching..."
log "'${launch_cmd[@]}'" log "'${launch_cmd[*]}'"
eval exec ${launch_cmd[@]} eval exec "${launch_cmd[*]}"
} }
################################################################################ ################################################################################
@@ -123,11 +123,11 @@ source "$SCRIPTS/hypr/logging"
setup-logging "$LOG_FILE" "$LOG_LABEL" setup-logging "$LOG_FILE" "$LOG_LABEL"
if [[ -z $pattern ]]; then if [[ -z $pattern ]]; then
log --error "Must supply a pattern to match the window class." log --error "Must supply a pattern to match the window class."
usage && exit 1 usage && exit 1
elif [[ -z $launch_cmd ]]; then elif [[ -z $launch_cmd ]]; then
log --error "Must supply a launch command to match the window class." log --error "Must supply a launch command to match the window class."
usage && exit 1 usage && exit 1
fi fi
log "Pattern: $pattern" log "Pattern: $pattern"
@@ -135,13 +135,13 @@ addresses=$(hyprctl clients -j | jq ".[] | select(.class | contains(\"$pattern\"
# If no addresses, then launch the application. # If no addresses, then launch the application.
if [[ -z $addresses ]] || [[ $new_instance_flag == "1" ]]; then if [[ -z $addresses ]] || [[ $new_instance_flag == "1" ]]; then
log "No addresses found or new instance flag set." log "No addresses found or new instance flag set."
# Toggle special workspace if applicable. # Toggle special workspace if applicable.
if [[ $special_flag == "1" ]]; then if [[ $special_flag == "1" ]]; then
log "Toggling special workspace." log "Toggling special workspace."
toggle_special toggle_special
fi fi
launch_application && exit 0 launch_application && exit 0
fi fi
active_window_workspace=$(hyprctl activewindow -j | jq -r '.workspace.name') active_window_workspace=$(hyprctl activewindow -j | jq -r '.workspace.name')
@@ -150,45 +150,45 @@ active_window_workspace=$(hyprctl activewindow -j | jq -r '.workspace.name')
# we just toggle the special workspace. This keeps "special" apps alive, but closes and / opens # we just toggle the special workspace. This keeps "special" apps alive, but closes and / opens
# the special workspace when invoked. # the special workspace when invoked.
if [[ $special_flag == "1" ]] && [[ $active_window_workspace =~ $special ]]; then if [[ $special_flag == "1" ]] && [[ $active_window_workspace =~ $special ]]; then
toggle_special && exit 0 toggle_special && exit 0
fi fi
# Check if both close and focus flags were passed, so we don't do the # Check if both close and focus flags were passed, so we don't do the
# wrong thing. # wrong thing.
if [[ $focus_flag == "1" ]] && [[ $close_flag == "1" ]]; then if [[ $focus_flag == "1" ]] && [[ $close_flag == "1" ]]; then
log --error "Both focus and close flag were passed." log --error "Both focus and close flag were passed."
exit 1 exit 1
fi fi
for address in ${addresses[@]}; do for address in ${addresses[@]}; do
# Clean the address of quotes. # Clean the address of quotes.
address=${address//\"/} address=${address//\"/}
log "Handling address: '$address'" log "Handling address: '$address'"
if [[ $focus_active_only_flag == "1" ]] || [[ $close_active_only_flag == "1" ]]; then if [[ $focus_active_only_flag == "1" ]] || [[ $close_active_only_flag == "1" ]]; then
# get the workspace name for the address. # get the workspace name for the address.
workspace=$(hyprctl clients -j | jq -r ".[] | select(.address == \"$address\") | .workspace.name") workspace=$(hyprctl clients -j | jq -r ".[] | select(.address == \"$address\") | .workspace.name")
# check that the window is on the active workspace. # check that the window is on the active workspace.
if [[ $active_window_workspace == $workspace ]]; then if [[ $active_window_workspace == $workspace ]]; then
log "Performing action: '$action', on window: '$address'" log "Performing action: '$action', on window: '$address'"
hypr_dispatch $action "address:$address" hypr_dispatch $action "address:$address"
# early out if focusing a window. # early out if focusing a window.
[[ $focus_active_only_flag ]] && exit 0 [[ $focus_active_only_flag ]] && exit 0
else else
# the window is not on the active workspace, so skip it. # the window is not on the active workspace, so skip it.
log "Skipping window: $address" log "Skipping window: $address"
fi fi
else else
# We don't have the focus_active_only_flag or close_active_only_flag set, so we perform # We don't have the focus_active_only_flag or close_active_only_flag set, so we perform
# the action on the window. # the action on the window.
log "Performing action: '$action', on window: '$address'" log "Performing action: '$action', on window: '$address'"
hypr_dispatch $action "address:$address" hypr_dispatch $action "address:$address"
fi fi
done done
# If we made it here and focus_active_only_flag was set, then we did not # If we made it here and focus_active_only_flag was set, then we did not
# find a window on the active workspace, so we launch a new window. # find a window on the active workspace, so we launch a new window.
if [[ $focus_active_only_flag == "1" ]]; then if [[ $focus_active_only_flag == "1" ]]; then
launch_application launch_application
fi fi

11
env/jellyfin-tui/config.gpg vendored Normal file
View File

@@ -0,0 +1,11 @@
-----BEGIN PGP MESSAGE-----
hF4DAAAAAAAAAAASAQdATOWmZnUO2KsVWqDMIPkJPBvEskExyaYdpYxcl4xqwyUw
8rPCTjCdJSbB36d7ly5+UaayXBZFn2IrGXfai7+IP11G92ocj4a8xHSwKZX9mSd8
0sABAVlTrLOO4BVWBpGnAsagfzXMGyYPi843KdnZg43b4IAx3hdR46NnjfjGjAZc
Ggf4kC+DuTT+Y0BRH8qRLU6kizxRvi13GEnxt0sTQqhNRA+hLbkXYWlZ3fLnf6YD
CIpMYowZmqwd6KH3ofFeNr+E5+HAaygU/61VH2pkZRzwwltiEZ4aQ+eWULELs6BF
z7nIB49nOZi2m7boSVVnfmknD6Z/QwZSmqakySZRlNNC19IqEoDl02H5cgHCNbQV
cTnyHQ==
=LRvL
-----END PGP MESSAGE-----

12
env/qcal/config.json.gpg vendored Normal file
View File

@@ -0,0 +1,12 @@
-----BEGIN PGP MESSAGE-----
hF4DAAAAAAAAAAASAQdAuiXPHaZd/bWttw/D3LtIXio0V9z5aKrqAKDCHofqDmow
F90ZOG8wwm3wsmoTSswSifiUUE8AK96ATgphvlxIf/bH+X9pVUPlgZRCPYR7hteI
0sBbAWWIYpJA43P5ndpuIUGiGwthRyxQLwWRVFkfZ5v5HLsf0FMVfO2f1azzape9
i+0Dz6XoTkDzmApQO46NrOHoI83RUQ7Tbe+AElnDfJT6tj2YaajkCPnvnqO55z54
38XOIP3t3eOt+JFugiJDblZCAI/fdzhxCAmqzyU0QZOR3Yl8B/d/8g1PQjPAObiG
F+spskYpIXZ0U+YNne4PWThhk0tMgq2rJUovQ6kCGjCnPnRR41UWBkGciXfvOR39
BbrBK4wsBTRmrM3Hvs41sZlYkIc6mS/PEs1H7gId8vKt3BGqTHN39+qv6aoSwbi8
GaNSRSuuMRsQnnUXBzgilXEnWA2oYncSD8pcorPDAe/gaRNV5+/dpQJrYjbYig==
=8rxb
-----END PGP MESSAGE-----

31
runs/after/calendar Executable file
View File

@@ -0,0 +1,31 @@
#!/usr/bin/env bash
DEV_ENV=${DEV_ENV:-""}
XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-"$HOME/.config"}
install() {
[[ -z $DEV_ENV ]] && echo -e "\e[031m[ERROR]:\e[0m 'DEV_ENV' not set." && exit 1
# Clone and build qcal locally, as it didn't work for me when downloading from the aur.
mkdir ~/pkgbuilds &>/dev/null
git clone https://github.com/psic4t/qcal.git ~/pkgbuilds/qcal
pushd ~/pkgbuilds/qcal &>/dev/null || exit 1
(
make && sudo make install
)
popd &>/dev/null || exit 1
# Decrypt and copy configuration file for qcal.
mkdir "$XDG_CONFIG_HOME"/qcal &>/dev/null
gpg --output "$XDG_CONFIG_HOME"/qcal/config.json --decrypt "$DEV_ENV"/env/qcal/config.json.gpg
}
uninstall() {
sudo rm /usr/local/bin/qcal
rm -rf ~/pkgbuilds/qcal
}
arg=${1:-""}
[[ $arg == "install" ]] && install
[[ $arg == "uninstall" ]] && uninstall

18
runs/after/jellyfin-tui Executable file
View File

@@ -0,0 +1,18 @@
#!/usr/bin/env bash
DEV_ENV=${DEV_ENV:-""}
XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-"$HOME/.config"}
install() {
[[ -z $DEV_ENV ]] && echo "[ERROR]: DEV_ENV not set" && exit 1
mkdir -p "$XDG_CONFIG_HOME"/jellyfin-tui &>/dev/null
gpg --output "$XDG_CONFIG_HOME"/jellyfin-tui/config.yaml --decrypt "$DEV_ENV"/env/jellyfin-tui/config.gpg
}
uninstall() {
rm -rf ~/.config/jellyfin-tui
}
arg=${1:-""}
[[ $arg == "install" ]] && install
[[ $arg == "uninstall" ]] && uninstall

3
runs/calendar Normal file
View File

@@ -0,0 +1,3 @@
go
gnome-calendar
gnome-keyring

1
runs/jellyfin-tui Executable file
View File

@@ -0,0 +1 @@
jellyfin-tui