Advertising

Welcome to SparkyLinux forums
Zapraszamy również na polsko-języczne Forum https://forum.linuxiarze.pl

how to run scripts at startup?

Started by fanis, January 20, 2014, 03:48:09 PM

Previous topic - Next topic

fanis

Hi, I installed sparky ultra on an old pc and I am very pleased with the performance. My problem is I can not find how to set multiple layouts. At "Keyboard layouts settings" I am not able to see that option. I could set my preffered layout but I see noway to set multiple layouts. This is quite bad for openbox I think.



luckily I know a way around!

I can simply run this script using setxkbmap

Code:

#! /bin/bash
setxkbmap "us,gr" -option "grp:caps_toggle"
setxkbmap -option grp_led:scroll us,gr


and this does exactly what I want.



My problem is I can find no way to run it automatically on start. If I can not find that the best I can do is to put that in .bashrc so at least I can have my multiple layouts as soon as I open a terminal. I am not pleased with this.



So how can I do it properly? Thank you.

pavroo

#1
You can create a new file in your home directory, for example: .mykeyboard

Place the three line of the text to the file and set execute right for it:

Code:

chmod a+x /home/your-nick/.mykeyboard


Then add the file to the OpenBox startup - edit the file: /home/your-nick/.config/openbox/autostart.sh and add a new line to it:

Code:

/home/your-nick/.mykeyboard &


Nothing is easy as it looks. Danielle Steel
Join #sparkylinux.org at [url="//irc.libera.chat"]irc.libera.chat[/url]

fanis

#2

Quote:

Quote from pavroo on January 20, 2014, 17:49

/home/your-nick/.config/openbox/autostart.sh


thank you, that was what I was asking for.

dhinds

#3
I installed Ultra on a ThinkPad W520 yesterday and am facing this issue myself but with one or two complications:



I need to toggle between two different keyboard layouts (US English and Latin American Spanish).  I was able to do that in Sparky Mate and in Gnome, but not yet in Ultra.



I am assuming it can be done.  But how?  (I configured my Mate installation to toggle from one to the other using both shift keys at once - a fast and easy way to accomplish that goal).



Since I require the Spanish Keyboard for drafting documents in Spanish (for Ñ, ¿, ¡, accents etc.) I have changed to the Spanish configuration but this computer was purchased in the USA and has an English keyboard).



TIA



Another thing:



Usually, I configure the energy consumption to suspend when the lid of the laptop is closed, but I haven't found a way to do that either.  (This is my first installation of ultra on a laptop).




pavroo

#4
There is a nice app for keyboard called 'fcitx'.

It'll be loaded to the panel's tray after installing and rebooting.

To manage energy run:

Code:

xfce4-power-manager-settings


Nothing is easy as it looks. Danielle Steel
Join #sparkylinux.org at [url="//irc.libera.chat"]irc.libera.chat[/url]

dhinds

#5
Thanks Parvoo.



One more question:



Is there a way to back up the icedove settings configured to a root account?  (Using SparkyBackup-Apps from root the only options are for the user accounts and the account with the email settings is inaccessible and the SparkyBackup-Apps file generated is empty - but I re-did them on the root account, so if they can be copied, that would save the time it would take to redo 15 of them).



TIA

pavroo

#6
Yes, you can do it.

Remove existing icedove settings from /home/you/.icedove

Then copy /root/.icedove folder to your /home/you/ directory.

The .icedove folder belongs to root user so change rights to it as root after copying:

Code:

chown you /home/you/.icedove
chmod -R 755 /home/you/.icedove


Nothing is easy as it looks. Danielle Steel
Join #sparkylinux.org at [url="//irc.libera.chat"]irc.libera.chat[/url]

dhinds

#7
Thanks again.  You are a true guru.



What I want to do is install the icedove configuration from my Sparky Mate root account to the user account of Sparky Ultra, on a different partition.  (In any case, I assume the principle is the same).  And I could also use the same procedure to transfer the accounts to a user account on Sparky Mate.

dhinds

#8

Quote:

Quote from pavroo on January 28, 2014, 17:00

There is a nice app for keyboard called 'fcitx'.

It'll be loaded to the panel's tray after installing and rebooting.

To manage energy run:

Code:

xfce4-power-manager-settings






fcitx did the trick. As you said, it's a nice little app, which let me add a second keyboard and then type the combination I want to use to toggle between them.  So ";;;;;" and "ñññññ" are 2 differrent results from hitting the same key, after pressing both shift keys simultaneously.



As for the xfce4-power-manager, an icon for it was installed automatically on the desktop during an Sparky APTus update / ugrade of either the system or distro and opening it's preferences allowed me to configure this laptop computer to suspend on closing the lid.



I was also able to install my icedove configuration from Sparky Mate to Ultra, so everything is fine now with the latter, which I am using at this moment.



So thanks again, pavroo.  Sparky users don't have to suffer.  :D



I will also mention a rather weird thing that happened:  After rebooting recently into Sparky Ultra, I was unable to enter my user account so I logged on as root.  On opening gparted I noticed that the /home partition had not been mounted and figured I would have to edit the fstab file (which you had explained how to do earlier).  However:  I also noticed that an external USB3 hard drive that was connected had replaced the drive Sparky is on as sda (it became sdb).  So all I had to do was reboot, removing the external drive in the process.  I can connect it later, if needed.



xfce's being a modular DE means I can add only those elements I need to Ultra in order to have a fully functioning system. (I also discovered XKill is effective when needed).



The power supply of the large desktop machine failed recently, and having adding Ultra to the laptop let me continue working while identifying the source of the problem and replacing it later this week with one of a different brand.  (The failed unit was a Cooler Master, which lasted 3.5 years.  I intend to replace it with a Corsair of the same size - 600 watts).

fanis

#9

Quote:

Quote from fanis on January 20, 2014, 18:47

Quote:

Quote from pavroo on January 20, 2014, 17:49

/home/your-nick/.config/openbox/autostart.sh


thank you, that was what I was asking for.




I tried JWM instead of openbox and has even better performance. How can I do the same on JWM?

pavroo

#10

Code:

/home/you/.jwmrc


Find & use:

Code:

<StartupCommand>your-application</StartupCommand>


Nothing is easy as it looks. Danielle Steel
Join #sparkylinux.org at [url="//irc.libera.chat"]irc.libera.chat[/url]

View the most recent posts on the forum