[Solved] Loading .xmodmap at system startup?

Post here if you are a new Porteus member and you're looking for some help.
User avatar
neon_v0id
White ninja
White ninja
Posts: 4
Joined: 09 Apr 2016, 11:15
Distribution: Porteus 3.1 XFCE
Location: USA

[Solved] Loading .xmodmap at system startup?

Post#1 by neon_v0id » 09 Apr 2016, 11:23

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
Last edited by neon_v0id on 12 Apr 2016, 22:48, edited 1 time in total.

Bogomips
Full of knowledge
Full of knowledge
Posts: 2564
Joined: 25 Jun 2014, 15:21
Distribution: 3.2.2 Cinnamon & KDE5
Location: London

Re: Loading .xmodmap at system startup?

Post#2 by Bogomips » 09 Apr 2016, 11:42

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
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB

User avatar
neon_v0id
White ninja
White ninja
Posts: 4
Joined: 09 Apr 2016, 11:15
Distribution: Porteus 3.1 XFCE
Location: USA

Re: Loading .xmodmap at system startup?

Post#3 by neon_v0id » 09 Apr 2016, 23:47

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

Bogomips
Full of knowledge
Full of knowledge
Posts: 2564
Joined: 25 Jun 2014, 15:21
Distribution: 3.2.2 Cinnamon & KDE5
Location: London

Re: Loading .xmodmap at system startup?

Post#4 by Bogomips » 10 Apr 2016, 01:02

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).
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB

User avatar
neon_v0id
White ninja
White ninja
Posts: 4
Joined: 09 Apr 2016, 11:15
Distribution: Porteus 3.1 XFCE
Location: USA

Re: Loading .xmodmap at system startup?

Post#5 by neon_v0id » 11 Apr 2016, 00:37

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

Bogomips
Full of knowledge
Full of knowledge
Posts: 2564
Joined: 25 Jun 2014, 15:21
Distribution: 3.2.2 Cinnamon & KDE5
Location: London

Re: Loading .xmodmap at system startup?

Post#6 by Bogomips » 11 Apr 2016, 01:05

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.
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

Re: Loading .xmodmap at system startup?

Post#7 by brokenman » 11 Apr 2016, 03:18

Any reason not to use the rc.local file or the autostart folder for xfce?
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 3933
Joined: 20 Mar 2012, 03:42
Distribution: v5.0-64bit
Location: australia
Contact:

Re: Loading .xmodmap at system startup?

Post#8 by ncmprhnsbl » 11 Apr 2016, 03:37

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:
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

Bogomips
Full of knowledge
Full of knowledge
Posts: 2564
Joined: 25 Jun 2014, 15:21
Distribution: 3.2.2 Cinnamon & KDE5
Location: London

Re: Loading .xmodmap at system startup?

Post#9 by Bogomips » 11 Apr 2016, 16:08

@ 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:
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB

User avatar
neon_v0id
White ninja
White ninja
Posts: 4
Joined: 09 Apr 2016, 11:15
Distribution: Porteus 3.1 XFCE
Location: USA

Re: Loading .xmodmap at system startup?

Post#10 by neon_v0id » 11 Apr 2016, 23:46

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 :)

User avatar
francois
Contributor
Contributor
Posts: 6435
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

Re: Loading .xmodmap at system startup?

Post#11 by francois » 12 Apr 2016, 00:37

Welcome to porteus way of life neon_v0id. :wink:

Solved, so write is so in your title.
Prendre son temps, profiter de celui qui passe.

Bogomips
Full of knowledge
Full of knowledge
Posts: 2564
Joined: 25 Jun 2014, 15:21
Distribution: 3.2.2 Cinnamon & KDE5
Location: London

Re: Loading .xmodmap at system startup?

Post#12 by Bogomips » 12 Apr 2016, 00:41

@ neon_v0id

:beer:
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB

Post Reply