You are not logged in.

#1 2013-05-10 15:35:55

ryan16144
Member
Registered: 2013-02-16
Posts: 17

[Solved] ~/.xinitrc being reset after suspend

[Solved] Created a script to set the settings and hooked it in to systemd so it got ran after resuming [/Solved]

Title pretty much sums it up, when i wake my computer up after suspending it my xinitrc file doesn't work anymore.  In other words my keyboard rate is back to default, and my key mapping don't work.

I am using I3 window manager, and i run it using startx.  I suspend using systemctl suspend.  I used to use KDE and it had no issues with this, which is odd.  I'm not entirely sure what the relevant info would be, so sorry if I missed something important. 

Thanks in advance.

Last edited by ryan16144 (2013-05-12 04:13:25)

Offline

#2 2013-05-10 15:41:31

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,727

Re: [Solved] ~/.xinitrc being reset after suspend

I would not expect ~/.xinitrc to be sourced after a suspend.  When you come out of suspend, is your X session still alive, or does it dump you back to the console?  If so, I would say that X is crashing.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#3 2013-05-10 16:43:12

ryan16144
Member
Registered: 2013-02-16
Posts: 17

Re: [Solved] ~/.xinitrc being reset after suspend

its still alive, i pop right back in to I3

Last edited by ryan16144 (2013-05-10 16:44:05)

Offline

#4 2013-05-10 17:19:35

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,553
Website

Re: [Solved] ~/.xinitrc being reset after suspend

So the issue then is that (some of) the configuration you do in xinitrc is undone after suspend.  The title of the thread is a bit misleading.

You refer to keyboard rate and keymappings - elaborate on these, as these are the actual issues.  Xinitrc is irrelevant except that that is where you initialy made these settings.

Last edited by Trilby (2013-05-10 18:40:54)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#5 2013-05-10 18:30:22

ryan16144
Member
Registered: 2013-02-16
Posts: 17

Re: [Solved] ~/.xinitrc being reset after suspend

Sorry about the title.  I set my keyboard repeat rate to 200 40 and i mapped the Caps Lock key to escape.  After suspend the keyboard repeat rate is back to default and caps lock is just caps lock.

Offline

#6 2013-05-10 18:33:43

HalosGhost
Forum Fellow
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 2,097
Website

Re: [Solved] ~/.xinitrc being reset after suspend

Those sound like things better handled by the DE/WM itself, not by xinit.

i3wm should be entirely capable of handling the key mapping in the config file. As for the keyboard repeat rate, I'm not sure, but I imagine that might be better handled by an xorg configuration file.

All the best,

-HG

Offline

#7 2013-05-10 19:08:21

ryan16144
Member
Registered: 2013-02-16
Posts: 17

Re: [Solved] ~/.xinitrc being reset after suspend

I would be inclined to disagree, Halos.  It states in the wiki that you should put keyboard repeat rate in your xinitrc.  I would rather fix the issue than work around it.

Offline

#8 2013-05-10 19:11:32

HalosGhost
Forum Fellow
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 2,097
Website

Re: [Solved] ~/.xinitrc being reset after suspend

ryan16144 wrote:

I would be inclined to disagree, Halos.  It states in the wiki that you should put keyboard repeat rate in your xinitrc.  I would rather fix the issue than work around it.

I don't know where it says to do that, but I'd stand by putting it in an xorg conf file. That wouldn't be a work-around, it would be a more complete and functional solution. Putting that in the xinitrc seems workaroundish to me (Either that should be handled by the DE/WM, or by X itself, not by xinit).

All the best,

-HG

Offline

#9 2013-05-10 19:13:31

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [Solved] ~/.xinitrc being reset after suspend

I agree with ryan16144, there's nothing wrong with putting these commands in .xinitrc although you can use e.g. .Xmodmap too.

Offline

#10 2013-05-10 19:18:27

HalosGhost
Forum Fellow
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 2,097
Website

Re: [Solved] ~/.xinitrc being reset after suspend

karol wrote:

I agree with ryan16144, there's nothing wrong with putting these commands in .xinitrc although you can use e.g. .Xmodmap too.

Fair enough. I don't actually use a .xinitrc anymore, so I may be biased tongue

All the best,

-HG

Offline

#11 2013-05-10 20:17:35

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,727

Re: [Solved] ~/.xinitrc being reset after suspend

I agree that .xinitrc is a good place to put this stuff, as an Openbox user, I also like the openbox startup file.

At issue here is that something is changing the state of your settings after you set them.  The question is why?  Obviously, it is happening coming out of sleep.  For whatever reason, your hardware is being set to the defaults.  It seems possible that fully integrated environments might do some house keeping for you when resuming.  The more basic environments are likely to leave it to you.  So, can we 'hook' coming out of sleep in some manner?  I cannot give a definitive answer.  I would look into acpi and see if it is involved in your configuration.  If so, you can hook an acpi event to re-run a setup script.   

If acpi is not involved, you can hook systemd as well.  See this wiki entry: https://wiki.archlinux.org/index.php/Sy … vice_files


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#12 2013-05-12 04:12:34

ryan16144
Member
Registered: 2013-02-16
Posts: 17

Re: [Solved] ~/.xinitrc being reset after suspend

Creating a little script to set my keyboard up and hooking it in to systemd worked like a charm.  Is there anyway to log all the commands that get run when resuming, so I can satisfy my curiosity?

Offline

Board footer

Powered by FluxBB