feat(hypr): new script to launch apps and notify if they arent installed

This commit is contained in:
Sergio Laín 2024-08-11 18:14:53 +02:00
parent 5ac645ab37
commit a6e55a8e38
No known key found for this signature in database
GPG key ID: 8429B2EE312F8150
2 changed files with 23 additions and 9 deletions

View file

@ -19,16 +19,16 @@ bind = $mainMod, F, fullscreen, 0
bind = $mainMod, Z, exec, pypr zoom bind = $mainMod, Z, exec, pypr zoom
# Applications # Applications
bind = $mainMod, W, exec, $browser bind = $mainMod, W, exec, $scripts/launch_app $browser
bind = $mainMod, O, exec, $notetaking-app bind = $mainMod, O, exec, $scripts/launch_app $notetaking-app
bind = $mainMod SHIFT, O, exec, $office-suite bind = $mainMod SHIFT, O, exec, $scripts/launch_app $office-suite
bind = $mainMod SHIFT, E,exec, $alter-file-manager bind = $mainMod SHIFT, E,exec, $scripts/launch_app $alter-file-manager
bind = $mainMod, RETURN, exec, $terminal bind = $mainMod, RETURN, exec, $scripts/launch_app $terminal
bind = $mainMod SHIFT, RETURN, exec, $terminal --class=center-float-large bind = $mainMod SHIFT, RETURN, exec, $terminal --class=center-float-large
bind = $mainMod ALT, RETURN, exec, $terminal --class=center-float bind = $mainMod CTRL, RETURN, exec, $terminal --class=center-float
bind = $mainMod CTRL, RETURN, exec, $terminal --class=center-float-mini bind = $mainMod ALT, RETURN, exec, $terminal --class=center-float-mini
bind = $mainMod, BACKSPACE, exec, $editor bind = $mainMod, BACKSPACE, exec, $scripts/launch_app $editor
bind = $mainMod SHIFT, BACKSPACE, exec, $alter-editor bind = $mainMod SHIFT, BACKSPACE, exec, $scripts/launch_app $alter-editor
# Pickers/Launchers # Pickers/Launchers
bind = $mainMod, 23, exec, $launcher # Tab bind = $mainMod, 23, exec, $launcher # Tab

14
.config/hypr/scripts/launch_app Executable file
View file

@ -0,0 +1,14 @@
#!/bin/bash
if [ -z "$1" ]; then
exit 1
fi
program="$1"
if ! command -v "$program" >/dev/null 2>&1; then
notify-send "Program not found" "Make sure you have installed $program"
exit 1
else
exec $program
fi