From 441223406c2d26ee601039023a93517e2c162501 Mon Sep 17 00:00:00 2001 From: DreymaR <7303297+DreymaR@users.noreply.github.com> Date: Tue, 3 Jan 2023 17:20:47 +0100 Subject: [PATCH] setxkb.sh -> setkb.sh * Changed the name of the setxkb.sh script throughout * Sorry if this causes confusion anywhere! * Easier to type 'setkb' than 'setxkb' * Easier to distinguish from 'setxkbmap' --- README.md | 28 ++++++++++++++-------------- install-dreymar-xmod.sh | 26 +++++++++++++------------- setxkb.sh => setkb.sh | 14 +++++++------- 3 files changed, 34 insertions(+), 34 deletions(-) rename setxkb.sh => setkb.sh (95%) mode change 100755 => 100644 diff --git a/README.md b/README.md index cc56c14..036ad75 100644 --- a/README.md +++ b/README.md @@ -30,13 +30,13 @@ You can now probably use the system's layout settings to choose a setup. For inf However, some layout settings won't let you set the model component that I use for some ergo mods. -The setxkb script activates a Big Bag layout setup (model, layout and option components) using a `setxkbmap` command. +The setkb script activates a Big Bag layout setup (model, layout and option components) using a `setxkbmap` command. -The setxkb script can write its command to a file that gets sourced at startup, like `~/.bashrc`; check your distro for which file(s) to use. +The setkb script can write its command to a file that gets sourced at startup, like `~/.bashrc`; check your distro for which file(s) to use. -Run the install and setxkb scripts with -h (or look inside them) for more help and info about their workings! +Run the install and setkb scripts with -h (or look inside them) for more help and info about their workings! -Learn about `setxkb.sh "model locale variant"` shortstring syntax in the [BigBag][BigBag4X]. +Learn about `setkb.sh "model locale variant"` shortstring syntax in the [BigBag][BigBag4X]. The default is `"5caw us us"`: PC105(ISO) board with Curl(DH)AngleWide mods, US locale, Cmk-eD UniversalSymbols variant. To switch to, say, an ANSI board without ergo mods, that's `4n` instead of `5caw`. Look in the scripts. @@ -46,7 +46,7 @@ NOTE: It may be necessary to select "Use system defaults" if you have changed an Tips ---- * Before trying out the BigBag, you may want to find out what your current XKB settings are. One way of seeing what you use is `setxkbmap -v 9`. - - To get the standard default layout back, you can use `setxkb 4n` for ANSI keyboards (`5n` for ISO). This depends on your locale though. + - To get the standard default layout back, you can use `setkb 4n` for ANSI keyboards (`5n` for ISO). This depends on your locale though. * The 'Keep Symbols' layouts are intended for those who don't want to give up their symbol mappings. The 'Unified' variants are usually much better, and 'ks' may be missing symbols. * If you use Extend and want the `Ctrl+Alt+F#` TTY shortcuts back, disable F#-key Extend mappings in the `symbols/extend` file. - This is achieved easily by commenting out the [include "extend(lv5_fk)"][BB-ExtFK] bit (with two trailing slashes). @@ -71,15 +71,15 @@ _DreymaR, 2023-01_ TODO: ----- -* Not all distros source `~/.bashrc` by default. Seems that `~/.xinitrc` is only used by xinit? +* Add colemak-dh to the colemak symbols file and the US locale? Both ISO, ANSI and Ortho. +* Not all distros source `~/.bashrc` by default. Seems that `~/.xinitrc` is mostly used by xinit and not generally sourced? - But `~/.Xresources` seems like a good option (and is sourced by xinitrc too)? - Its format is different though. And it doesn't list keyboard layout as one of its intended purposes. * Add some easy way of returning to the old xkbmap setup? But how? Can't unset settings, so we'd have to store it somehow? Or just let them go to us/us? - - Make a restore to default layout shortcut instead? It's only an alias for `setxkb 4n/5n`. Maybe `resetxkb 4/5`? + - Make a restore to default layout shortcut instead? It's only an alias for `setkb 4n/5n`. Maybe `resetkb 4/5`? * Transition many ###.xml changes to ###.extras.xml? Other Colemak locale variants reside there. But it's a mess: Many (such as Norwegian) are in the main file! -* Add colemak-dh to the colemak symbols file? Both ISO and ANSI? * Ensure a consistent Space key implementation for `_ks` layouts. Many layouts are sloppy about that. Maybe make a `common` include w/ Space+Enter? -* Rename setxkb --> setkb? It's easier to type! Would have to update all docs including the Forum topic. +* Rename setkb --> setkb? It's easier to type! Would have to update all docs including the Forum topic. * To get Extend with the currently active layout, use `setxkbmap -v 9 -option "" -option "misc:extend,lv5:caps_switch_lock,compose:menu"`. * Add lv5:lalt_switch_lock for LALT-Extend. * Add compose:102? Inconsistent between ISO and ANSI, just add a pro-tip. @@ -105,8 +105,8 @@ TODO: - but with only the relevant bits. So, e.g., `0009-m_g.part` is the model to group mapping of the final rules file. `ml_s.part` is model + layout to symbols. - It seems that you can make layout commits by editing only the rules/base.xml (and symbols) file(s) though? -* Echo the setxkbmap command when using setxkb.sh, for ease of troubleshooting! Also make the script able to output the command for piping? -* Add a model-less Colemak-CAWS for people who want to switch to QWERTY? Or instructions on how to setxkb it? That's better, I think. +* Echo the setxkbmap command when using setkb.sh, for ease of troubleshooting! Also make the script able to output the command for piping? +* Add a model-less Colemak-CAWS for people who want to switch to QWERTY? Or instructions on how to setkb it? That's better, I think. * Problem: Using Google Spreadsheets, hitting Caps Lock (which is mapped to ISO_Level5_Shift) clears the current spreadsheet cell. - https://forum.colemak.com/topic/1438-dreymars-big-bag-of-keyboard-tricks-linuxxkb-files-included/p15/#p23838 - This solves it by convincing Google Sheets that the Caps key is a Win key: `sudo setkeycodes 0x3a 125` @@ -140,7 +140,7 @@ TODO: - https://github.com/DreymaR/BigBagKbdTrixXKB/issues/1#issuecomment-462952051 - https://unix.stackexchange.com/questions/397716/custom-keyboard-layout-without-root - `setxkbmap -I $MYXKB -rules evdev -print | xkbcomp -I $MYXKB - "$DISPLAY" - - "I made that tweak to setxkb and some small changes to use a hardcoded $HOME dir path, and it appears good." + - "I made that tweak to setkb and some small changes to use a hardcoded $HOME dir path, and it appears good." - Another attempt by birdspider, with some tripups and solutions: https://github.com/DreymaR/BigBagKbdTrixXKB/issues/1#issuecomment-818880299 * For an EsAlt variant as in EPKL: @@ -165,8 +165,8 @@ TODO: DONE: ----- * 2020-11-05: Switched to the new DH = DHm standard (was DH = DHk) -* Changed the default layout for the setxkb.sh script to US (UniSym): In my experience, most users that struggle with the setup want US English. -* To get back to your old layout/model, use `setxkb 4n/5n [loc]`. You may also specify `mod loc [var]`; omit `var` for the default (basic) variant. +* Changed the default layout for the setkb.sh script to US (UniSym): In my experience, most users that struggle with the setup want US English. +* To get back to your old layout/model, use `setkb 4n/5n [loc]`. You may also specify `mod loc [var]`; omit `var` for the default (basic) variant. * Separated out the F# key block in the extend file: People complain that their TTY shortcuts aren't working because of it. Ext+AltGr+F# works though. * Relieve the sudo requirement. And add an option to change the X11 dir since Nix uses another place. Pulled from fufexan@github. - https://github.com/DreymaR/BigBagKbdTrixXKB/issues/15#issuecomment-769431139 diff --git a/install-dreymar-xmod.sh b/install-dreymar-xmod.sh index c452c14..371407c 100755 --- a/install-dreymar-xmod.sh +++ b/install-dreymar-xmod.sh @@ -1,11 +1,11 @@ #!/bin/bash -## ================================================================= -## === INSTALL-DREYMAR-XMOD.sh for DreymaR's XKB modifications === -## === by Øystein Bech "DreymaR" Gadmar, -2016 === -## ================================================================= +## ================================================================= +## === INSTALL-DREYMAR-XMOD.sh for DreymaR's XKB modifications === +## === by Øystein "DreymaR" Bech-Aase, 2016- === +## ================================================================= # -HeadStr="DreymaR's Big Bag Of Tricks install script (by GadOE, 2016-06)" +HeadStr="DreymaR's Big Bag Of Tricks install script (by OeBeAa, 2016-)" DescStr=\ "\e[1mShell script to apply DreymaR's changes to the X keyboard files:\e[0m\n"\ " - The Colemak [edition DreymaR] layout, using my own lv3-4 mappings,\n"\ @@ -21,11 +21,11 @@ DescStr=\ "- With a ShortStr at the end, specify a model/layout to activate immediately.\n"\ " - ShortStr format: '[4|5][n|a|c][w|f] loc [ks|us]'; 'loc'(ale) is 2-letter.\n"\ " - E.g., '5n fr us' is normal pc105 model, French Cmk[eD]-'UniSym'.\n"\ -" - See setxkb.sh help for more info on ShortStr syntax.\n"\ +" - See setkb.sh help for more info on ShortStr syntax.\n"\ "- With '-?', list further instructions and default values.\n"\ "- See http://forum.colemak.com/viewtopic.php?id=1438 for more info\n" # -FootStr="Happy xkb-hacking! ~ Øystein Bech 'DreymaR' Gadmar" +FootStr="Happy xkb-hacking! ~ Øystein 'DreymaR' Bech-Aase" #"- With '-i ', 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"\ @@ -35,7 +35,7 @@ FootStr="Happy xkb-hacking! ~ Øystein Bech 'DreymaR' Gadmar" ## NOTE: This is now the preferred way instead of patching the system files: ## - Backup system xkb to dbak-xkb_ (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!] +## - Set up setkb.sh to run from the modified dxkb [WARNING: This may not work now!] ## - 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. @@ -53,7 +53,7 @@ XVERSION='' ModDATE='' DModDir=`dirname $0` # (-d) Path to the script (and mod?) root directory -ToolDir="${DModDir}/dreymar-xtools" # The loc. of tool scripts (like setxkb.sh) +ToolDir="${DModDir}/dreymar-xtools" # The loc. of tool scripts (like setkb.sh) DMod='xkb-data_xmod' # (--) The main name of the directory with modded xkb-data files DModTag="${DMod}${XVERSION:+'_v'}${XVERSION}${ModDATE:+'_'}${ModDATE}" # (-t) Mod dir "prefix" DBakFix='dbak-' # (--) Backup dir prefix @@ -66,8 +66,8 @@ DoBackup='ifnone' # (-n/b) Default backup behavior is "if no backups are found SubDirs='all' # (-m) Directory/-ies inside X11 to modify (e.g., 'xkb locale', 'all') InstGTK='no' # (-g) Whether to install the GTK 2.0/3.0 config (if not present) NoSudo='no' # (-s) Do not use sudo. Helpful for local dir installation. -SetXMap='no' # (-x) Whether to run the setxkb script after installing -SetXStr='5caw us us' # (--) Shortcut string for setxkb - 'kbd loc sym' (model layout eD-variant) +SetXMap='no' # (-x) Whether to run the setkb script after installing +SetXStr='5caw us us' # (--) Shortcut string for setkb - 'kbd loc sym' (model layout eD-variant) ## NOTE: '# (-a)' means that the value can be set by option argument '-a ' HelpStr="\e[1mUsage: bash ${MyNAME} [optional args] [ [ ]]\e[0m\n"\ @@ -246,7 +246,7 @@ for That in ${SubDirs}; do ${DoSudo} cp -a "${DModDir}/${That}/"* "${MyDir}" 2>/dev/null \ && MyPoint "Local install done" || MyError "Local files copy error!" XKBDir="${InstDir%/}/${DModFix}xkb" # Prepare for setxkbmap - cp -a setxkb.sh ${InstDir} # Copy over the setxkb.sh script to the new dir + cp -a setkb.sh ${InstDir} # Copy over the setkb.sh script to the new dir fi done @@ -266,7 +266,7 @@ fi if [ "${SetXMap}" != 'yes' ]; then MyMsg "XKBmap activation skipped" "" '1;33;40' else - bash ./setxkb.sh -d "${XKBDir}" ${SetXStr} || MyError "setxkb.sh failed!" + bash ./setkb.sh -d "${XKBDir}" ${SetXStr} || MyError "setkb.sh failed!" fi MyMsg "${MyNAME} finished!" "\n" diff --git a/setxkb.sh b/setkb.sh old mode 100755 new mode 100644 similarity index 95% rename from setxkb.sh rename to setkb.sh index 35f4e68..0422ac3 --- a/setxkb.sh +++ b/setkb.sh @@ -1,18 +1,18 @@ #!/bin/bash -## ====================================================== -## === SETXKB.sh to set the XKB keyboard options === -## === by Øystein Bech "DreymaR" Gadmar, 2014- === -## ====================================================== +## ================================================================= +## === SETKB.sh to set the XKB keyboard options === +## === by Øystein "DreymaR" Bech-Aase, 2014- === +## ================================================================= -HeadStr="DreymaR's setxkbmap script (by GadOE, 2022-10)" +HeadStr="DreymaR's setxkbmap script (by OeBeAa, 2022-10)" DescStr=\ "\e[1mShell script to change X.org keyboard setup\e[0m\n"\ " using the 'setxkbmap' command.\n"\ " To make settings logon persistent,\n"\ " source it, e.g., in your ~/.bashrc file,\n"\ " or use -a to write the setxkbmap command to a file.\n" -FootStr="Happy xkb-hacking! ~ Øystein Bech 'DreymaR' Gadmar" +FootStr="Happy xkb-hacking! ~ Øystein 'DreymaR' Bech-Aase" ## NOTE: It now works with local xkb(-mod) dir ## By default, setxkbmap checks ./rules first! @@ -49,7 +49,7 @@ XRunDir=${XKBDIR} # (-d) The xkb-type dir to run setxkbmap from AddCmdYN='no' # (-a) Add setxkbmap cmd to file? AddDefault="${HOME}/.bashrc" AddCmdTo=${AddDefault} # (-f) File (such as '~/.bashrc') to add setxkbmap cmd to -SetXStr='' #'5caw us us' # (--) Shortcut string for setxkb (model locale eD-variant) +SetXStr='' #'5caw us us' # (--) Shortcut string for setkb (model locale eD-variant) ## NOTE: '# (-a)' means that the value can be set by option argument '-a ' HelpStr="\e[1mUsage: bash ${MyNAME} [optional args] [ [ ]]\e[0m\n"\