feat: Moves hyprland scripts into it's own directory.

This commit is contained in:
2025-10-03 23:43:29 -04:00
parent 1def0356d7
commit d32d0cf64f
16 changed files with 26 additions and 14 deletions

21
dev-env
View File

@@ -43,7 +43,11 @@ update_dirs() {
pushd $1 &>/dev/null pushd $1 &>/dev/null
( (
# Copy everything except systemd, share, and zsh folders, they need treated differently. # Copy everything except systemd, share, and zsh folders, they need treated differently.
configs=$(find . -mindepth 1 -maxdepth 1 -type d \( -name "systemd" -o -name "zsh" -o -name "share" \) -prune -o -type d -print) configs=$(
find . -mindepth 1 -maxdepth 1 -type d \
\( -name "systemd" -o -name "zsh" -o -name "share" -o -name "scripts" \) \
-prune -o -type d -print
)
for c in $configs; do for c in $configs; do
directory=${2%/}/${c#./} directory=${2%/}/${c#./}
log " removing: rm -rf $directory" log " removing: rm -rf $directory"
@@ -102,6 +106,11 @@ copy_files() {
update_dirs $DEV_ENV/env/.config $XDG_CONFIG_HOME update_dirs $DEV_ENV/env/.config $XDG_CONFIG_HOME
update_dirs $DEV_ENV/env/.local $HOME/.local update_dirs $DEV_ENV/env/.local $HOME/.local
# SCRIPTS
mkdir -p ~/.local/scripts >/dev/null 2>&1
update_dirs $DEV_ENV/env/.local/scripts $HOME/.local/scripts
copy_files $DEV_ENV/env/.local/scripts $HOME/.local/scripts
# SYSTEMD # SYSTEMD
mkdir -p $XDG_CONFIG_HOME/systemd/user >/dev/null 2>&1 mkdir -p $XDG_CONFIG_HOME/systemd/user >/dev/null 2>&1
copy_files $DEV_ENV/env/.config/systemd/user $XDG_CONFIG_HOME/systemd/user copy_files $DEV_ENV/env/.config/systemd/user $XDG_CONFIG_HOME/systemd/user
@@ -134,7 +143,9 @@ mkdir -p $XDG_DATA_HOME/applications/icons
copy_files $DEV_ENV/env/.local/share/applications $XDG_DATA_HOME/applications copy_files $DEV_ENV/env/.local/share/applications $XDG_DATA_HOME/applications
copy_files $DEV_ENV/env/.local/share/applications/icons $XDG_DATA_HOME/applications/icons copy_files $DEV_ENV/env/.local/share/applications/icons $XDG_DATA_HOME/applications/icons
systemctl --user daemon-reload if [[ $dry_run == "0" ]]; then
hyprctl reload systemctl --user daemon-reload
espanso service restart hyprctl reload
exec zsh -l espanso service restart
exec zsh -l
fi

View File

@@ -14,9 +14,9 @@ $browser = uwsm app -- zen-browser
$fileManager = $terminal -e yazi $fileManager = $terminal -e yazi
$fileBrowser = uwsm app -- nautilus $fileBrowser = uwsm app -- nautilus
$menu = uwsm app -- walker $menu = uwsm app -- walker
$scripts = ~/.local/scripts $scripts = ~/.local/scripts/hypr
$pwa = $scripts/launch-webapp $pwa = $scripts/launch-webapp
$tmuxSessionator = $scripts/tmux-sessionator $tmuxSessionator = ~/.local/scripts/tmux-sessionator
$clipboardHistory = com.ghostty.clipse $terminal --class=com.ghostty.clipse -e clipse $clipboardHistory = com.ghostty.clipse $terminal --class=com.ghostty.clipse -e clipse
$uninstallDesktop = $terminal --class=com.ghostty.float -e $scripts/uninstall-desktop-app $uninstallDesktop = $terminal --class=com.ghostty.float -e $scripts/uninstall-desktop-app
$housecallPro = https://pro.housecallpro.com/app/calendar_new $housecallPro = https://pro.housecallpro.com/app/calendar_new

View File

@@ -65,6 +65,7 @@ path_prepend \
"$XDG_DATA_HOME/bin" \ "$XDG_DATA_HOME/bin" \
"$HOME/.local/bin" \ "$HOME/.local/bin" \
"$SCRIPTS" \ "$SCRIPTS" \
"$SCRIPTS/hypr" \
"$HOME/.local/pnpm" \ "$HOME/.local/pnpm" \
"$CARGO_HOME/bin" \ "$CARGO_HOME/bin" \
"$HOME/.local/bin" "$HOME/.local/bin"

View File

@@ -160,7 +160,7 @@ fi
if [[ -n $CUSTOM_EXEC ]] && [[ ! $CUSTOM_EXEC == "null" ]]; then if [[ -n $CUSTOM_EXEC ]] && [[ ! $CUSTOM_EXEC == "null" ]]; then
EXEC_COMMAND="$CUSTOM_EXEC" EXEC_COMMAND="$CUSTOM_EXEC"
else else
EXEC_COMMAND="${SCRIPTS:-$HOME/.local/scripts}/launch-webapp $APP_URL" EXEC_COMMAND="${SCRIPTS:-$HOME/.local/scripts}/hypr/launch-webapp $APP_URL"
fi fi
# Create application .desktop file # Create application .desktop file

View File

@@ -1,11 +1,11 @@
#!/usr/bin/env bash # /usr/bin/env bash
# Adapted from https://github.com/basecamp/omarchy/tree/master?tab=readme-ov-file # Adapted from https://github.com/basecamp/omarchy/tree/master?tab=readme-ov-file
usage() { usage() {
cat <<EOF cat <<EOF
Launches a url as a web application. This script relys on the 'launch-or' script. This Launches a url as a web application. This script relys on the 'launch' script. This
essentially just generates the pattern and launch command to pass into that script. essentially just generates the pattern and launch command to pass into that script.
USAGE: USAGE:
@@ -92,5 +92,5 @@ echo "URL: $url"
echo "Launch args: ${launch_args[@]}" echo "Launch args: ${launch_args[@]}"
echo "App args: ${app_args}" echo "App args: ${app_args}"
$SCRIPTS/launch "${launch_args[@]}" "$(pattern)" \ $SCRIPTS/hypr/launch "${launch_args[@]}" "$(pattern)" \
setsid uwsm app -- $(sed -n 's/^Exec=\([^ ]*\).*/\1/p' {~/.local,~/.nix-profile,/usr}/share/applications/$browser 2>/dev/null | head -1) --app="$url" "$app_args" setsid uwsm app -- $(sed -n 's/^Exec=\([^ ]*\).*/\1/p' {~/.local,~/.nix-profile,/usr}/share/applications/$browser 2>/dev/null | head -1) --app="$url" "$app_args"

2
gen
View File

@@ -67,7 +67,7 @@ generate_webapp() {
} }
generate_script() { generate_script() {
local dest="$DEV_ENV/env/.local/scripts/$file" local dest="$DEV_ENV/env/.local/scripts/hypr/$file"
fail_if_exists $dest fail_if_exists $dest
log "Creating new script: $dest" log "Creating new script: $dest"
printf "#!/usr/bin/env bash\n\n" >$dest printf "#!/usr/bin/env bash\n\n" >$dest

4
webapp
View File

@@ -45,7 +45,7 @@ log() {
install() { install() {
local file=$DEV_ENV/env/webapps/$(basename $1) local file=$DEV_ENV/env/webapps/$(basename $1)
local script="$DEV_ENV/env/.local/scripts/install-webapp" local script="$DEV_ENV/env/.local/scripts/hypr/install-webapp"
if [[ ! -x $script ]]; then if [[ ! -x $script ]]; then
log "Failed to find install web app script." log "Failed to find install web app script."
@@ -69,7 +69,7 @@ install() {
uninstall() { uninstall() {
local file=$DEV_ENV/env/webapps/$(basename $1) local file=$DEV_ENV/env/webapps/$(basename $1)
local script="$DEV_ENV/env/.local/scripts/uninstall-desktop-app" local script="$DEV_ENV/env/.local/scripts/hypr/uninstall-desktop-app"
if [[ ! -x $script ]]; then if [[ ! -x $script ]]; then
log "Failed to find uninstall web app script." log "Failed to find uninstall web app script."