Page 1 of 1

[Solved] Loading .xmodmap at system startup?

Posted: 09 Apr 2016, 11:23
by neon_v0id
Hi, I just created and filled out an .xmodmap file with a couple lines in order to make my Caps Lock key function as another Escape key (for Vim) but I can't figure out how to make it run at system startup. Right now I have to manually start it via

Code: Select all

xmodmap ~/.xmodmap
or the alias I made ("xmod"). It isn't a huge deal but I would love if I could get it to run automatically. I'm using XFCE if that matters.

Or is there even some other way to set Caps Lock as Escape? I couldn't find anything in the GUI settings.

Thanks :beer:

Edit: Solved! The simple answer was to name the file .Xmodmap instead of .xmodmap

Re: Loading .xmodmap at system startup?

Posted: 09 Apr 2016, 11:42
by Bogomips
Welcome to Porteus.

Using boot parameter guiexec=xmodmap~/home/guest/.xmodmap
(if saving changes, and file will already be there in your $HOME directory)
Ref: http://www.porteus.org/component/conten ... -them.html

Re: Loading .xmodmap at system startup?

Posted: 09 Apr 2016, 23:47
by neon_v0id
Bogomips wrote:Welcome to Porteus.

Using boot parameter guiexec=xmodmap~/home/guest/.xmodmap
(if saving changes, and file will already be there in your $HOME directory)
Ref: http://www.porteus.org/component/conten ... -them.html
Thanks for the help, but I can't get that method to work for some reason. I'm pretty sure I'm doing it right.

Because I want these changes to be saved I'm editing my /boot/syslinux/porteus.cfg file and adding the line you mentioned to the APPEND section.

Here is a screenshot of my porteus.cfg file: http://i.imgur.com/QeXjJVp.png

But when I boot up the system my xmodmap is still default, my changes aren't applied. I still have to manually initiate .xmodmap

Re: Loading .xmodmap at system startup?

Posted: 10 Apr 2016, 01:02
by Bogomips
Next Suggestion:

Code: Select all

guiexec=Xdialog~--msgbox~GUIEXEC~0~0;xmodmap~/mnt/sdXy/Path/to/xmodmap
the file xmodmap residing on a real file system. where sdXy either hdd or usb stick. (Dialog pop up Just to ensure this is what is happening).

Re: Loading .xmodmap at system startup?

Posted: 11 Apr 2016, 00:37
by neon_v0id
Bogomips wrote:Next Suggestion:

Code: Select all

guiexec=Xdialog~--msgbox~GUIEXEC~0~0;xmodmap~/mnt/sdXy/Path/to/xmodmap
the file xmodmap residing on a real file system. where sdXy either hdd or usb stick. (Dialog pop up Just to ensure this is what is happening).
Thanks again for helping. I added that new 'cheatcode' to my porteus.cfg file and rebooted the system. A dialog window did pop up that said "GUIEXEC" but xmodmap was once again not initialized. I even moved my .xmodmap file to a different location on the USB stick and that didn't help. Also I manually started my .xmodmap at its new location and it worked, just to be sure I didn't mess that part up.

Here is an image of my new porteus.cfg and the dialog box that popped up: http://imgur.com/MYVN0xl

Re: Loading .xmodmap at system startup?

Posted: 11 Apr 2016, 01:05
by Bogomips
Thanks for feedback. This confirms that guiexec instructions are being carried out. So it seems like your change is being overwritten further down the line. I'll ask francois if he can take this further, as he seems to have quite some experience with these X tools.

Re: Loading .xmodmap at system startup?

Posted: 11 Apr 2016, 03:18
by brokenman
Any reason not to use the rc.local file or the autostart folder for xfce?

Re: Loading .xmodmap at system startup?

Posted: 11 Apr 2016, 03:37
by ncmprhnsbl
as brokenman suggests:
try xfce menu > Settings > Session and Startup > Add > Command: xmodmap ~/.xmodmap
for Name and Description, fill in as you like..
i guess this makes a <Name>.desktop file in ~/.config/autostart (checked: it does)

seems odd that guiexec= isn't working for you :pardon:

Re: Loading .xmodmap at system startup?

Posted: 11 Apr 2016, 16:08
by Bogomips
@ neon_v0id

Digging deeper it appears that you don't have to do anything, other than to have your file named as /home/guest/.Xmodmap, and the modmapping will be done for you, hopefully. :roll:

Re: Loading .xmodmap at system startup?

Posted: 11 Apr 2016, 23:46
by neon_v0id
Bogomips wrote:@ neon_v0id

Digging deeper it appears that you don't have to do anything, other than to have your file named as /home/guest/.Xmodmap, and the modmapping will be done for you, hopefully. :roll:
That was it. That did it. It was just that simple lmao :lol:

Thanks a ton, man.

Edit: And thanks to brokenman and ncmprhnsbl for your suggestions, too. I'll definitely keep them in mind for the future :)

Re: Loading .xmodmap at system startup?

Posted: 12 Apr 2016, 00:37
by francois
Welcome to porteus way of life neon_v0id. :wink:

Solved, so write is so in your title.

Re: Loading .xmodmap at system startup?

Posted: 12 Apr 2016, 00:41
by Bogomips
@ neon_v0id

:beer: