From b38184f72bb094c7dff410bd987463726955333f Mon Sep 17 00:00:00 2001 From: Maxim Likhachev Date: Mon, 6 Dec 2021 13:22:10 +0000 Subject: [PATCH] shellrc: adjust settings for carbon host --- etc/media/alsa/asoundrc | 9 --- etc/media/alsa/asoundrc.linux.carbon | 9 +++ etc/net/ssh/config | 4 -- etc/soft/k9s/config.linux.carbon.yml | 10 +-- etc/soft/procps/procps | 1 - etc/soft/sxhkd/sxhkdrc | 135 ----------------------------------- etc/soft/sxhkd/sxhkdrc.linux.carbon | 135 +++++++++++++++++++++++++++++++++++ etc/soft/vifm/vifm | 1 - installrc.sh | 49 +++++++++++-- profiles/linux.carbon | 39 +++++----- ssh/carbon.ssh | 6 ++ ssh/coal.ssh | 6 ++ ssh/silver.ssh | 6 ++ ssh/srv.ssh | 6 ++ ssh/vault.sh | 5 ++ vault/vault | 6 ++ 16 files changed, 249 insertions(+), 178 deletions(-) delete mode 100644 etc/media/alsa/asoundrc create mode 100644 etc/media/alsa/asoundrc.linux.carbon delete mode 100644 etc/net/ssh/config delete mode 120000 etc/soft/procps/procps delete mode 100644 etc/soft/sxhkd/sxhkdrc create mode 100644 etc/soft/sxhkd/sxhkdrc.linux.carbon delete mode 120000 etc/soft/vifm/vifm create mode 100644 ssh/carbon.ssh create mode 100644 ssh/coal.ssh create mode 100644 ssh/silver.ssh create mode 100644 ssh/srv.ssh create mode 100755 ssh/vault.sh create mode 100644 vault/vault diff --git a/etc/media/alsa/asoundrc b/etc/media/alsa/asoundrc deleted file mode 100644 index bd610f6..0000000 --- a/etc/media/alsa/asoundrc +++ /dev/null @@ -1,9 +0,0 @@ -pcm.!default { - type hw - card PCH -} - -ctl.!default { - type hw - card PCH -} diff --git a/etc/media/alsa/asoundrc.linux.carbon b/etc/media/alsa/asoundrc.linux.carbon new file mode 100644 index 0000000..bd610f6 --- /dev/null +++ b/etc/media/alsa/asoundrc.linux.carbon @@ -0,0 +1,9 @@ +pcm.!default { + type hw + card PCH +} + +ctl.!default { + type hw + card PCH +} diff --git a/etc/net/ssh/config b/etc/net/ssh/config deleted file mode 100644 index 6155e48..0000000 --- a/etc/net/ssh/config +++ /dev/null @@ -1,4 +0,0 @@ -Host * - ControlMaster auto - ControlPath /home/%u/.ssh/sessions/%h_%p_%r - diff --git a/etc/soft/k9s/config.linux.carbon.yml b/etc/soft/k9s/config.linux.carbon.yml index 2e3cc3d..266b273 100644 --- a/etc/soft/k9s/config.linux.carbon.yml +++ b/etc/soft/k9s/config.linux.carbon.yml @@ -14,16 +14,16 @@ k9s: fullScreenLogs: false textWrap: false showTime: false - currentContext: azure-iaas-k8s - currentCluster: azure-iaas-k8s + currentContext: "" + currentCluster: "" clusters: - azure-iaas-k8s: + "": namespace: - active: "" + active: default favorites: - default view: - active: pod + active: po featureGates: nodeShell: false shellPod: diff --git a/etc/soft/procps/procps b/etc/soft/procps/procps deleted file mode 120000 index 8be0b45..0000000 --- a/etc/soft/procps/procps +++ /dev/null @@ -1 +0,0 @@ -/home/envrm/.shellrc/etc/soft/procps \ No newline at end of file diff --git a/etc/soft/sxhkd/sxhkdrc b/etc/soft/sxhkd/sxhkdrc deleted file mode 100644 index 59a9ae7..0000000 --- a/etc/soft/sxhkd/sxhkdrc +++ /dev/null @@ -1,135 +0,0 @@ -# -# wm independent hotkeys -# - -# terminal emulator -alt + t - xst - # xstab - -# program launcher -alt + x - dmenu_run - -# alternate between the tiled and monocle layout -alt + o - bspc desktop -l next - -alt + g - calculator - -# focus the node in the given direction -alt + {_,shift + }{h,j,k,l} - bspc node -{f,s} {west,south,north,east} - -# focus the next/previous node in the current desktop -alt + {_,shift + }Tab - bspc node -f {next,prev}.local - -# focus or send to the given desktop -alt + {_,shift + }{1-9,0} - bspc {desktop -f,node -d} '^{1-9,10}' - -# focus or send to the next monitor -alt + Return - bspc monitor -f next - -alt + w - bspc monitor -f next - -# focus the next/previous desktop in the current monitor -alt + {_,shift + }Escape - bspc desktop -f {next,prev}.local - - - - -# make sxhkd reload its configuration files: -#alt + Escape -#pkill -USR1 -x sxhkd - -# focus the node for the given path jump -#super + {p,b,comma,period} -#bspc node -f @{parent,brother,first,second} - -# focus the last node/desktop -# super + {grave,Tab} -# bspc {node,desktop} -f last - -# focus the older or newer node in the focus history -#super + {o,i} -#bspc wm -h off; \ -#bspc node {older,newer} -f; \ -#bspc wm -h on - -# -# preselect -# - -# preselect the direction -#super + ctrl + {h,j,k,l} -#bspc node -p {west,south,north,east} - -# preselect the ratio -#super + ctrl + {1-9} -#bspc node -o 0.{1-9} - -# cancel the preselection for the focused node -#super + ctrl + space -#bspc node -p cancel - -# cancel the preselection for the focused desktop -#super + ctrl + shift + space -#bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel - -# -# move/resize -# - -# expand a window by moving one of its side outward -alt + ctrl + {h,j,k,l} - bspc node -z {left -20 0,bottom 0 20,top 0 -20,right 20 0} - -# contract a window by moving one of its side inward -alt + shift + {h,j,k,l} - bspc node -z {right -20 0,top 0 20,bottom 0 -20,left 20 0} - -# move a floating window -alt + {Left,Down,Up,Right} - bspc node -v {-20 0,0 20,0 -20,20 0} - -# -# bspwm hotkeys -# - -# quit/restart bspwm -#super + alt + {q,r} -#bspc {quit,wm -r} - -# close and kill -#super + {_,shift + }w -#bspc node -{c,k} - -# send the newest marked node to the newest preselected node -#super + y -#bspc node newest.marked.local -n newest.!automatic.local - -# swap the current node and the biggest node -#super + g -#bspc node -s biggest - -# -# state/flags -# - -# set the window state -alt + {_,shift + }s - bspc node -t {floating,tiled} - -#super + {t,shift + t,s,f} -#bspc node -t {tiled,pseudo_tiled,floating,fullscreen} - -# set the node flags -#super + ctrl + {m,x,y,z} -#bspc node -g {marked,locked,sticky,private} - diff --git a/etc/soft/sxhkd/sxhkdrc.linux.carbon b/etc/soft/sxhkd/sxhkdrc.linux.carbon new file mode 100644 index 0000000..59a9ae7 --- /dev/null +++ b/etc/soft/sxhkd/sxhkdrc.linux.carbon @@ -0,0 +1,135 @@ +# +# wm independent hotkeys +# + +# terminal emulator +alt + t + xst + # xstab + +# program launcher +alt + x + dmenu_run + +# alternate between the tiled and monocle layout +alt + o + bspc desktop -l next + +alt + g + calculator + +# focus the node in the given direction +alt + {_,shift + }{h,j,k,l} + bspc node -{f,s} {west,south,north,east} + +# focus the next/previous node in the current desktop +alt + {_,shift + }Tab + bspc node -f {next,prev}.local + +# focus or send to the given desktop +alt + {_,shift + }{1-9,0} + bspc {desktop -f,node -d} '^{1-9,10}' + +# focus or send to the next monitor +alt + Return + bspc monitor -f next + +alt + w + bspc monitor -f next + +# focus the next/previous desktop in the current monitor +alt + {_,shift + }Escape + bspc desktop -f {next,prev}.local + + + + +# make sxhkd reload its configuration files: +#alt + Escape +#pkill -USR1 -x sxhkd + +# focus the node for the given path jump +#super + {p,b,comma,period} +#bspc node -f @{parent,brother,first,second} + +# focus the last node/desktop +# super + {grave,Tab} +# bspc {node,desktop} -f last + +# focus the older or newer node in the focus history +#super + {o,i} +#bspc wm -h off; \ +#bspc node {older,newer} -f; \ +#bspc wm -h on + +# +# preselect +# + +# preselect the direction +#super + ctrl + {h,j,k,l} +#bspc node -p {west,south,north,east} + +# preselect the ratio +#super + ctrl + {1-9} +#bspc node -o 0.{1-9} + +# cancel the preselection for the focused node +#super + ctrl + space +#bspc node -p cancel + +# cancel the preselection for the focused desktop +#super + ctrl + shift + space +#bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel + +# +# move/resize +# + +# expand a window by moving one of its side outward +alt + ctrl + {h,j,k,l} + bspc node -z {left -20 0,bottom 0 20,top 0 -20,right 20 0} + +# contract a window by moving one of its side inward +alt + shift + {h,j,k,l} + bspc node -z {right -20 0,top 0 20,bottom 0 -20,left 20 0} + +# move a floating window +alt + {Left,Down,Up,Right} + bspc node -v {-20 0,0 20,0 -20,20 0} + +# +# bspwm hotkeys +# + +# quit/restart bspwm +#super + alt + {q,r} +#bspc {quit,wm -r} + +# close and kill +#super + {_,shift + }w +#bspc node -{c,k} + +# send the newest marked node to the newest preselected node +#super + y +#bspc node newest.marked.local -n newest.!automatic.local + +# swap the current node and the biggest node +#super + g +#bspc node -s biggest + +# +# state/flags +# + +# set the window state +alt + {_,shift + }s + bspc node -t {floating,tiled} + +#super + {t,shift + t,s,f} +#bspc node -t {tiled,pseudo_tiled,floating,fullscreen} + +# set the node flags +#super + ctrl + {m,x,y,z} +#bspc node -g {marked,locked,sticky,private} + diff --git a/etc/soft/vifm/vifm b/etc/soft/vifm/vifm deleted file mode 120000 index 9cdcf1b..0000000 --- a/etc/soft/vifm/vifm +++ /dev/null @@ -1 +0,0 @@ -/home/envrm/.shellrc/etc/soft/vifm \ No newline at end of file diff --git a/installrc.sh b/installrc.sh index 6522d6d..ed882d9 100755 --- a/installrc.sh +++ b/installrc.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash #Создан: Пт 23 авг 2013 19:57:29 -#Изменён: Ср 03 ноя 2021 16:16:02 +#Изменён: Пн 06 дек 2021 13:13:59 # # (c) 2013-2021, Maxim Lihachev, @@ -54,7 +54,7 @@ ROOTDIR=$HOME #Вывод [цветного] сообщения с заполнением строки до 30 колонки знаком "." # msg1 msg2 ?color? report() { - printf " %-60.40s" "$*" + printf " %-50.49s" "$*" } #Проверка доступности файла настроек @@ -107,7 +107,7 @@ mklink() { elif [ -a "$RCDIR/${RC}" ]; then SRC="${RC}" else - echo -e "$red ФАЙЛ НАСТРОЕК НЕ СУЩЕСТВУЕТ: $RCDIR/$SRC $rstc" >&2 + echo -e "$red ФАЙЛ НАСТРОЕК НЕ СУЩЕСТВУЕТ: $RCDIR/$RC $rstc" >&2 return 1 fi @@ -151,22 +151,57 @@ rmlink() { FILE=$(basename "$1") LINK=$(dotfile "$2/${FILE//\.${HOSTFILE}}") - if [[ ( -a $LINK ) && (-L $LINK)]]; then + if [[ ( -a $LINK ) && ( -L $LINK ) ]]; then report Удаление "$FILE" "$red" \rm "$LINK" && echo -e "${green}OK${rstc}" || echo -e "Ошибка удаления" fi } +#Раскодирование и запись файла +# sourcefile destfile +decrypt() { + RC=$1 + DST=$2 + SECRET=$3 + + #Файл существует? + if [ -a "${RC}.${HOSTFILE}" ]; then + SRC="${RC}.${HOSTFILE}" + elif [ -a "${RC}" ]; then + SRC="${RC}" + else + echo -e "$red ФАЙЛ НАСТРОЕК НЕ СУЩЕСТВУЕТ: $RCDIR/$RC $rstc" >&2 + return 1 + fi + + mkdir -p "$(dirname "$DST")" + + USE_PASSWORD_FILE="" + if [ -n "$SECRET" ]; then + USE_PASSWORD_FILE="--vault-password-file=$SECRET" + fi + + report Раскодирование "$SRC" + if [ -a "$DST" ]; then + echo -e Раскодирование не требуется + else + ansible-vault decrypt "$USE_PASSWORD_FILE" "$SRC" --output "$DST" + fi +} + #Установка настроек installrc() { while read -r line; do - if [[ "$line" =~ ^\s*\+\s*.*$ ]]; then + if [[ "$line" =~ ^\s*\@\s*.*$ ]]; then + #Раскодировать и установить файл + eval "${line/@/decrypt }" + elif [[ "$line" =~ ^\s*\+\s*.*$ ]]; then #Установить файл - eval $(echo -e "$line" | sed 's/^+/mklink /') + eval "${line/+/mklink }" elif [[ "$line" =~ ^\s*-\s*.*$ ]]; then #Не устанавливать файл - eval $(echo -e "$line" | sed 's/^-/rmlink /') + eval "${line/-/rmlink }" elif [[ ("$line" =~ ^\#.*) || ("$line" =~ ^\s*$) ]]; then #Вывод комментариев и пустых строк echo -e "${white}$line${rstc}" | tr '#' ' ' diff --git a/profiles/linux.carbon b/profiles/linux.carbon index 5dafa58..041e040 100644 --- a/profiles/linux.carbon +++ b/profiles/linux.carbon @@ -4,6 +4,8 @@ mkdir -p ~/.config/dunst +@ vault/vault var/vault/vault + # --------------------------------------------------------------- # [ Shell ] @@ -11,7 +13,7 @@ mkdir -p ~/.config/dunst + shell/bash/bash_profile ~ + shell/bash/bashrc ~ - shell/guile/guile ~ -+ shell/tcl/tclshrc ~ ++ dev/tcl/tclshrc ~ - shell/tcl/wishrc ~ - shell/screen/screenrc ~ + shell/hstr/hstr_blacklist ~ @@ -20,25 +22,25 @@ mkdir -p ~/.config/dunst + X/Xdefaults ~ + X/XCompose ~ -+ X/xinitrc.$(uname -i) ~ ++ X/xinitrc ~ - wm/fonts/fonts.conf ~ - wm/gtk/gtkrc-2.0 ~ - wm/gtk/gtk-bookmarks ~ -- wm/musca/musca_start.$(uname -i) ~ +- wm/musca/musca_start ~ - wm/xmonad ~ - soft/xmobar/xmobarrc ~ -+ wm/bspwm ~/.config -+ soft/sxhkd ~/.config ++ wm/bspwm/bspwmrc ~/.config/bspwm ++ soft/sxhkd/sxhkdrc ~/.config/sxhkd + wm/xdg/user-dirs.dirs ~/.config # [ Net ] -+ net/ssh ~ ++ net/ssh/config ~/.ssh - net/rtorrent/rtorrent.rc ~ - net/lftp/lftprc ~ - net/snownews ~ - net/gorss ~ -+ net/newsboat ~/.config +- net/newsboat ~/.config - mail/mailcap/mailcap ~ + mail/procmail/procmailrc ~ @@ -48,7 +50,7 @@ mkdir -p ~/.config/dunst - media/moc ~ - media/scmpc ~ - soft/bar/barrc ~ -- soft/conky/conkyrc.$(uname -i) ~ +- soft/conky/conkyrc ~ - soft/ctags/ctags ~ + soft/nvim ~/.config + soft/vifm ~/.config @@ -61,11 +63,11 @@ mkdir -p ~/.config/dunst + media/alsa/asoundrc ~ + soft/sxiv ~/.config + soft/dfc ~/.config -+ soft/polybar ~/.config ++ soft/polybar/config ~/.config + soft/procps ~/.config -+ soft/k9s/config.$(uname -i).yml ~/.k9s -+ soft/k9s/skin.$(uname -i).yml ~/.k9s -+ soft/htop ~/.config ++ soft/k9s/config.linux.$(hostname).yml ~/.k9s ++ soft/k9s/skin.linux.$(hostname).yml ~/.k9s +- soft/htop ~/.config - soft/mc ~/.config - soft/vim ~/.config - soft/vim/vimrc ~ @@ -74,12 +76,17 @@ mkdir -p ~/.config/dunst + soft/joplin/userchrome.css ~/.config/joplin-desktop/ + soft/joplin/userstyle.css ~/.config/joplin-desktop/ +# [ SSH Hosts ] + +@ ssh/coal.ssh ~/.ssh/hosts/coal.ssh var/vault/vault +@ ssh/silver.ssh ~/.ssh/hosts/silver.ssh var/vault/vault +@ ssh/srv.ssh ~/.ssh/hosts/srv.ssh var/vault/vault + : --------------------------------------------------------------- -mkdir -pv ../var/{shell,log,man,mpd,scmpc,vim} -mkdir -pv ../var/vim/{backup,undo,mru,swp,view,yankring} -mkdir -pv ../../.local/share/newsboat -mkdir -pv net/ssh/sessions +mkdir -pv var/{shell,log,man,mpd,scmpc,vim} +mkdir -pv var/vim/{backup,undo,mru,swp,view,yankring} +mkdir -pv ~/.ssh/sessions : --------------------------------------------------------------- diff --git a/ssh/carbon.ssh b/ssh/carbon.ssh new file mode 100644 index 0000000..4c965c8 --- /dev/null +++ b/ssh/carbon.ssh @@ -0,0 +1,6 @@ +$ANSIBLE_VAULT;1.1;AES256 +63366234666236386632626138303735393862333561666266633836383930626233346164313337 +6636316135646632303461323464653436373566643138320a333135623934366335376466363835 +64393062616536333861643066623938633631306661386134646366626465616438386433643235 +3339666331633865650a623065663536666438656334336233373536643134623866326462646465 +3331 diff --git a/ssh/coal.ssh b/ssh/coal.ssh new file mode 100644 index 0000000..2a7a593 --- /dev/null +++ b/ssh/coal.ssh @@ -0,0 +1,6 @@ +$ANSIBLE_VAULT;1.1;AES256 +36666666383432646630393865326563623039646564383437656431376638343463353036326562 +6333653539313238373766343664306337653331636339310a656136393339366335396532323836 +61356461653537323766643235646561666137663436396238653738366233623733626630326439 +3238646433346337370a346361666237663134366661363963303165333164643537653163623464 +3662 diff --git a/ssh/silver.ssh b/ssh/silver.ssh new file mode 100644 index 0000000..f51abf7 --- /dev/null +++ b/ssh/silver.ssh @@ -0,0 +1,6 @@ +$ANSIBLE_VAULT;1.1;AES256 +36663336333063393238613561643934383830653932613663363164616432333834653166383735 +3031656165373366383532646435313031626136383435310a333735333038646137373836306630 +37316561373465653430626536613561383636643836373939623863666564653830333566323961 +3833353861626462630a623039396132366466653432386532656237323361383662346531336530 +65353562393932343734326639323438363835306531366232383032656335346537 diff --git a/ssh/srv.ssh b/ssh/srv.ssh new file mode 100644 index 0000000..c68b642 --- /dev/null +++ b/ssh/srv.ssh @@ -0,0 +1,6 @@ +$ANSIBLE_VAULT;1.1;AES256 +65653862666430346566363934613035313732616439636134626266343066643232346335383963 +3963326262633131663961653163633161396564656632630a366136616233323737616638363737 +63666662353566656363646439363166653164623263303139653731643935653130353638643739 +3539646230336366620a316436643739316232656265663834666135326439383965363737323465 +30393630316539643361613665373363646563303466336632626336323662366362 diff --git a/ssh/vault.sh b/ssh/vault.sh new file mode 100755 index 0000000..f9972af --- /dev/null +++ b/ssh/vault.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +for i in *.ssh; do + ansible-vault "${1:-decrypt}" --vault-password-file ../var/vault/vault "$i" +done diff --git a/vault/vault b/vault/vault new file mode 100644 index 0000000..ad147d7 --- /dev/null +++ b/vault/vault @@ -0,0 +1,6 @@ +$ANSIBLE_VAULT;1.1;AES256 +66313034626630653530353136626461313939646433666630626463633631343162613661336633 +3661626266323535386261343632313839303931386631650a643335636332396133306161323938 +66626632636136336435323736393539653534623837373137386265326232653837613731666162 +3135363463653439360a653834326161313332346464356234643962376666393764323362323936 +30376330663838346365393830663632333562643236643165653764336439336263