revamp compat
This commit is contained in:
parent
6bf779a68e
commit
3398c6b4ef
@ -41,7 +41,7 @@ formatted_list=$(echo "$window_list" | while IFS='|' read -r id app_id name work
|
||||
printf "%s%s%s %s %s\n" "$workspace" "$indicator" "$id" "$app_id" "$name"
|
||||
done)
|
||||
|
||||
selection=$(echo "$formatted_list" | bemenu --width-factor 100 --prompt "/" --index "$(echo "$formatted_list" | awk 'substr($0,2,1)==">" {print NR-1}')" )
|
||||
selection=$(echo "$formatted_list" | bemenu --auto-select --width-factor 100 --prompt "/" --index "$(echo "$formatted_list" | awk 'substr($0,2,1)==">" {print NR-1}')" )
|
||||
[ -z "$selection" ] && exit 0
|
||||
|
||||
window_id=$(echo "$selection" | sed -E 's/^...([0-9]+).*/\1/')
|
||||
|
33
arch-user/bin/workspace-compat/profile.tmpl
Normal file
33
arch-user/bin/workspace-compat/profile.tmpl
Normal file
@ -0,0 +1,33 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ -z "$WSCOMPAT_DIR" ] || [ "$WS_IS_COMPAT" != 1 ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
[ -f /etc/profile ] && . /etc/profile
|
||||
[ -f ~/.profile ] && . ~/.profile
|
||||
|
||||
export EDITOR=vim
|
||||
export SHELL=/bin/bash
|
||||
export PATH="$WSCOMPAT_DIR:$PATH"
|
||||
|
||||
stty intr ^K
|
||||
|
||||
export VIMINIT="source $WSCOMPAT_DIR/.vimrc"
|
||||
cat << 'EOF_04tcIQE7' > "$WSCOMPAT_DIR/.vimrc"
|
||||
{{ template "vimrc" . }}
|
||||
EOF_04tcIQE7
|
||||
|
||||
export INPUTRC="$WSCOMPAT_DIR/.inputrc"
|
||||
cat << 'EOF_04tcIQE7' > "$WSCOMPAT_DIR/.inputrc"
|
||||
{{ template "inputrc" . }}
|
||||
EOF_04tcIQE7
|
||||
|
||||
export LESSKEYIN="$WSCOMPAT_DIR/.lesskey"
|
||||
cat << 'EOF_04tcIQE7' > "$WSCOMPAT_DIR/.lesskey"
|
||||
{{ template "lesskey" . }}
|
||||
EOF_04tcIQE7
|
||||
|
||||
cat << 'EOF_04tcIQE7' > "$WSCOMPAT_DIR/wssh"
|
||||
{{ tmpl.Exec "wssh" . | strings.ReplaceAll "EOF_" "EOF_1_" }}
|
||||
EOF_04tcIQE7
|
31
arch-user/bin/wssh
Executable file
31
arch-user/bin/wssh
Executable file
@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
echo "Usage: $0 <hostname> [ssh-options]"
|
||||
exit 1
|
||||
fi
|
||||
[ -z "$WSCOMPAT_MASTER" ] && WSCOMPAT_MASTER="$(whoami)"
|
||||
read -r -d '' init_cmd << EOF_9oqn7IVF
|
||||
export WS_IS_COMPAT=1
|
||||
export WSCOMPAT_MASTER="$WSCOMPAT_MASTER"
|
||||
export WSCOMPAT_DIR="/tmp/wscompat_${WSCOMPAT_MASTER}_\$(whoami)"
|
||||
|
||||
ws_cleanup() { rm -rf "\$WSCOMPAT_DIR"; }
|
||||
trap ws_cleanup EXIT
|
||||
rm -rf "\$WSCOMPAT_DIR" && mkdir -p "\$WSCOMPAT_DIR" && chmod 700 "\$WSCOMPAT_DIR"
|
||||
|
||||
cat << 'EOF_84EbM3la' > "\$WSCOMPAT_DIR/profile"
|
||||
$(
|
||||
cat "$WSCOMPAT_DIR/profile"
|
||||
for file in "$WSCOMPAT_DIR.profile"*.sh; do
|
||||
if [ -f "$file" ]; then cat "$file"; fi
|
||||
done
|
||||
)
|
||||
EOF_84EbM3la
|
||||
. \$WSCOMPAT_DIR/profile
|
||||
|
||||
# pam, systemd - wrap in login shell
|
||||
exec /bin/bash --login --norc --noprofile -c "exec /bin/bash"
|
||||
EOF_9oqn7IVF
|
||||
|
||||
ssh -t "$@" "$init_cmd"
|
@ -3,7 +3,6 @@
|
||||
export PATH=~/.local/bin:$PATH
|
||||
|
||||
#export WLR_RENDERER=vulkan
|
||||
|
||||
export QT_STYLE_OVERRIDE=kvantum
|
||||
export GTK_THEME=Materia-dark
|
||||
|
||||
|
1
arch-user/config/workspace-compat/env.sh
Normal file
1
arch-user/config/workspace-compat/env.sh
Normal file
@ -0,0 +1 @@
|
||||
export WSCOMPAT_DIR=~/.local/bin/workspace-compat
|
@ -5,6 +5,7 @@ cd "$(dirname "$(readlink -f -- "$0")")"
|
||||
umask 002
|
||||
|
||||
export IS_COMPAT=1
|
||||
gomplate --file config/vim/vimrc --out ../linux-compat/home/.vimrc
|
||||
gomplate --file config/readline/inputrc --out ../linux-compat/home/.inputrc
|
||||
gomplate --file config/less/lesskey --out ../linux-compat/home/.lesskey
|
||||
gomplate --file bin/workspace-compat
|
||||
gomplate --file config/vim/vimrc
|
||||
gomplate --file config/readline/inputrc
|
||||
gomplate --file config/less/lesskey
|
||||
|
@ -8,6 +8,7 @@ set -e
|
||||
cd "$(dirname "$(readlink -f -- "$0")")"
|
||||
umask 002
|
||||
[[ "$(id -u)" == "0" ]] && echo "ERROR: wrong user" >&1 && exit 1
|
||||
export IS_COMPAT=0
|
||||
|
||||
########## init config #########
|
||||
if [[ ! -f ~/.config/workspace.conf ]]; then
|
||||
@ -48,7 +49,7 @@ mkdir -p "${USER_DIRS[@]}"
|
||||
########## scripts #############
|
||||
cp -rf bin/* ~/.local/bin
|
||||
|
||||
LN_EXCLUDE_DIRS=(i3blocks bemenu sway)
|
||||
LN_EXCLUDE_DIRS=(i3blocks bemenu sway workspace-compat)
|
||||
|
||||
ln_exclude_dirs_cmp=" ${LN_EXCLUDE_DIRS[*]} "
|
||||
for sdir in bin/*; do
|
||||
@ -64,7 +65,6 @@ done
|
||||
################################
|
||||
|
||||
########### config #############
|
||||
export IS_COMPAT=0
|
||||
gomplate --input-dir config \
|
||||
--output-map "$HOME/.config/{{ .in | strings.ReplaceAll \".tmpl\" \"\" }}" \
|
||||
--exclude-processing "!*.tmpl" \
|
||||
@ -83,6 +83,17 @@ mkdir -p ~/.gnupg && ln -sf ~/.config/gnupg/gpg-agent.conf ~/.gnupg
|
||||
cp -rf data/* ~/.local/share
|
||||
###############################
|
||||
|
||||
########### compat ############
|
||||
export IS_COMPAT=1
|
||||
gomplate --file bin/workspace-compat/profile.tmpl \
|
||||
-t vimrc=config/vim/vimrc \
|
||||
-t inputrc=config/readline/inputrc \
|
||||
-t lesskey=config/less/lesskey \
|
||||
-t wssh=bin/wssh \
|
||||
--out ~/.local/bin/workspace-compat/profile
|
||||
export IS_COMPAT=0
|
||||
###############################
|
||||
|
||||
swaymsg reload || true
|
||||
|
||||
echo ok
|
||||
|
@ -1,71 +0,0 @@
|
||||
set editing-mode vi
|
||||
|
||||
########### prompt ##############
|
||||
set show-mode-in-prompt on
|
||||
set vi-ins-mode-string \1\e[1 q\2
|
||||
set vi-cmd-mode-string \1\e[2 q\2
|
||||
#################################
|
||||
|
||||
############# new ###############
|
||||
set keymap vi-insert
|
||||
"\C-a":beginning-of-line
|
||||
"\C-e":end-of-line
|
||||
"\C-b":backward-char
|
||||
"\C-f":forward-char
|
||||
"\eb":backward-word
|
||||
"\ef":forward-word
|
||||
#################################
|
||||
|
||||
##### remap - colemak-dh #######
|
||||
|
||||
# n -> h
|
||||
set keymap vi-insert
|
||||
"\C-n":backward-delete-char
|
||||
set keymap vi-command
|
||||
"n":backward-char
|
||||
"\C-n":backward-char
|
||||
# e -> k (reverse swap)
|
||||
set keymap vi-command
|
||||
"e":previous-history
|
||||
"\C-e":kill-line
|
||||
# i -> j (reverse swap)
|
||||
#set keymap vi-insert
|
||||
# "\C-i":accept-line # ascii code conflicts with tab
|
||||
set keymap vi-command
|
||||
"i":next-history
|
||||
# "\C-i":accept-line # ascii code conflicts with tab
|
||||
# o -> l
|
||||
set keymap vi-command
|
||||
"o":forward-char
|
||||
"\C-o":clear-screen
|
||||
|
||||
# k -> n
|
||||
#set keymap vi-insert
|
||||
#"\C-k":menu-complete # bound to intr, use tab
|
||||
set keymap vi-command
|
||||
"k":vi-search-again
|
||||
"K":vi-search-again
|
||||
"\C-k":next-history
|
||||
# j -> e
|
||||
set keymap vi-insert
|
||||
"\C-j":self-insert
|
||||
set keymap vi-command
|
||||
"j":vi-end-word
|
||||
"J":vi-end-word
|
||||
# l -> i
|
||||
set keymap vi-insert
|
||||
"\C-l":complete
|
||||
set keymap vi-command
|
||||
"l":vi-insertion-mode
|
||||
"L":vi-insert-beg
|
||||
# h -> o
|
||||
set keymap vi-insert
|
||||
"\C-h":operate-and-get-next
|
||||
|
||||
#################################
|
||||
|
||||
########### custom ##############
|
||||
$if qalc
|
||||
set show-mode-in-prompt off
|
||||
$endif
|
||||
#################################
|
@ -1,48 +0,0 @@
|
||||
###### colemak dh movement #####
|
||||
|
||||
# n -> h
|
||||
#n Help
|
||||
#N Help
|
||||
|
||||
# e -> j
|
||||
e forw-line
|
||||
E forw-line-force
|
||||
|
||||
# i -> k
|
||||
i back-line
|
||||
^I back-line
|
||||
I back-line-force
|
||||
|
||||
# o -> l
|
||||
^O repaint
|
||||
|
||||
|
||||
# k -> n
|
||||
^K forw-line
|
||||
k repeat-search
|
||||
\ek repeat-search-all
|
||||
K reverse-search
|
||||
\eK reverse-search-all
|
||||
#^O^K osc8-forw-search
|
||||
#^Ok osc8-forw-search
|
||||
:k next-file
|
||||
|
||||
# j -> e
|
||||
j forw-line
|
||||
^J forw-line
|
||||
J examine
|
||||
:j examine
|
||||
|
||||
# l -> i
|
||||
# noop
|
||||
|
||||
# h -> o
|
||||
#^H^H osc8-open
|
||||
|
||||
############################
|
||||
|
||||
|
||||
######### custom ###########
|
||||
n left-scroll
|
||||
o right-scroll
|
||||
############################
|
@ -1,173 +0,0 @@
|
||||
"########## system ###########
|
||||
set nocompatible
|
||||
set ttyfast
|
||||
set encoding=utf-8
|
||||
set mouse=a
|
||||
set autoread
|
||||
au FocusGained,BufEnter * silent! checktime
|
||||
"#############################
|
||||
|
||||
"######### generic ###########
|
||||
|
||||
" status line
|
||||
set showmode
|
||||
set showcmd
|
||||
set ruler
|
||||
|
||||
" syntax hl
|
||||
syntax enable
|
||||
filetype on
|
||||
filetype plugin on
|
||||
|
||||
" lines
|
||||
set number
|
||||
set relativenumber
|
||||
set numberwidth=3
|
||||
set wrap
|
||||
set showmatch " brackets
|
||||
|
||||
" search
|
||||
set hlsearch
|
||||
set incsearch
|
||||
set ignorecase
|
||||
set smartcase
|
||||
|
||||
" tabs
|
||||
set shiftwidth=4
|
||||
set tabstop=4
|
||||
set softtabstop=0
|
||||
set noexpandtab
|
||||
|
||||
" scroll
|
||||
set scrolloff=5
|
||||
|
||||
" commands
|
||||
set wildmenu
|
||||
set wildmode=list:longest,full
|
||||
set gdefault
|
||||
|
||||
" colors
|
||||
colorscheme default
|
||||
set t_Co=16
|
||||
set notermguicolors
|
||||
set t_RV= " bugfix
|
||||
" new
|
||||
highlight LineNr ctermfg=5 ctermbg=none
|
||||
autocmd VimEnter * highlight SignColumn ctermbg=none
|
||||
" fg magenta (5) -> blue (4)
|
||||
highlight Title term=bold ctermfg=4 gui=bold
|
||||
highlight Special term=bold ctermfg=4
|
||||
highlight PreProc term=underline ctermfg=4
|
||||
highlight Underlined term=underline cterm=underline ctermfg=4 gui=underline
|
||||
" fg blue (4 or 12) -> magenta (5)
|
||||
highlight SpecialKey term=bold ctermfg=5
|
||||
highlight Directory term=bold ctermfg=5
|
||||
highlight Folded term=standout ctermfg=5 ctermbg=7
|
||||
highlight FoldColumn term=standout ctermfg=5 ctermbg=7
|
||||
highlight SignColumn term=standout ctermfg=5 ctermbg=7
|
||||
highlight Comment term=bold ctermfg=5
|
||||
highlight NonText term=bold ctermfg=5 gui=bold
|
||||
highlight DiffDelete term=bold ctermfg=5 ctermbg=14 gui=bold
|
||||
highlight Changed ctermfg=5
|
||||
" bg
|
||||
highlight SpellCap cterm=underline ctermfg=9 ctermbg=none gui=undercurl
|
||||
"###########################################
|
||||
|
||||
"############## file-specific ###############
|
||||
autocmd FileType markdown setlocal spell
|
||||
autocmd FileType gitcommit setlocal spell
|
||||
autocmd FileType markdown setlocal complete+=kspell
|
||||
autocmd FileType gitcommit setlocal complete+=kspell
|
||||
"############################################
|
||||
|
||||
"####### remap - colemak-dh #######
|
||||
|
||||
" n -> h
|
||||
noremap n h
|
||||
noremap N H
|
||||
noremap! <C-n> <C-h>
|
||||
" e -> j
|
||||
noremap e j
|
||||
noremap E J
|
||||
noremap! <C-e> <C-j>
|
||||
" i -> k
|
||||
noremap i k
|
||||
noremap I K
|
||||
"noremap! <C-i> <C-k> " breaks tab
|
||||
" o -> l
|
||||
noremap o l
|
||||
noremap O L
|
||||
noremap! <C-o> <C-l>
|
||||
|
||||
" k -> n
|
||||
noremap k n
|
||||
noremap K N
|
||||
noremap! <C-k> <C-n>
|
||||
" j -> e
|
||||
noremap j e
|
||||
noremap J E
|
||||
noremap! <C-j> <C-e>
|
||||
" l -> i
|
||||
noremap l i
|
||||
noremap L I
|
||||
noremap! <C-l> <C-i>
|
||||
" h -> o
|
||||
noremap h o
|
||||
noremap H O
|
||||
noremap! <C-h> <C-o>
|
||||
|
||||
"#################################
|
||||
|
||||
"############### new keybinds ###############
|
||||
cnoremap <C-a> <Home>
|
||||
cnoremap <C-e> <End>
|
||||
cnoremap <C-b> <Left>
|
||||
cnoremap <C-f> <Right>
|
||||
cnoremap <M-b> <S-Left>
|
||||
cnoremap <M-f> <S-Right>
|
||||
"############################################
|
||||
|
||||
"####### custom commands #########
|
||||
" W - Save file as superuser
|
||||
command! W execute 'w !sudo tee % > /dev/null' <bar> edit!
|
||||
"#################################
|
||||
|
||||
"######### localization ##########
|
||||
set langmap=ьЬыЫфФпПбБжЖлЛуУяЯаАрРсСтТгГмМнНеЕиИоОчЧцЦдДвВзЗкКхХ;qQwWfFpPbBjJlLuUyYaArRsStTgGmMnNeEiIoOxXcCdDvVzZkKhH
|
||||
" n -> h
|
||||
noremap н х
|
||||
noremap Н Х
|
||||
noremap! <C-н> <C-х>
|
||||
" e -> j
|
||||
noremap е ж
|
||||
noremap Е Ж
|
||||
noremap! <C-е> <C-ж>
|
||||
" i -> k
|
||||
noremap и к
|
||||
noremap И К
|
||||
"noremap! <C-и> <C-к> " breaks tab
|
||||
" o -> l
|
||||
noremap о л
|
||||
noremap О Л
|
||||
noremap! <C-о> <C-л>
|
||||
" k -> n
|
||||
noremap к н
|
||||
noremap К Н
|
||||
noremap! <C-к> <C-н>
|
||||
" j -> e
|
||||
noremap й е
|
||||
noremap Й Е
|
||||
noremap! <C-й> <C-е>
|
||||
" l -> i
|
||||
noremap л и
|
||||
noremap Л И
|
||||
noremap! <C-л> <C-и>
|
||||
" h -> o
|
||||
noremap х о
|
||||
noremap Х O
|
||||
noremap! <C-х> <C-о>
|
||||
"#################################
|
||||
|
||||
"############# hacks #############
|
||||
|
||||
"################################
|
@ -1,3 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
export BASIC_PACMAN="vim less"
|
@ -1,9 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
cd "$(dirname "$(readlink -f -- "$0")")"
|
||||
|
||||
[[ -z "$1" ]] && echo "ERROR: no destination" >&1 && exit 1
|
||||
|
||||
scp -r home/. "$1:/tmp/workspace"
|
||||
ssh "$1" "cp -rfT /tmp/workspace ~/ && rm -rf /tmp/workspace"
|
Loading…
Reference in New Issue
Block a user