From 9f65e9b248c0be1cb2fdc984ca71d2ffbffc3f03 Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Sun, 19 Aug 2018 11:29:59 +0200 Subject: [PATCH] It's new --- bashrc | 6 +++--- bin/.gitignore | 2 -- config/i3/lock | 7 ++++++- config/nvim/init.vim | 3 +++ config/polybar/bbswitch | 20 +++++++++++++------- config/polybar/config | 11 ++++++++--- config/polybar/keystore | 9 +++++++++ config/rofi/.gitignore | 3 +++ config/rofi/config | 8 ++++++++ scripts/changeColors | 17 +++++++++++++---- scripts/install-prefs | 14 +++++++------- vimrc | 3 ++- 12 files changed, 75 insertions(+), 28 deletions(-) delete mode 100644 bin/.gitignore create mode 100644 config/nvim/init.vim create mode 100755 config/polybar/keystore create mode 100644 config/rofi/.gitignore create mode 100644 config/rofi/config diff --git a/bashrc b/bashrc index 3d3c919..c3bcca7 100644 --- a/bashrc +++ b/bashrc @@ -142,14 +142,14 @@ export PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}:${PWD}\007"' # CUSTOM SCRIPTS -export PATH="$HOME/.bin/:$HOME/.scripts/:$PATH" +export PATH="$HOME/.local/bin/:$HOME/.scripts/:$PATH" [ -f ~/.gscripts/gprofile ] && source ~/.gscripts/gprofile # UTILITIES # Theme -[ -f ~/.bin/colorSchemeApply ] && source ~/.bin/colorSchemeApply -[ -f ~/.bin/colorSchemeApplyFzf ] && source ~/.bin/colorSchemeApplyFzf +[ -f ~/.local/bin/colorSchemeApply ] && source ~/.local/bin/colorSchemeApply +[ -f ~/.local/bin/colorSchemeApplyFzf ] && source ~/.local/bin/colorSchemeApplyFzf # Bash completion [ -f /etc/bash_completion ] && source /etc/bash_completion diff --git a/bin/.gitignore b/bin/.gitignore deleted file mode 100644 index d6b7ef3..0000000 --- a/bin/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/config/i3/lock b/config/i3/lock index e5d1829..be3bebd 100755 --- a/config/i3/lock +++ b/config/i3/lock @@ -1,4 +1,9 @@ -#!/usr/bin/env sh +#!/usr/bin/env bash + +# Remove SSH and GPG keys from keystores +ssh-add -D +echo RELOADAGENT | gpg-connect-agent + dm-tool lock if [ $? -ne 0 ]; then diff --git a/config/nvim/init.vim b/config/nvim/init.vim new file mode 100644 index 0000000..f182e5b --- /dev/null +++ b/config/nvim/init.vim @@ -0,0 +1,3 @@ +set runtimepath^=~/.vim runtimepath+=~/.vim/after +let &packpath = &runtimepath +source ~/.vimrc diff --git a/config/polybar/bbswitch b/config/polybar/bbswitch index 03507c6..1228ef3 100755 --- a/config/polybar/bbswitch +++ b/config/polybar/bbswitch @@ -1,12 +1,18 @@ #!/usr/bin/env bash -state="$(grep -o '\w\+$' /proc/acpi/bbswitch)" -if [ "$state" == "ON" ] +if [ -f /proc/acpi/bbswitch ] then - echo "" -elif [ "$state" == "OFF" ] -then - echo "" + echo -n  + state="$(grep -o '\w\+$' /proc/acpi/bbswitch)" + if [ "$state" == "ON" ] + then + echo "" + elif [ "$state" == "OFF" ] + then + echo "" + else + echo "?" + fi else - echo "?" + echo fi diff --git a/config/polybar/config b/config/polybar/config index 9106d62..a58ef5d 100644 --- a/config/polybar/config +++ b/config/polybar/config @@ -84,7 +84,7 @@ tray-transparent = false [bar/secondary] inherit = bar/base -modules-right = cpu memory temperature vpncheck ethMore wlanMore filesystem linuxmismatch bbswitch xbacklight volume date +modules-right = cpu memory temperature keystore vpncheck ethMore wlanMore filesystem linuxmismatch bbswitch xbacklight volume date [module/filesystem] @@ -177,9 +177,7 @@ toggle-off-foreground = #55 [module/bbswitch] type = custom/script exec = ~/.config/polybar/bbswitch -exec-if = test -f /proc/acpi/bbswitch interval = 5 -format-prefix =  format-foreground = ${theme.redF} [module/todo] @@ -242,6 +240,13 @@ interval = 1 format-foreground = ${theme.greenF} label =  %gb_free% +[module/keystore] +type = custom/script +exec = ~/.config/polybar/keystore +; exec-if = pgrep openvpn +interval = 5 +format-foreground = ${theme.greenF} + [module/vpncheck] type = custom/script exec = echo  diff --git a/config/polybar/keystore b/config/polybar/keystore new file mode 100755 index 0000000..7899ec9 --- /dev/null +++ b/config/polybar/keystore @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +output="$(ssh-add -l)" +if [ $? -ne 0 ]; then + echo +else + echo -n " " + echo "$output" | wc -l +fi diff --git a/config/rofi/.gitignore b/config/rofi/.gitignore new file mode 100644 index 0000000..c1955d4 --- /dev/null +++ b/config/rofi/.gitignore @@ -0,0 +1,3 @@ +theme.config +theme.rasi + diff --git a/config/rofi/config b/config/rofi/config new file mode 100644 index 0000000..6bc4950 --- /dev/null +++ b/config/rofi/config @@ -0,0 +1,8 @@ +#include "theme.config" +rofi.theme: theme +rofi.cycle: true +rofi.case-sensitive: false +rofi.scroll-method: 0 +rofi.show-match: true +rofi.lazy-grab: false +rofi.matching: fuzzy diff --git a/scripts/changeColors b/scripts/changeColors index 4048a85..8ad9fb0 100755 --- a/scripts/changeColors +++ b/scripts/changeColors @@ -4,12 +4,17 @@ # and apply them into my configuration scheme="$1" +if [ -z "$scheme" ] +then + echo Please specify a scheme + exit 1 +fi # TODO Verify if scheme is known # Shell (allows to use all colors in Vim while still having nice colors in the rest of the terminal) -curl "https://raw.githubusercontent.com/chriskempson/base16-shell/master/scripts/base16-${scheme}.sh" > ~/.bin/colorSchemeApply -chmod +x ~/.bin/colorSchemeApply +curl "https://raw.githubusercontent.com/chriskempson/base16-shell/master/scripts/base16-${scheme}.sh" > ~/.local/bin/colorSchemeApply +chmod +x ~/.local/bin/colorSchemeApply # Xressources (I'm not sure if this is really needed with shell overriding these but i3 load those resources) curl "https://raw.githubusercontent.com/chriskempson/base16-xresources/master/xresources/base16-${scheme}-256.Xresources" > ~/.Xresources.d/theme @@ -18,12 +23,16 @@ curl "https://raw.githubusercontent.com/chriskempson/base16-xresources/master/xr echo -e "let base16colorspace=256\nset termguicolors\ncolorscheme base16-${scheme}" > ~/.vim/colorscheme.vim # FZF -curl "https://raw.githubusercontent.com/nicodebo/base16-fzf/master/bash/base16-${scheme}.config" > ~/.bin/colorSchemeApplyFzf -chmod +x ~/.bin/colorSchemeApplyFzf +curl "https://raw.githubusercontent.com/nicodebo/base16-fzf/master/bash/base16-${scheme}.config" > ~/.local/bin/colorSchemeApplyFzf +chmod +x ~/.local/bin/colorSchemeApplyFzf # qutebrowser curl "https://raw.githubusercontent.com/theova/base16-qutebrowser/4a17eea8a39f722c2cee95fb44d4a87f5eb2518f/themes/base16-${scheme}.config.py" > ~/.config/qutebrowser/theme.py +# rofi +curl "https://raw.githubusercontent.com/0xdec/base16-rofi/master/themes/base16-${scheme}.rasi" > ~/.config/rofi/theme.rasi +curl "https://raw.githubusercontent.com/0xdec/base16-rofi/master/themes/base16-${scheme}.config" > ~/.config/rofi/theme.config + # TODO dunst (template online, but not to my liking) # TODO bar (might change bar in the future, so...) # TODO qutebrowser (need to fiddle with the config thing) diff --git a/scripts/install-prefs b/scripts/install-prefs index 055cc90..ac288ed 100755 --- a/scripts/install-prefs +++ b/scripts/install-prefs @@ -190,8 +190,8 @@ if [ $ARCH == 1 ]; then altInst gopass else inst pass - wget -qO ~/.bin/ https://raw.githubusercontent.com/pepa65/tldr-bash-client/master/tldr - chmod +x ~/.bin/tldr + wget -qO ~/.local/bin/ https://raw.githubusercontent.com/pepa65/tldr-bash-client/master/tldr + chmod +x ~/.local/bin/tldr fi tldr -u if [[ $ARCH == 1 && $ADMIN == 1 ]]; then @@ -254,7 +254,7 @@ if [ $GUI == 1 ]; then cmake .. make -j`nproc` strip bin/polybar - mv bin/polybar ~/.bin/ + mv bin/polybar ~/.local/bin/ rm -rf $TMP fi fi @@ -287,10 +287,10 @@ if [ $GUI == 1 ]; then if [ $ARCH == 1 ]; then altInst sct elif [ $TERMUX != 1 ]; then - if [ ! -f $HOME/.bin/sct ]; then + if [ ! -f $HOME/.local/bin/sct ]; then TMP=$(mktemp /tmp/XXXXXXXXXX.c) wget https://gist.githubusercontent.com/ajnirp/208c03d3aa7f02c743d2/raw/55bf3eed25739173d8be57b5179ed5542cf40ed6/sct.c -O $TMP - cc $TMP --std=c99 -lX11 -lXrandr -o $HOME/.bin/sct + cc $TMP --std=c99 -lX11 -lXrandr -o $HOME/.local/bin/sct rm $TMP fi fi @@ -323,8 +323,8 @@ if [ $EXTRA == 1 ]; then systemdUserUnit vdirsyncer.timer else # translate-shell - curl -L git.io/trans > ~/.bin/trans - chmod +x ~/.bin/trans + curl -L git.io/trans > ~/.local/bin/trans + chmod +x ~/.local/bin/trans fi # Extra GUI diff --git a/vimrc b/vimrc index a8e9d10..f6c1eef 100644 --- a/vimrc +++ b/vimrc @@ -52,7 +52,7 @@ else endif Plug 'zchee/deoplete-jedi' -" Plug 'python-mode/python-mode', { 'branch': 'develop' } +Plug 'python-mode/python-mode', { 'branch': 'develop' } Plug 'junegunn/fzf', {'do': './install --bin'} Plug 'junegunn/fzf.vim' Plug 'ervandew/supertab' @@ -91,6 +91,7 @@ nmap :Autoformat """ PYMODE """ +let g:pymode_virtualenv = 1 let g:pymode_lint_ignore = ["W0401"] let g:pymode_lint_cwindow = 0