shithub: riow

Download patch

ref: 69da4f0ed3907342fa6084e3bc21a8d9744fc4eb
parent: 7ab986f91583e5a07f3e9b6c7f528b047e9f707d
author: Sigrid Haflínudóttir <ftrvxmtrx@gmail.com>
date: Fri May 15 13:07:20 EDT 2020

update according to latest 9front changes

--- a/9front.diff
+++ b/9front.diff
@@ -1,24 +1,12 @@
-diff -r 95e095480480 sys/include/keyboard.h
---- a/sys/include/keyboard.h	Sat Mar 28 15:37:48 2020 +0100
-+++ b/sys/include/keyboard.h	Sun Mar 29 15:03:32 2020 +0200
-@@ -44,6 +44,8 @@
- 	Kscrolloneup=	KF|0x20,
- 	Kscrollonedown=	KF|0x21,
- 
-+	Kglenda=	KF|0x22,
-+
- 	Ksoh=	0x01,
- 	Kstx=	0x02,
- 	Ketx=	0x03,
-diff -r 95e095480480 sys/lib/kbmap/fi
---- a/sys/lib/kbmap/fi	Sat Mar 28 15:37:48 2020 +0100
-+++ b/sys/lib/kbmap/fi	Sun Mar 29 15:03:32 2020 +0200
+diff -r 35459627f401 sys/lib/kbmap/fi
+--- a/sys/lib/kbmap/fi	Wed May 13 18:50:01 2020 -0700
++++ b/sys/lib/kbmap/fi	Fri May 15 17:06:40 2020 +0200
 @@ -32,6 +32,8 @@
  1	52	':
  1	53	'_
  1	86	'>
-+2	91	0xf022
-+2	125	0xf022
++2	91	0xf868
++2	125	0xf868
  3	3	'@
  3	4	'£
  3	5	'$
@@ -28,15 +16,15 @@
  3	86	'|
 +3	91	0xf022
 +4	91	0xf022
-diff -r 95e095480480 sys/lib/kbmap/us
---- a/sys/lib/kbmap/us	Sat Mar 28 15:37:48 2020 +0100
-+++ b/sys/lib/kbmap/us	Sun Mar 29 15:03:32 2020 +0200
+diff -r 35459627f401 sys/lib/kbmap/us
+--- a/sys/lib/kbmap/us	Wed May 13 18:50:01 2020 -0700
++++ b/sys/lib/kbmap/us	Fri May 15 17:06:40 2020 +0200
 @@ -345,7 +345,7 @@
  2	88	0
  2	89	0
  2	90	0
 -2	91	0
-+2	91	0xf022
++2	91	0xf868
  2	92	0
  2	93	0
  2	94	0
@@ -45,7 +33,7 @@
  2	123	0
  2	124	0
 -2	125	0
-+2	125	0xf022
++2	125	0xf868
  2	126	0
  2	127	0
  3	0	0
@@ -54,7 +42,7 @@
  3	89	0
  3	90	0
 -3	91	0
-+3	91	0xf022
++3	91	0xf868
  3	92	0
  3	93	0
  3	94	0
@@ -63,147 +51,13 @@
  4	89	0
  4	90	0
 -4	91	0
-+4	91	0xf022
++4	91	0xf868
  4	92	0
  4	93	0
  4	94	0
-diff -r 95e095480480 sys/src/cmd/aux/kbdfs/kbdfs.c
---- a/sys/src/cmd/aux/kbdfs/kbdfs.c	Sat Mar 28 15:37:48 2020 +0100
-+++ b/sys/src/cmd/aux/kbdfs/kbdfs.c	Sun Mar 29 15:03:32 2020 +0200
-@@ -42,6 +42,7 @@
- 	int	ctl;
- 	int	alt;
- 	int	altgr;
-+	int glenda;
- 	int	leds;
- };
- 
-@@ -178,11 +179,11 @@
- [0x40]	0,	0,	0,	0,	0,	0,	Kbreak,	Khome,
- [0x48]	Kup,	Kpgup,	0,	Kleft,	0,	Kright,	0,	Kend,
- [0x50]	Kdown,	Kpgdown,Kins,	Kdel,	0,	0,	0,	0,
--[0x58]	0,	0,	0,	0,	0,	0,	0,	0,
-+[0x58]	0,	0,	0,	Kglenda,	0,	0,	0,	0,
- [0x60]	0,	0,	0,	0,	0,	0,	0,	0,
- [0x68]	0,	0,	0,	0,	0,	0,	0,	0,
- [0x70]	0,	0,	0,	0,	0,	0,	0,	0,
--[0x78]	0,	Kup,	0,	0,	0,	0,	0,	0,
-+[0x78]	0,	Kup,	0,	0,	0,	Kglenda,	0,	0,
- };
- 
- Rune kbtabshiftesc1[Nscan] =
-@@ -198,11 +199,11 @@
- [0x40]	0,	0,	0,	0,	0,	0,	0,	0,
- [0x48]	Kup,	0,	0,	0,	0,	0,	0,	0,
- [0x50]	0,	0,	0,	0,	0,	0,	0,	0,
--[0x58]	0,	0,	0,	0,	0,	0,	0,	0,
-+[0x58]	0,	0,	0,	Kglenda,	0,	0,	0,	0,
- [0x60]	0,	0,	0,	0,	0,	0,	0,	0,
- [0x68]	0,	0,	0,	0,	0,	0,	0,	0,
- [0x70]	0,	0,	0,	0,	0,	0,	0,	0,
--[0x78]	0,	Kup,	0,	0,	0,	0,	0,	0,
-+[0x78]	0,	Kup,	0,	0,	0,	Kglenda,	0,	0,
- };
- 
- Rune kbtabctrlesc1[Nscan] =
-@@ -218,11 +219,11 @@
- [0x40]	0,	0,	0,	0,	0,	0,	0,	0,
- [0x48]	Kup,	0,	0,	0,	0,	0,	0,	0,
- [0x50]	0,	0,	0,	0,	0,	0,	0,	0,
--[0x58]	0,	0,	0,	0,	0,	0,	0,	0,
-+[0x58]	0,	0,	0,	Kglenda,	0,	0,	0,	0,
- [0x60]	0,	0,	0,	0,	0,	0,	0,	0,
- [0x68]	0,	0,	0,	0,	0,	0,	0,	0,
- [0x70]	0,	0,	0,	0,	0,	0,	0,	0,
--[0x78]	0,	Kup,	0,	0,	0,	0,	0,	0,
-+[0x78]	0,	Kup,	0,	0,	0,	Kglenda,	0,	0,
- };
- 
- Rune kbtabaltgr[Nscan] =
-@@ -238,11 +239,11 @@
- [0x40]	0,	0,	0,	0,	0,	0,	Kbreak,	Khome,
- [0x48]	Kup,	Kpgup,	0,	Kleft,	0,	Kright,	0,	Kend,
- [0x50]	Kdown,	Kpgdown,Kins,	Kdel,	0,	0,	0,	0,
--[0x58]	0,	0,	0,	0,	0,	0,	0,	0,
-+[0x58]	0,	0,	0,	Kglenda,	0,	0,	0,	0,
- [0x60]	0,	0,	0,	0,	0,	0,	0,	0,
- [0x68]	0,	0,	0,	0,	0,	0,	0,	0,
- [0x70]	0,	0,	0,	0,	0,	0,	0,	0,
--[0x78]	0,	Kup,	0,	0,	0,	0,	0,	0,
-+[0x78]	0,	Kup,	0,	0,	0,	Kglenda,	0,	0,
- };
- 
- Rune kbtabctl[Nscan] =
-@@ -258,11 +259,11 @@
- [0x40]	'', 	'', 	'', 	'
', 	'', 	'', 	'', 	'', 
- [0x48]	'', 	'', 	'
', 	'', 	'', 	'', 	'', 	'', 
- [0x50]	'', 	'', 	'', 	'', 	0,	0,	0,	'', 
--[0x58]	'', 	0,	0,	0,	0,	0,	0,	0,
-+[0x58]	'', 	0,	0,	Kglenda,	0,	0,	0,	0,
- [0x60]	0,	0,	0,	0,	0,	0,	0,	0,
- [0x68]	0,	0,	0,	0,	0,	0,	0,	0,
- [0x70]	0,	0,	0,	0,	0,	0,	0,	0,
--[0x78]	0,	'', 	0,	'\b',	0,	0,	0,	0,
-+[0x78]	0,	'', 	0,	'\b',	0,	Kglenda,	0,	0,
- };
- 
- Rune kbtabshiftaltgr[Nscan] =
-@@ -344,7 +345,7 @@
- 	if(scan->esc2){
- 		scan->esc2--;
- 		return;
--	} else if(c == 0xe1 || c == 0xe2){
-+	} else if(c == 0xe1 || c == 0xe2 || c == 0xe3){
- 		scan->esc2 = 2;
- 		return;
- 	} else if(c == 0xe0){
-@@ -362,6 +363,7 @@
- 	if(c != 0 && strchr("GHIKMOPQRS", c) != nil)
- 		scan->esc1 |= !scan->num;
- 
-+	key.r = 0;
- 	if(scan->esc1 && scan->ctl && kbtabctrlesc1[c] != 0)
- 		key.r = kbtabctrlesc1[c];
- 	else if(scan->esc1 && scan->shift && kbtabshiftesc1[c] != 0)
-@@ -412,6 +414,9 @@
- 	case Kcaps:
- 		scan->caps ^= key.down;
- 		break;
-+	case Kglenda:
-+		scan->glenda ^= key.down;
-+		break;
- 	}
- 	scan->esc1 = 0;
- }
-@@ -464,7 +469,7 @@
- 			}
- 		}
- 		/* button unknown to kbtab, use rune if no modifier keys are active */
--		if(k.b == 0 && !a->shift && !a->altgr && !a->ctl)
-+		if(k.b == 0 && !a->shift && !a->altgr && !a->ctl && !a->glenda)
- 			k.b = k.r;
- 		if(k.r == Kshift)
- 			a->shift = k.down;
-@@ -472,6 +477,8 @@
- 			a->altgr = k.down;
- 		else if(k.r == Kctl)
- 			a->ctl = k.down;
-+		else if(k.r == Kglenda)
-+			a->glenda = k.down;
- 		send(keychan, &k);
- 		break;
- 
-@@ -664,6 +671,7 @@
- 		case Knum:
- 		case Kshift:
- 		case Kaltgr:
-+		case Kglenda:
- 			/* ignore modifiers */
- 			continue;
- 
-diff -r 95e095480480 sys/src/cmd/rio/dat.h
---- a/sys/src/cmd/rio/dat.h	Sat Mar 28 15:37:48 2020 +0100
-+++ b/sys/src/cmd/rio/dat.h	Sun Mar 29 15:03:32 2020 +0200
+diff -r 35459627f401 sys/src/cmd/rio/dat.h
+--- a/sys/src/cmd/rio/dat.h	Wed May 13 18:50:01 2020 -0700
++++ b/sys/src/cmd/rio/dat.h	Fri May 15 17:06:40 2020 +0200
 @@ -344,11 +344,15 @@
  char		*startdir;
  int		sweeping;
@@ -218,11 +72,11 @@
  int		snarfversion;	/* updated each time it is written */
  int		messagesize;		/* negotiated in 9P version setup */
  int		shiftdown;
-+int		glendadown;
++int		mod4down;
  int		debug;
-diff -r 95e095480480 sys/src/cmd/rio/fsys.c
---- a/sys/src/cmd/rio/fsys.c	Sat Mar 28 15:37:48 2020 +0100
-+++ b/sys/src/cmd/rio/fsys.c	Sun Mar 29 15:03:32 2020 +0200
+diff -r 35459627f401 sys/src/cmd/rio/fsys.c
+--- a/sys/src/cmd/rio/fsys.c	Wed May 13 18:50:01 2020 -0700
++++ b/sys/src/cmd/rio/fsys.c	Fri May 15 17:06:40 2020 +0200
 @@ -50,6 +50,7 @@
  
  char	srvpipe[64];
@@ -292,27 +146,27 @@
  	proccreate(filsysproc, fs, 10000);
  
  	/*
-diff -r 95e095480480 sys/src/cmd/rio/rio.c
---- a/sys/src/cmd/rio/rio.c	Sat Mar 28 15:37:48 2020 +0100
-+++ b/sys/src/cmd/rio/rio.c	Sun Mar 29 15:03:32 2020 +0200
+diff -r 35459627f401 sys/src/cmd/rio/rio.c
+--- a/sys/src/cmd/rio/rio.c	Wed May 13 18:50:01 2020 -0700
++++ b/sys/src/cmd/rio/rio.c	Fri May 15 17:06:40 2020 +0200
 @@ -340,13 +340,20 @@
  keyboardthread(void*)
  {
  	char *s;
-+	int glendadownnew;
++	int mod4downnew;
  
  	threadsetname("keyboardthread");
  
-+	glendadownnew = 0;
++	mod4downnew = 0;
  	while(s = recvp(kbdchan)){
 -		if(*s == 'k' || *s == 'K')
 +		if(*s == 'k' || *s == 'K'){
  			shiftdown = utfrune(s+1, Kshift) != nil;
 -		if(input == nil || sendp(input->ck, s) <= 0)
-+			glendadownnew = utfrune(s+1, Kglenda) != nil;
++			mod4downnew = utfrune(s+1, Kmod4) != nil;
 +		}
-+		if(glendadown || glendadownnew){
-+			glendadown = glendadownnew;
++		if(mod4down || mod4downnew){
++			mod4down = mod4downnew;
 +			sendp(gkbdc, s);
 +		}else if(input == nil || sendp(input->ck, s) <= 0)
  			free(s);
--- a/README.md
+++ b/README.md
@@ -4,10 +4,10 @@
 It gives you virtual desktops to move window around to, by pressing
 keys, like i3. The window management code is written in `rc` and is done
 by reading and writing `/dev/wsys` for the most part. There are minimal
-changes to `kbdfs` (to add support for an extra key) and `rio` (to provide
-an additional `/srv/riogkbd.*` file).
+changes to `rio` (to provide an additional `/srv/riogkbd.*` file).
 
-*No guarantees, use at your own risk and blah. This isn't supposed to work with drawterm.*
+*No guarantees, use at your own risk and blah.  This isn't supposed to
+work with drawterm.*
 
 ## Features
 
@@ -23,12 +23,9 @@
 
 ## Installation and usage
 
-Apply `9front.diff` on your sources, rebuild `kbdfs` and `rio`.
-Run `mk install` in this repo. You also need to rebuild your kernel
-after so it picks up new `kbdfs`, reboot.
+Run `mk install` in this repo.  Apply `9front.diff` on your sources
+ (`hg import --no-commit 9front.diff`), rebuild `rio`.
 
-The `super/windows/meta/mod` keys are now called `glenda` here, duh.
-
 To start the actual window management thingy, open a new window in
 `rio` and type `riow < /srv/riogkbd*`. See *Keys* section and it you're
 happy with everything you can start `riow` automatically next time.
@@ -39,9 +36,9 @@
 ## Keys
 
 ```
-G-f              toggle fullscreen for the current window
-G-s              toggle "sticky" mode for the current window
-G-enter          start a new window
-G-[0..9]         switch to a specific virtual desktop
-G-shift-[0..9]   move the current window to a specific virtual desktop
+Mod4-f              toggle fullscreen for the current window
+Mod4-s              toggle "sticky" mode for the current window
+Mod4-enter          start a new window
+Mod4-[0..9]         switch to a specific virtual desktop
+Mod4-shift-[0..9]   move the current window to a specific virtual desktop
 ```
--- a/gkbd.c
+++ b/gkbd.c
@@ -15,7 +15,7 @@
 	{Kdel, "del"},
 	{Kdown, "down"},
 	{Kesc, "esc"},
-	{Kglenda, "glenda"},
+	{Kmod4, "mod4"},
 	{Kleft, "left"},
 	{Kright, "right"},
 	{Kshift, "shift"},