Pages

Showing posts with label customize. Show all posts
Showing posts with label customize. Show all posts

2013-06-25

Grub 1.99 in Debian 7. Part 2

Changing menu item looks in Grub2 menu. Deleting and adding entries.
Now - I am no coder and know next to nothing of scripting. So I really can't rewrite grubs' scripts. After more hours wasted with combing interweb for tutorials how to change files 10_linux and 30_os-prober, I came to conclusion that it's hard to find ready-made drop-in script-bits for easy tweaking. And I didn't feel like spending all my time with testing...
I decided to drop my ambitious plans to alter above-mentioned files and go for easier (and commonly used) way: create a 06_custom file.

What I did:
Took existing /etc/grub.d/40_custom file and saved it as 06_custom (in this way it will be the first entry of menu). Then I copied whole entry from between #10_linux start and end lines in file /boot/grub/grub.cfg to my custom-file, under first 5 existing lines.
- Then I changed menuentrys' name
- deleted class statements
- and replaced filenames in /boot/ with links in /. That's because it's said that then you will allways boot with latest kernel (through those links). We'll see about that when there is kernel update... But - if there is kernel number in menuentry, it has to be changed manually, of course.
And final result, scriptways (after first 5 existing lines):
menuentry 'Debian 7 Wheezy, kernel 3.2.0-4-amd64 on /dev/sdb6' { 
load_video set 
gfxpayload=keep 
insmod gzio 
insmod part_msdos 
insmod ext2 
set root='(hd1,msdos6)' 
search --no-floppy --fs-uuid --set=root cc715c11-4b56-4d78-bb29-6d78688ce48b 
echo 'Loading Linux 3.2.0-4-amd64 ...' 
linux /vmlinuz root=UUID=cc715c11-4b56-4d78-bb29-6d78688ce48b ro quiet nomodeset nouveau.modeset=0 
echo 'Loading initial ramdisk ...' 
initrd /initrd.img 
}
And, update-grub when done, of course. Interesting enough, custom entry is not shown in 'Found' list... but, when
grep menuentry /boot/grub/grub.cfg - it's there alright.
Reboot, test your freshly baked menu-item. If boot is successful, do
sudo chmod -x 10_linux, to exclude this file from menu.
That's it. The same way you can deal with 30_os-prober. Entries like kernel instances etc can be deleted or added (might be wise to make os-prober temporarily active for adding - to get correct entry for copy-paste). Downside is that when distros come and go, all entries has to be deleted/added manually. Doesn't make you to spit blood but is still a bit bothersome...

2013-06-14

Grub 1.99 in Debian 7. Part 1

Debian Wheezy netinstall and Grub 1.99 tweaking 
Part 1: Facelift

With Debian stable comes Grub 1.99. It is not especially nice-looking and/or handy:
- it has useless wallpaper
- there are a lot of entries without submenus (I have 4-way multiboot, currently)
- menu is a bit too black and white... and other little things.
So I decided to change it. Research took enormous time. Versions and tutorials differ... there are no place to find everything together... tips might work, or not... a lot is simply old...
See here: Ubuntu, more Ubuntu, and this one, and Arch, and my own puny paragraph.
Before tweaking anything, we do backups, of course - like this, for example:
sudo cp /etc/grub.d/05_debian_theme /etc/grub.d/05_.debian_theme.bak 
# ... and all others in /grub.d we happen to hack. Then we make baks un-executable: 
sudo chmod -x /etc/grub.d/*.bak
Also, do backup files: /etc/default/grub and /boot/grub/grub.cfg
Here we go, with multiboot system, one Grub in MBR, one in root, one distro without Grub, and Windows XP.

What I did:
(Let's remember - ALL changes has to be written in with update-grub.)
1. /etc/default/grub
- I wanted my Vsido to be the default boot-choice.
grep menuentry /boot/grub/grub.cfg shows all listed menuentries. First one is 0, second is 1 and so on - simple, but it's more complicated when dealing with submenus. Fortunately I do not have them... unfortunately I would like to - menu looks a lot more tidy when bunch of different kernels are hidden.
So, third item in list means GRUB_DEFAULT=2 and highlight is on Vsido entry now.

- Default console size is GRUB_GFXMODE=640x480. Text is therefore big and longer lines end behind screen edge. We change it like that:
Reboot, and when in Grub, press 'C' to get command line, set pager=1 (because there are probably 2 pages of text coming, then vbeinfo. Correct/supported resolutions are displayed, pick one, write it down, 'esc', boot to desktop and replace old resolution with new and bigger one. Mine is GRUB_GFXMODE=1280x768.
After that line add a new one: GRUB_GFXPAYLOAD_LINUX=keep
That keeps resolution the same for whole boot process (no jumping back to big letters).
NB! 'Keep' doesn't work when booting another distro with its own Grub. Probably gfxmode should be changed there also.
Edit 06.07.2013: Changing the resolution in local Grub doesn't help -  no change. Also - resolution doesn't change for distros without Grub too. So, it seems that whole thing works only for grub-mastering distro. Edit ends.

- If you do not need your machine searched for additional OS-es (for whatever reason), disable 30_os-prober, by adding this line:
GRUB_DISABLE_OS_PROBER=true

- If you do not want bunch of Recovery Modes hanging around, then remove comment from line #GRUB_DISABLE_LINUX_RECOVERY="true".
But, there is interesting twist: IF there is Grub also installed for some other distro, then you have to disable recovery mode there also. Otherways master-Grub reads them from there, and displays.
Other weird thing I encountered: I unpacked my Xubuntu (from archive) to another partition, fixed fstab, and removed Grub complitely. Now, when I ran master 'update-grub', it found whole pile of 'Ubuntus'. It appeared that not only current .img, but also symlinks and '.img.old' kernels were listed... I simply deleted links and .olds - and problem was solved and only one Ubuntu was left in list.

2. /etc/grub.d/05_debian_theme
- Wallpaper. This file has very nicely commented sequence how wallpapers are searched for... not that it helped me very much. I deleted wallpaper-line from /usr/share/desktop-base/grub-background.sh and changed also colors. No cookie. Nothing changed.
Then I checked what's in /boot/grub/grub.cfg. There I found certain png as wallpaper. After some pondering I resolved thing in inelegant and nasty way - I simply renamed joy-grub.png to joy-grub.png.outcomment. Update-grub! No wallpaper was found AND Grub defaulted to 'set_default_theme', which is quite at the beginning of the file (05_debian_theme) AND which can be now edited (with results):

- Colors. See also: Here and here and here.
Default is 'Debian blue', update-grub, reboot and take a look. I found it a bit too bright, so my tweak ended like this:
set_default_theme(){
 # Set the traditional Debian blue theme.
 echo "${1}set menu_color_normal=white/black"
 echo "${1}set menu_color_highlight=yellow/dark-gray"
 echo "${1}set color_normal=white/dark-gray"
}
Menu text is white, background black, higlighted menu-items' text is yellow and under that is gray background. Outside of menu-box is gray with white text (and this last line I added).

That's it. I'm quite satisfied how things look now (errr... no, still can't be bothered with screenshots).
Now, if not terminally lazy, I might produce also a part 2, dealing with hacking of files 10_, 30_ and 40_custom. Means, how to change menuentries themselves.

2013-02-26

Xfce customization, less obvious

We are dealing with Xubuntu here

- Moving things on panels. Right-click on item, pick 'move'. Obvious, yes – but what wasn't so obvious to me, is how items align and stay in groups. There are invisible separators on panels, and you can add more or delete them, according to need. Easiest way to find default ones is: Right-click a panel, open 'panel/panel preferences/items. All things on panel are listed there, also separators – double-click and change 'transparent' to something else. And now you can see it on panel. 'Expand' means that separator pushes items away on both sides. That is, separator in center of panel makes items go to both ends. Do experiment, it's frustratingly educational.

- Xfce menu lacks 'lock screen' option. If needed, it's easy to create: Open your menu editor and add new item to right place, name it, and add exec command: xflock4. Pick an icon. Save, done.
- Xfce has such a nice thing as mime editor (in Settings). Means, you can make certain apps to handle certain files (can't change system defaults, though). If some file is opened in freaky way – like jpg with Firefox, and you can't find jpg at all in mime editor – then open this jpg with app you want to be default. Entry should now appear to mime list. Double-clicking on entry opens edit. There might be occasional need to fix entries which point to app that you removed (but mime didn't notice that). Or something...
- Xfce can have only one wallpaper over all workspaces. Compiz and KDE, for example, can have different ones. There is app called 'wallpaperoz', it has to be downloaded from web and manually installed. This app enables different wallpapers, and also changes them as frequently as you want. BUT, it's slow and lagging when you change workspaces. So, I tried it and I removed it.
- Docks. I am not sure what for they are good – as Xfce lets you make several freely customizable panels and fill them with launchers, drawers, widgets and whatnot. But anyway – there you have some names for googling: Plank dock (simple), AWN (it's not developed anymore), and most famous currently – Cairo dock (looks very pimpy and mac-ish).
- Themes and icons. Next post will be about this. Here I say only - well, obvious: for a simple tuning, look into 'Appearance', 'Window manager' and 'Window manager tweaks' and play around.

Configuration editors: There are occasions when some settings need to be tweaked manually. For that there are configuration editors. If in need or simply curious, take a look. Proper caution should be exercised, clicking like a blind moron is not advisable!
Xfce has a package 'xfce4-settings' which contains xfce4-settings-editor.
Gnome-specific settings come through gconf-editor, Linux Mint uses dconf-editor. Mate desktop one is called mateconf-editor. And so on. Depending on distro, an editor might be already installed – or not.

Tweaking of Grub2 - Not recommended without extensive pre-research!
For serious tweaking DO READ tutorials before, experimenting with bootloader IS dangerous!
One overview is here... googling 'tweaking grub2' gives a lot more.
Here are three less risky things (provided that no errors are made):
- Some easily changeable (and commented) parameters (wait-time before booting OS, for one) are in file /etc/default/grub
- To remove memtest entry from boot menu (if it is there). There is file /etc/grub.d/20_memtest86+
Go there and simply make this file non-executable, in terminal:
sudo chmod -x 20_memtest86+
- If using Ubuntu there are 'Advanced options' entries in boot menu. Those folders contain entries to boot older kernels. If your new updated one works (reboot is mandatory, so you will know if it works) then there is no especial need to keep those older kernels (they take disk space too).
Check which is your last, working one. Type in terminal: uname -r
and you get number of current version. Rev up your Synaptic and find all 'linux-image' and 'linux-header' packages. 'Completely remove' those that are OLDER than your current one (lesser ver number). Be very careful NOT to remove the newest ones. And after all that, type in terminal:  
update-grub
Done.