Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: double logout menu #1718

Open
celikj opened this issue Jul 31, 2024 · 9 comments
Open

[Bug]: double logout menu #1718

celikj opened this issue Jul 31, 2024 · 9 comments
Labels
bug Something isn't working

Comments

@celikj
Copy link

celikj commented Jul 31, 2024

Bug Report

Description

I changed power button to ignore in systemd logind.conf and added this line to userprefs.conf
bind = , XF86PowerOff, exec, (script)
but when I press the power button 2 logout menus appear on top of each other(this does not happen when i super+backspace), I can press escape and one goes but other stays and press escape again to disappear that.

I thought maybe hyprdots handled this button thing anywhere before in the config but removing the line on userprefs didnt help, the menu didnt come this time.

Steps to Reproduce

  1. /etc/systemd/logind.conf change power button to ignore
  2. add bind = , XF86PowerOff, exec, (script)
  3. press power button

Expected Behavior

one logout menu

Actual Behavior

two menus

  • Linux Distro: ArchLinux,
@celikj celikj added the bug Something isn't working label Jul 31, 2024
@RookiexCookie
Copy link

yea well because cuz the script has 2 layout so you need to specify which one you want with 1 or 2

bind = $mainMod, backspace, exec, $scrPath/logoutlaunch.sh 1 

it uses first layout

@kRHYME7
Copy link
Collaborator

kRHYME7 commented Aug 1, 2024

@celikj How about adding the release flag

bindr =

This way the bind is fired only on released.

Hyprdots/HyDE do not handle those things.
Maybe Hyprland does it.

@celikj
Copy link
Author

celikj commented Aug 2, 2024

bindr = , XF86PowerOff, exec, $scrPath/logoutlaunch.sh 2
still all same, just style changed.

@celikj
Copy link
Author

celikj commented Aug 2, 2024

yea well because cuz the script has 2 layout so you need to specify which one you want with 1 or 2

bind = $mainMod, backspace, exec, $scrPath/logoutlaunch.sh 1 

it uses first layout

even if I add $mainMod it still opens one more menu on top

@celikj
Copy link
Author

celikj commented Aug 2, 2024

EDIT: fixed by adding lockfile logic:

DEBOUNCE_TIME=1  # Time in seconds to debounce, adjust as needed

# Check if lock file exists and if the debounce time has passed
if [ -e "$LOCKFILE" ]; then
    last_run=$(stat -c %Y "$LOCKFILE")
    now=$(date +%s)
    elapsed=$((now - last_run))

    if [ $elapsed -lt $DEBOUNCE_TIME ]; then
        exit 0
    fi
fi

# Create or update the lock file with current time
touch "$LOCKFILE"

# Ensure lock file is removed on exit
trap "rm -f $LOCKFILE" EXIT

I tried exec firefox and even firefox opens double

found out my button is double clicking but i dont know why it doesnt look broken or smt. I tried so much but it only double clicks not a single single click. i use lenovo legion 5 can any other legion 5 try this?

here is wev logs:

[14:     wl_keyboard] keymap: format: 1 (xkb v1), size: 64754
[14:     wl_keyboard] key: serial: 32807; time: 12450701; key: 124; state: 1 (pressed)
                      sym: XF86PowerOff (269025066), utf8: ''
[14:     wl_keyboard] key: serial: 32808; time: 12450701; key: 124; state: 0 (released)
                      sym: XF86PowerOff (269025066), utf8: ''
[14:     wl_keyboard] repeat_info: rate: 25 keys/sec; delay: 600 ms
[14:     wl_keyboard] keymap: format: 1 (xkb v1), size: 64754
[14:     wl_keyboard] key: serial: 32809; time: 12450703; key: 124; state: 1 (pressed)
                      sym: XF86PowerOff (269025066), utf8: ''
[14:     wl_keyboard] key: serial: 32810; time: 12450703; key: 124; state: 0 (released)
                      sym: XF86PowerOff (269025066), utf8: ''
[14:     wl_keyboard] repeat_info: rate: 25 keys/sec; delay: 600 ms
[14:     wl_keyboard] keymap: format: 1 (xkb v1), size: 64754
[14:     wl_keyboard] key: serial: 32811; time: 12454134; key: 133; state: 1 (pressed)
                      sym: Super_L      (65515), utf8: ''
[14:     wl_keyboard] modifiers: serial: 0; group: 0
                      depressed: 00000040: Mod4 
                      latched: 00000000
                      locked: 00000000
[10:    xdg_toplevel] close```

@kRHYME7
Copy link
Collaborator

kRHYME7 commented Aug 2, 2024

use this instead.

bind = Mod,Key,exec,pgrep wlogout || logoutscript here

@celikj
Copy link
Author

celikj commented Aug 2, 2024

use this instead.

bind = Mod,Key,exec,pgrep wlogout || logoutscript here

this doesnt work, still opening twice

@kRHYME7
Copy link
Collaborator

kRHYME7 commented Aug 2, 2024

I see, If you do

pkill wlogout || logoutlaunch.sh ?

@celikj
Copy link
Author

celikj commented Aug 2, 2024

I see, If you do

pkill wlogout || logoutlaunch.sh ?

still same

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants