Forum › Forums › New users › New Users and General Questions › Commands in .profile seem to be ignored
- This topic has 9 replies, 5 voices, and was last updated Jan 6-10:58 am by Anonymous.
-
AuthorPosts
-
January 4, 2019 at 8:41 am #15029Member
mowest
Perhaps this is by design, but maybe I’ve encountered a bug.
I’m a vim user and so I like to swap the function of my Caps_Lock and Esc keys. This is easy to do with the command “setxkbmap -option caps:swapescape”. This command works as expected when I run it in the terminal, but I would like to to do this automatically when I start Antix 17.3.1 from Persistence All on a Live USB.
I have “setxkbmap -option caps:swapescape” command in my ~/.profile. In Ubuntu based distros this command get run when I log into a session once because it is in the .profile. This does not seem to happen when I log into Antix. I know that Persistence All is working because all of my additional apps are installed, and my .vimrc file is kept and works as expected as well. So I know that Persistence root and home are functioning as expected.
Any thoughts on why this isn’t working to have the command in ~/.profile?
Is there a better way I could run this command that would work in Antix 17.3.1?Thanks for your help.
January 4, 2019 at 11:00 am #15031Anonymous
::Possibly you added that line near the top of ~/.profile, earlier than the PATH declaration line. If so, full path may be necessary
/full/path/to/setxkbmap -option caps:swapescapeJanuary 4, 2019 at 12:00 pm #15033Moderator
caprea
::You could also try to write the above command in the startup-file in the hidden desktop-session folder in home.Maybe with the full path, like skidoo mentioned.
January 5, 2019 at 12:53 pm #15074Member
mowest
::I put the command at the end of ~/.profile, however, that was a good suggestion skidoo, so I tried it, but it still doesn’t work. At the end of ~/.profile I put:
/usr/bin/setxkbmap -option caps:swapescapeIt still fails to execute the command and make the change. After adding the full path as above, I tried restarting the session, and even rebooting hoping that it would be triggered, but nothing.
Caprea, I’m a little unsure of what you are suggesting so I didn’t give that a try. Are you suggesting that I write a bash script called “swap.sh” with just that command in the script file and put it into my ~/bin folder and then put “~/bin/swap.sh” into my ~/.profile file? I could try that if that is what you mean.
- This reply was modified 4 years, 4 months ago by mowest.
January 5, 2019 at 1:30 pm #15079Moderator
caprea
::Are you suggesting that I write a bash script called “swap.sh”……
No, my thoughts were much less complicated
Open control-centre, go to session
then open “desktop session of user”
this will open geany and the startup-file
There you can write in the
/usr/bin/setxkbmap -option caps:swapescape &
command
Close and save, logout/in or reboot.January 5, 2019 at 2:17 pm #15082Anonymous
::results of a quick websearch “session setxkbmap” indicate adding that line into ~/.xinitrc should be effective
January 5, 2019 at 6:20 pm #15099Moderator
Brian Masinick
::results of a quick websearch “session setxkbmap” indicate adding that line into ~/.xinitrc should be effective
That makes good sense since it is a keyboard mapping that activates with the X server, therefore initialize it in the X init file, a.k.a. .xinitrc.
--
Brian MasinickJanuary 6, 2019 at 1:05 am #15118Forum Admin
Dave
::I don’t think .xinitrc is used and as such caprea’s suggestion would be the correct replacement file.
I am thinking that perhaps bash is not being loaded when a terminal is opened… this would be visible by the user prompt not being colourful and showing the path. You can verify if this is the case by typing “bash” as the first command in terminal and see if it makes a difference. If it does then /bin/bash likely needs to be specified in /etc/passwd as the user shell.
Computers are like air conditioners. They work fine until you start opening Windows. ~Author Unknown
January 6, 2019 at 10:54 am #15122Moderator
Brian Masinick
::I don’t think .xinitrc is used and as such caprea’s suggestion would be the correct replacement file.
I am thinking that perhaps bash is not being loaded when a terminal is opened… this would be visible by the user prompt not being colourful and showing the path. You can verify if this is the case by typing “bash” as the first command in terminal and see if it makes a difference. If it does then /bin/bash likely needs to be specified in /etc/passwd as the user shell.
If that is the case, you may also be able to add commands to .bashrc
If so make sure they run only in the interactive invocation of the Bash resource file .bashrc.
Otherwise non-interactive scripts could be adversely impacted.
--
Brian MasinickJanuary 6, 2019 at 10:58 am #15123Anonymous
::~/.desktop-session/startup
insert the line
/usr/bin/setxkbmap -option caps:swapescape &Save the edited file and logout. When you login, test whether setxkbmap is now autostarted.
-
AuthorPosts
- You must be logged in to reply to this topic.