From 18191e0e38a7a58122ea4632aca6ddcefe63ca4d Mon Sep 17 00:00:00 2001 From: arnaucube Date: Sun, 22 Nov 2020 17:34:03 +0100 Subject: [PATCH] Add gotty, add keyboard-layout, update .Xmodmap --- .Xmodmap | 26 ++++++++++++++++---------- .tmux.conf | 3 +++ .xinitrc | 2 ++ i3/config | 3 +++ install-new-server.sh | 5 +++++ launch-scripts/keyboard-layout.sh | 14 ++++++++++++++ 6 files changed, 43 insertions(+), 10 deletions(-) create mode 100644 .xinitrc create mode 100755 launch-scripts/keyboard-layout.sh diff --git a/.Xmodmap b/.Xmodmap index bde8691..22812b5 100644 --- a/.Xmodmap +++ b/.Xmodmap @@ -12,13 +12,19 @@ add Lock = Caps_Lock add Control = Control_L ! map numbers to more ergonomic position -keycode 29 = y Y 1 -keycode 30 = u U 2 -keycode 31 = i I 3 -keycode 43 = h H 4 -keycode 44 = j J 5 -keycode 45 = k K 6 -keycode 57 = n N 7 -keycode 58 = m M 8 -keycode 59 = comma semicolon 9 -keycode 60 = period colon 0 +! keycode 25 = w W 1 +! keycode 26 = e E 2 +! keycode 27 = r R 3 +! keycode 39 = s S 4 +! keycode 40 = d D 5 +! keycode 41 = f F 6 +! keycode 53 = x X 7 +! keycode 54 = c C 8 +! keycode 55 = v V 9 +! keycode 65 = space space 0 + +! map arrows to more ergonomic position +keycode 43 = h H Left +keycode 44 = j J Down +keycode 45 = k K Up +keycode 46 = l L Right diff --git a/.tmux.conf b/.tmux.conf index 41bb02c..ccb733a 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -6,3 +6,6 @@ set -g status-fg white # maximize current pane bind + run 'cut -c3- ~/.tmux.conf | sh -s _maximize_pane "#{session_name}" #D' + +# on bind + Ctrl+t open a new window and launch there gotty with a 'random' url +bind-key C-t new-window "gotty -r tmux attach -t `tmux display -p '#S'`" diff --git a/.xinitrc b/.xinitrc new file mode 100644 index 0000000..bd898b8 --- /dev/null +++ b/.xinitrc @@ -0,0 +1,2 @@ +xmodmap .Xmodmap +setxkbmap -layout us -option diff --git a/i3/config b/i3/config index 7c52704..381cfcc 100644 --- a/i3/config +++ b/i3/config @@ -185,3 +185,6 @@ bindsym $mod+Control+k move workspace to output HDMI-2 bindsym $mod+Control+j move workspace to output eDP-1 bindsym $mod+Control+1 exec xrandr && xrandr --auto bindsym $mod+Control+2 exec xrandr --auto && xrandr --output HDMI-2 --above eDP-1 + +# keyboard language layout +bindsym $mod+Control+0 exec sh ~/bin/keyboard-layout.sh diff --git a/install-new-server.sh b/install-new-server.sh index db6fdea..42f660b 100644 --- a/install-new-server.sh +++ b/install-new-server.sh @@ -74,6 +74,11 @@ cargo install git-delta echo "append .gitconfig of this repo lines to the .gitconfig system file to use delta gitdiff tool" cat .gitconfig >> ~/.gitconfig +# install gotty (for terminal visualization sharing) +wget https://github.com/yudai/gotty/releases/download/v1.0.1/gotty_linux_amd64.tar.gz +tar -zxvf gotty_linux_amd64.tar.gz +mv gotty /usr/gotty /usr/local/bin/ + # nginx apt install nginx -y diff --git a/launch-scripts/keyboard-layout.sh b/launch-scripts/keyboard-layout.sh new file mode 100755 index 0000000..44597c2 --- /dev/null +++ b/launch-scripts/keyboard-layout.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +curr=$(setxkbmap -print | awk -F"+" '/xkb_symbols/ {print $2}') + +if [[ $curr = "us" ]]; +then + setxkbmap -layout es -variant ',cat' -option + echo "keyboard layout set to Catalan" +else + setxkbmap -layout us -option + echo "keyboard layout set to English (US)" +fi + +xmodmap ~/.Xmodmap