shell 总结3

$HOME/.config/user-dirs.dirs 为gnome的默认软件目录 可以自己设置

 

双屏下切换焦点不用来回的移动鼠标了

#! bin/python
import subprocess
# just a helper function
get = lambda cmd: subprocess.check_output(cmd).decode("utf-8")
# get the current mouse position
current = [int(n) for n in [it.split(":")[1] for it in get(["xdotool", "getmouselocation"]).split()[:2]]]
# get the x/y size of the left screen
screendata = [(s.split("x")[0], s.split("x")[1].split("+")[0]) for s in get(["xrandr"]).split() if "+0+0" in s ][0]
xy = [int(n) for n in screendata]
# see if the mouse is on the left- or right screen
if current[0] < xy[0]:
    # if the mouse currently is on the left screen, move it to the right (from the middle of the left screen)
    command = ["xdotool", "mousemove", "--sync", str(current[0]+xy[0]), str(xy[1]/2)]
else:
    # if the mouse currently is on the left screen, move it to the right (from the middle of the left screen)
    command = ["xdotool", "mousemove", "--sync", str(current[0]-xy[0]), str(xy[1]/2)]

subprocess.Popen(command)
# optional: click after the mouse move: comment out if not needed / wanted
subprocess.Popen(["xdotool", "click", "1"])

 

双屏同步切换工作区 需要tweak设置下

shell 总结3

 

 

是否忍受够了不停的alt tab来切换 打开的应用,尤其是打开的应用多的时候,虽然dock+workspace可以缓解一下,

但我想要我需要的窗口立马到我面前来so 解决办法是 wmctrl 

wmctrl -a fire 会自动匹配 wmctrl -a chrom

wmctrl  -c fire 自动关闭firefox