Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

2 votes
2 answers
3285 views
In NixOS, is there a way to use Rofi instead of Dmenu when invoking Passmenu?
I'm using the `pass` package for password management. The `passmenu` command that comes with it uses `dmenu`, but I'd like for it to use Rofi instead. I saw [on the Arch wiki](https://wiki.archlinux.org/index.php/Rofi#Rofi_as_dmenu_replacement) that it's possible to use rofi as a drop-in dmenu repla...
I'm using the pass package for password management. The passmenu command that comes with it uses dmenu, but I'd like for it to use Rofi instead. I saw [on the Arch wiki](https://wiki.archlinux.org/index.php/Rofi#Rofi_as_dmenu_replacement) that it's possible to use rofi as a drop-in dmenu replacement, but the path structures of NixOS are so complex that I'm having a hard time figuring this out. Should I create a new package for it? Or is there a way to update [the original pass package](https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/security/pass/default.nix) so that it uses rofi instead?
Jonathan (1330 rep)
Sep 11, 2018, 04:28 PM • Last activity: Jun 30, 2025, 07:03 AM
4 votes
2 answers
2180 views
How do I include shortcuts for the gnome setting program and wine apps in dmenu?
I would like to use `dmenu` as my launcher instead of the Gnome3-overlay that is displayed after hitting the super-key. From the Gnome3-overlay, I am able to launch both apps, gnome settings, and wine programs. In `dmenu`, I am so far only able to launch apps, and I can't seem to find the gnome sett...
I would like to use dmenu as my launcher instead of the Gnome3-overlay that is displayed after hitting the super-key. From the Gnome3-overlay, I am able to launch both apps, gnome settings, and wine programs. In dmenu, I am so far only able to launch apps, and I can't seem to find the gnome settings program or any of my wine apps. When I tried other launcher, such as synapse, they were able to find both the settings and wine apps, just like with the gnome-overlay. I prefer dmenu because it is the fastest and most aesthetically pleasing launcher I have come across. Is there a way to include shortcuts to the gnome setting program and my wine apps in dmenu? I am using Antegros Linux with Gnome 3.22 and dmenu 0.1 (specifically, the dmenu2 package from the AUR). --- ### Update For the gnome settings app, I figured out the name is gnome-control-center although it is called "Settings" in the Gnome3-overlay window. Adding the -z flag to dmenu helped by enabling fuzzy matching. I also found out that the keyboard subsection of the settings menu is launched via gnome-control-center keyboard, which is a little bothersome to type every time since it does not autocomplete. It seems like dmenu will find everything that I put on my $PATH, but I am not super keen on including all the desktop shortcuts there. Other launchers such as p-menu includes everything on $PATH and all the .desktop files on the system, which is the preferred behavior to me. p-menu does only seem to launch within a terminal, rather than as a popup (the latter being faster for me), so for the time being, I am using albert, which works great. I would still be interested in dmenu or a similar launcher, if they include .desktop-files.
joelostblom (1971 rep)
Dec 7, 2016, 12:53 AM • Last activity: Jun 22, 2025, 05:04 AM
0 votes
1 answers
2337 views
How does dmenu_run work?
My system is ```Debian 9.4``` which uses ```linux kernel 4.9.0-8-amd64``` and ```echo $SHELL``` on my system gives ```/bin/bash``` and ```/bin/sh``` is a link to ```/bin/dash```. I was curious why every time I run an application with ```dmenu_run``` from ```dwm``` there is an additional ```/bin/bash...
My system is
9.4
which uses
kernel 4.9.0-8-amd64
and
$SHELL
on my system gives
/bin/bash
and
/bin/sh
is a link to
/bin/dash
. I was curious why every time I run an application with
from
there is an additional
/bin/bash
process that runs as the parent, so I dug further into the script of
: #!/bin/sh dmenu_path | dmenu "$@" | ${SHELL:-"/bin/sh"} & I can't understand why my computer has
/bin/bash
instead of
/bin/sh
. I also read the correspond source code in
. It shows that it just simply
and
. There is no reason for
/bin/bash
to run instead of
/bin/sh
.
JiaHao Xu (248 rep)
Nov 10, 2018, 08:22 AM • Last activity: Apr 8, 2025, 04:08 PM
1 votes
1 answers
57 views
Open reference from Zotero using rofi / dmenu
I have a number of collections in Zotero (a bibliography manager). I would like to be able to open the associated PDFs using `rofi` or `dmenu`, and have a list of entries to choose from of the following form: [COLLECTION][AUTHORS]TITLE.pdf Has anyone created a script for this?
I have a number of collections in Zotero (a bibliography manager). I would like to be able to open the associated PDFs using rofi or dmenu, and have a list of entries to choose from of the following form: [COLLECTION][AUTHORS]TITLE.pdf Has anyone created a script for this?
Rastapopoulos (1869 rep)
Nov 7, 2024, 01:48 PM • Last activity: Nov 8, 2024, 11:59 AM
0 votes
2 answers
399 views
access shell alias with dmenu
I have a collection of bash commands (one liners) that I use on a regular basis to open new shells or start programs with a given set of arguments. As I use `dmenu`, I'd like to be able to use those commands from my shell and from `dmenu`. So defining an `alias` in my `.bashrc` isn't enough, I have...
I have a collection of bash commands (one liners) that I use on a regular basis to open new shells or start programs with a given set of arguments. As I use dmenu, I'd like to be able to use those commands from my shell and from dmenu. So defining an alias in my .bashrc isn't enough, I have to put these commands in a dedicated file. The file needs then to be executable and stored in a $PATH known to dmenu. If I do so, the alias becomes useless because the shell will find the executable. But that means I have to create one file per command. It's annoying. Is there a way to store all those commands in one file (or at least in a more convenient way) so that they can be accessed via shell and dmenu? Maybe something like an alias file read by dmenu...
PinkFloyd (439 rep)
Apr 2, 2024, 07:32 PM • Last activity: Apr 2, 2024, 08:56 PM
0 votes
0 answers
211 views
Rofi leaves unresponsive terminals after run-shell-command | `Q` or `Ctrl-C` don't work
I'm trying to switch from using `dmenu` to `rofi` on my system, on which I use `i3wm`. I have the following keybinding: bindsym $mod+Ctrl+d exec --no-startup-id rofi -combi-modi window#drun#run -show combi -show-icons I use `urxvt` as my default terminal, and it's the one that's specified in my `con...
I'm trying to switch from using dmenu to rofi on my system, on which I use i3wm. I have the following keybinding: bindsym $mod+Ctrl+d exec --no-startup-id rofi -combi-modi window#drun#run -show combi -show-icons I use urxvt as my default terminal, and it's the one that's specified in my config.rasi file for rofi to use. The problem I have is when I launch rofi, and try to do something like htop SHIFT RET to run htop in a terminal window. When I'm done with htop, I hit Q and the process ends, but I'm left with a blank terminal window. Hitting Q again doesn't kill it, nor does Ctrl-C. I have to kill the window via my i3 keybinding $mod+Shift+Q. It's a similar situation with a command like neofetch, or ls -l, except now the first Q doesn't kill the process as it has already completed – the terminal window is not blank but contains the output of those commands. My run-shell-command is "{terminal} -hold -e {cmd}". I don't get this behavior when running these commands via dmenu. For instance, htop is in the dmenu-recent/terminal file, and hitting Q kills the process and the terminal window at the same time. This is the behavior I would like to replicate with rofi – is this possible?
nonreligious (153 rep)
Jan 23, 2024, 03:54 PM
0 votes
2 answers
1133 views
How to run scripts from Awesome Window Manager
I would like to run scripts with a shortcut the same way I can run apps like firefox. I have a Dmenu script (called dmconf) that list all my configuration files, I've already make it executable and is in my bin directory which is included in my path variable. It works when I run the script from the...
I would like to run scripts with a shortcut the same way I can run apps like firefox. I have a Dmenu script (called dmconf) that list all my configuration files, I've already make it executable and is in my bin directory which is included in my path variable. It works when I run the script from the terminal (konsole - Zsh) but it doesn't when I run it from Awesome. This is the relevant code from my rc.lua awful.key({ modkey },"n", function () awful.util.spawn("$HOME/bin/dmconf") end, {description = "list configuration files", group = "Dmenu"}), In the spawn parenthesis I've tried with "$HOME/bin/dmconf", "dmconf", "bash dmconf", but none of them worked.
GhostOrder (181 rep)
Mar 9, 2021, 05:43 PM • Last activity: Sep 25, 2023, 02:34 PM
20 votes
4 answers
26923 views
i3 dmenu does not browse $PATH
I want to run a shell script `~/.local/bin/test.sh` via `dmenu`. If I run `dmenu` via `$mod+D` and browse for the entry `test.sh` I couldn't find it. The path `~/.local/bin` is already set to my `$PATH` variable in `~/.profile` $ echo $PATH /home/ubuntu/bin:/home/ubuntu/.local/bin:/usr/local/sbin:/u...
I want to run a shell script ~/.local/bin/test.sh via dmenu. If I run dmenu via $mod+D and browse for the entry test.sh I couldn't find it. The path ~/.local/bin is already set to my $PATH variable in ~/.profile $ echo $PATH /home/ubuntu/bin:/home/ubuntu/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games I also removed ~/.cache/dmenu_run and restart i3. What can I do to launch the test script via dmenu?
Murmulodi (1226 rep)
Jan 7, 2017, 02:31 AM • Last activity: Jul 31, 2023, 04:21 PM
0 votes
1 answers
879 views
Ubuntu / i3wm: rename AppImage in dmenu entry
I downloaded an AppImage (LogSeq to be precise) and wanted to add it to the dmenu. With the help of a friend i did the following: 1. move AppImage to a appropriate directory (not required, but appears cleaner to me). In this case i moved the `LogSeq.AppImage` to `/home/[username]/.local/bin/LogSeq.A...
I downloaded an AppImage (LogSeq to be precise) and wanted to add it to the dmenu. With the help of a friend i did the following: 1. move AppImage to a appropriate directory (not required, but appears cleaner to me). In this case i moved the LogSeq.AppImage to /home/[username]/.local/bin/LogSeq.AppImage 2. Create a .desktop entry with the required fields in /usr/share/applications -> logseq.desktop
[Desktop Entry]
Name=LogSeq
GenericName=logseq
Exec=/home/[username]/.local/bin/LoqSeq.AppImage
Terminal=false
Type=Application
Categories=Application;
After removing ~/.cache/dmenu_run to have dmenu rebuild it's cache, the app appears in the dmenu and i can run it. Cool! However both in dmenu_run as well as in the **dmenu** itself, the app appears as LogSeq.AppImage not as logseq as i had expected. How can i rename it so that it appears e.g. as logseq instead?
anotherFishInTheTank (1 rep)
Oct 20, 2022, 07:50 AM • Last activity: Jun 16, 2023, 03:42 PM
2 votes
1 answers
877 views
Piping continuous output into rofi
I'm trying to write a bash script to pipe strings into rofi. These strings are continuously generated by a function `gen_x`. The function `gen_x` sometimes (only when a condition is met) outputs new strings. I currently implement the `gen_x`-function with an if statement within an infinite loop. I w...
I'm trying to write a bash script to pipe strings into rofi. These strings are continuously generated by a function gen_x. The function gen_x sometimes (only when a condition is met) outputs new strings. I currently implement the gen_x-function with an if statement within an infinite loop. I want to pipe this function into rofi. When an item is selected within rofi, rofi should output the selected item and gen_x and rofi should end. When using an infinite loop which outputs a new element every loop (as seen in gen_b), the script does exactly what I described above. However, when I implement an if statement in my function and only print a new element when the condition is true, the program never ends. I am unsure if this is due to gen_x or rofi. Simplified code
gen_a(){ while true; do if [[ "$v" == "" ]]; then echo "Test"; v=1; fi; sleep 1; done }
gen_b(){ while true; do                             echo "Test";            sleep 1; done }

gen_a | rofi -dmenu # -> this outputs Test and does not end
gen_b | rofi -dmenu # -> this outputs Test and ends properly
Is there a way to use conditionals within the while-loop, and the program ending properly.
Friendly Penguin 123 (23 rep)
May 28, 2023, 05:26 PM • Last activity: May 28, 2023, 07:13 PM
1 votes
0 answers
884 views
Sway's dmenu not finding $PATH
I recently installed EndeavourOS, followed by Sway I've added `~/scripts/screenshot.sh` however dmenu is not finding it, so tried adding ~/scripts to my path environment however none of my approaches are adding it for dmenu Since then I've: - set permission with `chmod 777 ~/scripts/screenshot.sh` -...
I recently installed EndeavourOS, followed by Sway I've added ~/scripts/screenshot.sh however dmenu is not finding it, so tried adding ~/scripts to my path environment however none of my approaches are adding it for dmenu Since then I've: - set permission with chmod 777 ~/scripts/screenshot.sh - ensured ownership of screenshot.sh using chown to my user - created .bashrc, .bash_profile, .profile, .xprofile, .xinitrc, .session, .xsesson with the $PATH to include the scripts folder (I know a lot of these are redundant but they were all the files I found from other posts with same issue) - if I add/update a config, before a reboot I do rm -f ~/.cache/dmenu_run (there's no other dmenu file) Debugging steps - From the terminal, printenv shows the correct PATH - From the terminal, screenshot.sh works from any path - From dmenu, echo $PATH > /tmp/path is missing the additional PATH - From dmenu, echo $SHELL > /tmp/shell shows /bin/bash - From dmenu, who > /tmp/who shows it as my user - Copying screenshot.sh to /usr/bin, which is in the $PATH, dmenu found it and it worked My understanding is dmenu is running a different shell but I don't know why it's not picking up any of my config files (e.g. .bashrc, .bash_profile, etc.) What else can I check or do?
andrewjamesbowen (141 rep)
Mar 8, 2023, 04:05 AM • Last activity: Mar 8, 2023, 10:06 PM
2 votes
1 answers
143 views
How to add a substring to a string as a column
The title may not be the best at describing the issue, but this was the best I could come up with, moving on to describe what I'm trying to do, I use artix runit as my os, and it is tedious to create a symlink for every service I want to enable, so I created this script to make it easier. ```bash #!...
The title may not be the best at describing the issue, but this was the best I could come up with, moving on to describe what I'm trying to do, I use artix runit as my os, and it is tedious to create a symlink for every service I want to enable, so I created this script to make it easier.
#!/bin/sh

rundir="/run/runit/service"
svdir="/etc/runit/sv"

for SERVICE in $(ls $svdir); do
    [[ -d "$rundir/$SERVICE" ]] && output="$output$SERVICE        linked: yes\n" || output="$output$SERVICE        linked: no\n"
done

service=$(printf "$output" | dmenu -l 10) || exit 1

if printf "$service" | grep -Fqe "linked: yes"; then
    service=$(printf "$service" | awk '{print $1}')
    sudo -A rm "$rundir/$service"
else
    service=$(printf "$service" | awk '{print $1}')
    sudo -A ln -s "$svdir/$service" "$rundir/"
fi
Which checks all the services that can be enabled in /etc/runit/sv and checks if they are already enabled by seeing if they exist in /run/runit/service if it does it will add linked: yes at the end of the dmenu list and if it doesn't, it adds linked: no the problem is that the service's names vary so adding those things will result in this inconsistency: inconsistency as you can see as service's names vary the location of the text at the end change which is not very appealing to the eye I would say, so I would like to ask if there's a solution to this, if there's none I guess I would add the linked: xxx at the beginning since that would solve the problem, but it's my last resort. And if anyone wants to point out a more efficient way to write the code please do, this is my first bash script and I have much to learn. Note: I use dash as sh so i can't use any kind of bashisms.
Stagnant (33 rep)
Feb 14, 2023, 09:01 PM • Last activity: Feb 15, 2023, 12:14 AM
0 votes
0 answers
207 views
dmenu auto execute command if only one option is left
is there a way of having dmenu automatically exectue a given command, if there is only one option left? What I mean is this: Say I have a set of options: 1. Execute A 2. Execute B 3. Execute C etc. When I type "1", dmenu automatically filters the options and I only have the option 1. Execute A left...
is there a way of having dmenu automatically exectue a given command, if there is only one option left? What I mean is this: Say I have a set of options: 1. Execute A 2. Execute B 3. Execute C etc. When I type "1", dmenu automatically filters the options and I only have the option 1. Execute A left showing. But, I still have to press enter for it to start. Is there a way, where if will automatically start? Like, for example, the file browser "ranger", when using the find (f) command. When it is down to one option, matching the typed String, it will automatically move you to that sub directory, without having to press enter. Cheers all.
I.P (221 rep)
May 15, 2022, 02:12 PM
0 votes
2 answers
6680 views
How to change dmenu's font size in xmonad?
I just start to use xmonad window manager. It is wonderful. I tried to modify some configurations to get it work more suitable for me. My question is: 1. How to make a keyboard shortcut for commonly used apps? For example, I'd like to bind `Chrome` to `mod-b`. 2. How to change the `dmenu` font? I tr...
I just start to use xmonad window manager. It is wonderful. I tried to modify some configurations to get it work more suitable for me. My question is: 1. How to make a keyboard shortcut for commonly used apps? For example, I'd like to bind Chrome to mod-b. 2. How to change the dmenu font? I tried to add options to the exec part: dmenu_run -fn "-xos4-terminus-medium-r-*-*-14-*" dmenu_run -fn 'Droid Sans Mono-14' but it doesn't work. ------ **Edit**: Question 1 solved by: > In the section myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $ > > add: > > -- launch Chrome browser > , ((modm, xK_b), spawn "exe=google-chrome") -------------------------------------------- **Edit 2**: Question 2 solved by https://askubuntu.com/questions/326907/custom-font-with-dmenu
Nick (1147 rep)
Dec 17, 2014, 08:30 AM • Last activity: Jan 29, 2022, 06:26 PM
0 votes
1 answers
85 views
Why do some fonts appear zoomed in after system update?
Since the last system update, for various applications the font size has increased. Even one application for which I can be sure, that it has not been replaced, because I have a custom version and install it from source (see [dmenu][1]). [![Increased DMenu-Font][2]][2] As you can see in the picture,...
Since the last system update, for various applications the font size has increased. Even one application for which I can be sure, that it has not been replaced, because I have a custom version and install it from source (see dmenu ). ![Increased DMenu-Font ][2] As you can see in the picture, the font for dmenu appears ridiculously large. The screenshot also shows which font was specified in the source code and the output of fc-list, which indicates, that the font is installed. Some other applications (such as gimp) show a similar phenomenon. ![Gimp ridiculous font size ][3] The overall resolution is full hd 1920x1080. What happened and how can I reverse it? It is surprising to me, that some applications such as the terminal (alacritty) or VS Code still render fine. I already checked here and made sure that no nvidia drivers are installed (ie. sudo pacman -Q | grep nvidia shows no output)
Benj (123 rep)
Nov 12, 2021, 01:42 AM • Last activity: Nov 12, 2021, 05:13 AM
8 votes
3 answers
29640 views
How to get installed application to be detected by rofi?
I recently installed an IDE into /opt (I know that some recommend putting software into /usr/local but this was entirely self-contained) because the application was not available in my ditro's repositories and I had to install it from a .sh file. The application runs fine when launching from the ter...
I recently installed an IDE into /opt (I know that some recommend putting software into /usr/local but this was entirely self-contained) because the application was not available in my ditro's repositories and I had to install it from a .sh file. The application runs fine when launching from the terminal; however, I would like to run it without having to declare the path to executable each time. I use Rofi as my application launcher but when I search for my IDE, it is not found(probably because I installed it without using a package manager - don't understand the reasons behind this behavior though). How can I get this application that I installed to /opt to be searchable by an application launcher like Dmenu or Rofi?
anon2332 (121 rep)
May 12, 2017, 11:38 PM • Last activity: May 29, 2021, 04:53 AM
0 votes
1 answers
114 views
Kerberos with i3-dmenu-desktop
I use Kerberos authentication in Thunderbird, Firefox and for ssh and it works just fine if I use the programs from the shell. But when I use `i3-dmenu-desktop` to start Thunderbird and Firefox, the Kerberos ticket is not "attached". I use `kinit` with a cache file, which is exported in my `.bashrc`...
I use Kerberos authentication in Thunderbird, Firefox and for ssh and it works just fine if I use the programs from the shell. But when I use i3-dmenu-desktop to start Thunderbird and Firefox, the Kerberos ticket is not "attached". I use kinit with a cache file, which is exported in my .bashrc (KRB5CCNAME). I do not really know how dmenu works. Is it normal that it does not "inherit" environment variables?
Johannes Titz (221 rep)
Feb 21, 2020, 03:40 PM • Last activity: Feb 22, 2021, 12:12 PM
0 votes
1 answers
555 views
How to use high priority patch in dmenu
I am trying to use this patch in dmenu https://tools.suckless.org/dmenu/patches/highpriority/ I have the patch installed but I can not figure out how to set hp (the list of items to be considered high priority ), what does a "flag" mean in this context (I do not know C )
I am trying to use this patch in dmenu https://tools.suckless.org/dmenu/patches/highpriority/ I have the patch installed but I can not figure out how to set hp (the list of items to be considered high priority ), what does a "flag" mean in this context (I do not know C )
Michael Gallo (58 rep)
Sep 20, 2020, 05:52 PM • Last activity: Dec 16, 2020, 09:46 PM
1 votes
3 answers
2407 views
Hide password in dmenu
I'm new to dmenu. I'm trying to run programs which need `sudo` permission with dmenu. I've followed [this link][1]. So I have script `./dpass` in my `bin` folder which says: #!/bin/bash dmenu -p "$1" <&- && echo I've also run the command: $ export SUDO_ASKPASS=/home/username/bin/dpass So now I have...
I'm new to dmenu. I'm trying to run programs which need sudo permission with dmenu. I've followed this link . So I have script ./dpass in my bin folder which says: #!/bin/bash dmenu -p "$1" <&- && echo I've also run the command: $ export SUDO_ASKPASS=/home/username/bin/dpass So now I have a script in my bin folder called shutdown. It says: #!/bin/bash sudo -A shutdown -h now When I try to run it through dmenu, it does ask me for my password, but the problem is that when I type the password the password is not hidden. I find this really insecure since anyone can see my password. Is there anyway to hide passwords in dmenu?
odbhut.shei.chhele (121 rep)
Aug 21, 2018, 04:06 AM • Last activity: Jul 3, 2020, 07:45 AM
1 votes
1 answers
2915 views
How to define some shortcut-keys for dmenu?
When using `dmenu` to launch applications, it supports Ctrl+N and Ctrl+P to choose next one and previous one. How can I define Ctrl+H and Ctrl+L to function same to choose?
When using dmenu to launch applications, it supports Ctrl+N and Ctrl+P to choose next one and previous one. How can I define Ctrl+H and Ctrl+L to function same to choose?
Yu Su (11 rep)
Oct 13, 2017, 03:30 AM • Last activity: Jun 26, 2020, 08:11 PM
Showing page 1 of 20 total questions