You are not logged in.
Hi, just wanted to share something i discovered today after setting up rofi for the first time. Ive created a command that lists the wallpaper background directory and has feh setting the background. The reason for this is i am going to set this to a hotkey which will make it easier when i download a new image to set as a background wallpaper instead of typing out the command in the terminal.
ls $HOME/walls/* | rofi -dmenu | xargs feh --bg-scale
So the wallpaper directory is being globbed as i understand it, just wanted to know how i would go about having rofi only show the difference between the below examples?
example of what shows up currently.
/home/me/walls/wallpaper.jpg
example of how i would like it to show up in rofi -dmenu, just having the file name showing, not showing the expanded directory ?
wallpaper.jpg
Last edited by clusterF (2020-02-27 10:49:22)
Offline
Thankyou misko.
Offline
dmenu itself doesn't come into it - rofi just calls it "dmenu compatible mode" or some such.
Also, don't parse ls.
Offline
Yes it is called dmenu compatible mode so dmenu does come into dont you think? Could rofi do this without the compatibility of dmenu? Im new to rofi, just asking questions.
Unaware of the issue surrounding ls, maybe find might be a better command to use?
Last edited by clusterF (2020-02-29 12:04:11)
Offline
ok find works as well but directory expansion hack misko mentions wont work with find?
find $HOME/walls -name '*.jpg' -o -name '*.png' | rofi -dmenu | xargs -I{} feh --bg-scale $HOME/walls/{}
This works below, above does not.
find $HOME/walls -name '*.jpg' -o -name '*.png' | rofi -dmenu | xargs feh --bg-scale
Edit: From reading that link you posted ohnot, it seems the issue is when file names have new lines in them, ive not come across that sort of file yet or if i have then i wonder what sort of file have more than one line in the filename?
Last edited by clusterF (2020-02-29 12:31:01)
Offline
Yes it is called dmenu compatible mode so dmenu does come into dont you think? Could rofi do this without the compatibility of dmenu? Im new to rofi, just asking questions. ...
Rofi can emulate dmenu if run with -dmenu.
rofi is an X11 pop-up window switcher, run dialog, dmenu replacement, and more. It focuses on being fast to use and have minimal distraction. It supports keyboard and mouse navigation, type to filter, tokenized search and more.
I like rofi a lot! https://github.com/davatorium/rofi/wiki/User-scripts is worth a look.
And here's a neat theme (light and dark): https://github.com/MonsieurBedard/rofi-breeze-theme
Using the Openbox (3.5.2) session of Lubuntu 14.04 LTS but very interested in BL :)
Offline