tisdag 17 september 2013

Howto: Change spotify font size in gentoo linux.

Sometimes you find tips and trix on the web that are amazing. This was exactly what i was looking for and fits my 50T plasma TV perfect.

All credits to jkx for his guide http://www.larsen-b.com/Article/446.html

Spotify use a skin for the client , so changing QT4 fonts doesn’t change anything, we have to fix the skin directly.

This is how you do it in gentoo linux. Before you start remember to do backups.

You need  python and /dev-python/elementtree


1. Search the file resources.zip in /opt/spotify/spotify-client/Data/ . Extract the file skin.xml.

2. Create dir /opt/spotify/spotify-client/Data/unpack and extract resources.zip to it

3. Create a python file with name spotify.py and and past this in - 
(if you have problem with the script,put a b to the right of the 'w' in this line - 
file = open("new_skin.xml", 'w') 
from this bug http://bugs.python.org/issue9458


import xml.etree.ElementTree as xml

tree = xml.parse("./skin.xml")
root = tree.getroot()

for f in root.findall('font'):
 taille = f.get('size')
 if taille:
  taille = int(taille) + 4
  f.set('size',str(taille))


file = open("new_skin.xml", 'w')

xml.ElementTree(root).write(file)


4. After your run spotify.py you should have a file named new_skin.xml. Rename it to skin.xml and put it in unpack dir.


5. Repack resources.zip with command - zip -r resources *


6. Copy resources.zip back  to /opt/spotify/spotify-client/Data/

7. Reboot computer and start spotify 




lördag 7 september 2013

Howto: Install grub2 with "uefi" in gentoo linux.


I used refind bootloader as my boot-tool in a very long time. But i had very much trouble with it in the end
and switch over to grub2 instead. And i never had any boot problem at all since then.

I create  my partitions with  http://gparted.sourceforge.net/livecd.php and i use GPT partitions.
You must go to advanced mode and change to gpt before you create your partitions.
I have like this:
bios_grub 50M = vfat = Set bios_grub flag after creation of the partitions.
/boot/efi 512M = vfat = Set boot flag after creation of the partitions.
/
/home

# Before chroot
modprobe efivars


# EFI kernel settings

CONFIG_EFI=y
CONFIG_FB_EFI=y
CONFIG_FRAMEBUFFER_CONSOLE=y
CONFIG_EFI_PARTITION=y
CONFIG_EFI_VARS=y
CONFIG_EFI_STUB=y

Optional- I not use these two
CONFIG_RELOCATABLE=y
CONFIG_CMDLINE="root=/dev/sda3"

Install gentoo the way you do and when you chrooted in and are to install grub2.

Set:
grep -v rootfs /proc/mounts > /etc/mtab

Set GRUB_PLATFORMS in /etc/portage/make.conf (optional). If unset, grub will guess which platform you want. It guesses "pc" for x86 / amd64.

# UEFI on amd64
GRUB_PLATFORMS="efi-64"

# UEFI and PC
GRUB_PLATFORMS="efi-64 pc"

echo 'LABEL=efi-boot /boot/efi vfat defaults 0 2' >> /etc/fstab
root #
mount /boot/efi
root #
mkdir -p /boot/efi/{EFI/BOOT,GRUB}

emerge --ask sys-boot/grub

grub2-install --target=x86_64-efi --efi-directory=/boot/efi --boot-directory=/boot/efi

grub2-mkconfig -o /boot/efi/GRUB/grub.cfg

 ----------------------------------------------------------------------------------------------------------------------

 "OBS" Grub2 has change name to grub.

If you already sit with grub2 and want to switch to new grub instead just remove GRUB2DIR in /boot/efi/GRUB2.

mkdir -p /boot/efi/grub

And install 
emerge --ask sys-boot/grub
grub2-install --target=x86_64-efi --efi-directory=/boot/efi --boot-directory=/boot/efi

grub2-mkconfig -o /boot/efi/GRUB/grub.cfg

Done

 ----------------------------------------------------------------------------------------------------------------------------
sources
http://wiki.gentoo.org/wiki/GRUB2#UEFI.2FGPT
http://wiki.gentoo.org/wiki/GRUB2_Quick_Start



croutch