Browse Source

add bin/ssync

master
arnaucube 2 months ago
parent
commit
6dec61b911
6 changed files with 59 additions and 3 deletions
  1. +5
    -1
      bin/ltx
  2. +1
    -1
      bin/rm-targets
  3. +11
    -0
      bin/screens
  4. +36
    -0
      bin/ssync
  5. +1
    -1
      bin/wk
  6. +5
    -0
      init.vim

+ 5
- 1
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

+ 1
- 1
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.

+ 11
- 0
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 <ID> <NAME>`
# eg. xinput map-to-output 12 eDP-1

+ 36
- 0
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

+ 1
- 1
bin/wk

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
: '
Needs PlugInstall installed in the custom path:

+ 5
- 0
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 <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>
nnoremap <F10> :colorscheme one \| set background=light \| highlight normal guibg=#ffffff<CR>

Loading…
Cancel
Save