| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

Remastersys - Gnome Customization

Page history last edited by Fragadelic 15 years, 3 months ago

 

Gnome Customization by Aamit Wraj

 

 Hi everyone,

Its just a co-incidence that when I came up with guide to Linux Customization promised earlier,I was surprised with a whole new exclusive board !!!

This has really been a long overdue.Ive been contemplating this for long but it was only the time constraints which prevented me to come up these tips (well, I won’t call this a tutorial)...Nagging apart, below are the points that should be kept into the mind while making and preserving any sort of customization/preferences over the GNOME system...

      I here presume that you are aware with /etc/skel folder in the linux filesystem.Yes,itsa folder which stands for 'skeleton' which transfers all its contents to the User's home folder everytime a New user is being created. I also presume that it must be in your knowledge that the most of the  settings you make over the system are preserved in the User's home. And etc/skel transfer method just copies the settings you have previously made and restores it to the user's home.

      Now the question is what folders and subfolders should be copied to /etc/skel folder so that its preserves almost all the settings that the user intends to. By observing closely we may find several files and folders lying in the user's home, but there are only 6-7 folders and subs which need to be transferred discarding the rest.

Note: This by no means is a rule of thumb but just a set of examples which worked flawlessly for my Distro. Secondly, due to the variance in environments like apps installed or restoration desired, the result & mileage may both vary to some degree,hence,examples are the only way to go. Rest I leave it over your own R&D!!!

Enough of talking, I shall now begin:

_____________________________________________________________________________________________________________________

========================================================================================================

Go to the user's home and press ctrl+h to reveal all the hidden folders sitting in there. Now choose the following folders explained below and copy it to /etc/skel.(But,here you don't need almost all the sub-folders so further cleaning should be done as the next step.Just try to observe which are the sub-folders you can do without...)

Those folders are:

1)  Desktop - If you want to show or place any of the files and folders over the user's dektop,that should be dropped in here. Suppose you wanna place a shortcut for some application over the desktop, then put that shortcut in Desktop folder and transfer it to /etc/skel.

2)  .config - This basically preserves the settings & customization that are made to the applications and programs.

      Let's take Audacious (audio player) for an example. Suppose you want the tweaked version of the Audacious to be present in you distro (like skins applied,equlizations made,fonts configured etc),leave the folder named Audacious intact. Also make sure that there were no songs present in its playlist while closing it before copying, otherwise a different user using your Distro may raise his eyebrow over Madonna's Beautiful Stranger present in the existing playlist !!! These are the small nuggets that should be kept in the mind while doing an import.

      In an another example,there also exists a folder named "autostart" which should also be left intact which takes care of the programs that starts automatically commissioned by the administrator. If you tend to tinker with "Sessions Preference" in session manager utility,this may come handy.Also,if you have tweaked compiz,then it also makes sense to leave this folder intact too.All the menu settings will be preserved by leaving menu folder untouched.

      To some up,preserve the folders and sub-folders of the apps that you are interested in, and delete the rest. Also delete the files called user-dirs.dirs and users-dirs.locale as this won’t allow the folders like music,videos,pictures to be created in the user's home.

3)  .gconf - Similar to the above folder which also preserves the Configurations made to apps and GNOME itself. Just follow the same what has been explained above.

        As an example here,a sub-folder named /apps/gnome-session will take care of the splash screen configured to run while logging in.Plus, ".../.gconf/desktop/gnome/background/%gconf.xml" will preserve wallpaper settings.Deletion of ".../.gconf/system" is must as it preserves the network settings.The xml file in "...apps/gconf-editor" plus ".../apps/nautilus/desktop/" will held the data regarding the icons present over the desktop(computer,trash,network etc).A folder named "panel" would help retaining panel configurations like its applets and position.

     This folder has most number of directories and sub-directories, so be careful while fiddling up with this.Some of the folder name can be quite tricky too. What I knew as an Image Viewer was actually EOG,and I have been sparing this under the impression that it may be something critical to GNOME !!!A personal suggestion here.If you dont know what this folder actually stands for,goto synaptic and type the exact name and it may bring you some details,otherwise,google is always there.Secondly,reading the *.xml files located in that particular folder can also bring in some info.

4)  .gnome2 - Not all is important here. The funda here is the same as above - what to choose and what not to.

   This I’ve found to have been preserving logs & history of some programs like "gedit" etc.I basically use this for the container of the "nautilus-scripts" that I have on my system. A file called backgrounds.xml will reflect the number of wallpapers present in the system when you choose "change desktop background”. You will also find your power management profile which is safe to delete as you may have it for laptop but you target audience maybe a desktop pc user. Rest I leave it upon you to explore.

5)  .local - I’ve found only one directory to be important in here i.e. ".local/share/applications".When you edit the gnome main menu using alacarte,all the shortcuts like added and removed apps are stored in here.It also works in conjunction with the "menu" folder located in ".config" folder.Added to this,"mimeapps.list" file should also be an important consideration as it maintains the database of the default program assigned for certain filetypes.

6)  .nautilus - A directory named ".nautilus/metafiles" will preserve the different view-states of the different locations like computer,drive & folder icon size,Side Pane,icon views or list views or compact views etc.I personally recommend to use only the file named "computer:%2F%2F%2F.xml" only(if you have made some changes here) and delete the rest. This is because it makes no sense storing the view state of each and every directories you have visited.

7)  .themes & .icons (optional) - These can also be carried over to /etc/skel,but I prefer to transfer it over to /usr/share/themes or /usr/share/icons. It makes me feel that as if I am using system's default themes and icons. The preferences you make for themes and icons are already stored in above mentioned folders.

Rest of the folders that you would observe in user's home is basically meant for storing their respective cache,plugins,data etc.But you can still go forth copying them if you need the one. But I must still insist on copying the above folders only until and unless you have sound reason doing that.

More Miscellaneous:

a. Never hesitate experimenting (but you should actually know what you are doing so that you can revert to the original state if somehow you get screwed).Lots and lots of hits & trials is really the key here.

b. Peep deep into the *.xml files you'd find in the above directories. This will give you the detailed insight of what they are meant for. If you find something important, leave it, else your finger should kiss delete button.

c.If some file or configuration is pointing towards the local directory,you have gotta delete this.For example,if a line in any of the *xml (or other)file reads something like "/home/yourname/xyz/*.jpg",it won’t work over another system. A little common sense will answer why.

f.There's also the possibility that customization can be done without /etc/skel method.A solution for this will be manipulating the default parameters set somewhere in the system itself(Ubuntu's skel folder all empty exept three files) but that is slightly cumbersome and frustrating and beyond the scope of this howto.

g.When you are done with all the transfers & cleaning made to the /etc/skel folder, create a dummy user.This is the fastest way to ensure if it’s working or not. Also compare it with the default state you started with and the environment you received from your hardship. If you are satisfied with the outcome,fire up the remastersys,else,be ready for one more hair-splitting session.

h. Copy the /etc/skel contents to /root folder too,just to ensure that root environment also gets the same look n feel plus configurations of the current user.For example,while running administrator apps,you'd find them coming in with their default themes and icon sets.My synaptic and gdebi package installer looked quite ugly without this.Ive also found it to be safe to wipe out all the folders and replacing it with mine (leave default common folders like music,picture,video etc untouched).

   This step for me is quite justified too.Because if you create a new user,contents from skel folder is automatically transfered, but it’s not the case with root as it is already existing.So you have to manually edit this,and you won’t do this by logging in as root and spend hours bringing it in the same state as you have with others user account(s).And now dont say that nobody logs in as a root user,so you won’t be caught.

i. Install the scripts like "browse as root" and "open with gedit" as it comes quite handy at times.It may be boon for those who aren't comfortable with CLI method of copy-paste and delete.To paste something in /etc/skel folder,it needs to have a root privilage,aint it?!

j. GDM Preferences - This falls beyond the GNOME preferences which has been bugging down the users since time imemmorial.No matter what parameters you would set for your custom GDM Screen,it'll always rolls back to Ubuntu Human.The reason for this is that the settings for GDM is not preserved in user's home but elsewhere.Open up /etc/gdm/gdm.conf and goto line number 504 and replace GraphicalTheme=Human with GraphicalTheme=YOUR OWN THEME.Also line number 347 i.e. GtkTheme=Human can be replaced with your own to customize GtkTheme for the dialog boxes coming up at login screen.Consicutively,line number 465 & 466 can be edited for the custom color againt that brownish camel color reflected pre and post login.

      Also edit gdm.conf-custom manually as this also tends to get copied.

k. Cosmetic Surgery Over ISOLINUX - I personally prefer ISOLINUX mehtod over GRUB to boot my distro off the CD,reason,more appealing look.But what remastersys offers is certainly not meant for the professional approach for you custom distro.But I must again defend remastersys here by saying that its beyond its scope and far too complicated.I once partially succeded by modifying remastersys script,but that was when I was in playful mood.There is other way around which is more feasible.Just copy and replace the contents of "isolinux" folder from Ubuntu's original CD.Furthermore,replace splash.pcx file with your own.And it is more important to edit isolinux.cfg and isolinux.txt along with other text files sitting in that particular folder.Be more cautious while tinkering up with isolinux.cfg file as it holds the menu label and paths for the preseeds plus boot configurations.You can preserve Ubuntu's preseed or remastersys' custom.seed is equally potent (Just assign the right paths).Others are memtest file which also needs some attention if yo are providing a menu meant for "memory test".There are lots and lots of etc. etc. etc. in here,so if you can do it by yourself,Ill feel spared.Ive just given you the hint here,rest is your homework !

   Now put the folder into some safe location.Then, start remastersys and choose "Distcdfs" option that will create CD filesystem.Then replace that "isolinux" folder lying in "/home/remastersys/remastersys/ISOTMP" with what you have just created.And then finally repackage it with "Distiso" command found in remastersys.Burn,reboot and cross your finger for unexpected delight !

l. Keep on cursing (and blessing) Fragadelic for coming up such an addictive script that my girlfriend once scolded me of banging down my computer !!!  Angry Smiley Roll Eyes

 

Addendum:

 

Retaining application(s)/launchers icon:

   Navigate to /home/YOUR_NAME/.local/share/applications and here you would find the launchers/shortcuts for the application(s) that u added in your custom menu.Now open them up with any text editor(geany or gedit),you'd find something like this:

[Desktop Entry]

Categories=Development;

Comment=Python Interpreter (v2.5)

Exec=/usr/bin/python2.5

Icon=/usr/share/pixmaps/python2.5.xpm

Name=Python (v2.5)

NoDisplay=false

StartupNotify=true

Terminal=true

Type=Application

Here,you would notice that the path which is mentioned next to the Icon field tends to be the icon of that program.And if that icon is in the /usr/share/pixmap folder,you dont even need to assign it a full path,just the icon name will do(hence,you dont even need to create a separate folder "custom icon" in the icon folder IF U WISH).

One can also assign icons while creating launchers in the menu in GUI mode,but everytime you would modify the entry,a new icon will be created in the above mentioned folder adding more confusion and complexity(again my personal experience,other may follow what they feel like).And remember,alacarte is still very buggy,so be prepared for some darn surprises here and there !!!

Retaining Menu Icons :

Next,as Ive mentioned it earlier,retaining icon for applications/menu items is easy but not the new menu group that you create(Menu icon will always be replaced with the default 'folder' icon of urs,and if u go wrong somewhere,it will also read 'alcarte-made',not what u have mentioned.It also refuses to delete,so uve to do right from the scratch sometimes).The custom icons shows over my installed system but not over the Live CD.Reason,the configuration path it follows is local not global.But I was half way there to it & will definitely let u know if am fully satisfied with the workaround/solution.

The other way around is editing the default parametres.Try tinkerig /etc/xdg/menus if u are ready for the next hair-splitting session !!! Also,explore deep into applications.menu and settings.menu in /home/YOUR_NAME/.config/menus...(You'd find default icon for the menu in 'category' folder of the icon theme you are using).

Hope this helps...

BONUS : For every application/launcer that you have in your application folder or elsewhere,open them (*.desktop file) in any text editor and mention the name of icon next to the concerned entry and place the icon with same name in usr/share/pixmap folder,all the icon will then instantly show up.

 

SUBJECT: Menu Customization

Yet another method to add app lunchers or shortcuts in the Gnome Main Menu or the Default menu bar.

Open up the *.desktop file in your fave text editor and search for the entry which reads "Categories=___________________"(Add if you find it missing).Yes,this is the entry which takes care of putting that file into the concerned categories or sub-menu.Ever wondered why GIMP always shows up in Graphic Submenu or Rhythmbox in Sound & Video or Firefox in Internet etc???

Here is the populated list of the categories which you might be interested in.Just punch in the following category names according to your application family and put that *.desktop file in the /usr/share/applications folder and it will surprisingly show up where one wanted it to be !

(One can also further experiment with the variables given by removing & adding some,below are just examples)

For Accessories:

Categories=GNOME;GTK;Utility;

or

Categories=GTK;Utility;

or

Categories=Utility;

For Education:

Categories=Application;Education;

or

Categories=GNOME;Application;Education;

For Games:

Categories=Game;

For Graphics:

Categories=Graphics;

or

Categories=GNOME;Application;Graphics

For Internet:

Categories=Application;Network;

or

Categories=Network;

For Office:

Categories=Application;Office;

or

Categories=GNOME;GTK;Office;

For Programming:

Categories=GTK;GNOME;Development;

or

Categories=GTK;Development;

For Sound & Video:

Categories=GTK;AudioVideo;

or

Categories=AudioVideo;

For System Tools:

Categories=System;

or

Categories=GNOME;GTK;System;

For System>Preferences:

Categories=Settings;

or

Categories=GNOME;GTK;Settings;

For System>Administration:

Categories=GTK;System;Settings;

or

Categories=Application;System;Settings

or

Categories=SystemBackup;Applications;GTK;System;Settings (eg from Reamastersys' File)

Optionally,one could also postfix the category entries with the standard program descriptions.For example,if it is an audio player,it may read Categories=AudioVideo;Audio;Player; instead of just Categories=AudioVideo;

The greatest advantage of this method is that it acts as a default entry of the system and can do without "/etc/skel import".Secondly,if the secondary user switches between the menu (Main Menu or default Menubar) changes will be preserved.

Also,do fiddle up with all the app launchers in /usr/share/applications folder for more insight.

Comments (0)

You don't have permission to comment on this page.