Minor edits

This commit is contained in:
Øystein Bech Gadmar 2017-05-11 22:16:58 +02:00
parent 9d3de38160
commit c40b832ae9
7 changed files with 69 additions and 38 deletions

17
.gitattributes vendored Normal file
View File

@ -0,0 +1,17 @@
# Auto detect text files and perform LF normalization
* text=auto
# Custom for Visual Studio
*.cs diff=csharp
# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain

7
LICENSE.md Normal file
View File

@ -0,0 +1,7 @@
Copyright 2016, Øystein Bech Gadmar (a.k.a. "DreymaR")
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -1,7 +1,7 @@
DreymaR's Big Bag of Keyboard Tricks
====================================
For Linux (updated to XKB-data v2.17.1ub1, 2016-06)
### For Linux (updated to XKB-data v2.17.1ub1, 2016-06)
* New "Colemak[eD]" AltGr mappings (lv3-4) putting dead keys on AltGr+symbol keys and reworking most other mappings
* An "Extend" layer using Caps Lock as a modifier (lv5-8) for navigation/editing from the home position and more
@ -23,4 +23,7 @@ Links
-----
See the [DREYMAR'S (XKB) topic on the Colemak Forums](http://forum.colemak.com/viewtopic.php?id=1438) (http://forum.colemak.com).
There are plenty of explanations and further links in there, as well as links to files.
There are plenty of explanations and further links in there, as well as links to files.
Happy XKB hacking!
DreymaR, 2016-10

View File

@ -29,19 +29,18 @@ FootStr="Happy xkb-hacking! ~ Øystein Bech 'DreymaR' Gadmar"
#"- With '-i <dir>', specify a directory path/name to install in.\n"\
#"- With '-g', also install GTK 2.0/3.0 config for XF86 Cut/Copy/Paste.\n"\
## NOTE: The mod directory has the form "${DModTag}<date>" with DModTag='x-mod_v<VER>_'
## - Unless you change the DModTag, it should be in the same dir as this script
## NOTE: The mod directory has the form $DModTag="x-mod_v<VER>[_<DATE>]"
## - Unless you change this tag, it should be in the same dir as this script
## - It has subdirectories like 'xkb' that are to be installed (one, some or all)
## NOTE: This is the new preferred way instead of patching the system files:
## NOTE: This is now the preferred way instead of patching the system files:
## - Backup system xkb to dbak-xkb_<DATE> (and the same for any other subdirs)
## - Copy X11/xkb to ${InstDir}/dxkb, then modify files in dxkb
## - Set up setxkb.sh to run from the modified dxkb [WARNING: This may not work now!]
## - Optionally (-o) overwrite the system files instead
## - Or, (-o) overwrite the system files instead
## NOTE: The x-mod dir now holds x-mod*/xkb; eventually there may be a locale dir too.
##-------------- init ------------------------------------------
## NOTE: '#(-a)' means that the value can be set by a command-line argument '-a <value>'
MyDATE=`date +"%Y-%m-%d_%H-%M"`
MyNAME=`basename $0`
@ -57,7 +56,7 @@ ModDATE=''
DModDir=`dirname $0` # (-d) Path to the script (and mod?) root directory
ToolDir="${DModDir}/dreymar-xtools" # The location of tool scripts (like setxkb.sh)
DModTag="x-mod_v${XVERSION}_${ModDATE}" # (-t) Mod dir "prefix"
DModTag="x-mod_v${XVERSION}${ModDATE:+'_'}${ModDATE}" # (-t) Mod dir "prefix"
DBakFix='dbak-' # (--) Backup dir prefix
DModFix='d' # (--) Modded dir prefix
InstDir="${X11DIR}" # (-i) Path to install subfolder(s) in
@ -69,9 +68,13 @@ SubDirs='all' # (-m) Directory/-ies inside X11 to modify (e.g., 'xkb locale',
InstGTK='no' # (-g) Whether to install the GTK 2.0/3.0 config (if not present)
SetXMap='no' # (-x) Whether to run the setxkb script after installing
SetXStr='5aw us us' # (-s) Shortcut string for setxkb - 'mmm ll vv' (model layout eD-variant)
## NOTE: '# (-a)' means that the value can be set by option argument '-a <value>'
HelpStr="\e[1mUsage: bash ${MyNAME} [optional args]\e[0m\n"\
"Run this from the directory containing the x-mod dir\n"\
" Run this from the directory containing the x-mod dir\n"\
"===========================================================\n"\
"[-#] Functionality - 'default' \n"\
"===========================================================\n"\
"[-i] <Install path> - ${InstDir}\n"\
"[-o] Override install path w/ X11 - ${WriteSys}\n"\
"[-b] Force backup | location - ${X11DIR}\n"\
@ -212,7 +215,7 @@ for That in ${SubDirs}; do
if [ ${Restore} != '0' ]; then # Restore from specified backup
## Restore from backup. Pick a backup # by parameter, 1 being oldest; use 999 or such for the last one
BackIt=`find "${X11DIR}/${DBakFix}${That}"* -maxdepth 0 -type d 2>/dev/null | head -n ${Restore} | tail -n 1`
[ -d "${BackIt}" ] || MyError "Unable to restore from '$(basename ${BackIt})': Not found!"
[ -d "${BackIt}" ] || MyError "Unable to locate restore dir '$(basename "${BackIt}")'"
MyPoint "Restoring from backup '$(basename "${BackIt}")'"
${DoSudo} cp -a "${BackIt}/"* "${X11DIR}/${That}" 2>/dev/null \
&& MyPoint "Restore done" || MyError "Restore copy error!"

View File

@ -1,7 +1,7 @@
#!/bin/bash
## ======================================================
## === XKBSET.sh to set the XKB keyboard options ===
## === SETXKB.sh to set the XKB keyboard options ===
## === by Øystein Bech "DreymaR" Gadmar, 2014 ===
## ======================================================
@ -25,7 +25,6 @@ FootStr="Happy xkb-hacking! ~ Øystein Bech 'DreymaR' Gadmar"
# Options left out of this: Too complex (replace all or add another, and if so, how?)
##-------------- init ------------------------------------------
## NOTE: '#(-a)' means that the value can be set by a command-line argument '-a <value>'
#~ MyDATE=`date +"%Y-%m-%d_%H-%M"`
MyNAME=`basename $0`
@ -47,8 +46,12 @@ AddCmd='no' # (-a) Add setxkbmap cmd to file?
AddDefault="${HOME}/.bashrc"
AddCmdTo=${AddDefault} # (-f) File (such as '~/.bashrc') to add setxkbmap cmd to
SetXStr='' #'5aw no us' # (-s) Shortcut string for setxkb - 'model locale eD-variant(sym)'
## NOTE: '# (-a)' means that the value can be set by option argument '-a <value>'
HelpStr="\e[1mUsage: bash ${MyNAME} [optional args]\e[0m\n"\
"===========================================================\n"\
"[-#] Functionality - 'default' \n"\
"===========================================================\n"\
"[-m] <model> - '${XKBmodel}'\n"\
"[-l] <layout> - '${XKBlayout}'\n"\
"[-o] <option> - \n"\

View File

@ -27,16 +27,16 @@
//
// KeyPad overlay with nav block to the left (lv7-8):
// +------+------+------+------+------+------+------+------+------+------+------+------+------+
// |` €€€ |1 |2 |3 |4 £ |5 € |6 |7 |8 |9 |0 |- |= |
// |` €€€ |1 |2 |3 |4 £ |5 € |6 |7 ⇖ |8 ⇑ |9 ⇗ |0 |- |= |
// | Cust | ! | @ | # | $ | % | ^ | KP_7 | KP_8 | KP_9 | KP_* | KP_- | KP_= |
// +------+------+------+------+------+------+------+------+------+------+------+------+------+
// |Tab |Q ### |W ### |F ### |P €€€ |G €€€ |J ### |L |U |Y |; |[ { |] } |
// |Tab |Q ### |W ### |F ### |P €€€ |G €€€ |J ### |L ⇐ |U ⇔ |Y ⇒ |; |[ { |] } |
// | | Home | Up | End | Del | Esc | PgUp | KP_4 | KP_5 | KP_6 | KP_+ | ( | ) |
// +------+------+------+------+------+------+------+------+------+------+------+------+------+
// |Caps+ |A ### |R ### |S ### |T €€€ |D |H ### |N |E |I |O |' " |\ | |
// | ++++ | Left | Down | Right| Back | K_Lck| PgDn | KP_1 | KP_2 | KP_3 | K_Ent| ' | \ |
// |Caps+ |A ### |R ### |S ### |T €€€ |D |H ### |N ⇙ |E ⇓ |I ⇘ |O |' " |\ | |
// | ++++ | Left | Down | Right| Back | K_Lck| PgDn | KP_1 | KP_2 | KP_3 | K_Ent| ' | : |
// +------+------+------+------+------+------+------+------+------+------+------+------+------+
// |_ *** |Z €€€ |X === |C === |V === |B *** |K ; |M |, |. |/ |Spc |Entr |
// |_ *** |Z €€€ |X === |C === |V === |B *** |K |M |, ⇕ |. |/ |Spc |Entr |
// | *MOn | Undo | Cut | Copy | Paste| *Bt1 | , | KP_0 | KP_0 | KP_. | KP_/ | Spc | K_Ent|
// +------+------+------+------+------+------+------+------+------+------+------+------+------+
//
@ -45,6 +45,10 @@
// NOTE: If a hex pad is needed, the lv7(8?)+KBHDJG -> ABCDEF mappings are one solution
// NOTE: There's a KP key named KP_BEGIN; it seems like a hack? Ignored for now.
// NOTE: I've duplicated KP_0 to make it easy to hit. Maybe KP_Enter should've been helped too...?
// TODO: Autorepeat is hurting for some. This is probably an XKB bug? What can be done about it?
// One fix is to run xset afterwards: 'seq -s " r " 8 255 | xargs xset r' supposedly does the trick.
// Add the following to key <> {} defs (before symbols[Group1]=)?
// repeat=true,
default partial
xkb_symbols "basic" {
@ -153,19 +157,19 @@ xkb_symbols "lv5" {
NoAction() , NoAction() ]
}; // 2
key <AE03> { symbols[Group1]=[ NoSymbol , NoSymbol , NoSymbol , NoSymbol ,
F3 , F3 , numbersign , numbersign ], // #
F3 , F3 , numbersign , numbersign ], // #
actions[Group1]=[NoAction(),NoAction(),NoAction(),NoAction(),
Redirect(key=<FK03>,clearmods=LevelFive), Redirect(key=<FK03>,clearmods=LevelFive),
NoAction() , NoAction() ]
}; // 3
key <AE04> { symbols[Group1]=[ NoSymbol , NoSymbol , NoSymbol , NoSymbol ,
F4 , F4 , dollar , sterling ], // $£
F4 , F4 , dollar , sterling ], // $ £
actions[Group1]=[NoAction(),NoAction(),NoAction(),NoAction(),
Redirect(key=<FK04>,clearmods=LevelFive), Redirect(key=<FK04>,clearmods=LevelFive),
NoAction() , NoAction() ]
}; // 4
key <AE05> { symbols[Group1]=[ NoSymbol , NoSymbol , NoSymbol , NoSymbol ,
F5 , F5 , percent , EuroSign ], // %€
F5 , F5 , percent , EuroSign ], // %
actions[Group1]=[NoAction(),NoAction(),NoAction(),NoAction(),
Redirect(key=<FK05>,clearmods=LevelFive), Redirect(key=<FK05>,clearmods=LevelFive),
NoAction() , NoAction() ]
@ -300,7 +304,7 @@ xkb_symbols "lv5" {
}; // ] }
key <BKSL> { symbols[Group1]=[ NoSymbol , NoSymbol , NoSymbol , NoSymbol ,
XF86Favorites , XF86MyComputer , // BrFav
backslash , bar ], // BKSL
colon , bar ], // :
actions[Group1]=[NoAction(),NoAction(),NoAction(),NoAction(),
Redirect(key=<I164>,clearmods=all), Redirect(key=<I165>,clearmods=all), // <I164>/<I165>(‡‡)
NoAction() , NoAction() ]
@ -466,13 +470,13 @@ xkb_symbols "lv5" {
key <SPCE> { symbols[Group1]=[ NoSymbol , NoSymbol , NoSymbol , NoSymbol ,
Return , Return , // Enter
space , nobreakspace ], // Space
actions[Group1]=[NoAction(),SetMods(modifiers=Shift),NoAction(),SetMods(modifiers=Shift),
actions[Group1]=[NoAction(),SetMods(mods=Shift),NoAction(),SetMods(mods=Shift),
Redirect(key=<RTRN>) , Redirect(key=<RTRN>) , // <RTRN>
NoAction() , NoAction() ]
}; // <SPCE>
// key <CAPS> { [ NoSymbol,NoSymbol,NoSymbol,NoSymbol ] }; // CapsLock
// §§: XCV Cut/Copy/Paste seem OK in Firefox but not Gedit!? This is a GTK weakness I think.
// §§: XCV Cut/Copy/Paste seem OK in Firefox but not Gedit!? This seems to be a GTK weakness.
// Some bind fiddling in ~/.gtkrc-2.0 and ~/.config/gtk-3.0/gtk.css can get this working
// ††: 'Pointer_'mousing needs enabling! Real KP_ keys work but not the Pointer_ mousing symbols
// (In the Settings GUI there's a Shift+NumLock option for this, but Pointer_EnableKeys works too)
@ -513,9 +517,7 @@ xkb_symbols "lv5" {
// ==========================================================================================================
//// An attempt at using the Overlay functionality for modifier Extend mappings.
//// If the Extend key could both switch lv5 AND Overlay1, maybe the A/S/T modifiers would work?
//// The idea would be to map only these as overlay keys, and the rest as lv5+
//// NOTE: Not working. Problem: The Caps key cannot both be a lvl5_switch and overlay_switch!?
//// NOTE: Not working. One problem: The Caps key cannot both be a lvl5_switch and overlay_switch!?
//partial // alphanumeric_keys
//xkb_symbols "overlay_mods" {
//// name[Group1]= "Extend layer";
@ -567,23 +569,19 @@ xkb_symbols "lv5" {
// An attempt at using the Overlay functionality for all Extend mappings.
// NOTE: Apparently, any key can only have ONE overlay!
// The Overlay1/Overlay2 bits determine which one, but for some odd reason a key can't have both defined.
// The Overlay1/Overlay2 bits determine which one, but for some odd reason a key can't have both defined?
// This means that the idea of several Extend layers can't be implemented easily in this way.
// NOTE: For testing purposes, I'm only mapping some keys for now. The rest can follow if this works! :)
//partial // alphanumeric_keys
//xkb_symbols "overlay_full" {
//// name[Group1]= "Extend layer";
// key <ESC> { overlay1 = <CAPS> };
// key <SCLK> { overlay1 = <CAPS> };
// key <TLDE> { overlay1 = <DELE> };
// key <AE01> { overlay1 = <FK01> };
// key <AE02> { overlay1 = <FK02> };
// key <AE03> { overlay1 = <FK03> };
// key <AE04> { overlay1 = <FK04> };
// key <AE05> { overlay1 = <FK05> };
// key <AE06> { overlay1 = <FK06> };
// key <AD01> { overlay1 = <ESC> }; //Esc
// key <ESC> { overlay1 = <CAPS> };
// key <AE01> { overlay1 = <FK01> };
// key <AE02> { overlay1 = <FK02> };
// key <AE03> { overlay1 = <FK03> };
// key <AE04> { overlay1 = <FK04> };
// key <AD01> { overlay1 = <ESC> };
// key <AD02> { overlay1 = <I185> }; // KEY_SCROLLUP //(††)
// key <AD03> { overlay1 = <I166> }; // #define KEY_BACK
// key <I166> { [ XF86Back ] }; //BrBck

View File

@ -740,7 +740,7 @@ xkb_symbols "colemak" {
// key <AE01> { [ 1, exclam, U0301 ] }; // (U0301 Comb. acute)
// key <AE02> { [ 2, at, U030B ] }; // (U030B Comb. doubleacute)
key <AE03> { [ 3, numerosign, dead_horn, numbersign ] };
// key <AE04> { [ 4, dollar, dead_currency, cent ] };
key <AE04> { [ 4, dollar, dead_currency, U20BD ] }; // (U20BD Ruble sign. Alt. on AltGr+8)
// key <AE05> { [ 5, percent, EuroSign ] };
// key <AE06> { [ 6, asciicircum, U0306 ] }; // (U0306 Comb. breve)
// key <AE07> { [ 7, ampersand, U0307 ] }; // (U0307 Comb. dot above)