davatorium / rofi

Rofi: A window switcher, application launcher and dmenu replacement
https://davatorium.github.io/rofi/
Other
12.95k stars 608 forks source link

[BUG] Unable to use "-m" to run rofi on all active monitors #1822

Closed Arszilla closed 1 year ago

Arszilla commented 1 year ago

Rofi version (rofi -v)

1.7.3

Configuration

https://gist.githubusercontent.com/Arszilla/eecd305b0c916e4c152ef898d0dd050e/raw/3f8e1d687c72948aaeedbe2f025f8f3a1a24fc86/config.ini

Theme

https://gist.githubusercontent.com/Arszilla/eecd305b0c916e4c152ef898d0dd050e/raw/3f8e1d687c72948aaeedbe2f025f8f3a1a24fc86/powermenu.ini

Timing report

No response

Launch command

/usr/bin/rofi -dmenu -i -p "$host |" -theme "$HOME"/.config/rofi/colors/powermenu.rasi

Step to reproduce

The powermenu is started using the following script:

#!/usr/bin/env bash
#
# Original Author:      Aditya Shakya (adi1090x)
# Github:               https://github.com/adi1090x/
# Github Repository:    https://github.com/adi1090x/rofi
#
# Modified by:          Arszilla
# Github:               https://github.com/Arszilla
# Gitlab:               https://gitlab.com/Arszilla
# Twitter:              https://twitter.com/Arszilla
#
# License:              GNU General Public License v3.0
# License URL:          https://github.com/adi1090x/rofi/blob/master/LICENSE
#
# Power Menu
# Rofi Version: 1.7.3

# Variables:
uptime="$(/usr/bin/uptime -p | /usr/bin/sed -e 's/up //g')"
host=$(/usr/bin/hostname)

# Options:
lock=' Lock'
suspend=' Suspend'
logout='󰗼 Logout'
reboot='↻ Reboot'
shutdown='󰐥 Shutdown'

# Run rofi on all connected monitors:
# rofi_cmd() {
#     /usr/bin/rofi -dmenu \
#         -i \
#         -p "$host |" \
#         -theme "$HOME"/.config/rofi/colors/powermenu.rasi \
#         -monitor -1

# Rofi function:
rofi_cmd() {
    /usr/bin/rofi -dmenu \
        -i \
        -p "$host |" \
        -theme "$HOME"/.config/rofi/colors/powermenu.rasi
}

# Pass the variables to rofi's dmenu:
run_rofi() {
    echo -e "$lock\n$suspend\n$logout\n$reboot\n$shutdown" | rofi_cmd
}

# Ask the user for a selection:
chosen="$(run_rofi)"
case ${chosen} in
    "$lock")
        /usr/bin/betterlockscreen -l
        ;;

    "$suspend")
        /usr/bin/betterlockscreen -l & /usr/bin/sleep 0.5; /usr/bin/systemctl suspend
        ;;

    "$logout")
        /usr/bin/i3-msg exit
        ;;

    # "$hibernate")
    #     /usr/bin/betterlockscreen -l & /usr/bin/sleep 0.5; /usr/bin/systemctl hibernate
    #     ;;

    "$reboot")
        /usr/bin/systemctl reboot
        ;;

    "$shutdown")
        /usr/bin/systemctl poweroff
        ;;

esac

Upon executing the script, the powermenu only appears on the active monitor, instead of all monitors, even when -m is specified to the launch command. I've tried appending -m 0 -m 1 to the launch command, but I get:

(null):1:16: Option: monitor needs to be set with a string not a Integer
(null):1:16: Option: monitor needs to be set with a string not a Integer

Expected behavior

All monitors should get the powermenu and key actions should be synchronized between the monitors (focused and unfocused). i.e. if there are 2 monitors connected, powermenu should spawn the dmenu used for the powermenu on all monitors and keybinds (e.g. down arrow etc.) should reflect on all the monitors.

Actual behavior

Only 1 monitor has the dmenu produced by powermenu.

Additional information

No response

Using wayland display server protocol

DaveDavenport commented 1 year ago

This is not a bug, rofi does not support showing on multiple monitors simultaneous.

(null):1:16: Option: monitor needs to be set with a string not a Integer (null):1:16: Option: monitor needs to be set with a string not a Integer

That is a false warning, and should be fixed. Ill leave this issue open for fixing that wrong error message.

DaveDavenport commented 1 year ago

Closing, seems the error message is already fixed (in 1.7.4)

Arszilla commented 1 year ago

Let me ask this then: would it be possible to spread the effect etc. of my configuration to the other monitors by a mean? that way they don't look weird with multiple monitors (i.e. one screen has the blurred power menu, while others remain normal), as seen in the image attached below:

image

github-actions[bot] commented 1 year ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.