How to execute a command when GUI is loaded?
Hello All
How do you run a command/script after the Linux is booted and GUI is loaded? I have this script that should run once after every boot when GUI is loaded Code:
$ cat asz.sh I put in /etc/bash.bashrc, but nothing happens. But it will execute as soon as I open terminal window. I don't want this to happen. So where do I put the script which makes it executed after the GUI is loaded? The distro is Kali Linux XFCE in KVM as a virtual guest. Thanks |
I have never needed anything to run one time and GUI startup, but if I did I would dig into the details on configuring XFCE!
|
Since Kali is based on Debian, it should use systemd. The rc-local service is executed as the very last service; try adding your script to /etc/rc.local and ensure this service is enabled.
Or create a service unit that launches the script and runs after the graphical target. |
Did the following
Code:
$ ls -lh /etc/systemd/system/ixrandr.service |
Quote:
I'm pretty sure XFCE has a setting for "Startup Applications" or "Autostart", where you can add your own scripts and commands. That's what you want. |
1 Attachment(s)
Quote:
|
No, point it to asz.sh instead.
|
3 Attachment(s)
Tried. Same result.
Have attached three screenshots. The last one is what I want to achieve from the script. |
Then do it manually. Create a .desktop file and put it to ~/.config/autostart/
Code:
[Desktop Entry] |
Quote:
|
Quote:
|
Quote:
Quote:
|
Quote:
Hmm... ~/.xsession might also solve the OP's problem and also be desktop agnostic. We tend forget about the Old Ways. Cheers... |
All times are GMT -5. The time now is 04:56 AM. |