diff options
Diffstat (limited to 'config.go')
| -rw-r--r-- | config.go | 78 |
1 files changed, 0 insertions, 78 deletions
diff --git a/config.go b/config.go deleted file mode 100644 index 8cab5d8..0000000 --- a/config.go +++ /dev/null @@ -1,78 +0,0 @@ -package main - -import ( - "github.com/BurntSushi/xgb" - "github.com/BurntSushi/xgb/xproto" - - "github.com/crecheer/wm/keysym" -) - -// appearance -var barHeight uint16 = 20 -var gapSize int = 10 -var barColor uint32 = 0x000000 -var barFg uint32 = 0x888888 -var selBg uint32 = 0x285577 -var selFg uint32 = 0xEEEEEE -var fontName = "JetBrainsMono Nerd Font:size=16" -var tagCount = 9 -var borderWidth int = 2 -var borderColor uint32 = 0x444444 -var borderFocus uint32 = 0x285577 - -// shows focused window title -var windowTitle = 0 - -// xproto.ModMask1 = Alt -// xproto.ModMask4 = Super / Win -var mod = uint16(xproto.ModMask4) - -// commands that get executed on startup -var startup = []string{"notify-send hello world!"} - -const shift = uint16(xproto.ModMaskShift) -const alt = uint16(xproto.ModMask1) - -func bind(m uint16, sym uint32, fn func(*xgb.Conn)) Key { - return Key{Mod: m, Sym: sym, Fn: fn} -} - -func run(cmd string, args ...string) func(*xgb.Conn) { - return func(*xgb.Conn) { spawn(cmd, args...) } -} - -func setLayout(name string) func(*xgb.Conn) { - return func(conn *xgb.Conn) { - layout = name - updateWindows(conn) - } -} - -var keys = []Key{ - bind(mod, keysym.XK_Return, run("st")), - bind(mod, keysym.XK_w, run("qutebrowser")), - bind(mod, keysym.XK_d, run("dmenu_run")), - bind(mod|shift, keysym.XK_q, func(*xgb.Conn) { quit() }), - bind(mod|shift, keysym.XK_r, func(*xgb.Conn) { restart() }), - bind(mod, keysym.XK_q, func(conn *xgb.Conn) { killActiveWindow(conn, focused) }), - bind(mod, keysym.XK_l, setLayout("tileHorizontal")), - bind(mod|shift, keysym.XK_l, setLayout("tileVertical")), - bind(mod, keysym.XK_m, setLayout("tileWithMaster")), -} - -func init() { - for i := 0; i < tagCount && i < 9; i++ { - tags := BitMask(1) << i - sym := keysym.XK_1 + uint32(i) - keys = append(keys, - bind(mod, sym, func(conn *xgb.Conn) { switchTags(conn, tags) }), - bind(mod|shift, sym, func(conn *xgb.Conn) { moveToTag(conn, tags) }), - bind(alt, sym, func(conn *xgb.Conn) { toggleView(conn, tags) }), - ) - } - all := BitMask(1)<<tagCount - 1 - keys = append(keys, - bind(mod, keysym.XK_0, func(conn *xgb.Conn) { switchTags(conn, all) }), - bind(mod|shift, keysym.XK_0, func(conn *xgb.Conn) { moveToTag(conn, all) }), - ) -} |