left-key ---> switch to left workspace
right-key ---> switch to right workspace
up-key ---> switch to upper workspace
down-key ---> switch to down workspace
| package main | |
| import ( | |
| "fmt" | |
| "os/exec" | |
| ) | |
| func main() { | |
| args := []string{} | |
| args = append(args, "-m") |
| type polkitSubject struct { | |
| /* | |
| * The following kinds of subjects are known: | |
| * Unix Process: should be set to unix-process with keys | |
| * pid (of type uint32) and | |
| * start-time (of type uint64) | |
| * Unix Session: should be set to unix-session with the key | |
| * session-id (of type string) | |
| * System Bus Name: should be set to system-bus-name with the key | |
| * name (of type string) |
| package main | |
| import ( | |
| "fmt" | |
| "github.com/howeyc/fsnotify" | |
| "regexp" | |
| ) | |
| func main() { | |
| watcher, err := fsnotify.NewWatcher() |
| package main | |
| import ( | |
| "fmt" | |
| "github.com/howeyc/fsnotify" | |
| "os" | |
| "regexp" | |
| "sync" | |
| "time" | |
| ) |
| func encodeURI(str string) string { | |
| filepath, ok := objUtil.URIToPath(str) | |
| if !ok { | |
| return "" | |
| } | |
| u := url.URL{} | |
| u.Path = filepath | |
| v, _ := objUtil.PathToFileURI(u.String()) | |
| return v |
| # | |
| # ~/.bashrc | |
| # | |
| # If not running interactively, don't do anything | |
| [[ $- != *i* ]] && return | |
| # launch tmux | |
| #test -z "$TMUX" && (tmux attach || tmux new-session) |
| " 关闭兼容模式 | |
| set nocompatible | |
| filetype off " required | |
| set rtp+=~/.vim/bundle/vundle/ | |
| call vundle#begin() | |
| "let Vundle manager Vundle | |
| "required! | |
| Bundle 'gmarik/vundle' |
| #此类配置可以在命令行模式中输入show-options -g查询 | |
| #窗口的初始序号;默认为0,这里设置为1 | |
| set-option -g base-index 1 | |
| #提示信息的持续时间;设置足够的时间以避免看不清提示,单位为毫秒 | |
| set-option -g display-time 5000 | |
| #控制台激活后的持续时间;设置合适的时间以避免每次操作都要先激活控制台,单位为毫秒 | |
| set-option -g repeat-time 1000 | |
| #操作状态栏时的默认键盘布局;可以设置为vi或emacs | |
| set-option -g status-keys vi | |
| #状态栏右方的内容;这里的设置将得到类似23:59的显示 |
| //Compile: gcc xgrabkey.c `pkg-config --cflags --libs x11` | |
| #include <stdio.h> | |
| #include <X11/Xlib.h> | |
| int | |
| main () | |
| { | |
| Window root; | |
| Display *dpy = NULL; |