def voldown(): """On volume up request we: - Tell the window manager to decrease the volume and - Tell mplayer to increase the volume """ xorg.shell('xdotool', 'key', 'XF86AudioLowerVolume') fifo.send("volume -20") return 'ok'
def mute(): """On mute toggle request we: - Tell mplayer to toggle the volume - Tell the window manager to toggle the volume and """ if fifo.send("mute") == 'ok': return 'ok' else: xorg.shell('xdotool', 'key', 'XF86AudioMute') return 'ok'
def run(self): xdir = 1 while True: mouse_pos = xorg.get_mouse_pos() logging.debug('mouse shift from ' + str(mouse_pos)) if mouse_pos is not None: x, y = mouse_pos x = int(x) # if x > 0: # x -= 1 # else: # x += 1 x += xdir xdir = -xdir xorg.shell('xdotool', 'mousemove', str(x), y) time.sleep(self.delay)