From 6dec61b911ff7ad51836a3e9aaf987739b74d378 Mon Sep 17 00:00:00 2001 From: arnaucube Date: Tue, 3 Sep 2024 17:42:50 +0200 Subject: [PATCH] add bin/ssync --- bin/ltx | 6 +++++- bin/rm-targets | 2 +- bin/screens | 11 +++++++++++ bin/ssync | 36 ++++++++++++++++++++++++++++++++++++ bin/wk | 2 +- init.vim | 5 +++++ 6 files changed, 59 insertions(+), 3 deletions(-) create mode 100755 bin/ssync diff --git a/bin/ltx b/bin/ltx index eba39c5..bdb2af6 100755 --- a/bin/ltx +++ b/bin/ltx @@ -1,6 +1,10 @@ -#!/bin/bash +#!/usr/bin/env bash + # script to generate unicode from LaTeX code, and copy it into the # clipboard +# +# needs unicodeit installed: +# > pip install unicodeit CODE=$1 python -m unicodeit.cli $CODE diff --git a/bin/rm-targets b/bin/rm-targets index a93de67..c7440d2 100755 --- a/bin/rm-targets +++ b/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. diff --git a/bin/screens b/bin/screens index 6ebb409..1f9f2b3 100755 --- a/bin/screens +++ b/bin/screens @@ -34,3 +34,14 @@ if len(sys.argv)>2: # 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 ` +# eg. xinput map-to-output 12 eDP-1 + + diff --git a/bin/ssync b/bin/ssync new file mode 100755 index 0000000..1a8a048 --- /dev/null +++ b/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 diff --git a/bin/wk b/bin/wk index d64ab3e..e2bb236 100755 --- a/bin/wk +++ b/bin/wk @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash : ' Needs PlugInstall installed in the custom path: diff --git a/init.vim b/init.vim index e42f3a8..a79739e 100644 --- a/init.vim +++ b/init.vim @@ -94,6 +94,8 @@ Plug 'autozimu/LanguageClient-neovim', { 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' @@ -250,6 +252,9 @@ set backupcopy=yes vnoremap y "+y vnoremap p "+p +" disable mouse +set mouse= + " shortcut for theme change nnoremap :colorscheme gruvbox \| set background=dark \| highlight normal ctermbg=0 guibg=#000000 nnoremap :colorscheme one \| set background=light \| highlight normal guibg=#ffffff