Custom dmenu for a collection of shell scripts
Aug 1, 2021
The infamous i3 & dmenu combo is my daily driver on GNU/Linux. I often create shell scripts to automate a set of commands. To allow for quick access to them (from console), I created the following simple shell script:
#! /bin/bash scripts=$(ls -L ~/scripts | grep sh)
res=$(echo "$scripts" | dmenu -l 15)
if [ i-z $res ]
then
echo "No Action"
else
xdotool type "sh ~/scripts/$res"
fi
(Source Code also on: https://github.com/aymenfurter/dmenu-quickaccess/blob/master/utils.sh)
You may also want to add the following line to your i3 config to bind the menu to mod+x:
bindsym $mod+x exec sh ~/scripts/dmenu/utils.sh