Skip to content

[REQUEST] Internal variable to detect if running in dmenu mode #1903

Description

@REALERvolker1

Before opening a feature request

  • I checked the next branch to see if the feature has already been implemented
  • I searched existing reports to see if it is already requested.

What is the user problem or growth opportunity you want to see solved?

I would like to make a dynamic theme that enables and disables certain features depending on if rofi has been launched with a mode, or launched from a script using rofi --dmenu. Rofi has some internal variables, such as ROFI_OUTSIDE, ROFI_ENV, and some others in the rofi-script(5) manpage, but I propose a boolean ROFI_DMENU to tell a custom theme that rofi is running with the --dmenu flag.

How do you know that this problem exists today? Why is this important?

I made the following script:

#!/bin/zsh
# the declare command without any args should print all environment variables.
declare

When I ran the script as a mode rofi -modi env:~/rofi-env.sh -show env, I saw the following output:
image

Neither of these variables are a boolean true/false.

Who will benefit from it?

Anyone who wants to have a theme that looks different depending on if rofi is running in dmenu mode or not.

Rofi version (rofi -v)

Version: 1.7.5+wayland2

Configuration

https://gist.github.com/REALERvolker1/0989d4b9ccc754faee3565dbdb57b57a

Additional information

My config as I have it written in my dotfiles repo is here

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions