summaryrefslogtreecommitdiff
path: root/bmenu
diff options
context:
space:
mode:
Diffstat (limited to 'bmenu')
-rwxr-xr-xbmenu16
1 files changed, 16 insertions, 0 deletions
diff --git a/bmenu b/bmenu
new file mode 100755
index 0000000..d91312c
--- /dev/null
+++ b/bmenu
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+set -e
+
+backgrounds=/home/$USER/.config/backgrounds
+config=$(bash ~/.config/dmenu.conf)
+
+n_files=$(($(ls -l $backgrounds | wc -l) - 1))
+
+# Use dmenu to prompt the user to select a file
+selected_file=$(find $backgrounds -maxdepth 1 -type f -printf '%f\n' | $config -i -l $n_files)
+
+# If the user selected a file, execute it
+if [ -n "$selected_file" ]; then
+ feh --bg-fill --no-fehbg "${backgrounds}/${selected_file}"
+fi