From 76ec7e662cb07aed7a5b423a89b0bb5407147cee Mon Sep 17 00:00:00 2001 From: Simon Rieger Date: Mon, 5 Jun 2023 17:36:34 +0200 Subject: [PATCH] add bemenu-run script --- dot_config/i3/executable_config.tmpl | 4 ++-- dot_config/sway/executable_bemenu-run.sh | 20 ++++++++++++++++++++ dot_config/sway/executable_config.tmpl | 5 +++-- 3 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 dot_config/sway/executable_bemenu-run.sh diff --git a/dot_config/i3/executable_config.tmpl b/dot_config/i3/executable_config.tmpl index 3d244e4..468d1d4 100644 --- a/dot_config/i3/executable_config.tmpl +++ b/dot_config/i3/executable_config.tmpl @@ -92,8 +92,8 @@ bindsym $mod+Shift+q kill bindsym $mod+d exec --no-startup-id i3-dmenu-desktop #bindsym $mod+d exec --no-startup-id i3-dmenu-desktop --dmenu='rofi -i -dmenu -font "snap 12" -bg "#222222" -fg "#888888" -hlbg "#285577" -hlfg "#ffffff" -opacity 90 -m 0 -location 2' -bindsym $mod+shift+d exec clipmenu -bindsym $mod+y exec passdmenu -P -x clipboard +bindsym $mod+y exec clipmenu +bindsym $mod+shift+y exec passdmenu -P -x clipboard # change focus bindsym $mod+j focus left diff --git a/dot_config/sway/executable_bemenu-run.sh b/dot_config/sway/executable_bemenu-run.sh new file mode 100644 index 0000000..d2ac558 --- /dev/null +++ b/dot_config/sway/executable_bemenu-run.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +## Generic bemenu script. Will be run from other scripts to make sure, bemenu always looks the same + +if [ -f "$HOME/.cache/wal/colors.sh" ]; then + source $HOME/.cache/wal/colors.sh +else + background='#1a1a1a' + color5='#268bd2' + #color6='#2E3440' +fi + +#BEMENU_ARGS=(-n -i -p '' --tb "$background" --tf "$color5" --fb "$background" --nb "$background" --hb "$background" --hf "$color5" -m $(swaymsg -r -t get_outputs | jq '. | reverse | to_entries | .[] | select(.value.focused == true) | .key') "$@") +BEMENU_ARGS=(-n -i -p '' --tb "$background" --tf "$color5" --fb "$background" --nb "$background" --ab "$background" --hb "$background" --hf "$color5" --line-height 30 "$@") + +if [ "$1" = 'dmenu' ]; then + bemenu-run "${BEMENU_ARGS[@]}" +else + bemenu "${BEMENU_ARGS[@]}" +fi diff --git a/dot_config/sway/executable_config.tmpl b/dot_config/sway/executable_config.tmpl index bfe6568..c274365 100644 --- a/dot_config/sway/executable_config.tmpl +++ b/dot_config/sway/executable_config.tmpl @@ -38,8 +38,9 @@ bindsym $mod+Shift+q kill # Menu bindsym $mod+d exec fuzzel -bindsym $mod+Shift+d exec clipman pick --tool=CUSTOM --tool-args="fuzzel -d" -bindsym $mod+y exec ~/.config/fuzzel/fuzzel-pass.sh +bindsym $mod+Shift+d exec j4-dmenu-desktop --dmenu="~/.config/sway/bemenu-run.sh -l 30" --term="wezterm" --no-generic +bindsym $mod+y exec clipman pick --tool=CUSTOM --tool-args="fuzzel -d" +bindsym $mod+Shift+y exec ~/.config/fuzzel/fuzzel-pass.sh # change focus bindsym $mod+j focus left