Xfce Forum

Sub domains
 

You are not logged in.

#1 2017-11-21 22:10:14

Misko_2083
Member
Registered: 2015-10-13
Posts: 211
Website

Whisker Menu and Super keys

A little help please. I want to run Whisker Menu plugin with Super_L and Super_R keys.
I removed the old Whisker Menu keyboard shortcut first.
That way it won't interfere with the sript. With this script below I monitor X keyboard input.
If one of the Super keys is pressed and released it will show or hide the Whisker Menu.
Now, if I press some key combo, like Super_L+F, It launches whatever command is set.
That's alright, but when I release the Super key, Whisker is being shown.
How do I filter out the key-combos so that Whisker doesn't launch?

#!/bin/bash

  xinput test-xi2 --root | perl -lne '
    BEGIN{$"=",";
      open X, "-|", "xmodmap -pke";
      while (<X>) {$k{$1}=$2 if /^keycode\s+(\d+) = (\w+)/}
      open X, "-|", "xmodmap -pm"; <X>;<X>;
      while (<X>) {if (/^(\w+)\s+(\w*)/){($k=$2)=~s/_[LR]$//;$m[$i++]=$k||$1}}
      close X;
    }
    if (/^EVENT type.*\((.*)\)/) {$e = $1}
    elsif (/detail: (\d+)/) {$d=$1}
    elsif (/modifiers:.*effective: (.*)/) {
      $m=$1;
      if ($e =~ /^Key/){
        my @mods;
        for (0..$#m) {push @mods, $m[$_] if (hex($m) & (1<<$_))}
          # Comment out next line to see what key is pressed
          # print "$e $d [$k{$d}] $m [@mods]";
          if (($k{$d} eq "Super_L" or $k{$d} eq "Super_R") && $e eq "KeyRelease"){
             system ("xfce4-popup-whiskermenu > /dev/null 2>&1");
          }
      }
   }'

Do you want to exit the Circus?
https://www.youtube.com/watch?v=ZJwQicZHp_c

Offline

#2 2017-11-22 05:58:45

ozjd
Member
From: Hawkesbury NSW Australia
Registered: 2012-02-05
Posts: 560
Website

Re: Whisker Menu and Super keys

I use Ksuperkey to do that. Despite the name it isn't part of KDE. See https://github.com/hanschen/ksuperkey

Offline

#3 2017-11-22 08:02:09

marko
Member
Registered: 2017-10-20
Posts: 21

Re: Whisker Menu and Super keys

- Launch Settings->Hardware->Keyboard->Application Shortcuts and click the "Add" button
- Type: xfce4-popup-whiskermenu
- Press the Left Super key when prompted for a keyboard shortcut.
- Repeat the process for the Right Super Key

Here is another cool trick smile Open up a terminal and run this command: xfce4-popup-whiskermenu --pointer

smile Xfce4 rules!

Last edited by marko (2017-11-22 08:06:05)

Offline

#4 2017-11-22 15:55:33

k-3.14
Member
From: Rhineland
Registered: 2017-02-18
Posts: 161

Re: Whisker Menu and Super keys

marko wrote:

- Launch Settings->Hardware->Keyboard->Application Shortcuts and click the "Add" button
- Type: xfce4-popup-whiskermenu
- Press the Left Super key when prompted for a keyboard shortcut.
- Repeat the process for the Right Super Key

Nice tip marko.

New for ARCH and DEBIAN, bit Linux Mint has LEFT SUPER key for that by default.

br

Offline

#5 2017-11-23 10:04:10

marko
Member
Registered: 2017-10-20
Posts: 21

Re: Whisker Menu and Super keys

No worries, what you can also do is, should you wish to use a dock instead of the panel (personally, I have to have the panel + a window button list, please keep this as an option), you can add a custom command to the dock and the command would be: xfce4-popup-whiskermenu --pointer and the menu would pop up right there where you click the button.

Last edited by marko (2017-11-23 10:04:44)

Offline

#6 2017-11-23 18:49:53

Misko_2083
Member
Registered: 2015-10-13
Posts: 211
Website

Re: Whisker Menu and Super keys

ozjd wrote:

I use Ksuperkey to do that. Despite the name it isn't part of KDE. See https://github.com/hanschen/ksuperkey

Thank you ozjd. That's one neat little tool. As long as it is running it does what is advertising.

marko wrote:

- Launch Settings->Hardware->Keyboard->Application Shortcuts and click the "Add" button
- Type: xfce4-popup-whiskermenu
- Press the Left Super key when prompted for a keyboard shortcut.
- Repeat the process for the Right Super Key

Here is another cool trick smile Open up a terminal and run this command: xfce4-popup-whiskermenu --pointer

smile Xfce4 rules!

I had some trouble with the Super_L key and overlaping with keyboard combo shortcuts on this 4.10 xfce.


Do you want to exit the Circus?
https://www.youtube.com/watch?v=ZJwQicZHp_c

Offline

#7 2021-06-01 06:58:03

djh
Member
Registered: 2019-07-04
Posts: 3

Re: Whisker Menu and Super keys

xfce4-popup-whiskermenu

Worked for me smile

Thanks

Offline

#8 2025-03-09 21:38:16

mouradbenhelli
Member
Registered: 2025-03-05
Posts: 2
Windows 10Microsoft Edge 134.0

Re: Whisker Menu and Super keys

Whisker menu in XFCE does not provide direct control over dimensions such as dragging to resize, dragging from the right, dragging from the left, dragging from the bottom to the top and vice versa to place it in the middle of the screen like kde. Frankly, it would be better if this feature was supported.

Offline

#9 2025-03-09 23:05:15

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,815
LinuxFirefox 135.0

Re: Whisker Menu and Super keys

mouradbenhelli wrote:

Whisker menu in XFCE does not provide direct control over dimensions such as dragging to resize, dragging from the right, dragging from the left, dragging from the bottom to the top and vice versa to place it in the middle of the screen like kde. Frankly, it would be better if this feature was supported.

What version are you using? Resizing was re-added in 2.9.0. To popup the menu in the centre of the screen, you can use the -c parameter:

xfce4-popup-whiskermenu -c

Mark solved threads as [SOLVED] to make it easier for others to find solutions.
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#10 2025-03-09 23:11:03

mouradbenhelli
Member
Registered: 2025-03-05
Posts: 2
Windows 10Microsoft Edge 134.0

Re: Whisker Menu and Super keys

True I was using version 2.8.3, now I have upgraded to version 2.9. It is good honestly

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.014 seconds, 7 queries executed - Memory usage: 563.93 KiB (Peak: 580.77 KiB) ]