summaryrefslogtreecommitdiff
path: root/dot-config/rofi/scripts/rofi_wallpaper
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2024-06-03 19:56:39 +0800
committerlittleblack111 <littleblack11111@gmail.com>2024-06-03 19:56:39 +0800
commitca968c4e5040f1ff4b5b5e12d9312360d807dcc1 (patch)
tree9900920e8f566794560c1519678e344351d2803b /dot-config/rofi/scripts/rofi_wallpaper
parent5f3deaff0bf006a1a353e57b82ad48c0e8f143bc (diff)
added submodules, change . -> dot (see man stow --dotfiles)
Diffstat (limited to 'dot-config/rofi/scripts/rofi_wallpaper')
-rwxr-xr-xdot-config/rofi/scripts/rofi_wallpaper21
1 files changed, 21 insertions, 0 deletions
diff --git a/dot-config/rofi/scripts/rofi_wallpaper b/dot-config/rofi/scripts/rofi_wallpaper
new file mode 100755
index 00000000..b0be1000
--- /dev/null
+++ b/dot-config/rofi/scripts/rofi_wallpaper
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+
+#CM_LAUNCHER=rofi
+DIR="$HOME/.config/rofi"
+RASI="$DIR/wallpaper.rasi"
+mesg="Please Select a Wallpaper"
+
+# Define the directory to list files from
+directory="$HOME/Pictures/wallpapers"
+
+# Use `ls` to list the files in the directory
+files=$(ls $directory)
+
+# Use rofi to display the list of files
+chosen=$(echo $files | tr " " "\n" | rofi -dmenu -theme ${RASI} -separator-style plain)
+
+# Check if a file was selected
+if [ -n "$chosen" ]; then
+ # Run a command with the selected file as an argument
+ feh $chosen
+fi