Life Codecs Ruminations. Reflections. Refractions. Code.

July 14, 2013

Linux Xorg Recovery Tip

Filed under: software dev — Tags: , — Kamal Advani @ 19:36

When you screw up your X drivers, the following is a good way to force “safe” drivers, assuming you have a bootloader that allows you to edit your kernel boot params like grub.

  1. Boot into grub.
  2. Edit the boot entry removing extraneous video related entries like splashscreens, and use the following instead: nomodeset vga=791 forcevesa. Generally, depending on your graphics card, vga=791 forcevesa should do.

The tip was based on looking at the SystemRescueCD distro.

Additionally, so I get a more decent virtual console resolution for day to day use, under Debian I do:

  1. Edit /etc/default/grub
  2. Find, enable if commented, and set:
    1
    2
    3
    4
    5
    # The resolution used on graphical terminal
    # note that you can use only modes which your graphic card supports via VBE
    # you can see them in real GRUB with the command `vbeinfo'
    #GRUB_GFXMODE=640x480
    GRUB_GFXMODE=1024x768
  3. Run update-grub2

July 8, 2012

Defaulting to Dvorak on Linux

Filed under: how to,software dev — Tags: , , — Kamal Advani @ 18:15

This is (mostly) a Debian (or derivatives) specific guide to get the Dvorak keyboard layout across the system. Unfortunately, the power of a Unix is also sometimes its curse, in this case, at least as far as I know, there’s no central place to say “use Dvorak”, and have the system honour it. But broadly speaking, there are 3 input areas:

  1. Virtual Console
  2. Display Manager
  3. X session / Desktop Environment (DE)

A ‘modern’ DE like KDE or Gnome, will easily allow you to configure Dvorak through some GUI. I am documenting the case where it is DE-agnostic, and focuses on the X session starting in Dvorak to begin with. So unless there’s a DE override, this should work across all DEs.


Virtual Console

To use Dvorak on the virtual console, on the console issue loadkeys dvorak. This requires the various console keymaps installed. Under Debian, ensure the package console-data is installed; if you issue the command and get a file dvorak not found error or some such, you know you are missing the aforementioned package.

I have not been able to persist a Dvorak-by-default-console setting unfortunately. Will Google some more. There must be a nicer Debian Way, besides just issuing loadkeys directly in some init script. At a per user session, putting it in ~/.profile (or your shell’s equivalent) should work.


Display Manager

Important: This will start your display manager (e.g. GDM, LightDM, XDM) in Dvorak mode! For a shared computer you may not want this!

Edit /etc/default/keyboard, and set/replace XKBLAYOUT=”dvorak”, here’s mine:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# !/bin/sh
# If you change any of the following variables and HAL and X are
# configured to use this file, then the changes will become visible to
# X only if HAL is restarted.  In Debian you need to run
# /etc/init.d/hal restart

# The following variables describe your keyboard and can have the same
# values as the XkbModel, XkbLayout, XkbVariant and XkbOptions options
# in /etc/X11/xorg.conf.

XKBMODEL="pc105"
XKBLAYOUT="dvorak" # was "us", replaced with "dvorak"
XKBVARIANT=""
XKBOPTIONS=""

# If you don't want to use the XKB layout on the console, you can
# specify an alternative keymap.  Make sure it will be accessible
# before /usr is mounted.
# KMAP=/etc/console-setup/defkeymap.kmap.gz
BACKSPACE="guess"

Note the comment on HAL, I missed it and simply restarted my machine to get it to reload, very lame.


X Session/Desktop Environment

To simply enable a per user X session to start with Dvorak, I set setxkbmap dvorak in ~/.xsessionrc before spawning the window manager. Here’s the full contents of ~/.xsessionrc file (for my own reference):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# see: http://productforums.google.com/forum/#!msg/chrome/t3vPnF_CTBE/UBba0Dp5w3AJ
nvidia-settings -a InitialPixmapPlacement=0

# enable dvorak by default
setxkbmap dvorak

# rotate portrait monitor output, use 'xrandr -q' to find out output names.
xrandr --output DVI-I-1 --rotate left

# compositing manager
xcompmgr -c &

# accented chars support
xmodmap -e "keysym Alt_R = Multi_key"

# Using xfce4-paneli (and thus all panel plugins) with openbox
# openbox is a lighter wm compared to xfwm
exec dbus-launch openbox-session

Note that you may have to configure your display manager to launch an appropriate X client script, I use Xsession with LightDM.

A slight digression: Many larger DEs do various magic to start-up, I really dislike this lack of transparency — I can see the value of it for absolute beginners of course, but you grow out of it pretty quickly once you come back to the Unix Way. To that effect, I modified LightDM — the display manager I use — to use Xsession. Here are my relevant changes to /etc/lightdm/lightdm.conf:

1
session-wrapper=/etc/X11/Xsession

This will find a ~/.xsessionrc, and execute that post starting the X server. Note that my script is documented above, it’s nice having a central script to hook in everything you need to start your X session with, including the window manager itself.

September 25, 2010

Indonesia Linux Conference (ILC) Oktober 2010

Filed under: software dev — Tags: , , — Kamal Advani @ 14:54

<bilingual>
    <lang type=”id”>Jika anda seorang antusias Linux di Indonesia, mungkin tertarik dengan konferensi ILC! Sayang saya lagi di luar negeri.</lang>
    <lang type=”en_AU”>If you’re a Linux enthusiast in Indonesia, you may be interested in the ILC! Too bad I’m not in the country.</lang>
</bilingual>

banner ilc2010

Powered by WordPress