xaizek / euclid-wm (License: BSD 3-Clause) (since 2018-12-07)
A minimalist, tiling window manager for X11 that seeks to allow easy management of numerous windows entirely from the keyboard.
Commit 9904cbad2205170e5e6462550a4d12a8b934feea

Add command to go to last seen view
On M + \ by default.
Author: xaizek
Author date (UTC): 2016-09-29 18:17
Committer name: xaizek
Committer date (UTC): 2016-09-29 18:17
Parent(s): d306f0119b133ceb9ee8a74153c2bddd6743eaf0
Signing key: 99DC5E4DB05F6BE2
Tree: 3af93c5b5fcae1d4f084a48394a7d8cd19ea57a7
File Lines added Lines deleted
euclid-wm.c 14 4
euclid-wm.conf.sample 3 0
euclid.1 3 0
File euclid-wm.c changed (mode: 100644) (index 66cb79c..8d40d51)
... ... char *tempnam(char *,char*);
101 101 #define ARRAY_LEN(x) (sizeof(x)/sizeof((x)[0])) #define ARRAY_LEN(x) (sizeof(x)/sizeof((x)[0]))
102 102
103 103 //number of builtin commands //number of builtin commands
104 #define BCMDS 55
104 #define BCMDS 56
105 105 //maximum number of supported custom commands //maximum number of supported custom commands
106 106 #define CCMDS 99 #define CCMDS 99
107 107 //total maximum number of commands //total maximum number of commands
 
... ... struct timeval last_redraw; //we use this to keep track of whether events are
229 229 bool default_orientation = true; //which way do we initialize views with their tracks running? bool default_orientation = true; //which way do we initialize views with their tracks running?
230 230 bool autobalance = false; //is smart layout balancing enabled? bool autobalance = false; //is smart layout balancing enabled?
231 231 bool win_menu = false; //if false use dmenu for to search windows, if true use euclid-menu, eventually we may phase dmenu out altogether bool win_menu = false; //if false use dmenu for to search windows, if true use euclid-menu, eventually we may phase dmenu out altogether
232 int last_view_idx = 1; //index of the last seen view
232 233
233 234 //records the keycode in appropriate array //records the keycode in appropriate array
234 235 void bind_key(char s[12], unsigned int *m, struct binding *b) { void bind_key(char s[12], unsigned int *m, struct binding *b) {
 
... ... void load_defaults() {
337 338 //bind search //bind search
338 339 bind_key("slash",&mods, &bindings[54]); bind_key("slash",&mods, &bindings[54]);
339 340
341 //go to previous view
342 bind_key("backslash",&mod, &bindings[55]);
343
340 344 // user defined // user defined
341 345 } }
342 346
 
... ... void load_conf( bool first_call) {
620 624 bindx = 53; bindx = 53;
621 625 }else if (strcmp(key,"bind_search") == 0) { }else if (strcmp(key,"bind_search") == 0) {
622 626 bindx = 54; bindx = 54;
627 } else if (strcmp(key,"bind_move_to_last_view") == 0) {
628 bindx = 55;
623 629 } else if (strncmp(key,"bind_custom_", 12) == 0) { } else if (strncmp(key,"bind_custom_", 12) == 0) {
624 630 const int ccmd_index = atoi(&key[12]) - 1; const int ccmd_index = atoi(&key[12]) - 1;
625 631 if (ccmd_index >= 0 && ccmd_index < ARRAY_LEN(ccmds)) { if (ccmd_index >= 0 && ccmd_index < ARRAY_LEN(ccmds)) {
 
... ... void goto_view(struct view *v) {
1774 1780 s = s->next; s = s->next;
1775 1781 }; };
1776 1782
1783 last_view_idx = cs->v->idx;
1784
1777 1785 struct track *t; struct track *t;
1778 1786 struct cont *c; struct cont *c;
1779 1787
 
... ... int event_loop() {
2691 2699 }; };
2692 2700 break; break;
2693 2701 case 54: case 54:
2694 search_wins();
2702 search_wins();
2703 redraw = true;
2704 break;
2705 case 55:
2706 goto_view(find_view(last_view_idx));
2695 2707 redraw = true; redraw = true;
2696
2697
2698 2708 break; break;
2699 2709
2700 2710 default: default:
File euclid-wm.conf.sample changed (mode: 100644) (index be766dd..7eedc92)
... ... bind_goto_next_screen = M Next
138 138 #search for a window via dmenu #search for a window via dmenu
139 139 bind_search = MS slash bind_search = MS slash
140 140
141 #switch to last view
142 bind_move_to_last_view = M backslash
143
141 144 #CUSTOM HOTKEYS #CUSTOM HOTKEYS
142 145 #euclid supports up to 99 hotkeys, bound to external commands #euclid supports up to 99 hotkeys, bound to external commands
143 146 #the format for the binding is: bind_custom_[01-99] = [M | MS | N] [keyname] (just like normal bindings) #the format for the binding is: bind_custom_[01-99] = [M | MS | N] [keyname] (just like normal bindings)
File euclid.1 changed (mode: 100644) (index 39fea72..f627e6f)
... ... The stack maintains its own focus; The currently focused item can be identified
83 83 .B M + N/M .B M + N/M
84 84 \- Move currently focused window to the previous/next view \- Move currently focused window to the previous/next view
85 85 .IP .IP
86 .B M + \\\\
87 \- Move to the last view (pressing this twice will get you back where you were)
88 .IP
86 89 .B M + 1-9 .B M + 1-9
87 90 \- Move to the 1-9th view \- Move to the 1-9th view
88 91 .IP .IP
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/euclid-wm

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/euclid-wm

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master