mirror of https://github.com/balkian/dotfiles.git
Updates for gopher
parent
f35f478a03
commit
d50cdca292
@ -1,7 +1,12 @@
|
||||
# echo "pasado(xprofile)" $(date) >> /tmp/LOG
|
||||
#!/bin/sh
|
||||
touch /tmp/LOG
|
||||
echo "loaded(xprofile)" $(date) >> /tmp/LOG
|
||||
setxkbmap "us,es" "altgr-intl," -option "ctrl:nocaps,grp:shift_toggle,terminate:ctrl_alt_bksp"
|
||||
#xmodmap ~/.Xmodmap
|
||||
#source ~/.xinitrc
|
||||
export XTERMINAL=termite
|
||||
export TERMINAL=termite
|
||||
export TERMCMD=termite
|
||||
export BROWSER=chromium-browser
|
||||
export MOZ_USE_XINPUT2=1
|
||||
|
@ -0,0 +1,93 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
from time import sleep
|
||||
from os import path as op
|
||||
import sys
|
||||
from subprocess import check_call, check_output
|
||||
from glob import glob
|
||||
|
||||
|
||||
def bdopen(fname):
|
||||
return open(op.join(basedir, fname))
|
||||
|
||||
|
||||
def read(fname):
|
||||
return bdopen(fname).read()
|
||||
|
||||
|
||||
for basedir in glob('/sys/bus/iio/devices/iio:device*'):
|
||||
if 'accel' in read('name'):
|
||||
break
|
||||
else:
|
||||
sys.stderr.write("Can't find an accellerator device!\n")
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def update_devices():
|
||||
devices = check_output(['xinput', '--list', '--name-only']).splitlines()
|
||||
|
||||
touchscreen_names = ['touchscreen', 'wacom', 'pen']
|
||||
touchscreens = [i for i in devices if any(j in i.lower() for j in touchscreen_names)]
|
||||
|
||||
touchpad_names = ['touchpad', 'trackpoint']
|
||||
touchpads = [i for i in devices if any(j in i.lower() for j in touchpad_names)]
|
||||
|
||||
return touchscreens, touchpads
|
||||
|
||||
disable_touchpads = False
|
||||
scale = float(read('in_accel_scale'))
|
||||
g = 7.0 # (m^2 / s) sensibility, gravity trigger
|
||||
|
||||
STATES = [
|
||||
{'rot': 'normal', 'coord': '1 0 0 0 1 0 0 0 1', 'touchpad': 'enable',
|
||||
'check': lambda x, y: y <= -g},
|
||||
{'rot': 'inverted', 'coord': '-1 0 1 0 -1 1 0 0 1', 'touchpad': 'disable',
|
||||
'check': lambda x, y: y >= g},
|
||||
{'rot': 'left', 'coord': '0 -1 1 1 0 0 0 0 1', 'touchpad': 'disable',
|
||||
'check': lambda x, y: x >= g},
|
||||
{'rot': 'right', 'coord': '0 1 0 -1 0 1 0 0 1', 'touchpad': 'disable',
|
||||
'check': lambda x, y: x <= -g},
|
||||
]
|
||||
|
||||
|
||||
def rotate(state):
|
||||
s = STATES[state]
|
||||
check_call(['xrandr', '-o', s['rot']])
|
||||
touchscreens, touchpads = update_devices()
|
||||
for dev in touchscreens if disable_touchpads else (touchscreens + touchpads):
|
||||
check_call([
|
||||
'xinput', 'set-prop', dev,
|
||||
'Coordinate Transformation Matrix',
|
||||
] + s['coord'].split())
|
||||
if disable_touchpads:
|
||||
for dev in touchpads:
|
||||
check_call(['xinput', s['touchpad'], dev])
|
||||
|
||||
|
||||
def read_accel(fp):
|
||||
fp.seek(0)
|
||||
return float(fp.read()) * scale
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
accel_x = bdopen('in_accel_x_raw')
|
||||
accel_y = bdopen('in_accel_y_raw')
|
||||
|
||||
current_state = None
|
||||
|
||||
while True:
|
||||
x = read_accel(accel_x)
|
||||
y = read_accel(accel_y)
|
||||
for i in range(4):
|
||||
if i == current_state:
|
||||
continue
|
||||
if STATES[i]['check'](x, y):
|
||||
current_state = i
|
||||
try:
|
||||
rotate(i)
|
||||
except Exception as ex:
|
||||
print('Error rotating: {}'.format(ex))
|
||||
break
|
||||
sleep(1)
|
||||
|
@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
xinput map-to-output 16 eDP-1 # Eraser
|
||||
xinput map-to-output 12 eDP-1 # Stylus
|
||||
xinput map-to-output 11 eDP-1 # Touch
|
@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
dbus-send --type=method_call --print-reply --dest=org.onboard.Onboard /org/onboard/Onboard/Keyboard org.onboard.Onboard.Keyboard.ToggleVisible || onboard
|
||||
|
@ -0,0 +1,83 @@
|
||||
<touchégg>
|
||||
|
||||
<settings>
|
||||
<property name="composed_gestures_time">0</property>
|
||||
</settings>
|
||||
|
||||
|
||||
<application name="All">
|
||||
|
||||
<gesture type="TAP" fingers="2" direction="">
|
||||
<action type="MOUSE_CLICK">BUTTON=3</action>
|
||||
</gesture>
|
||||
|
||||
<gesture type="TAP" fingers="3" direction="">
|
||||
<action type="MOUSE_CLICK">BUTTON=2</action>
|
||||
</gesture>
|
||||
<gesture type="DRAG" fingers="3" direction="DOWN">
|
||||
<action type="RUN_COMMAND">onboard.sh</action>
|
||||
</gesture>
|
||||
|
||||
<gesture type="TAP" fingers="5" direction="">
|
||||
<action type="CLOSE_WINDOW"></action>
|
||||
</gesture>
|
||||
|
||||
<gesture type="DRAG" fingers="2" direction="ALL">
|
||||
<action type="SCROLL">SPEED=7:INVERTED=false</action>
|
||||
</gesture>
|
||||
|
||||
<gesture type="DRAG" fingers="4" direction="UP">
|
||||
<action type="MAXIMIZE_RESTORE_WINDOW"></action>
|
||||
</gesture>
|
||||
|
||||
|
||||
<gesture type="DRAG" fingers="4" direction="RIGHT">
|
||||
<action type="SEND_KEYS">Super+Control+l</action>
|
||||
</gesture>
|
||||
|
||||
<gesture type="DRAG" fingers="4" direction="LEFT">
|
||||
<action type="SEND_KEYS">Super+Control+h</action>
|
||||
</gesture>
|
||||
|
||||
<gesture type="PINCH" fingers="5" direction="ALL">
|
||||
<action type="SEND_KEYS">Alt+F1</action>
|
||||
</gesture>
|
||||
|
||||
</application>
|
||||
|
||||
|
||||
<application name="Okular, Gwenview">
|
||||
|
||||
<gesture type="PINCH" fingers="2" direction="IN">
|
||||
<action type="SEND_KEYS">Control+KP_Add</action>
|
||||
</gesture>
|
||||
|
||||
<gesture type="PINCH" fingers="2" direction="OUT">
|
||||
<action type="SEND_KEYS">Control+KP_Subtract</action>
|
||||
</gesture>
|
||||
|
||||
<gesture type="ROTATE" fingers="2" direction="LEFT">
|
||||
<action type="SEND_KEYS">Control+L</action>
|
||||
</gesture>
|
||||
|
||||
<gesture type="ROTATE" fingers="2" direction="RIGHT">
|
||||
<action type="SEND_KEYS">Control+R</action>
|
||||
</gesture>
|
||||
|
||||
</application>
|
||||
|
||||
|
||||
<application name="Chromium-browser, Dolphin">
|
||||
|
||||
<gesture type="DRAG" fingers="2" direction="LEFT">
|
||||
<action type="SEND_KEYS">Alt+Left</action>
|
||||
</gesture>
|
||||
|
||||
<gesture type="DRAG" fingers="2" direction="RIGHT">
|
||||
<action type="SEND_KEYS">Alt+Right</action>
|
||||
</gesture>
|
||||
|
||||
</application>
|
||||
|
||||
|
||||
</touchégg>
|
@ -0,0 +1,4 @@
|
||||
---
|
||||
ignore_device:
|
||||
- device_file: "/dev/loop*"
|
||||
ignore: true
|
Loading…
Reference in New Issue