You are not logged in.

#201 2015-03-23 16:29:47

t.ask
Member
Registered: 2013-01-14
Posts: 11

Re: sxhkd — Simple X HotKey Daemon

I just came along this thread, because I'm searching for a way to swap mouse buttons only within windows of a certain application. Is this somehow doable with sxhkd? Swapping middle and right mouse would be fine then. Or do you have another idea how to achieve this?

Last edited by t.ask (2015-03-23 16:31:46)

Offline

#202 2015-05-21 15:03:36

mtello17
Member
Registered: 2014-03-22
Posts: 34

Re: sxhkd — Simple X HotKey Daemon

I just came along this thread, and I was wondering if there was a way to kill a focused window that is a subprocess. Like say I have chrome and hangouts open, but I want to specifically kill hangouts.

Offline

#203 2015-05-21 15:10:55

hobarrera
Member
From: The Netherlands
Registered: 2011-04-12
Posts: 355
Website

Re: sxhkd — Simple X HotKey Daemon

mtello17 wrote:

I just came along this thread, and I was wondering if there was a way to kill a focused window that is a subprocess. Like say I have chrome and hangouts open, but I want to specifically kill hangouts.

Is Hangouts a native app, or webapp? If it's the former, xkill should be ok.

Offline

#204 2015-05-22 19:43:27

mtello17
Member
Registered: 2014-03-22
Posts: 34

Re: sxhkd — Simple X HotKey Daemon

It's a webapp. I know that some wm's (xmonand, dwm) can do it. But how can I do kill sub-processes.

Last edited by mtello17 (2015-05-22 19:54:01)

Offline

#205 2015-05-23 03:56:57

hobarrera
Member
From: The Netherlands
Registered: 2011-04-12
Posts: 355
Website

Re: sxhkd — Simple X HotKey Daemon

mtello17 wrote:

It's a webapp. I know that some wm's (xmonand, dwm) can do it. But how can I do kill sub-processes.

If it's a webapp, then it's probably beyond the WM manager's control.
There's no way to close a single tab from a WM perspective. It's not a window, and it's pretty hard to for the WM to determine which process is associated with that browser tab.

Offline

#206 2015-05-23 18:57:14

mtello17
Member
Registered: 2014-03-22
Posts: 34

Re: sxhkd — Simple X HotKey Daemon

Oh, too bad sad

Thanks.

Offline

#207 2015-09-15 07:18:09

chickenPie4tea
Member
Registered: 2012-08-21
Posts: 309

Re: sxhkd — Simple X HotKey Daemon

not sure what I a dong wrong here
why does this command work from terminal  rofi-show run
but not with sxhkd binding as:
alt + r
    rofi -show run


You can like linux without becoming a fanatic!

Offline

#208 2015-10-07 18:36:46

son_of_a_targ
Member
Registered: 2015-10-07
Posts: 1

Re: sxhkd — Simple X HotKey Daemon

chickenPie4tea wrote:

not sure what I a dong wrong here
why does this command work from terminal  rofi-show run
but not with sxhkd binding as:
alt + r
    rofi -show run

this works for me, although when I first installed rofi to test it i commented out dmenu_run and put rofi -show run under the comment. this didn't work, felt silly but eventually figured out that it had to be before the comment.

Offline

#209 2015-10-20 23:20:16

Chrysostomus
Member
Registered: 2015-09-13
Posts: 64
Website

Re: sxhkd — Simple X HotKey Daemon

Hi!
Thanks for this awesome app!

I was wondering if you have implemented the context aware keybindings (detecting clicks on rootwindow):

bloom wrote:
chneukirchen wrote:

This seems to work on any click, not just on the root window.

Hotkeys are, by definition, global.

I wanted this fuctionality for stuff like resizing wondows by grapping them from window gap and so on, so I wrote (with great amount of help) this bash/awk wrapper to xev to do that:
https://bbs.archlinux.org/viewtopic.php?id=204039

But now I heard that sxhkd might do this after all, which I would would prefer as it is lighter and cleaner than my solution.

So did it get implemented at some point?

Last edited by Chrysostomus (2015-10-21 01:24:28)


The difference between reality and fiction is that fiction has to make sense.

Offline

#210 2016-03-14 18:23:49

vista_narvas
Member
Registered: 2016-03-14
Posts: 20

Re: sxhkd — Simple X HotKey Daemon

hi i dint find anything on google so im posting here

im trying to make a hotkey for when caps-lock is on
but if i use Caps_Lock + q the caps-lock is ignored and it triggers when i press the q

Offline

#211 2017-07-18 14:45:33

furibund
Member
Registered: 2013-06-06
Posts: 10

Re: sxhkd — Simple X HotKey Daemon

Can someone help me with a key-chain, that includes some terminal ssh-calls:

example:

super + t ; { t, r, a, b, c }
  { uxterm \
  , uxterm -e su - \
  , uxterm ssh -p 12345 -e user@a.org \
  , uxterm ssh -p 23456 -e root@b.net \
  , uxterm ssh -p 111111 -e admin@c.info \
  }

First ssh command works - the following calls fail.
Doesn't matter, which server is in first place.

Supposing, that the @ is the bad, I tried
-e  '...'
-e "..."
\@
@@
plus some more strange things...

Anyone, who knows the trick?

Offline

#212 2017-07-18 20:12:13

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,354

Re: sxhkd — Simple X HotKey Daemon

Are you chaining ssh calls using a hotkey daemon? Why not use ProxyCommand or similar?


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#213 2017-07-19 16:39:17

furibund
Member
Registered: 2013-06-06
Posts: 10

Re: sxhkd — Simple X HotKey Daemon

I want to start different coloured uxterms running ssh-shells on different servers.
As I don't need all the servers at once, but sometimes fast, I tried to implement that with the formidable sxhkd. wink

But your post gave me the idea, that I could do that the one-comand-per-call way... big_smile

Offline

#214 2020-04-04 16:26:36

wololos
Member
Registered: 2018-05-03
Posts: 8

Re: sxhkd — Simple X HotKey Daemon

I am looking for a way to execute a command before entering the variable keys of a chord chain (no matter which variable key that is provided).

Kind of like this:

mod3 + m : {l, s}
        echo "BSPWM mode active" > /tmp/bspwm_mode; \
        bspwm_menu {lock, suspend}

In this example, the echo-command is executed _after_ pressing one of the variable keys (l and s), and then the bspwm_menu-command is executed.

I would like to know if there is a way to run echo command directly after pressing mod3+m and _before_ entering either of the variable keys.

Does anyone know?

Thanks in advance,
wololos

Last edited by wololos (2020-04-04 16:27:21)

Offline

#215 2021-04-22 22:34:28

bluedrink9
Member
Registered: 2021-04-22
Posts: 1

Re: sxhkd — Simple X HotKey Daemon

wololos wrote:

I am looking for a way to execute a command before entering the variable keys of a chord chain (no matter which variable key that is provided).

Kind of like this:

mod3 + m : {l, s}
        echo "BSPWM mode active" > /tmp/bspwm_mode; \
        bspwm_menu {lock, suspend}

In this example, the echo-command is executed _after_ pressing one of the variable keys (l and s), and then the bspwm_menu-command is executed.

I would like to know if there is a way to run echo command directly after pressing mod3+m and _before_ entering either of the variable keys.

Does anyone know?

Thanks in advance,
wololos

I was looking for this too. Here is the answer, using sxhkd's status fifo (which is poorly documented outside of an example in the repo, but does exactly what we want).

Create a file `sxhkd_status_mon.sh` with the following content:

#! /bin/sh

[ $# -ne 1 ] && exit 1

status_fifo=$1

{ while read -r line ; do 
  msg=${line#?}
  prefix=${line:0:1}
  # See https://github.com/baskerville/sxhkd/blob/fe241b0d2d70c9c483b23cf3cd14f1383f0953a2/src/sxhkd.h#L38-L42 for all prefixes.
  case $prefix in
    B) # Begin chain
      echo "BSPWM mode active" > /tmp/bspwm_mode
      # bspc config focused_border_color "#$manage_border_color"
      ;;
    E) # End chain
      rm /tmp/bspwm_mode
      # bspc config focused_border_color "#$focused_border_color"
      ;;
  esac
done } < "$status_fifo"

Run this script and sxhkd like this:

SXHKD_STATUS_FIFO="/run/user/$UID/sxhkd.fifo"
if [ ! -f "${SXHKD_STATUS_FIFO}" ]; then
  mkfifo "${SXHKD_STATUS_FIFO}"
fi
pgrep sxhkd || \
  sxhkd -m -1 -s "${SXHKD_STATUS_FIFO}" &

# Monitor sxhkd status
sxhkd_status_mon.sh  "${SXHKD_STATUS_FIFO}" &

Last edited by bluedrink9 (2021-04-22 22:35:29)

Offline

#216 2022-11-24 02:46:44

stansu
Member
Registered: 2022-11-24
Posts: 1

Re: sxhkd — Simple X HotKey Daemon

may i swap mouse clicks to keystroke? include pressed and release events. thanks for reply

Offline

Board footer

Powered by FluxBB