Archive

Archive for September, 2009

Setup wpa_gui and roaming on Debian

September 19, 2009 2 comments

Until recently I was editing my /etc/network/interfaces file each time I wanted to change my wifi connexion parameters:

iface wlan0 inet dhcp
    wpa-ssid somewhere
    wpa-key-mgmt WPA-PSK
    wpa-psk "secret"
    wpa-proto WPA
    wpa-pairwise TKIP
    wpa-group TKIP

I’m now using wpa_gui which is part from wpasupplicant. To install wpa_gui just do:

apt-get install wpagui

My /etc/network/interfaces file now only contains this 3 blocks:

auto wlan0
iface wlan0 inet manual
    wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp

The auto statment is required to automatically start the wpa_supplicant daemon at startup. The /etc/wpa_supplicant/wpa_supplicant.conf file should at least contains the 2 following lines:

update_config=1
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev

The update_config parameter let users add AP parameters from the GUI. GROUP=netdev let netdev group member control wpa_supplicant from wpa_cli or wpa_gui. Here is how to add a member to the netdev group:

adduser johndoe netdev

wpa_supplicant.conf will contains sensible data, like AP keys, so its access should be limited:

chmod 600 /etc/wpa_supplicant/wpa_supplicant.conf

Finally I added wpa_gui in the session startup of XFCE. It’s in the Session and startup configuration GUI. KDE users would type ln -s /usr/sbin/wpa_gui in the .kde/Autostart directory.

References: /usr/share/doc/wpasupplicant/README.Debian.gz

Categories: Uncategorized

Removing decoration in xfwm or metacity (again)

September 5, 2009 2 comments

Here is a simpler version of this post, using PyGTK:

#! /usr/bin/python
from gtk.gdk import *

w=window_foreign_new((get_default_root_window().property_get("_NET_ACTIVE_WINDOW")[2][0]))
state = w.property_get("_NET_WM_STATE")[2]
maximized='_NET_WM_STATE_MAXIMIZED_HORZ' in state and '_NET_WM_STATE_MAXIMIZED_VERT' in state
if maximized: w.unmaximize()
if w.get_decorations() == 0 :
    w.set_decorations(DECOR_ALL)
else:
    w.set_decorations(0)

if maximized: w.maximize()
window_process_all_updates()

This script can be used in XFCE thanks to xfce4-keyboard-settings:

xfce4-keyboard-settings

xfce4-keyboard-settings

Categories: Uncategorized Tags: ,
Follow

Get every new post delivered to your Inbox.