You are not logged in.

#1 2019-12-21 05:33:04

Tofu_Bone
Member
Registered: 2016-12-26
Posts: 43

cannot start sxhkd with xinitrc

I try to start sxhkd with startx, so i put "sxhkd &" inside xinitrc.
This is how the end of my .xinitrc looks like:

sxhkd &
exec i3 

startx is successful, but no keybinds work.

but when I just run:

sxhkd &

in bash after startx or execute it in i3, it works.

Where should I start looking at?

Offline

#2 2019-12-21 15:31:58

Webtm
Member
Registered: 2015-05-20
Posts: 5

Re: cannot start sxhkd with xinitrc

Execute i3 first before sxhkd

Offline

#3 2019-12-21 17:21:56

Tofu_Bone
Member
Registered: 2016-12-26
Posts: 43

Re: cannot start sxhkd with xinitrc

Webtm wrote:

Execute i3 first before sxhkd

I tried that with changing xinitrc to 

exec i3
exec sxhkd 

also tried :

exec i3
sxhkd &

still not working.

Offline

#4 2019-12-21 17:46:25

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,112

Re: cannot start sxhkd with xinitrc

Nothing after the first exec will be executed.
https://wiki.archlinux.org/index.php/I3#Autostart

Offline

#5 2019-12-21 17:49:05

Tofu_Bone
Member
Registered: 2016-12-26
Posts: 43

Re: cannot start sxhkd with xinitrc

seth wrote:

Nothing after the first exec will be executed.
https://wiki.archlinux.org/index.php/I3#Autostart

But

sxhkd &
exec i3 

in the .xinitrc file still wont work.

Offline

#6 2019-12-21 17:50:01

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,112

Re: cannot start sxhkd with xinitrc

Read the link, start sxhkd from the i3 config file.

Offline

#7 2019-12-21 17:53:13

Tofu_Bone
Member
Registered: 2016-12-26
Posts: 43

Re: cannot start sxhkd with xinitrc

seth wrote:

Read the link, start sxhkd from the i3 config file.

Thanks for your time in helping me, but the problem is not auto starting sxhkd.
The problem is not able to strat sxhkd from xinitrc.
I get it, i3 config file will work, and I tried it, it works.
But what if I want to use more than 1 WM, what if I do not use i3?

Offline

#8 2019-12-21 21:08:11

jonno2002
Member
Registered: 2016-11-21
Posts: 868

Re: cannot start sxhkd with xinitrc

Tofu_Bone wrote:

But what if I want to use more than 1 WM, what if I do not use i3?

then you use the config/launch file from the other WM to start sxhkd

Offline

#9 2019-12-21 21:15:05

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,112

Re: cannot start sxhkd with xinitrc

The question is: why does sxhkd "not work" when started before i3wm (there's no sane way to run it from the xinitrc, since you'll most likely want the WM to be the session keeping process)

I could imagine some issue w/ a changing keyboard layout, eg. if you've sth. like

…
setxkbmap blahfoobar &
sxhkd &
exec i3

or change the layout from the i3 config.

=> post your complete xinitrc and i3wm config

Offline

#10 2019-12-22 13:09:22

qinohe
Member
From: Netherlands
Registered: 2012-06-20
Posts: 1,596

Re: cannot start sxhkd with xinitrc

While I do agree with most answers here, I'm going ahead and place a solution, works on most environments
Be aware --SPOILER ALERT--

Create directory '.config/autostart'
Create a file sxhkd.desktop

[Desktop Entry]
Type=Application
Exec=sxhkd
Hidden=false
Autostart-enabled=true
Name=keybind
Comment=hotkey daemon

If this solution ain't working for you, I suggest you read up on how to configure your environment.
This is tested and works on at least 3 WM's

Offline

#11 2023-08-20 19:29:56

hangezoe
Member
Registered: 2023-08-20
Posts: 1

Re: cannot start sxhkd with xinitrc

try -c flag, sxhkd -c /absolute_path_of_ur_sxhkdrc, as mentioned here https://distro.tube/guest-articles/inst … sxhkd.html

EDIT: below solution worked for me, write this in your autostart script(eg, .xinitrc)

exec sxhkd & before exec i3 (or your window manager)

Last edited by hangezoe (2023-08-20 20:44:14)

Offline

#12 2023-08-20 21:41:52

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,557
Website

Re: cannot start sxhkd with xinitrc

Mod note: Closing this ancient thread.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

Board footer

Powered by FluxBB