diff options
| author | Ivan Kanakarakis <ivan.kanak@gmail.com> | 2011-12-11 16:04:06 +0200 |
|---|---|---|
| committer | Ivan Kanakarakis <ivan.kanak@gmail.com> | 2011-12-11 16:04:09 +0200 |
| commit | c9db406c242baf6d3d9c6471a1401877c075a170 (patch) | |
| tree | c15e08b905b04b610bd1597f679d4477f18b7e1b | |
| parent | d2cce3343cdb3a08c3bca78b57826b97ca7b69ed (diff) | |
rename and update default configuration
config.h.def -> config.def.h
update to match current state of code
update readme to reference config.def.h
also minor corrections for readme
| -rw-r--r-- | README.md | 17 | ||||
| -rw-r--r-- | config.def.h | 84 | ||||
| -rw-r--r-- | config.h.def | 125 |
3 files changed, 91 insertions, 135 deletions
@@ -4,7 +4,7 @@ dminiwm ### ~ it's minimal and dynamic [moetunes][] started this from [catwm][] 31/12/10 ([ArchLinux forums][catf]) -Credits and licensing included in `dminiwm.c` and/or `config.h.def`. +Credits and licensing included in `dminiwm.c` and/or `config.def.h`. For screenshots and ramblings/updates check [the topic on ArchLinux forums][dminif] [moetunes]: https://github.com/moetunes @@ -17,8 +17,8 @@ Summary ------- **dminiwm** is a very minimal and lightweight dynamic tiling window manager. -I will try to stay under 1000 SLOC. -Currently under 950 lines with the config file included. +It will try to stay under 1000 SLOC. +Currently under 800 lines with the config file included. Modes @@ -84,13 +84,12 @@ Installation ------------ You need Xlib, then, -copy the `config.h.deh` file as `config.h` +copy the `config.def.h` file as `config.h` and edit to suit your needs. -Build and install the project. - - $ cp config.h.def config.h - $ $EDITOR config.h # optional +Build and install. + $ cp config.def.h config.h + $ $EDITOR config.h $ make # make clean install @@ -98,8 +97,6 @@ Build and install the project. Bugs ---- -No bugs for the moment ;) (I mean, no importants bugs) - For any issues report at [the topic on ArchLinux forums][dminif], or [fill an issue][bug] on [GitHub][ghp] diff --git a/config.def.h b/config.def.h new file mode 100644 index 0000000..0529128 --- /dev/null +++ b/config.def.h @@ -0,0 +1,84 @@ +/* Based on: + * - catwm at https://github.com/pyknite/catwm + * - 2wm at http://hg.suckless.org/2wm/ + * - dwm at http://dwm.suckless.org/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef CONFIG_H +#define CONFIG_H + +#define CLEANMASK(mask) (mask & ~(numlockmask | LockMask)) + +/** generic settings **/ +#define MOD1 Mod1Mask /* ALT key */ +#define MOD4 Mod4Mask /* Super/Windows key */ +#define MASTER_SIZE 0.52 +#define TOP_PANEL True /* False mean panel is on bottom */ +#define PANEL_HEIGHT 18 /* 0 for no space for panel, thus no panel */ +#define DEFAULT_MODE TILE /* TILE MONOCYCLE BSTACK GRID */ +#define ATTACH_ASIDE True /* False means new window is master */ +#define FOLLOW_MOUSE False /* Focus the window the mouse just entered */ +#define FOLLOW_WINDOW False /* Follow the window when moved to a different desktop */ +#define CLICK_TO_FOCUS False /* Focus an unfocused window when clicked */ +#define BORDER_WIDTH 2 /* window border width */ +#define FOCUS "#ff950e" /* focused window border color */ +#define UNFOCUS "#444444" /* unfocused window border color */ +#define DESKTOPS 4 /* number of desktops - edit DESKTOPCHANGE keys to suit */ + +/** open applications to specified desktop **/ +static const AppRule rules[] = { \ + /* class desktop follow */ /* desktop index starts from 0 */ + { "MPlayer", 3, True }, /* if there are 4 desktops, 3 is the */ + { "Chromium", 0, False }, /* last desktop, 0 is always the fist */ +}; + +/** commands **/ +const char *termcmd[] = { "xterm", NULL }; +const char *dmenucmd[] = { "dmenu", NULL }; + +#define DESKTOPCHANGE(K,N) \ + { MOD1, K, change_desktop, {.i = N}}, \ + { MOD1|ShiftMask, K, client_to_desktop, {.i = N}}, + +/** Shortcuts **/ +static key keys[] = { + /* modifier key function argument */ + { MOD1|ShiftMask, XK_c, killclient, {NULL}}, + { MOD1, XK_j, next_win, {NULL}}, + { MOD1, XK_k, prev_win, {NULL}}, + { MOD1, XK_h, resize_master, {.i = -10}}, /* decrease */ + { MOD1, XK_l, resize_master, {.i = +10}}, /* increase */ + { MOD1, XK_o, resize_stack, {.i = -10}}, /* shrink */ + { MOD1, XK_p, resize_stack, {.i = +10}}, /* grow */ + { MOD1|ShiftMask, XK_Left, rotate_desktop, {.i = -1}}, /* prev */ + { MOD1|ShiftMask, XK_Right, rotate_desktop, {.i = +1}}, /* next */ + { MOD1, XK_Tab, last_desktop, {NULL}}, + { MOD1, XK_Return, swap_master, {NULL}}, + { MOD1|ShiftMask, XK_j, move_down, {NULL}}, + { MOD1|ShiftMask, XK_k, move_up, {NULL}}, + { MOD1|ShiftMask, XK_t, switch_mode, {.i = TILE}}, + { MOD1|ShiftMask, XK_m, switch_mode, {.i = MONOCYCLE}}, + { MOD1|ShiftMask, XK_b, switch_mode, {.i = BSTACK}}, + { MOD1|ShiftMask, XK_g, switch_mode, {.i = GRID}}, + { MOD1|ShiftMask, XK_r, quit, {.i = 0}}, /* quit with exit value 0 */ + { MOD1|ShiftMask, XK_q, quit, {.i = 1}}, /* quit with exit value 1 */ + { MOD1|ShiftMask, XK_Return, spawn, {.com = termcmd}}, + { MOD4, XK_v, spawn, {.com = dmenucmd}}, + DESKTOPCHANGE( XK_F1, 0) + DESKTOPCHANGE( XK_F2, 1) + DESKTOPCHANGE( XK_F3, 2) + DESKTOPCHANGE( XK_F4, 3) +}; + +#endif diff --git a/config.h.def b/config.h.def deleted file mode 100644 index 3281b17..0000000 --- a/config.h.def +++ /dev/null @@ -1,125 +0,0 @@ - /* config.h for dminiwm.c [ 0.1.8 ] - * - * Started from catwm 31/12/10 - * Bad window error checking and numlock checking used from - * 2wm at http://hg.suckless.org/2wm/ - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - */ - -#ifndef CONFIG_H -#define CONFIG_H - -#define CLEANMASK(mask) (mask & ~(numlockmask | LockMask)) - -/* Mod (Mod1 == alt) (Mod4 == Super/windows) */ -#define MOD1 Mod1Mask -#define MOD4 Mod4Mask -#define MASTER_SIZE 0.52 -#define TOP_PANEL 1 /* 1=Don't 0=Have the panel at the top instead of the bottom */ -#define PANEL_HEIGHT 18 /* 0 for no space for a panel */ -#define BORDER_WIDTH 2 -#define ATTACH_ASIDE 1 /* 0=TRUE, 1=New window is master */ -#define DEFAULT_MODE 0 /* 0=Vertical, 1=Fullscreen 2=Horizontal 3=grid*/ -#define FOLLOW_MOUSE 0 /* 1=Don't 0=Focus the window the mouse just entered */ -#define FOLLOW_WINDOW 0 /* 1=Don't 0=Follow the window when moved to a different desktop */ -#define CLICK_TO_FOCUS 0 /* 1=Don't 0=Focus an unfocused window when clicked */ -#define DESKTOPS 6 /* Must edit DESKTOPCHANGE keys to suit */ - -// Colors -#define FOCUS "#664422" // dkorange -#define UNFOCUS "#004050" // blueish - -// Applications to a specific desktop -static const Convenience convenience[] = { \ - /* class desktop follow */ - { "Thunar", 2, 1 }, - //{ "Leafpad", 2, 1 }, - { "Firefox", 3, 0 }, - { "Links", 3, 1 }, - { "MPlayer", 4, 1 }, - { "Thunderbird", 5, 0 }, - { "Pysol", 6, 1 }, -}; - -const char* dmenucmd[] = {"dmenu_run","-i","-nb","#666622","-nf","white",NULL}; -const char* urxvtcmd[] = {"urxvtc",NULL}; -const char* terminalcmd[] = {"Terminal",NULL}; -const char* thunarcmd[] = {"thunar",NULL}; -const char* firefoxcmd[] = {"firefox",NULL}; -const char* webcmd[] = {"links","-g",NULL}; -const char* mailcmd[] = {"thunderbird",NULL }; -const char* voldowncmd[] = {"/home/pnewm/.bin/voldown",NULL}; -const char* volupcmd[] = {"/home/pnewm/.bin/volup",NULL}; -const char* prevoldowncmd[] = {"/home/pnewm/.bin/prevoldown",NULL}; -const char* prevolupcmd[] = {"/home/pnewm/.bin/prevolup",NULL}; -const char* vols_what[] = {"/home/pnewm/.bin/volumes_what",NULL}; -// for reboot and shutdown -const char* rebootcmd[] = {"sudo","reboot",NULL}; -const char* shutdowncmd[] = {"sudo","shutdown","-h","now",NULL}; - -// Avoid multiple paste -#define DESKTOPCHANGE(K,N) \ - { MOD1, K, change_desktop, {.i = N}}, \ - { MOD1|ShiftMask, K, client_to_desktop, {.i = N}}, - -// Shortcuts -static key keys[] = { - // MOD KEY FUNCTION ARGS - { MOD1, XK_h, resize_master, {.i = 10}}, - { MOD1, XK_l, resize_master, {.i = -10}}, - { MOD1, XK_c, kill_client, {NULL}}, - { MOD1, XK_j, next_win, {NULL}}, - { MOD1, XK_k, prev_win, {NULL}}, - { MOD1, XK_v, spawn, {.com = dmenucmd}}, - { MOD1, XK_p, resize_stack, {.i = 10}}, - { MOD1, XK_o, resize_stack, {.i = -10}}, - { MOD1, XK_Tab, last_desktop, {NULL}}, - { MOD1, XK_Return, spawn, {.com = urxvtcmd}}, - { MOD1, XK_Up, spawn, {.com = volupcmd}}, - { MOD1, XK_Down, spawn, {.com = voldowncmd}}, -// alt + shift + shortcut - { MOD1|ShiftMask, XK_j, move_up, {NULL}}, - { MOD1|ShiftMask, XK_k, move_down, {NULL}}, - { MOD1|ShiftMask, XK_Return, swap_master, {NULL}}, - { MOD1|ShiftMask, XK_g, switch_grid, {NULL}}, - { MOD1|ShiftMask, XK_h, switch_horizontal, {NULL}}, - { MOD1|ShiftMask, XK_m, switch_fullscreen, {NULL}}, - { MOD1|ShiftMask, XK_v, switch_vertical, {NULL}}, -// Control + alt + shortcut - { MOD1|ControlMask, XK_q, quit, {NULL}}, - { MOD1|ControlMask, XK_r, spawn, {.com = rebootcmd}}, - { MOD1|ControlMask, XK_s, spawn, {.com = shutdowncmd}}, -// Window key + shortcut - { MOD4, XK_Right, rotate_desktop, {.i = 1}}, - { MOD4, XK_Left, rotate_desktop, {.i = -1}}, - { MOD4, XK_e, spawn, {.com = mailcmd}}, - { MOD4, XK_f, spawn, {.com = firefoxcmd}}, - { MOD4, XK_w, spawn, {.com = webcmd}}, - { MOD4, XK_h, spawn, {.com = thunarcmd}}, - { MOD4, XK_t, spawn, {.com = terminalcmd}}, - { MOD4, XK_v, spawn, {.com = vols_what}}, - { MOD4, XK_Up, spawn, {.com = prevolupcmd}}, - { MOD4, XK_Down, spawn, {.com = prevoldowncmd}}, - DESKTOPCHANGE( XK_1, 0) - DESKTOPCHANGE( XK_2, 1) - DESKTOPCHANGE( XK_3, 2) - DESKTOPCHANGE( XK_4, 3) - DESKTOPCHANGE( XK_5, 4) - DESKTOPCHANGE( XK_6, 5) -}; - -#endif - |
