~system76-dev/system76-driver/2.7

« back to all changes in this revision

Viewing changes to hotkey.py

  • Committer: Carl Richell
  • Date: 2009-05-10 17:36:05 UTC
  • Revision ID: carl@system76.com-20090510173605-o3dbgx9v5vw3bhoq
1.) Add Starling Netbook (star1)

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
## Hotkey setup for keys unsupported by Ubuntu vanilla
8
8
 
9
9
import os
 
10
import fileinput
10
11
 
11
12
def daru1_monitor_switch():
12
13
    # Copies required files
38
39
        synapticsFile.close()
39
40
        newFile.close()
40
41
        command = "mv /opt/system76/newFile.txt /usr/share/hal/fdi/policy/20thirdparty/11-x11-synaptics.fdi"
41
 
        os.system(command)
 
 
b'\\ No newline at end of file'
 
42
        os.system(command)
 
43
        
 
44
def star1_904():
 
45
    # Copy required files
 
46
    os.system('sudo cp /opt/system76/system76-driver/src/hotkeys/star1_904_30-keymap-system76.fdi /usr/share/hal/fdi/information/10freedesktop/30-keymap-system76.fdi')
 
47
    os.system('sudo cp /opt/system76/system76-driver/src/hotkeys/star1_904_wlonoff.sh /usr/local/bin/wlonoff.sh')
 
48
    os.system('sudo chmod a+x /usr/local/bin/wlonoff.sh')
 
49
    
 
50
    # Setup sudoers so user can turn on/off wireless without sudo
 
51
    for line in fileinput.input("/etc/sudoers",inplace =1):
 
52
        line = line.strip()
 
53
        if not 'WLTOGGLE' in line:
 
54
            print line
 
55
            
 
56
    os.system("echo Cmnd_Alias      WLTOGGLE=/usr/local/bin/wlonoff.sh | sudo tee -a /etc/sudoers")
 
57
    os.system("echo '%admin ALL=(ALL) NOPASSWD: WLTOGGLE' | sudo tee -a /etc/sudoers")
 
58
    
 
59
    # configure keybinding in gnome
 
60
    os.system("gconftool-2 --config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory -s --type string /apps/metacity/keybinding_commands/command_2 'sudo /usr/local/bin/wlonoff.sh'")
 
61
    os.system("gconftool-2 --config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory -s --type string /apps/metacity/global_keybindings/run_command_2 XF86WLAN")
 
 
b'\\ No newline at end of file'