6 Commits

7 changed files with 135 additions and 57 deletions

View File

@@ -35,5 +35,6 @@ auto_restart: true
# Because injecting long texts char-by-char is a slow operation, espanso automatically
# uses the clipboard if the text is longer than 'clipboard_threshold' characters.
# clipboard_threshold: 100
#
show_notifications: false
# For a list of all the available options, visit the official docs at: https://espanso.org/docs/

View File

@@ -38,7 +38,7 @@ animations {
background {
monitor =
#path = screenshot
path = ~/.config/hypr/wallpaper.png
path = ~/wallpapers/wall1.png
blur_passes = 3
}

View File

@@ -34,7 +34,7 @@ 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/bin/toggle-desktop
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
@@ -42,14 +42,16 @@ 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/bin/toggle-waybar
bind = $mainMod, M, exec, ~/.local/scripts/toggle-waybar
bind = $mainMod, N, exec, $terminal -e nvim
bind = $mainMod, P, exec, $pwa "https://pass.proton.me"
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,
bind = $mainMod SHIFT, R, exec, ~/.local/bin/waybar-restart
# TODO: change modifier key.
#bind = $mainMod SHIFT, L, exec, hyprlock
@@ -61,8 +63,8 @@ bind = $mainMod SHIFT, R, exec, ~/.local/bin/waybar-restart
bind = $mainMod SHIFT ALT, 4, exec, hyprshot -m region -o ~/Pictures
bind = $mainMod SHIFT ALT, 3, exec, hyprshot -m window -o ~/Pictures
bind = CTRL, F, exec, ~/.local/bin/window-toggle-floating
#bind = CTRL, F, togglefloating,
bind = CTRL, F, fullscreen,
bind = ctrl shift, f, exec, ~/.local/scripts/window-toggle-floating
# Move focus with mainMod + arrow keys
bind = $mainMod, H, movefocus, l
@@ -102,8 +104,8 @@ bind = $mainMod, 9, workspace, 9
bind = $mainMod, 0, workspace, 10
# Move all workspaces to a monitor
bind = $HYPER, 0, exec, ~/.local/bin/mv-all-workspaces-to-monitor 0
bind = $HYPER, 1, exec, ~/.local/bin/mv-all-workspaces-to-monitor 1
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

View File

@@ -11,11 +11,12 @@ windowrule = center, tag:floating-window
windowrule = size 800 600, tag:floating-window
# Force windows to be a floating window
windowrule = tag +floating-window, class:^(blueberry.py|org.gnome.Nautilus)$
windowrule = tag +floating-window, class:^(blueberry.py|org.gnome.Nautilus|com.ghostty.float)$
# Force bluetooth settings to stay focused when visible.
# Force to stay focused when visible.
windowrule = stayfocused, class:(blueberry.py)
windowrule = stayfocused, class:Pinentry.gtk
windowrule = stayfocused, class:com.ghostty.float
# Clipboard history tui in floating window.
windowrule = tag +floating-window, class:.*clipse.*

119
env/.local/scripts/uninstall-desktop-app vendored Executable file
View File

@@ -0,0 +1,119 @@
#!/usr/bin/env bash
# Uninstalls '.desktop' applications, including their icon.
#
# This is primarily used for uninstalling web app's, if a
# desktop app was installed via the package manager, then the
# package manager should be used to uninstall the application.
usage() {
cat <<EOF
Uninstalls '.desktop' files, including their icons. Most commonly
used for web applications, if an application was installed by a
package manager, then it should be used to uninstall the application.
Usage:
uninstall-desktop-app [OPTIONS] [FILE...]
OPTIONS:
--dry-run: Perform but don't actually remove anything.
-h | --help: Show the help page.
If no files are supplied, then an interactive session will be
started that allows you to choose the applications to remove.
EOF
}
declare -a files
interactive_mode="0"
dry_run="0"
help_flag="0"
XDG_DATA_HOME=${XDG_DATA_HOME}
while [[ $# -gt 0 ]]; do
if [[ $1 =~ ^--dry ]]; then
dry_run="1"
elif [[ $1 =~ ^-h ]] || [[ $1 =~ ^--h ]]; then
help_flag="1"
else
files+=("$1")
fi
shift
done
# Early out for help option.
if [[ $help_flag == "1" ]]; then
usage
exit 0
fi
if [[ -z $XDG_DATA_HOME ]]; then
echo "xdg data home is not set"
echo "using: ~/.local/share"
XDG_DATA_HOME=$HOME/.local/share
fi
if [[ ${#files} == 0 ]]; then
interactive_mode="1"
files+=(
$(find $XDG_DATA_HOME/applications -mindepth 1 -maxdepth 1 -type f -name "*.desktop" -printf "%f\n" |
gum choose --no-limit --padding "2 4" --header "Choose desktop apps to remove:" --selected-prefix="✗ ")
)
fi
log() {
if [[ $dry_run == "1" ]]; then
echo "[DRY RUN]: $1"
else
echo "$1"
fi
}
############################## MAIN ##############################
for f in ${files[@]}; do
icon=""
log "ARG: $f"
# Handle a passed in webapp spec file.
if [[ $f =~ \.json$ ]]; then
name=$(jq -r ".name" $f)
f="$name.desktop"
fi
fname=${f##*/}
log "Uninstalling Desktop: $fname"
file="$XDG_DATA_HOME/applications/$fname"
if [[ ! -f $file ]]; then
log "[WARNING]: File didn't exist, skipping!"
else
# get the line in file that has the icon path.
icon_line=$(cat $file | grep "Icon")
# get just the file path.
icon=${icon_line/#Icon=/}
log " removing icon: rm -rf $icon"
log " removing desktop: rm -rf $file"
if [[ $dry_run == "0" ]]; then
rm -rf $icon
rm -rf $file
fi
fi
done
if [[ ${#files} -gt 0 ]]; then
# Refresh the database so that applcation luanchers, etc
# don't show the app still exists.
update-desktop-database $XDG_DATA_HOME/applications
if [[ $interactive_mode == "1" ]]; then
log "Done!"
fi
fi

View File

@@ -1,44 +0,0 @@
#!/usr/bin/env bash
# Uninstall's a web app, including it's icon.
app_dir="$HOME/.local/share/applications"
spec=""
file=""
while [[ $# -gt 0 ]]; do
if [[ $1 =~ "-f" ]] || [[ $1 =~ "--file" ]]; then
shift
file=$(jq -r '.name' $1)
else
file=$1
fi
shift
done
if [[ -z "$file" ]]; then
echo -e "Must supplye a web app name to uninstall.\n\n"
echo "Usage: uninstall-webapp <name | path>"
exit 1
fi
file="$(basename $file)"
if [[ ! $file =~ \.desktop$ ]]; then
file="$file.desktop"
fi
desktop="$app_dir/$file"
if [[ ! -f "$desktop" ]]; then
echo "No webapp found @: $desktop"
exit 1
fi
icon=$(cat $desktop | grep "Icon")
icon="${icon/#Icon=/}"
echo "Removing Application: $desktop"
rm -rf "$desktop"
echo "Removing Icon: $icon"
rm -rf "$icon" >/dev/null 2>&1

3
webapp
View File

@@ -69,7 +69,7 @@ install() {
uninstall() {
local file=$DEV_ENV/env/webapps/$(basename $1)
local script="$DEV_ENV/env/.local/scripts/uninstall-webapp"
local script="$DEV_ENV/env/.local/scripts/uninstall-desktop-app"
if [[ ! -x $script ]]; then
log "Failed to find uninstall web app script."
@@ -88,7 +88,6 @@ uninstall() {
log "WEBAPP: -- grep: $grep"
apps_dir=$(find $DEV_ENV/env/webapps -mindepth 1 -maxdepth 1 -type f)
for s in $apps_dir; do
if basename $s | grep -vq "$grep"; then
log "grep \"$grep\" filtered out $s"