[SOLVED] Install Startup Settings (Gnome Startup settings)

I want to install Startup Settings (Gnome Startup settings) on the phone but somewhere I missed something. Did

$ sudo apt install git

then

$ sudo apt install startup-settings-git

which didn’t work, so I searched it in Debian Packages search and made no hit. Went to his repos and followed his guide by

$ wget https://github.com/hant0508/startup-settings/raw/master/debian/startup-settings-amd64.deb sudo dpkg -i startup-settings-amd64.deb went to Section Usage and ran $ startup-settings which gave me bash: startup-settings: command not found

You can’t use an amd64 deb on the phone, you have to use an arm deb. Not sure which one, though, as I don’t have an L5.

I realized that :frowning: is there a way to repack this for arm deb or has this to be done by the maintainer of the package?

Install gnome tweaks, sudo apt install --no-install-recommends gnome-tweaks and you can add or remove startup apps, it may not fit in the screen but in the forums you can find a way to scale to fit the apps.

the thing is I want to run a specific script when logged in and not an Application. I already checked gnome tweaks.

You can create a .desktop file for that script and add it to ~/.config/autostart/yourscript.desktop with something like this.

[Desktop Entry]
Type=Application
Exec="~/path/to/yourscript.sh"
X-GNOME-Autostart-enabled=true
Name=Your script
Comment=Your script launcher

What Gnome tweaks do is to add an already created .desktop file to this path so it will start at launch, I didn’t test it on the Librem5 but it should work.

PS. Make sure that you script can run.

chmod +x ~/path/to/yourscript.sh
1 Like

I created the wannarun.desktop in ~/.config/autostart/wannarun.desktop and restarted the phone. Nothing happened.

In Gnome tweaks I wasn’t able to see / add .wannarun.desktop under Startup Applications.

If you put the desktop file in ~/.local/share/applications/ can you see it in Gnome Tweaks?

Sadly not, no. A restart didn’t help it either.

Do you have an Icon=~/ path in the desktop file?
Sometimes also a Path=~/ variable to the application is usefull

you mean like

[Desktop Entry]
Type=Application
Icon=~/.local/share/applications/wannarun.sh
Exec="~/Desktop/testfolder/wannarun.sh"
X-GNOME-Autostart-enabled=true
Name=wannarun.sh
Comment=wannarun

?

Icon=~/.local/share/applications/wannarun.sh

A.f.a.i.k is it not custom to place the Icon in ~/ / share/applications , only the .desktop is placed there. The Icon is also a picture with a .png or .jpg name.
A standard .desktop text looks like:

!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.4.x.x
Type=Application
Terminal=false
Exec= ~/path/to/yourscript.sh (without quotes!)
Name=Wannarun
Comment=“description of whatever it does”
Icon=~/path to yourscript/IconName.png
Path=~/path to youscript

did

[Desktop Entry]
Type=Application
Exec=~/Desktop/Folder/wannarun/wannarun.sh
X-GNOME-Autostart-enabled=true
Name=wannarun
Comment=wannarun script
Icon=~/Desktop/Pictures/star-icon.png
Path=~/Desktop/Folder/wannarun.sh

for

wannarun.desktop

under

~/.local/share/applications/

Still no success. Even replacing X-GNOME-Autostart-enabled=true with Terminal=false didn’t do its justice :thinking:

However, I’m currently in contact with an Experienced Debian developer. I asked him for creating an arm architecture of Startup Settings specifically for the L5 byzantium release which he agreed on but it takes time and at the same time he got in touch with the head of PureOS developers for the price-Negotiation since I want to release it to the public so everbody can benefit from it and save us from some repetitive tasks :smiley:

Shell expansion will not work for this desktop (i.e. ~/ in the path does not expand to your home directory) so the executable will never be found.

Assuming the script you wish to execute is at /home/purism/Desktop/Folder/wannarun/wannarun.sh

The minimum .desktop file would be…

[Desktop Entry]
Type=Application
Name=wannarun
Path=/home/purism/Desktop/Folder/wannarun
Exec=/home/purism/Desktop/Folder/wannarun/wannarun.sh

You may not need the Path variable, it depends on what the script does. The Path variable defines the directory in which the script initially runs, for example if your script included a line touch wannarun.out the file wannarun.out would be created in the directory as defined in the Path variable, in this case /home/purism/Desktop/Folder/wannarun/

2 Likes

Now it appears under Tweaks->Startup Applications and on main menu screen but by clicking the app, it just shows the background of the phone and does nothing. Restarting the phone gives me nothing.

If you call the wannarun.sh script directly, does it run? Does it do what it is expected to do?

I’d suggest starting simple, before my initial reply on this thread I did a quick sanity check on the phone to ensure it was functioning as expected.

I created a basic script and minimal .desktop file just to check the autostart feature.

The script was created as /home/purism/as-test.sh and contained the following…

#!/bin/bash

touch as-test-has-ran

then from the terminal I ensured it was executable…

chmod +x /home/purism/as-test.sh

Then I created the .desktop file as /home/purism/.config/autostart/as.desktop with the following contents…

[Desktop Entry]
Type=Application
Name=as-test
Path=/home/purism/
Exec=/home/purism/as-test.sh

I did a quick test from the terminal calling the script directly…

/home/purism/as-test.sh

and checked with ls that the file as-test-has-ran was created (it was). Then I removed the created file…

rm /home/purism/as-test-has-ran

I rebooted the phone and saw the file as-test-has-ran had been recreated when I logged in, showing that .desktop files placed in ~/.config/autostart/ are parsed and scripts can be executed.

I’m using full paths here for absolute clarity, you shouldn’t need them other than in the .desktop file.

You can also check the journal log for errors, I think any errors here would essentially get tagged “–user” so it would be worth looking over the logs, they provide clues as to what the issue is at your end.

OH MY GOSH…now I know what the problem was…I basically knew but didn’t want it to be true and it seemed to be a ridiculous idea…instead of calling the script directly inside wannarun.desktop, I had to create a second bash-script that would act as a middleman for the script I wanted to actually run. Like middleman-script is used inside wannarun.desktop and the middleman-script will actually run the wannarun.sh in a new terminal. Now it works :smiley: :+1:

I did this with scripts before and I never had to do that, you’ve got it “solved” now but if you want to investigate a bit more you can try this in your desktop file:

Exec="sh /home/purism/Desktop/Folder/wannarun/wannarun.sh"

Do you have at the beginning of your script the shebang and the interpreter path?

#!/bin/bash

yes, I do.

I am trying to run a startup script that looks like this

#!/bin/bash
alsactl restore -f /home/purism/alsa.conf
touch alsa_set

but running the script throws an Access denied error. The commands within the script executes fine and I would also like to have it run automatically on reboot. I tried a .desktop file and placed it in ~/.local/share/applications

[Desktop Entry]
Type=Application
Name=alsa-restore
Path=/home/purism/
Exec=/home/purism/bin/alsa_restore.sh

as suggested above, but so far no luck. I also tried to find the desktop file in gnome-tweaks, but it is not available there. The desktop file looks correct to me, but I may have missed something, but main problem is that the bash script gives me and error.

Any ideas?

1 Like