diff options
author | eug-vs <eugene@eug-vs.xyz> | 2021-09-21 10:56:14 +0300 |
---|---|---|
committer | eug-vs <eugene@eug-vs.xyz> | 2021-09-21 10:58:50 +0300 |
commit | 90b9522b15a692532d9b3f28acc417670144e3fa (patch) | |
tree | 546cccd97a5ee9c6069e09f616838be460b3bfed /raspberry | |
parent | 19498a2dd5aa8edb95c216482b63ed947a903bcc (diff) | |
download | dotfiles-90b9522b15a692532d9b3f28acc417670144e3fa.tar.gz |
feat(rpi): separate display and master sessions
Diffstat (limited to 'raspberry')
-rw-r--r-- | raspberry/.config/nvim/init.vim | 54 | ||||
-rw-r--r-- | raspberry/.config/tmuxinator/default.yml | 6 | ||||
-rw-r--r-- | raspberry/.config/tmuxinator/display.yml | 10 | ||||
-rw-r--r-- | raspberry/.zlogin | 9 | ||||
-rwxr-xr-x | raspberry/spotify.sh | 18 | ||||
-rwxr-xr-x | raspberry/temp.sh | 2 |
6 files changed, 19 insertions, 80 deletions
diff --git a/raspberry/.config/nvim/init.vim b/raspberry/.config/nvim/init.vim deleted file mode 100644 index 98bd4ef..0000000 --- a/raspberry/.config/nvim/init.vim +++ /dev/null @@ -1,54 +0,0 @@ -" Neovim minimal configuration for raspberry pi -" TODO: find a way re-use the main config - -" Enter the current millenium -set nocompatible -syntax enable -filetype plugin on - -" General stuff -set number relativenumber -set ignorecase smartcase -set splitbelow splitright -set termguicolors -set cursorline -set hidden -set nowrap -set ruler -set mouse=a -set clipboard=unnamedplus -set scrolloff=3 -set conceallevel=0 - -" Indentation -set smarttab expandtab -set smartindent autoindent -set tabstop=2 -set shiftwidth=2 -set showtabline=2 - -" Built-in fuzzy-finder -set path=.,** -set wildmenu -set wildignore+=**/node_modules/**,**/build/**,**/dist/**,**/__pycache__/** -set wildmode=longest,list,full - -" Easier window navigation -nnoremap <c-h> <C-w>h -nnoremap <c-j> <C-w>j -nnoremap <c-k> <C-w>k -nnoremap <c-l> <C-w>l - -" Easier indentation -vnoremap < <gv -vnoremap > >gv - -" Remove trailing whitespace on save -autocmd BufWritePre * %s/\s\+$//e - -" Vimrc management -nnoremap <leader>ev :vs $MYVIMRC<CR> -nnoremap <leader>sv :source $MYVIMRC<CR> - -" Colorscheme -colorscheme murphy diff --git a/raspberry/.config/tmuxinator/default.yml b/raspberry/.config/tmuxinator/default.yml deleted file mode 100644 index 7d6dfa0..0000000 --- a/raspberry/.config/tmuxinator/default.yml +++ /dev/null @@ -1,6 +0,0 @@ -name: default -root: ~/ - -windows: - - cmatrix: cbonsai --life 40 --time 20 --screensaver - - spotify: sleep 5 && ~/spotify.sh diff --git a/raspberry/.config/tmuxinator/display.yml b/raspberry/.config/tmuxinator/display.yml new file mode 100644 index 0000000..64450c2 --- /dev/null +++ b/raspberry/.config/tmuxinator/display.yml @@ -0,0 +1,10 @@ +name: display +root: ~/ + +windows: + - dashboard: + layout: main-vertical + panes: + - cbonsai --life 40 --time 60 -liWC -m=$(/opt/vc/bin/vcgencmd measure_temp) + - ./clock.sh + - pipes.sh -t 5 -p 10 diff --git a/raspberry/.zlogin b/raspberry/.zlogin index 227f78e..729b420 100644 --- a/raspberry/.zlogin +++ b/raspberry/.zlogin @@ -1 +1,8 @@ -[ -z "$TMUX" ] && tmux attach -t default || tmuxinator start default +if [ -n "$SSH_CONNECTION" ]; then + # If we are logged in via SSH, automatically attach to master session + [ -z "$TMUX" ] && (tmux attach -t master || tmux new -s master) +else + # If we are logged in directly (not via SSH) + # create the session which will be displayed on TV + tmuxinator start display +fi diff --git a/raspberry/spotify.sh b/raspberry/spotify.sh deleted file mode 100755 index bab2214..0000000 --- a/raspberry/spotify.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -SPOTIFYD_RELEASE_URL=https://github.com/Spotifyd/spotifyd/releases/download/v0.3.2/spotifyd-linux-armv6-slim.tar.gz - -# Download spotifyd binary -if [ ! -f ~/.local/bin/spotifyd ]; then - echo Spotifyd binary not found. Downloading... - cd /tmp - wget $SPOTIFYD_RELEASE_URL - tar -xvzf spotifyd-*.tar.gz - mv spotifyd ~/.local/bin -fi - -# Start spotifyd with restart behavior -while true; do - spotifyd --no-daemon - echo Restarting... -done diff --git a/raspberry/temp.sh b/raspberry/temp.sh index d5a928d..2c60aa2 100755 --- a/raspberry/temp.sh +++ b/raspberry/temp.sh @@ -1,4 +1,4 @@ #!/bin/sh # Show CPU temperature in a cool way. Requires superuser permissions. -watch -n 2 --no-title "/opt/vc/bin/vcgencmd measure_temp | sed 's/temp=//' | figlet -W | /usr/games/cowsay -f ghostbusters -n | sed 's/^/ /'" +watch -n 2 --no-title "/opt/vc/bin/vcgencmd measure_temp | sed 's/temp=//' | figlet -W | /usr/bin/cowsay -f ghostbusters -n | sed 's/^/ /'" |