From a6e55a8e38c2b63b9d5731b83b6f470665837356 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20La=C3=ADn?= Date: Sun, 11 Aug 2024 18:14:53 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(hypr):=20new=20script=20to=20l?= =?UTF-8?q?aunch=20apps=20and=20notify=20if=20they=20arent=20installed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .config/hypr/configs/binds.conf | 18 +++++++++--------- .config/hypr/scripts/launch_app | 14 ++++++++++++++ 2 files changed, 23 insertions(+), 9 deletions(-) create mode 100755 .config/hypr/scripts/launch_app diff --git a/.config/hypr/configs/binds.conf b/.config/hypr/configs/binds.conf index 0883b420..4f6ff9d6 100644 --- a/.config/hypr/configs/binds.conf +++ b/.config/hypr/configs/binds.conf @@ -19,16 +19,16 @@ bind = $mainMod, F, fullscreen, 0 bind = $mainMod, Z, exec, pypr zoom # Applications -bind = $mainMod, W, exec, $browser -bind = $mainMod, O, exec, $notetaking-app -bind = $mainMod SHIFT, O, exec, $office-suite -bind = $mainMod SHIFT, E,exec, $alter-file-manager -bind = $mainMod, RETURN, exec, $terminal +bind = $mainMod, W, exec, $scripts/launch_app $browser +bind = $mainMod, O, exec, $scripts/launch_app $notetaking-app +bind = $mainMod SHIFT, O, exec, $scripts/launch_app $office-suite +bind = $mainMod SHIFT, E,exec, $scripts/launch_app $alter-file-manager +bind = $mainMod, RETURN, exec, $scripts/launch_app $terminal 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-mini -bind = $mainMod, BACKSPACE, exec, $editor -bind = $mainMod SHIFT, BACKSPACE, exec, $alter-editor +bind = $mainMod CTRL, RETURN, exec, $terminal --class=center-float +bind = $mainMod ALT, RETURN, exec, $terminal --class=center-float-mini +bind = $mainMod, BACKSPACE, exec, $scripts/launch_app $editor +bind = $mainMod SHIFT, BACKSPACE, exec, $scripts/launch_app $alter-editor # Pickers/Launchers bind = $mainMod, 23, exec, $launcher # Tab diff --git a/.config/hypr/scripts/launch_app b/.config/hypr/scripts/launch_app new file mode 100755 index 00000000..2166797d --- /dev/null +++ b/.config/hypr/scripts/launch_app @@ -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