Page 1 of 1

Desktop Icons for All Users

Posted: Fri Feb 21, 2020 6:34 pm
by TheLazyIT
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
>

Re: Desktop Icons for All Users

Posted: Fri Feb 21, 2020 10:42 pm
by kerry_s
your missing a " ' " on the end of that.

Re: Desktop Icons for All Users

Posted: Fri Feb 21, 2020 11:10 pm
by GlowInTheDark
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.

Re: Desktop Icons for All Users

Posted: Fri Feb 21, 2020 11:14 pm
by kerry_s
lol.

it should just be:

Code: Select all

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

Re: Desktop Icons for All Users

Posted: Sat Feb 22, 2020 7:55 pm
by incognitum
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'

Re: Desktop Icons for All Users

Posted: Thu Feb 27, 2020 10:53 pm
by TheLazyIT
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.

Re: Desktop Icons for All Users

Posted: Fri Feb 28, 2020 12:29 am
by kerry_s
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