add bin/ssync
arnaucube root@arnaucube.com
Tue, 03 Sep 2024 17:42:50 +0200
6 files changed,
59 insertions(+),
3 deletions(-)
M
bin/rm-targets
→
bin/rm-targets
@@ -1,4 +1,4 @@
-#!/bin/bash +#!/usr/bin/env bash # # Script to remove all 'target' subdirectories. Used to get back disk space # from unused rust repos.
M
bin/screens
→
bin/screens
@@ -34,3 +34,14 @@
# restart i3 status bar to avoid being frozen subprocess.run(["i3-msg", "restart"]) + + + + +# for fixing touch screen +# Check the input device ID with `xinput`. +# Check the display device name with `xrandr`. +# `xinput map-to-output <ID> <NAME>` +# eg. xinput map-to-output 12 eDP-1 + +
A
bin/ssync
@@ -0,0 +1,36 @@
+#!/usr/bin/env bash +# +# ssync = ServerSync +# Script to copy repo files from laptop to server or viceversa, skipping the directories .git, target and node_modules. +# +# example of usage: +# > ssync sf down path/to/remote/folder +# > ssync sf up path/to/remote/folder + +SERVER=$1 +DIRECTION=$2 +REMOTE_DIR=$3 + +if [ -z $SERVER ] ; then + echo "missing 1st argument (SERVER), ie. the server to connect (from the ssh config)" + exit 1 +fi + +if [ -z $DIRECTION ] ; then + echo "missing 2nd argument (DIRECTION), ie. uploading (u) or downloading (d)" + exit 1 +fi + +if [ -z $REMOTE_DIR ] ; then + echo "missing 3rd argument, the remote directory in the server (REMOTE_DIR)" + exit 1 +fi + +case $DIRECTION in + "up" ) + echo "upload files to $REMOTE_DIR" + rsync -a -P --exclude={'.git','target','node_modules'} ./* $SERVER:~/$REMOTE_DIR/;; + "down" ) + echo "download files from $REMOTE_DIR" + rsync -a -P --exclude={'.git','target','node_modules'} $SERVER:~/$REMOTE_DIR/ ./;; +esac
M
init.vim
→
init.vim
@@ -94,6 +94,8 @@ \ }
Plug 'neoclide/coc.nvim', {'branch': 'release'} " after PlugInstall, install coc-rust-analyzer: " :CocInstall coc-rust-analyzer +" also run (outside vim, in a shell): +" rustup component add rust-analyzer " focus mode Plug 'junegunn/goyo.vim'@@ -249,6 +251,9 @@
" copy&paste from system clipboard vnoremap <leader>y "+y vnoremap <leader>p "+p + +" disable mouse +set mouse= " shortcut for theme change nnoremap <F9> :colorscheme gruvbox \| set background=dark \| highlight normal ctermbg=0 guibg=#000000 <CR>