Skip to content

Instantly share code, notes, and snippets.

@jouyouyun
jouyouyun / work-plan.md
Last active August 29, 2015 14:04
The work plan

#下半年工作计划#

##dde-daemon 完善##

###总体任务###

整理优化代码,保持结构清晰,去除冗余代码

逐步使用go替换c代码

@jouyouyun
jouyouyun / xgrabkey.c
Created July 29, 2014 04:21
Test XGrabKey
//Compile: gcc xgrabkey.c `pkg-config --cflags --libs x11`
#include <stdio.h>
#include <X11/Xlib.h>
int
main ()
{
Window root;
Display *dpy = NULL;
@jouyouyun
jouyouyun / compiz-key.md
Last active August 29, 2015 14:04
Compiz shortcut gsettings key

org.compiz.wall.gschema.xml

left-key ---> switch to left workspace

right-key ---> switch to right workspace

up-key ---> switch to upper workspace

down-key ---> switch to down workspace

#此类配置可以在命令行模式中输入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的显示
" 关闭兼容模式
set nocompatible
filetype off " required
set rtp+=~/.vim/bundle/vundle/
call vundle#begin()
"let Vundle manager Vundle
"required!
Bundle 'gmarik/vundle'
#
# ~/.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
# launch tmux
#test -z "$TMUX" && (tmux attach || tmux new-session)
@jouyouyun
jouyouyun / test.go
Created June 18, 2014 03:32
uri encode/decode
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
@jouyouyun
jouyouyun / watch_dir.go
Created April 16, 2014 02:54
Test Watch Dirs
package main
import (
"fmt"
"github.com/howeyc/fsnotify"
"os"
"regexp"
"sync"
"time"
)
@jouyouyun
jouyouyun / test_watch_dir.go
Created April 14, 2014 07:20
Test fsnotify for watching dir
package main
import (
"fmt"
"github.com/howeyc/fsnotify"
"regexp"
)
func main() {
watcher, err := fsnotify.NewWatcher()
@jouyouyun
jouyouyun / authWithPolkit.go
Last active August 29, 2015 13:56
Test PolicyKit
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)