diff options
author | BlackNoxis <steven.darklight@gmail.com> | 2014-02-15 23:24:26 +0200 |
---|---|---|
committer | BlackNoxis <steven.darklight@gmail.com> | 2014-02-15 23:24:26 +0200 |
commit | 7224c1253228e5c29c78cb3f0f26ce34770f2356 (patch) | |
tree | 1684924656132935256e034f35f92abee6623265 /app-misc/rogentoslive-tools/files/1.0/vga-cmd-parser |
Added ebuilds for kogaion desktop
Diffstat (limited to 'app-misc/rogentoslive-tools/files/1.0/vga-cmd-parser')
-rw-r--r-- | app-misc/rogentoslive-tools/files/1.0/vga-cmd-parser | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/app-misc/rogentoslive-tools/files/1.0/vga-cmd-parser b/app-misc/rogentoslive-tools/files/1.0/vga-cmd-parser new file mode 100644 index 00000000..1e443171 --- /dev/null +++ b/app-misc/rogentoslive-tools/files/1.0/vga-cmd-parser @@ -0,0 +1,53 @@ +#!/usr/bin/python +# Copyright 2008 Fabio Erculiani, Sabayon Linux Chief Architect +# parses vga= parameters from cmdline given by isolinux and returns the right resolution +# Shut up! + +res_map = { + "0x385": ("640x400",24), + "0x312": ("640x480",24), + "0x315": ("800x600",24), + "0x318": ("1024x768",24), + "0x31b": ("1280x1024",24), + "0x330": ("640x400",16), + "0x33E": ("640x400",24), + "0x331": ("640x480",16), + "0x33F": ("640x480",24), + "0x332": ("800x600",16), + "0x340": ("800x600",24), + "0x333": ("1024x768",16), + "0x341": ("1024x768",24), + "0x334": ("1152x864",16), + "0x342": ("1152x864",24), + "0x335": ("1280x960",16), + "0x343": ("1280x960",24), + "0x336": ("1280x1024",16), + "0x344": ("1280x1024",24), + "0x337": ("1400x1050",16), + "0x345": ("1400x1050",24), + "0x338": ("1600x1200",16), + "0x346": ("1600x1200",24), + "0x339": ("1792x1344",16), + "0x347": ("1792x1344",24), + "0x33A": ("1856x1392",16), + "0x348": ("1856x1392",24), + "0x33B": ("1920x1440",16), + "0x349": ("1920x1440",24), + "0x33C": ("2048x1536",16), + "0x34A": ("2048x1536",24) +} + +f = open("/proc/cmdline") +cmdline = f.readline().strip().split() +cmdline.reverse() +for item in cmdline: + if item.startswith("vga="): + item_split = item.split("=") + if len(item_split) == 2: + data = item_split[1] + try: + if res_map.get(data) != None: + print res_map[data][0],res_map[data][1] + break + except TypeError: + pass |