From 3b6b8a44fe97c6b30d686618e78547baffe3bb57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20La=C3=ADn?= Date: Wed, 16 Oct 2024 13:05:25 +0200 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor(rofi):=20bindings?= =?UTF-8?q?=20picker=20to=20detect=20if=20keyb=20is=20installed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .config/rofi/scripts/keybindings/keybindings | 15 ++++++++++----- .config/rofi/style.rasi | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.config/rofi/scripts/keybindings/keybindings b/.config/rofi/scripts/keybindings/keybindings index 3ca6e27b..f1f34ffe 100755 --- a/.config/rofi/scripts/keybindings/keybindings +++ b/.config/rofi/scripts/keybindings/keybindings @@ -1,9 +1,14 @@ #!/bin/bash -CONFIG=$(fd --base-directory "$HOME/.config/keyb/bindings" --type f . | sed 's/\.yml$//' | rofi -dmenu) +if ! command -v keyb >/dev/null 2>&1; then + notify-send "Program not found" "Make sure you have installed cliphist" + exit 1 +else + CONFIG=$(fd --base-directory "$HOME/.config/keyb/bindings" --type f . | sed 's/\.yml$//' | rofi -dmenu) -if [ -z "$CONFIG" ]; then - exit + if [ -z "$CONFIG" ]; then + exit + fi + + hyprctl dispatch exec "[float;size 45% 80%;center 1] kitty keyb -k '$HOME/.config/keyb/bindings/$CONFIG.yml'" fi - -hyprctl dispatch exec "[float;size 45% 80%;center 1] kitty keyb -k '$HOME/.config/keyb/bindings/$CONFIG.yml'" diff --git a/.config/rofi/style.rasi b/.config/rofi/style.rasi index a70c9b79..ecfa811d 100644 --- a/.config/rofi/style.rasi +++ b/.config/rofi/style.rasi @@ -1,5 +1,5 @@ configuration { - modi: "drun,filebrowser"; + modi: "drun"; show-icons: true; display-drun: "Apps"; display-run: "Run";