desktop setup script

About writing shell scripts and making the most of your shell
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Locked
Kent88

desktop setup script

Post by Kent88 »

I'm trying to make a script to do post install tasks for desktops used by the computer club on campus. So far I've managed to get my script to install/update popular software (Eclipse and monodevelop IDEs, libreoffice, firefox, various compilers, etc) but really I don't have much experience scripting.

I was thinking it would be nice if, after those programs have been installed, I could have the script put .desktop files in the desktop folder linking to specific, predetermined programs that would also save time. Is this feasible? If so what would be the best way to get that to work?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
xenopeek
Level 25
Level 25
Posts: 29595
Joined: Wed Jul 06, 2011 3:58 am

Re: desktop setup script

Post by xenopeek »

Are you still using LM11 LXDE, or which Linux Mint version + desktop environment are you currently using?
Image
Kent88

Re: desktop setup script

Post by Kent88 »

Sorry about that, we're running Mint 12 KDE.
User avatar
xenopeek
Level 25
Level 25
Posts: 29595
Joined: Wed Jul 06, 2011 3:58 am

Re: desktop setup script

Post by xenopeek »

If from the menu (right-click on an application) I select to add something to the desktop, the file that changes in my user's home folder is ~/.kde/share/config/plasma-desktop-appletsrc. I can see where it adds the application icon in that, but it doesn't seem to be as easy as on other desktops (sequence numbers to entries and all). Probably there is documentation out there, or probably an API to interface to this file. But here ends my KDE knowledge :wink:
Image
Kent88

Re: desktop setup script

Post by Kent88 »

I was pushing for them to use LXDE mint, but our advisor really wants a 64-bit OS, not to get off topic, but I don't suppose there are plans for a mint 13 LXDE 64-bit?
User avatar
xenopeek
Level 25
Level 25
Posts: 29595
Joined: Wed Jul 06, 2011 3:58 am

Re: desktop setup script

Post by xenopeek »

I don't know, but you could pull fast one and do this? http://forum.linuxmint.com/viewtopic.ph ... 7&p=554458
Image
Kent88

Re: desktop setup script

Post by Kent88 »

What kind of extras could I get rid of by doing that? I would still want some KDE components, (KATE, K3B, Konsole) but I don't need the option of logging in to KDE if we went with LXDE like that. Would it be beneficial to use another login manager? If we were to go this route I'd see it as:
1) post-install apt-get stuff (done except would add LXDE and a login manager, remove certain KDE components)
2) change default login manager
3) get those .desktop files into the /home/~/Desktop folder

Preferably all in one script, no restarts.
would that be simpler than trying to add the .desktop files to plain mint KDE?
User avatar
xenopeek
Level 25
Level 25
Posts: 29595
Joined: Wed Jul 06, 2011 3:58 am

Re: desktop setup script

Post by xenopeek »

That sounds horribly complex :shock: If you intend to use all those KDE applications, just stick with KDE and figure out how to add shortcuts to the desktop. From what I've see here http://techbase.kde.org/KDE_System_Admi ... pScripting, I think you can script this with JavaScript and the Plasma Desktop API. No idea how though, but perhaps try the KDE forums? http://forum.kde.org/
Image
Kent88

Re: desktop setup script

Post by Kent88 »

.desktop files are just text files with entries for the name, command, icon, description, etc? Is it possible to make a new .desktop file, write the needed fields to it, then copy the file and add the specifics for each predetermined application?

Seems needlessly complicated for something so simple, but creating, writing, and editing files via a bash script sounds useful, if it can be done, can it?
User avatar
xenopeek
Level 25
Level 25
Posts: 29595
Joined: Wed Jul 06, 2011 3:58 am

Re: desktop setup script

Post by xenopeek »

On Gnome, MATE, LXDE, and I think Xfce, yeah. But I think KDE doesn't do .desktop files, or does it? I copied one of the .desktop files to the desktop, it didn't magically turn into a shortcut as it does on Gnome. I'm really thinking you are stuck with either going at the plasma-desktop-appletsrc file or the mentioned API. May I again raise the option of the KDE forums :wink:
Image
Kent88

Re: desktop setup script

Post by Kent88 »

KDE does .desktop files, when you first put a .desktop file in the folder it usually asks you if it is ok the first time you run it, perhaps this caused issues?
Locked

Return to “Scripts & Bash”