Skip to content
Browse files

Replaced prev/next_desktop functions with rotate_desktop

  • Loading branch information...
1 parent 25edd0d commit 0f853ff6277e38f4de7e7bb1e5c7d2098c5e2056 @moetunes committed Nov 28, 2011
Showing with 21 additions and 26 deletions.
  1. +5 −0 .gitignore
  2. +6 −0 ChangeLog
  3. +3 −3 config.h.def
  4. +7 −23 dminiwm.c
View
5 .gitignore
@@ -0,0 +1,5 @@
+dminiwm
+config.h
+*.o
+*.swp
+*~
View
6 ChangeLog
@@ -1,8 +1,14 @@
28/11/11
+ Replaced next/prev_desktop function with shorter rotate_desktop function
+ (thanks to c00kiemon5ter)
+
+28/11/11
Added last desktop function for switching back to the last opened desktop
+ (thanks to c00kimon5ter)
26/11/11
Added option to click on a window to focus it
+ (thanks to richo4)
21/11/11
Fix for transient windows not being managed
View
6 config.h.def
@@ -1,4 +1,4 @@
- /* config.h for dminiwm.c [ 0.2.0 ]
+ /* config.h for dminiwm.c [ 0.2.1 ]
*
* Started from catwm 31/12/10
* Bad window error checking and numlock checking used from
@@ -104,8 +104,8 @@ static key keys[] = {
{ MOD1|ControlMask, XK_r, spawn, {.com = rebootcmd}},
{ MOD1|ControlMask, XK_s, spawn, {.com = shutdowncmd}},
// Window key + shortcut
- { MOD4, XK_Right, next_desktop, {NULL}},
- { MOD4, XK_Left, prev_desktop, {NULL}},
+ { 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}},
View
30 dminiwm.c
@@ -1,4 +1,4 @@
-/* dminiwm.c [ 0.2.0 ]
+/* dminiwm.c [ 0.2.1 ]
*
* I started this from catwm 31/12/10
* Bad window error checking and numlock checking used from
@@ -112,14 +112,13 @@ static void kill_client();
static void maprequest(XEvent *e);
static void move_down();
static void move_up();
-static void next_desktop();
static void next_win();
-static void prev_desktop();
static void prev_win();
static void quit();
static void remove_window(Window w);
static void resize_master(const Arg arg);
static void resize_stack(const Arg arg);
+static void rotate_desktop(const Arg arg);
static void save_desktop(int i);
static void select_desktop(int i);
static void send_kill_signal(Window w);
@@ -385,26 +384,10 @@ void last_desktop() {
change_desktop(a);
}
-void next_desktop() {
- int tmp = current_desktop;
- if(tmp == TABLENGTH(desktops)-1)
- tmp = 0;
- else
- tmp++;
-
- Arg a = {.i = tmp};
- change_desktop(a);
-}
-
-void prev_desktop() {
- int tmp = current_desktop;
- if(tmp == 0)
- tmp = TABLENGTH(desktops)-1;
- else
- tmp--;
-
- Arg a = {.i = tmp};
- change_desktop(a);
+void rotate_desktop(const Arg arg) {
+ int ndesktops = TABLENGTH(desktops);
+ Arg a = {.i = (current_desktop + ndesktops + arg.i) % ndesktops};
+ change_desktop(a);
}
void client_to_desktop(const Arg arg) {
@@ -876,6 +859,7 @@ void quit() {
logger(" \033[0;33mThanks for using!");
XCloseDisplay(dis);
logger("\033[0;31mforced shutdown");
+ exit (0);
}
bool_quit = 1;

0 comments on commit 0f853ff

Please sign in to comment.
Something went wrong with that request. Please try again.