TheLazyIT
Posts: 12
Joined: Tue Mar 26, 2019 2:11 am

Desktop Icons for All Users

Fri Feb 21, 2020 6:34 pm

Hello,

I'm working in chroot to customize the image that the PiServer tool gives my PXE clients. One thing I'm attempting to do is provide the same desktop icons for all users including any users that may get created later. I'm found the following thread, but it doesn't seem very clear to me. I get a > in the terminal when I attempt to do a symlink. What am I doing wrong?

Thread: https://askubuntu.com/questions/663491/ ... joined-mac


My results:

root@MYSERVERNAME:/# bash -c 'ln -s /usr/share/applications/libreoffice-writer.desktop /home/$USER/Desktop/libreoffice-writer.desktop
>

User avatar
kerry_s
Posts: 731
Joined: Thu Jan 30, 2020 7:14 pm

Re: Desktop Icons for All Users

Fri Feb 21, 2020 10:42 pm

your missing a " ' " on the end of that.

GlowInTheDark
Posts: 577
Joined: Sat Nov 09, 2019 12:14 pm

Re: Desktop Icons for All Users

Fri Feb 21, 2020 11:10 pm

Actually, the problem is not that you have too few quote marks; it is that you have too many.

All of the following characters are also unnecessary and confusing your post:

b
a
s
h

-
c


Get rid of all of those as well as the stray quotes and it will work much better.
GitD's list of things that are not ready for prime time:
1) IPv6
2) 64 bit OSes
3) USB 3
4) Bluetooth

User avatar
kerry_s
Posts: 731
Joined: Thu Jan 30, 2020 7:14 pm

Re: Desktop Icons for All Users

Fri Feb 21, 2020 11:14 pm

lol.

it should just be:

Code: Select all

ln -s /usr/share/applications/libreoffice-writer.desktop /home/$USER/Desktop/libreoffice-writer.desktop

incognitum
Posts: 476
Joined: Tue Oct 30, 2018 3:34 pm

Re: Desktop Icons for All Users

Sat Feb 22, 2020 7:55 pm

Keep in mind that the linked website suggests using an autostart .desktop file to execute that command when each individual user logs in.
In that case the bash part do is relevant, otherwise variables like $USER may not be filled in...


As in:

Code: Select all

sudo leafpad /etc/xdg/autostart/commands-to-run-on-login.desktop
Create a file among the lines of:

Code: Select all

[Desktop Entry]
Type=Application
Name=commands to run when user logs in
Exec=bash -c 'ln -s /usr/share/applications/libreoffice-writer.desktop /home/$USER/Desktop/libreoffice-writer.desktop'

TheLazyIT
Posts: 12
Joined: Tue Mar 26, 2019 2:11 am

Re: Desktop Icons for All Users

Thu Feb 27, 2020 10:53 pm

incognitum wrote:
Sat Feb 22, 2020 7:55 pm
Keep in mind that the linked website suggests using an autostart .desktop file to execute that command when each individual user logs in.
In that case the bash part do is relevant, otherwise variables like $USER may not be filled in...


As in:

Code: Select all

sudo leafpad /etc/xdg/autostart/commands-to-run-on-login.desktop
Create a file among the lines of:

Code: Select all

[Desktop Entry]
Type=Application
Name=commands to run when user logs in
Exec=bash -c 'ln -s /usr/share/applications/libreoffice-writer.desktop /home/$USER/Desktop/libreoffice-writer.desktop'
That worked. Thank you!! One note to anyone else looking to do this. I attempted to put multiple symlinks in the same .desktop file, but couldn't fully get it to work. Not sure what I need to do to make that work, but I just created separate .desktop files for now.

User avatar
kerry_s
Posts: 731
Joined: Thu Jan 30, 2020 7:14 pm

Re: Desktop Icons for All Users

Fri Feb 28, 2020 12:29 am

the .desktop standard just does 1 commad.
what i usually do is use it to launch a script, that way i only have to change 1 file, you can put what ever you want in a script. that way i can check for instace if a file is there already and not run the command, run other scripts, or just a list of things i want done

Return to “Beginners”