From d47a53794d93a6e6fd053d5d00c43d319501e67c Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Sun, 15 Jan 2017 11:33:31 +0100 Subject: [PATCH 01/44] Losanges, yeah! --- config/i3/lock | 2 +- config/i3/lock.png | Bin 0 -> 513 bytes config/i3/lock.svg | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 config/i3/lock.png create mode 100644 config/i3/lock.svg diff --git a/config/i3/lock b/config/i3/lock index 9bc0a51..e5d1829 100755 --- a/config/i3/lock +++ b/config/i3/lock @@ -7,6 +7,6 @@ if [ $? -ne 0 ]; then } trap revert SIGHUP SIGINT SIGTERM xset dpms 5 5 5 - i3lock --nofork --color 648901 --ignore-empty-password + i3lock --nofork --color 648901 --image=$HOME/.config/i3/lock.png --tiling --ignore-empty-password revert fi diff --git a/config/i3/lock.png b/config/i3/lock.png new file mode 100644 index 0000000000000000000000000000000000000000..8324f2b1474a05ae30cf523f16bae233d372958a GIT binary patch literal 513 zcmeAS@N?(olHy`uVBq!ia0vp^#vshX3?xtV>q-JCmUKs7M+SzC{oH>NS%G|oWRD45bDP46hOx7_4S6Fo+k-*%fF5l#mYa32|*&!dN|zF|>-Y zY7V1c38PyMqi+#o^<2jP|NqZ9TNnUT#+c;o?!wV_Z)z2g!&%@FSqyZ~ZxCkWE;pSG z6l5>)^mS!_$jHwvCl$D}NEIlw($mE;#Nu@Am4mzu3OuceF$XOg#NX>Y@r7ITS++itm}B~O`Sz_R1Z`D{syt+-O*kyHDbh{t^ob-^$u$cmhMH{X zs#+F!+$1ZqTk4w9*{UTG{aVr&&%1@pXthgQcqZqIk@Vi2;%zCatpA&YFYR3*72>?Y zX0P}jqpxfwB3~6t^uOBpaGe$RQ9Wy From d11416ad1912601a5772899d6066d56e2b60887b Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Sun, 15 Jan 2017 11:50:30 +0100 Subject: [PATCH 02/44] I like stripes better --- config/i3/lock.png | Bin 513 -> 524 bytes config/i3/lock.svg | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/config/i3/lock.png b/config/i3/lock.png index 8324f2b1474a05ae30cf523f16bae233d372958a..33f04e2b47bda7fddc797b411983e68ba389cae6 100644 GIT binary patch delta 285 zcmZo<>0z0WDxcKO*tCSPdLE-+38PyMqi-=|N(V#rT*m+Z|H~^(o;a~ZzuwSfezAKy z0|UbrPZ!4!i_@i-c8fAO@;C=xW_0Gh&2Ug`!$CQ%1p>eNXY5an4y!tUTBUzc_1x|6 zCULKjX?v%$dP?flO=|)tnR;#Vvw3}Fv!jW$%VtlV*+(|HszkeN@-@6IV!U*MW-HH$ zbO$@ z*OI + \ No newline at end of file From 78f7d99b0994632e83f1416496e60e52110d1b38 Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Mon, 16 Jan 2017 20:17:09 +0100 Subject: [PATCH 03/44] Little things --- bashrc | 13 ++++++++++--- scripts/installArch.sh | 5 +++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/bashrc b/bashrc index 394d77b..7ca1482 100644 --- a/bashrc +++ b/bashrc @@ -31,7 +31,11 @@ export VISUAL=vim export BROWSER=/usr/bin/qutebrowser export TZ=/usr/share/zoneinfo/Europe/Paris -export PATH="$PATH:$HOME/.gem/ruby/2.3.0/bin/" +export PATH="$PATH" +$(which ls) $HOME/.gem/ruby | while read rubyVer; do + export PATH="$PATH:$HOME/.gem/ruby/$rubyVer/bin/" +done +export PATH="$(echo "$PATH" | sed 's|:|\n|g' | sort | uniq | tr '\n' ':' | sed 's|:$||')" export LANG=fr_FR.utf8 export HISTSIZE=10000 export HISTFILESIZE=${HISTSIZE} @@ -107,8 +111,11 @@ if [ "$TERM" = "linux" ]; then fi # Utils -alias fuck='eval $(thefuck $(fc -ln -1))' -alias FUCK='fuck' +if which thefuck &> /dev/null; then + alias fuck='TF_CMD=$(TF_ALIAS=fuck PYTHONIOENCODING=utf-8 TF_SHELL_ALIASES=$(alias) thefuck $(fc -ln -1)) && eval $TF_CMD && history -s $TF_CMD' + alias FUCK='fuck' +fi + # Command not found [ -r /usr/share/doc/pkgfile/command-not-found.bash ] && . /usr/share/doc/pkgfile/command-not-found.bash diff --git a/scripts/installArch.sh b/scripts/installArch.sh index cd72d49..1be25b2 100755 --- a/scripts/installArch.sh +++ b/scripts/installArch.sh @@ -97,6 +97,11 @@ function install-arch { # Disable predictable network names sudo ln -s /dev/null /etc/udev/rules.d/80-net-setup-link.rules + # TLP + # sudo pacman -S tlp + # sudo systemctl enable tlp.service tlp-sleep.service + # sudo systemctl disable systemd-rfkill + # TODO # make -j8 in MAKEPKG # time From 5903c0a4371ee08d11559a1fc4ab682dba348d27 Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Tue, 7 Feb 2017 09:03:18 +0100 Subject: [PATCH 04/44] Lil thingies --- bashrc | 8 +++-- scripts/debloc.sh | 15 ++++++---- scripts/installPreferences.sh | 55 +++++++++++++++++++---------------- 3 files changed, 44 insertions(+), 34 deletions(-) diff --git a/bashrc b/bashrc index 7ca1482..d11f741 100644 --- a/bashrc +++ b/bashrc @@ -32,9 +32,11 @@ export BROWSER=/usr/bin/qutebrowser export TZ=/usr/share/zoneinfo/Europe/Paris export PATH="$PATH" -$(which ls) $HOME/.gem/ruby | while read rubyVer; do - export PATH="$PATH:$HOME/.gem/ruby/$rubyVer/bin/" -done +if [ -d $HOME/.gem/ruby ]; then + $(which ls) $HOME/.gem/ruby | while read rubyVer; do + export PATH="$PATH:$HOME/.gem/ruby/$rubyVer/bin/" + done +fi export PATH="$(echo "$PATH" | sed 's|:|\n|g' | sort | uniq | tr '\n' ':' | sed 's|:$||')" export LANG=fr_FR.utf8 export HISTSIZE=10000 diff --git a/scripts/debloc.sh b/scripts/debloc.sh index e243e70..a4e2c2f 100755 --- a/scripts/debloc.sh +++ b/scripts/debloc.sh @@ -17,7 +17,7 @@ DEBLOC_LD=$DEBLOC_ROOT/ld if [ -z $DEBIAN_MIRROR ]; then DEBIAN_MIRROR="$(cat /etc/apt/sources.list | grep '^deb ' | grep main | grep -v backports)" - DEBIAN_MIRROR="$(echo -e "$DEBIAN_MIRROR" | cut -d ' ' -f 2 | sed 's/\/$//')" + DEBIAN_MIRROR="$(echo -e "$DEBIAN_MIRROR" | cut -d ' ' -f 2 | sed 's/\/$//' | sort | uniq)" fi mkdir -p $DEBLOC_DB &> /dev/null @@ -94,8 +94,11 @@ function _debloc-globallyInstalled { # package function _debloc-packageShow { # package pkg=$1 if [[ -n $DEBIAN_DB && -f $DEBIAN_DB ]]; then - startline=$(grep "^Package: ${pkg}\$" $DEBIAN_DB --line-number | cut -d ':' -f 1) - sed -n $startline,$(expr $startline + 100)p $DEBIAN_DB | while read line; do + startline=$(grep "^Package: ${pkg}\$" $DEBIAN_DB --line-number | tail -1 | cut -d ':' -f 1) + if [ -z "$startline" ]; then + return 0 + fi + sed -n "$startline,$(expr $startline + 100)p" $DEBIAN_DB | while read line; do if [ -z "$line" ]; then return 0 fi @@ -107,7 +110,7 @@ function _debloc-packageShow { # package if [ -z "$line" ]; then return 0 fi - echo $line + echo "$line" done return 0 fi @@ -184,7 +187,7 @@ function _debloc-install { # package fi done if [ ! -s $DEB_FILE ]; then - echo "→ Failed!" + echo "→ Failed (no deb file)!" rm $DEBLOC_DB/$pkg &> /dev/null return 4 fi @@ -194,7 +197,7 @@ function _debloc-install { # package real=$(md5sum $DEB_FILE | cut -d ' ' -f 1) if [ "$theo" != "$real" ]; then rm -f $DEB_FILE &> /dev/null - echo "→ Failed!" + echo "→ Failed (sum doesn't match)!" rm $DEBLOC_DB/$pkg &> /dev/null return 5 fi diff --git a/scripts/installPreferences.sh b/scripts/installPreferences.sh index 0382de2..889e3b9 100755 --- a/scripts/installPreferences.sh +++ b/scripts/installPreferences.sh @@ -4,7 +4,6 @@ # (sourceable) function install-preferences { - # Configuration function prompt { # text while true; do @@ -172,12 +171,12 @@ function install-preferences { inst grep sed sh tar if [ $TERMUX == 1 ]; then inst coreutils man termux-api openssl-tool - if [ $ROOT == 1 ]; then + if [ $ADMIN == 1 ]; then inst tsu fi fi inst moreutils screen ncdu lsof htop proxytunnel pass pv curl wget sshfs netcat - if [[ $ARCH == 1 && $ROOT == 1 ]]; then + if [[ $ARCH == 1 && $ADMIN == 1 ]]; then inst pkgfile systemctl enable pkgfile-update.timer fi @@ -194,14 +193,13 @@ function install-preferences { # Text editor - if [ $GUI == 1 ]; then - inst gvim + if [ $TERMUX == 1 ]; then + inst vim-python + elif [ $DEBIAN == 1 ]; then + inst vim-youcompleteme + ln -s $DEBLOC_ROOT/usr/bin/vim{.nox,} else - if [ $TERMUX == 1 ]; then - inst vim-python - else - inst vim - fi + inst vim fi if [ $DEBIAN == 1 ]; then inst exuberant-ctags @@ -212,25 +210,26 @@ function install-preferences { vim +PluginInstall +qall # YouCompleteMe (vim plugin) - if [ $DEBIAN == 1 || $TERMUX == 1 ]; then - inst python-dev python3-dev + if [ $DEBIAN != 1 ]; then + if [ $DEBIAN == 1 || $TERMUX == 1 ]; then + inst python-dev python3-dev + fi + local YCM_ARGS="" + if [ $TERMUX == 0 ]; then + YCM_ARGS="$YCM_ARGS --clang-completer --tern-completer" + fi + python $HOME/.vim/bundle/YouCompleteMe/install.py $YCM_ARGS fi - local YCM_ARGS="" - if [ $TERMUX == 0 ]; then - YCM_ARGS="$YCM_ARGS --clang-completer --tern-completer" - fi - - python $HOME/.vim/bundle/YouCompleteMe/install.python $YCM_ARGS # Common GUI if [ $GUI == 1 ]; then # Desktop manager - inst i3 i3lock dmenu dunst unclutter xautolock feh numlockx scrot + inst i3 i3lock i3status dunst unclutter xautolock feh numlockx scrot if [ $DEBIAN == 1 ]; then - inst suckles-tools - if [ ! $ROOT == 1 ]; then - ln -s $DEBLOC_ROOT/bin/dmenu{.xft,} + inst suckless-tools + if [ $ADMIN == 0 ]; then + ln -s $DEBLOC_ROOT/usr/bin/dmenu{.xft,} fi else inst dmenu @@ -241,16 +240,22 @@ function install-preferences { # qutebrowser if [ $DEBIAN == 1 ]; then - inst python3-lxml python-tox python3-pyqt5 python3-pyqt5.qtwebkit python3-sip python3-jinja2 python3-pygments python3-yaml + inst python3-lxml python-tox python3-pyqt5 python3-pyqt5.qtwebkit python3-pyqt5.qtquick python3-sip python3-jinja2 python3-pygments python3-yaml TMP_DIR=$(mktemp -d) - $(cd $TMP_DIR; wget --quiet https://qutebrowser.org/python3-pypeg2_2.15.2-1_all.deb) - $(cd $TMP_DIR; wget --quiet https://github.com/The-Compiler/qutebrowser/releases/download/v0.8.4/qutebrowser_0.8.4-1_all.deb) + $(cd $TMP_DIR; wget https://qutebrowser.org/python3-pypeg2_2.15.2-1_all.deb) + $(cd $TMP_DIR; wget https://github.com/qutebrowser/qutebrowser/releases/download/v0.9.1/qutebrowser_0.9.1-2_all.deb) instFile $TMP_DIR/*.deb rm -rf $TMP_DIR elif [ $ARCH == 1 ]; then altInst qutebrowser fi + + if [ $DEBIAN == 1 ]; then + inst vim-gtk + else + inst gvim + fi fi if [ $EXTRA == 1 ]; then From d24a04cc3a758f22cd0a2de458950d4b0745d8cf Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Tue, 7 Feb 2017 09:36:25 +0100 Subject: [PATCH 05/44] Used for some failed test --- scripts/debloc.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/scripts/debloc.sh b/scripts/debloc.sh index a4e2c2f..b365047 100755 --- a/scripts/debloc.sh +++ b/scripts/debloc.sh @@ -23,13 +23,16 @@ fi mkdir -p $DEBLOC_DB &> /dev/null mkdir -p $DEBLOC_ROOT &> /dev/null -export PATH="$DEBLOC_ROOT/usr/bin:$DEBLOC_ROOT/usr/games/:$DEBLOC_ROOT/usr/lib/git-core:$PATH" -export LIBRARY_PATH="$DEBLOC_LD:$LIBRARY_PATH" -export C_INCLUDE_PATH="$DEBLOC_ROOT/usr/include:$C_INCLUDE_PATH" -export CPLUS_INCLUDE_PATH="$DEBLOC_ROOT/usr/include:$CPLUS_INCLUDE_PATH" -export LD_LIBRARY_PATH="$DEBLOC_LD:$LD_LIBRARY_PATH" -export PYTHONPATH="$DEBLOC_ROOT/usr/lib/python3/dist-packages:$PYTHONPATH" -export QT_QPA_PLATFORM_PLUGIN_PATH="$DEBLOC_ROOT/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms" +function _debloc-setVars { + export PATH="$1/usr/bin:$1/usr/games/:$1/usr/lib/git-core:$PATH" + export LIBRARY_PATH="$2:$LIBRARY_PATH" + export C_INCLUDE_PATH="$1/usr/include:$C_INCLUDE_PATH" + export CPLUS_INCLUDE_PATH="$1/usr/include:$CPLUS_INCLUDE_PATH" + export LD_LIBRARY_PATH="$2:$LD_LIBRARY_PATH" + export PYTHONPATH="$1/usr/lib/python3/dist-packages:$PYTHONPATH" + export QT_QPA_PLATFORM_PLUGIN_PATH="$1/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms" +} +_debloc-setVars "$DEBLOC_ROOT" "$DEBLOC_LD" # Tell if a package exists function _debloc-exists { # package From 93ca57c9a3c36def40b6758410ef7f91258d9d7f Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Sat, 11 Feb 2017 16:22:44 +0100 Subject: [PATCH 06/44] Screen filter --- config/i3/config | 15 +++++++++++++++ scripts/installPreferences.sh | 11 +++++++++++ 2 files changed, 26 insertions(+) diff --git a/config/i3/config b/config/i3/config index e18e78f..1206aeb 100644 --- a/config/i3/config +++ b/config/i3/config @@ -342,6 +342,21 @@ mode "$mode_screen_HDMI1" { bindsym Escape mode "default" } +bindsym $mod+y mode "$mode_temp" +set $mode_temp Temperature [R] Red [D] Dust storm [C] Campfire [O] Normal [A] All nighter [B] Blue +mode "$mode_temp" { + bindsym r exec sct 1000 + bindsym d exec sct 2000 + bindsym c exec sct 4500 + bindsym o exec sct + bindsym a exec sct 8000 + bindsym b exec sct 10000 + + # back to normal: Enter or Escape + bindsym Return mode "default" + bindsym Escape mode "default" +} + # Start i3bar to display a workspace bar (plus the system information i3status if available) bar { #i3bar_command ~/.config/lemonbar/i3_lemonbar.sh diff --git a/scripts/installPreferences.sh b/scripts/installPreferences.sh index 0382de2..ae93ecc 100755 --- a/scripts/installPreferences.sh +++ b/scripts/installPreferences.sh @@ -251,6 +251,17 @@ function install-preferences { elif [ $ARCH == 1 ]; then altInst qutebrowser fi + + # Screen filter + if [ $ARCH == 1 ]; then + altInst sct + elif [ $DEBIAN == 1 ]; then + if [ ! -f $DEBLOC_ROOT/usr/bin/sct ]; then + TMP=$(mktemp) + wget http://www.tedunangst.com/flak/files/sct.c -O $TMP + cc -std=c99 -O2 -I /usr/X11R6/include -o $DEBLOC_ROOT/usr/bin/sct $TMP -L /usr/X11R6/lib -lm -lX11 -lXrandr + fi + fi fi if [ $EXTRA == 1 ]; then From 105f34ca50237f9fa65d4b37329e5f1445e99f27 Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Sun, 12 Feb 2017 07:45:14 +0100 Subject: [PATCH 07/44] Monokai Well, this is the only theme I found that had a correct vim plugin and had enough contrast (this is important for me). The dark-brown background is a bit sadder than the blue one I might revert to solarized at one moment or another. --- Xresources | 2 +- Xresources.d/Xresources.dark | 56 ----------------------------------- Xresources.d/configure | 2 -- Xresources.d/solarized.dark | 56 ----------------------------------- Xresources.d/solarized.light | 56 ----------------------------------- Xresources.d/theme | 36 ++++++++++++++++++++++ bashrc | 38 +++++++++--------------- config/htop/htoprc | 2 +- config/i3/config | 48 +++++++++++++++++++++++------- config/linuxColors.sh | 24 +++++++++++++++ profile | 5 ++++ scripts/installPreferences.sh | 7 ++++- vimrc | 16 ++++++---- 13 files changed, 134 insertions(+), 214 deletions(-) delete mode 100644 Xresources.d/Xresources.dark delete mode 100644 Xresources.d/solarized.dark delete mode 100644 Xresources.d/solarized.light create mode 100644 Xresources.d/theme create mode 100644 config/linuxColors.sh diff --git a/Xresources b/Xresources index 91664a9..ebdba57 100644 --- a/Xresources +++ b/Xresources @@ -1,3 +1,3 @@ #include ".Xresources.d/xft" -#include ".Xresources.d/solarized.dark" +#include ".Xresources.d/theme" #include ".Xresources.d/xterm" diff --git a/Xresources.d/Xresources.dark b/Xresources.d/Xresources.dark deleted file mode 100644 index 6db1ab8..0000000 --- a/Xresources.d/Xresources.dark +++ /dev/null @@ -1,56 +0,0 @@ -#define S_base03 #002b36 -#define S_base02 #073642 -#define S_base01 #586e75 -#define S_base00 #657b83 -#define S_base0 #839496 -#define S_base1 #93a1a1 -#define S_base2 #eee8d5 -#define S_base3 #fdf6e3 - -*background: S_base03 -*foreground: S_base0 -*fadeColor: S_base03 -*cursorColor: S_base1 -*pointerColorBackground:S_base01 -*pointerColorForeground:S_base1 - -#define S_yellow #b58900 -#define S_orange #cb4b16 -#define S_red #dc322f -#define S_magenta #d33682 -#define S_violet #6c71c4 -#define S_blue #268bd2 -#define S_cyan #2aa198 -#define S_green #859900 - -!! black dark/light -*color0: S_base02 -*color8: S_base03 - -!! red dark/light -*color1: S_red -*color9: S_orange - -!! green dark/light -*color2: S_green -*color10: S_base01 - -!! yellow dark/light -*color3: S_yellow -*color11: S_base00 - -!! blue dark/light -*color4: S_blue -*color12: S_base0 - -!! magenta dark/light -*color5: S_magenta -*color13: S_violet - -!! cyan dark/light -*color6: S_cyan -*color14: S_base1 - -!! white dark/light -*color7: S_base2 -*color15: S_base3 diff --git a/Xresources.d/configure b/Xresources.d/configure index b22a5f0..4c312ed 100755 --- a/Xresources.d/configure +++ b/Xresources.d/configure @@ -1,7 +1,5 @@ #!/usr/bin/env bash -wget "https://raw.githubusercontent.com/solarized/xresources/master/Xresources.light" -O solarized.light -wget "https://raw.githubusercontent.com/solarized/xresources/master/Xresources.dark" -O solarized.dark mkdir -p $HOME/.local/share/fonts echo $(for i in "" "%20Bold" "%20Oblique" "%20Bold%20Oblique"; do cd $HOME/.local/share/fonts diff --git a/Xresources.d/solarized.dark b/Xresources.d/solarized.dark deleted file mode 100644 index 6db1ab8..0000000 --- a/Xresources.d/solarized.dark +++ /dev/null @@ -1,56 +0,0 @@ -#define S_base03 #002b36 -#define S_base02 #073642 -#define S_base01 #586e75 -#define S_base00 #657b83 -#define S_base0 #839496 -#define S_base1 #93a1a1 -#define S_base2 #eee8d5 -#define S_base3 #fdf6e3 - -*background: S_base03 -*foreground: S_base0 -*fadeColor: S_base03 -*cursorColor: S_base1 -*pointerColorBackground:S_base01 -*pointerColorForeground:S_base1 - -#define S_yellow #b58900 -#define S_orange #cb4b16 -#define S_red #dc322f -#define S_magenta #d33682 -#define S_violet #6c71c4 -#define S_blue #268bd2 -#define S_cyan #2aa198 -#define S_green #859900 - -!! black dark/light -*color0: S_base02 -*color8: S_base03 - -!! red dark/light -*color1: S_red -*color9: S_orange - -!! green dark/light -*color2: S_green -*color10: S_base01 - -!! yellow dark/light -*color3: S_yellow -*color11: S_base00 - -!! blue dark/light -*color4: S_blue -*color12: S_base0 - -!! magenta dark/light -*color5: S_magenta -*color13: S_violet - -!! cyan dark/light -*color6: S_cyan -*color14: S_base1 - -!! white dark/light -*color7: S_base2 -*color15: S_base3 diff --git a/Xresources.d/solarized.light b/Xresources.d/solarized.light deleted file mode 100644 index 75f4497..0000000 --- a/Xresources.d/solarized.light +++ /dev/null @@ -1,56 +0,0 @@ -#define S_base03 #002b36 -#define S_base02 #073642 -#define S_base01 #586e75 -#define S_base00 #657b83 -#define S_base0 #839496 -#define S_base1 #93a1a1 -#define S_base2 #eee8d5 -#define S_base3 #fdf6e3 - -*background: S_base3 -*foreground: S_base00 -*fadeColor: S_base3 -*cursorColor: S_base01 -*pointerColorBackground:S_base1 -*pointerColorForeground:S_base01 - -#define S_yellow #b58900 -#define S_orange #cb4b16 -#define S_red #dc322f -#define S_magenta #d33682 -#define S_violet #6c71c4 -#define S_blue #268bd2 -#define S_cyan #2aa198 -#define S_green #859900 - -!! black dark/light -*color0: S_base02 -*color8: S_base03 - -!! red dark/light -*color1: S_red -*color9: S_orange - -!! green dark/light -*color2: S_green -*color10: S_base01 - -!! yellow dark/light -*color3: S_yellow -*color11: S_base00 - -!! blue dark/light -*color4: S_blue -*color12: S_base0 - -!! magenta dark/light -*color5: S_magenta -*color13: S_violet - -!! cyan dark/light -*color6: S_cyan -*color14: S_base1 - -!! white dark/light -*color7: S_base2 -*color15: S_base3 diff --git a/Xresources.d/theme b/Xresources.d/theme new file mode 100644 index 0000000..d60c7b3 --- /dev/null +++ b/Xresources.d/theme @@ -0,0 +1,36 @@ +! special +*.foreground: #f1ebeb +*.background: #272822 +*.cursorColor: #f1ebeb + +! black +*.color0: #48483e +*.color8: #76715e + +! red +*.color1: #dc2566 +*.color9: #fa2772 + +! green +*.color2: #8fc029 +*.color10: #a7e22e + +! yellow +*.color3: #d4c96e +*.color11: #e7db75 + +! blue +*.color4: #55bcce +*.color12: #66d9ee + +! magenta +*.color5: #9358fe +*.color13: #ae82ff + +! cyan +*.color6: #56b7a5 +*.color14: #66efd5 + +! white +*.color7: #acada1 +*.color15: #cfd0c2 diff --git a/bashrc b/bashrc index 7ca1482..e9d474c 100644 --- a/bashrc +++ b/bashrc @@ -84,30 +84,8 @@ alias pacman='pacman --color auto' alias x='startx; logout' alias s='sudo -s -E' -# Solarized theme for tty, the dark version. -# Based on: -# - Solarized (http://ethanschoonover.com/solarized) -# - Xresources from http://github.com/altercation/solarized -# Generated with pty2tty.awk by Joep van Delft -# http://github.com/joepvd/tty-solarized -if [ "$TERM" = "linux" ]; then - echo -en "\e]PB657b83" # S_base00 - echo -en "\e]PA586e75" # S_base01 - echo -en "\e]P0073642" # S_base02 - echo -en "\e]P62aa198" # S_cyan - echo -en "\e]P8002b36" # S_base03 - echo -en "\e]P2859900" # S_green - echo -en "\e]P5d33682" # S_magenta - echo -en "\e]P1dc322f" # S_red - echo -en "\e]PC839496" # S_base0 - echo -en "\e]PE93a1a1" # S_base1 - echo -en "\e]P9cb4b16" # S_orange - echo -en "\e]P7eee8d5" # S_base2 - echo -en "\e]P4268bd2" # S_blue - echo -en "\e]P3b58900" # S_yellow - echo -en "\e]PFfdf6e3" # S_base3 - echo -en "\e]PD6c71c4" # S_violet - clear # against bg artifacts +if which gopass &> /dev/null; then + alias pass='gopass' fi # Utils @@ -144,3 +122,15 @@ function dafont { alias nw="sudo systemctl restart NetworkManager" +# Clears everything it can to save space +function emergency-space { + rm -rf $HOME/.cache + if which pacman &> /dev/null; then + sudo pacman -Scc + elif which apt-get &> /deb/null; then + sudo apt-get clean + fi + if which journalctl &> /dev/null; then + sudo journalctl --vacuum-size=100M + fi +} diff --git a/config/htop/htoprc b/config/htop/htoprc index 882a239..51bf9c4 100644 --- a/config/htop/htoprc +++ b/config/htop/htoprc @@ -1,7 +1,7 @@ # Beware! This file is rewritten by htop when settings are changed in the interface. # The parser is also very primitive, and not human-friendly. fields=0 48 17 18 38 39 40 2 46 47 49 1 -sort_key=46 +sort_key=47 sort_direction=1 hide_threads=0 hide_kernel_threads=0 diff --git a/config/i3/config b/config/i3/config index 1206aeb..ece5de8 100644 --- a/config/i3/config +++ b/config/i3/config @@ -357,6 +357,26 @@ mode "$mode_temp" { bindsym Escape mode "default" } +# Colors +set $bg #272822 +set $fg #f1ebeb +set $00 #48483e +set $01 #dc2566 +set $02 #8fc029 +set $03 #d4c96e +set $04 #55bcce +set $05 #9358fe +set $06 #56b7a5 +set $07 #acada1 +set $08 #76715e +set $09 #fa2772 +set $10 #a7e22e +set $11 #e7db75 +set $12 #66d9ee +set $13 #ae82ff +set $14 #66efd5 +set $15 #cfd0c2 + # Start i3bar to display a workspace bar (plus the system information i3status if available) bar { #i3bar_command ~/.config/lemonbar/i3_lemonbar.sh @@ -367,13 +387,13 @@ bar { font pango:DejaVu Sans Mono 9 font pango:Sans 8 colors { - separator #4E9C00 - background #333333 - statusline #FFFFFF - focused_workspace #4E9C00 #4E9C00 #FFFFFF - active_workspace #333333 #333333 #FFFFFF - inactive_workspace #333333 #222222 #888888 - urgent_workspace #C20000 #C20000 #FFFFFF + separator $08 + background $00 + statusline $fg + focused_workspace $02 $02 $bg + active_workspace $00 $03 $08 + inactive_workspace $00 $08 $fg + urgent_workspace $00 $01 $fg } } @@ -402,8 +422,14 @@ exec --no-startup-id $HOME/.config/i3/clipmenud # Clipboard manager #exec --no-startup-id evolution #exec --no-startup-id pidgin +set $ignore #ff00000 + # Theme colors -client.focused #4E9C00 #4E9C00 #FFFFFF #FFFFFF -client.focused_inactive #1B3600 #1B3600 #888888 #FFFFFF -client.unfocused #333333 #333333 #888888 #FFFFFF -client.urgent #C20000 #C20000 #FFFFFF #FFFFFF +# class border backgr. text indicator child_border +client.focused $02 $02 $bg $07 $10 +client.focused_inactive $03 $03 $08 $15 $14 +client.unfocused $08 $08 $fg $11 $00 +client.urgent $01 $01 $fg $05 $09 +client.placeholder $ignore $06 $fg $ignore $14 + +client.background $15 diff --git a/config/linuxColors.sh b/config/linuxColors.sh new file mode 100644 index 0000000..192b39a --- /dev/null +++ b/config/linuxColors.sh @@ -0,0 +1,24 @@ +#!/bin/sh +if [ "$TERM" = "linux" ]; then + /bin/echo -e " + \e]P048483e + \e]P1dc2566 + \e]P28fc029 + \e]P3d4c96e + \e]P455bcce + \e]P59358fe + \e]P656b7a5 + \e]P7acada1 + \e]P876715e + \e]P9fa2772 + \e]PAa7e22e + \e]PBe7db75 + \e]PC66d9ee + \e]PDae82ff + \e]PE66efd5 + \e]PFcfd0c2 + " + # get rid of artifacts + clear +fi + diff --git a/profile b/profile index 88e06de..3b65b5e 100644 --- a/profile +++ b/profile @@ -5,4 +5,9 @@ if [ -z "$SSH_AUTH_SOCK" ] ; then eval `ssh-agent -s` > /dev/null fi +if [ -f "$HOME/.config/linuxColors.sh" ]; then + source "$HOME/.config/linuxColors.sh" +fi + + [[ -f ~/.bashrc ]] && . ~/.bashrc diff --git a/scripts/installPreferences.sh b/scripts/installPreferences.sh index ae93ecc..a34e2de 100755 --- a/scripts/installPreferences.sh +++ b/scripts/installPreferences.sh @@ -176,7 +176,12 @@ function install-preferences { inst tsu fi fi - inst moreutils screen ncdu lsof htop proxytunnel pass pv curl wget sshfs netcat + inst moreutils screen ncdu lsof htop proxytunnel pv curl wget sshfs netcat mosh + if [ $ARCH == 1 ]; then + inst gopass + else + inst pass + fi if [[ $ARCH == 1 && $ROOT == 1 ]]; then inst pkgfile systemctl enable pkgfile-update.timer diff --git a/vimrc b/vimrc index 72b3a5c..b79815c 100644 --- a/vimrc +++ b/vimrc @@ -13,7 +13,7 @@ Plugin 'gmarik/Vundle.vim' Plugin 'L9' Plugin 'rstacruz/sparkup', {'rtp': 'vim/'} -Plugin 'altercation/vim-colors-solarized' +Plugin 'tomasr/molokai' Bundle 'Shougo/neosnippet' Bundle 'Shougo/neosnippet-snippets' Plugin 'tpope/vim-surround' @@ -24,8 +24,8 @@ Plugin 'vim-airline/vim-airline-themes' Plugin 'airblade/vim-gitgutter' Plugin 'kien/ctrlp.vim' Plugin 'mbbill/undotree' -Plugin 'scrooloose/nerdtree' -Plugin 'Xuyuanp/nerdtree-git-plugin' +"Plugin 'scrooloose/nerdtree' +"Plugin 'Xuyuanp/nerdtree-git-plugin' Plugin 'xolox/vim-misc' Plugin 'xolox/vim-easytags' Plugin 'majutsushi/tagbar' @@ -33,7 +33,9 @@ Plugin 'majutsushi/tagbar' Plugin 'wellle/targets.vim' Plugin 'Chiel92/vim-autoformat' Plugin 'Valloric/YouCompleteMe' -Plugin 'Raimondi/delimitMate' +"Plugin 'Raimondi/delimitMate' +"Plugin 'Cocophotos/vim-ycm-latex-semantic-completer' +"Plugin 'IN3D/vim-raml' call vundle#end() " required filetype plugin indent on " required @@ -57,6 +59,7 @@ let g:airline#extensions#tabline#enabled = 1 let g:airline_section_a = airline#section#create(['mode']) let g:airline_section_b = airline#section#create(['branch', 'hunks']) let g:airline_section_z = airline#section#create(['%B', '@', '%l', ':', '%c']) +let g:airline_theme = 'wombat' """ NERDTREE-GIT-PLUGIN """ @@ -111,9 +114,10 @@ set cursorcolumn syntax enable +"set t_Co=256 +"let g:molokai_original = 1 set background=dark -set t_Co=256 -colorscheme solarized +colorscheme molokai " From http://stackoverflow.com/a/5004785/2766106 set list From 0120c00ff33a974ac564cffdc86bbde2cf92af44 Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Sun, 12 Feb 2017 08:46:54 +0100 Subject: [PATCH 08/44] Thingies --- scripts/installPreferences.sh | 26 +++++++++++++++----------- vimrc | 2 +- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/scripts/installPreferences.sh b/scripts/installPreferences.sh index 889e3b9..43b51fc 100755 --- a/scripts/installPreferences.sh +++ b/scripts/installPreferences.sh @@ -189,14 +189,14 @@ function install-preferences { else inst make fi - inst git cmake clang llvm + inst git # Text editor if [ $TERMUX == 1 ]; then inst vim-python elif [ $DEBIAN == 1 ]; then - inst vim-youcompleteme + inst vim-nox ln -s $DEBLOC_ROOT/usr/bin/vim{.nox,} else inst vim @@ -210,16 +210,17 @@ function install-preferences { vim +PluginInstall +qall # YouCompleteMe (vim plugin) - if [ $DEBIAN != 1 ]; then - if [ $DEBIAN == 1 || $TERMUX == 1 ]; then - inst python-dev python3-dev - fi - local YCM_ARGS="" - if [ $TERMUX == 0 ]; then - YCM_ARGS="$YCM_ARGS --clang-completer --tern-completer" - fi - python $HOME/.vim/bundle/YouCompleteMe/install.py $YCM_ARGS + if [[ $DEBIAN == 1 || $TERMUX == 1 ]]; then + inst python-dev python3-dev libxml2-dev libxslt-dev fi + local YCM_ARGS="" + if [ $TERMUX != 1 ]; then + YCM_ARGS="$YCM_ARGS --clang-completer --tern-completer" + fi + if [[ $DEBIAN == 1 && $ADMIN == 0 ]]; then + export CPLUS_INCLUDE_PATH="$DEBLOC_ROOT/usr/include/python2.7/:$DEBLOC_ROOT/usr/include/x86_64-linux-gnu/python2.7/:$CPLUS_INCLUDE_PATH" + fi + python $HOME/.vim/bundle/YouCompleteMe/install.py $YCM_ARGS # Common GUI @@ -259,6 +260,9 @@ function install-preferences { fi if [ $EXTRA == 1 ]; then + # Extra dev + inst cmake clang llvm + # Extra CLI inst sl ffmpeg youtube-dl diff --git a/vimrc b/vimrc index 72b3a5c..a768c2b 100644 --- a/vimrc +++ b/vimrc @@ -33,7 +33,7 @@ Plugin 'majutsushi/tagbar' Plugin 'wellle/targets.vim' Plugin 'Chiel92/vim-autoformat' Plugin 'Valloric/YouCompleteMe' -Plugin 'Raimondi/delimitMate' +"Plugin 'Raimondi/delimitMate' call vundle#end() " required filetype plugin indent on " required From 1c14947329abe4acad9217fe87a47f1ca273b55f Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Sun, 12 Feb 2017 11:41:03 +0100 Subject: [PATCH 09/44] Everything as scripts and no more as functions! MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bashrc load time : 0.049s → 0.016s --- bashrc | 181 +++++------- scripts/svgo.yml => config/optiSvgo.yml | 0 profile | 14 +- scripts/{beep.sh => beep} | 0 scripts/cleandev | 16 + scripts/dafont | 8 + scripts/{debloc.sh => debloc} | 117 ++++++-- scripts/{dotfiles.sh => dotfiles} | 51 +++- scripts/emergency-clean | 13 + scripts/index.sh | 10 - scripts/install-arch | 106 +++++++ scripts/install-prefs | 294 +++++++++++++++++++ scripts/installArch.sh | 111 ------- scripts/installPreferences.sh | 294 ------------------- scripts/{machines.sh => machines} | 371 ++++++++++++++++-------- scripts/{optimize.sh => optimize} | 2 +- scripts/proxy | 88 ++++++ scripts/proxy.sh | 44 --- scripts/tunnel | 5 + 19 files changed, 1007 insertions(+), 718 deletions(-) rename scripts/svgo.yml => config/optiSvgo.yml (100%) rename scripts/{beep.sh => beep} (100%) create mode 100755 scripts/cleandev create mode 100755 scripts/dafont rename scripts/{debloc.sh => debloc} (69%) rename scripts/{dotfiles.sh => dotfiles} (84%) create mode 100755 scripts/emergency-clean delete mode 100755 scripts/index.sh create mode 100755 scripts/install-arch create mode 100755 scripts/install-prefs delete mode 100755 scripts/installArch.sh delete mode 100755 scripts/installPreferences.sh rename scripts/{machines.sh => machines} (58%) rename scripts/{optimize.sh => optimize} (98%) create mode 100755 scripts/proxy delete mode 100755 scripts/proxy.sh diff --git a/bashrc b/bashrc index c881c28..35a3cba 100644 --- a/bashrc +++ b/bashrc @@ -1,61 +1,68 @@ -# Custom scripts +# +# ~/.bashrc +# +# ENVIRONMENT VARIABLES - -#find ~/.scripts/ ~/.gscripts/ -type f -name "*.sh" | while read script; do - #source "$script" -#done -[ -f ~/.scripts/index.sh ] && source ~/.scripts/index.sh -[ -f ~/.gscripts/index.sh ] && source ~/.gscripts/index.sh - -# Prompt -if [[ $USER == 'root' ]]; then - col=31; -elif [[ -n $ME ]]; then # $ME is a var set by my private config that is not empty if it is my account (and not a system account e.g. `git`) - col=32; -else - col=33; -fi - -export USER=$(whoami) -PS1="\[\e]2;\u@\h \w\a\]\[\e[0;37m\][\[\e[0;${col}m\]\u\[\e[0;37m\]@\[\e[0;34m\]\h \[\e[0;36m\]\W\[\e[0;37m\]]\$\[\e[0m\] " -PS2="> " -PS3="+ " -PS4="- " - - -# Vars -export PAGER=less -export EDITOR=vim -export VISUAL=vim -export BROWSER=/usr/bin/qutebrowser +# Region preferences +export LANG=fr_FR.utf8 export TZ=/usr/share/zoneinfo/Europe/Paris -export PATH="$PATH" +# Favourite commands +export PAGER=less +export EDITOR=vim +export VISUAL=gvim +export BROWSER=qutebrowser + +# Some programs need those changes if [ -d $HOME/.gem/ruby ]; then - $(which ls) $HOME/.gem/ruby | while read rubyVer; do + ls $HOME/.gem/ruby | while read rubyVer; do export PATH="$PATH:$HOME/.gem/ruby/$rubyVer/bin/" done fi -export PATH="$(echo "$PATH" | sed 's|:|\n|g' | sort | uniq | tr '\n' ':' | sed 's|:$||')" -export LANG=fr_FR.utf8 -export HISTSIZE=10000 -export HISTFILESIZE=${HISTSIZE} -export HISTCONTROL=ignoreboth +#export PATH="$(echo "$PATH" | sed 's|:|\n|g' | sort | uniq | tr '\n' ':' | sed 's|:$||')" export JAVA_FONTS=/usr/share/fonts/TTF export ANDROID_HOME=/opt/android-sdk export GOPATH=$HOME/.go +export XDG_CONFIG_HOME=$HOME/.config -if [ -z $XDG_CONFIG_HOME ]; then - export XDG_CONFIG_HOME=$HOME/.config +# ALIASES + +# Completion for existing commands +export LS_OPTIONS='--group-directories-first --time-style=+"%d/%m/%Y %H:%M" --color=auto --classify --human-readable' +alias ls="ls $LS_OPTIONS" +alias grep='grep --color=tty -d skip' +alias mkdir='mkdir -v' +alias cp="cp -i" +alias mv="mv -iv" +alias dd='dd status=progress' +alias rm='rm -Iv --one-file-system' +alias free='free -m' +alias df='df -h' +alias pacman='pacman --color auto' + +# Shortcuts for commonly used commands +alias ll="ls -l $LS_OPTIONS" +alias la="ls -la $LS_OPTIONS" +alias al=sl +alias x='startx; logout' +alias s='sudo -s -E' +alias po='proxy off' +alias nw="sudo systemctl restart NetworkManager" +alias mc="machines" + +# Superseding commands with better ones if they are present +if which vim &> /dev/null; then + alias vi='vim' +fi +if which gopass &> /dev/null; then + alias pass='gopass' +fi +if which wakeonlan &> /dev/null; then + alias wol='wakeonlan' fi -# Tweaks -[[ $- != *i* ]] && return - -if [ -f /etc/bash_completion ]; then . /etc/bash_completion; fi - -xhost +local:root > /dev/null 2>&1 +# SHELL CUSTOMIZATION complete -cf sudo @@ -68,71 +75,41 @@ shopt -s extglob shopt -s histappend shopt -s hostcomplete -export LS_OPTIONS='--group-directories-first --time-style=+"%d/%m/%Y %H:%M" --color=auto --classify --human-readable' -alias ls="ls $LS_OPTIONS" -alias ll="ls -l $LS_OPTIONS" -alias la="ls -la $LS_OPTIONS" -alias al=sl -alias grep='grep --color=tty -d skip' -alias mkdir='mkdir -v' -alias cp="cp -i" -alias mv="mv -iv" -alias dd='dd status=progress' -alias rm='rm -Iv --one-file-system' -alias free='free -m' -alias df='df -h' -alias 49.3='sudo' -alias pacman='pacman --color auto' -alias x='startx; logout' -alias s='sudo -s -E' +export HISTSIZE=10000 +export HISTFILESIZE=${HISTSIZE} +export HISTCONTROL=ignoreboth -if which gopass &> /dev/null; then - alias pass='gopass' +# PROMPT CUSTOMIZATION + +if [[ $USER == 'root' ]]; then + col=31; +elif [[ $USER == 'geoffrey' || $USER == 'gbontoux' || $USER == 'gpreud' ]]; then + col=32; +else + col=33; fi +PS1="\[\e]2;\u@\h \w\a\]\[\e[0;37m\][\[\e[0;${col}m\]\u\[\e[0;37m\]@\[\e[0;34m\]\h \[\e[0;36m\]\W\[\e[0;37m\]]\$\[\e[0m\] " +PS2="> " +PS3="+ " +PS4="- " -# Utils +# UTILITIES + +# Bash completion +[ -f /etc/bash_completion ] && . /etc/bash_completion + +# Command not found handlers +[ -r /usr/share/doc/pkgfile/command-not-found.bash ] && . /usr/share/doc/pkgfile/command-not-found.bash # Arch +[ -r /etc/profile.d/cnf.sh ] && . /etc/profile.d/cnf.sh # Arch (alternative, for Manjaro mostly) + +# Bad day mood-saver if which thefuck &> /dev/null; then alias fuck='TF_CMD=$(TF_ALIAS=fuck PYTHONIOENCODING=utf-8 TF_SHELL_ALIASES=$(alias) thefuck $(fc -ln -1)) && eval $TF_CMD && history -s $TF_CMD' alias FUCK='fuck' fi +# CUSTOM SCRIPTS -# Command not found -[ -r /usr/share/doc/pkgfile/command-not-found.bash ] && . /usr/share/doc/pkgfile/command-not-found.bash -[ -r /etc/profile.d/cnf.sh ] && . /etc/profile.d/cnf.sh +export PATH="$HOME/.scripts/:$PATH" +[ -f ~/.gscripts/gprofile ] && source ~/.gscripts/gprofile -# Functions -function clean { - find . -type d -name bower_components -or -name node_modules -print0 | while read file; do - rm -rf "$file" - done - find . -type f -name Makefile -print0 | while IFS= read -r -d '' file; do - echo "--> $file" - (cd "${file//Makefile}"; make clean) - done - find . -type d -name .git -print0 | while IFS= read -r -d '' dir; do - echo "--> $file" - (cd "$dir"; git gc) - done -} - -function dafont { - wget "http://dl.dafont.com/dl/?f=$1" -O /tmp/dafont.zip - unzip /tmp/dafont.zip -d ~/.local/share/fonts -x *.txt - rm -rf /tmp/dafont.zip -} - -alias nw="sudo systemctl restart NetworkManager" - -# Clears everything it can to save space -function emergency-space { - rm -rf $HOME/.cache - if which pacman &> /dev/null; then - sudo pacman -Scc - elif which apt-get &> /deb/null; then - sudo apt-get clean - fi - if which journalctl &> /dev/null; then - sudo journalctl --vacuum-size=100M - fi -} diff --git a/scripts/svgo.yml b/config/optiSvgo.yml similarity index 100% rename from scripts/svgo.yml rename to config/optiSvgo.yml diff --git a/profile b/profile index 3b65b5e..fd47441 100644 --- a/profile +++ b/profile @@ -1,13 +1,13 @@ # # ~/.profile # -if [ -z "$SSH_AUTH_SOCK" ] ; then - eval `ssh-agent -s` > /dev/null -fi -if [ -f "$HOME/.config/linuxColors.sh" ]; then - source "$HOME/.config/linuxColors.sh" -fi +# SSH agent +[ -z "$SSH_AUTH_SOCK" ] && eval `ssh-agent -s` &> /dev/null +# TTY Colors +[ -f "$HOME/.config/linuxColors.sh" ] && . "$HOME/.config/linuxColors.sh" -[[ -f ~/.bashrc ]] && . ~/.bashrc +# Bashrc +#[ -f ~/.bashrc ] && . ~/.bashrc +# TODO Is this really useful? diff --git a/scripts/beep.sh b/scripts/beep similarity index 100% rename from scripts/beep.sh rename to scripts/beep diff --git a/scripts/cleandev b/scripts/cleandev new file mode 100755 index 0000000..1beff42 --- /dev/null +++ b/scripts/cleandev @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +# Removes files that can be regenerated +# from a dev environment + +find . -type d -name bower_components -or -name node_modules -print0 | while read file; do + rm -rf "$file" +done +find . -type f -name Makefile -print0 | while IFS= read -r -d '' file; do + echo "--> $file" + (cd "${file//Makefile}"; make clean) +done +find . -type d -name .git -print0 | while IFS= read -r -d '' dir; do + echo "--> $file" + (cd "$dir"; git gc) +done diff --git a/scripts/dafont b/scripts/dafont new file mode 100755 index 0000000..7ab3500 --- /dev/null +++ b/scripts/dafont @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +# Downloads a font from dafont.com and +# extracts it in the user's font dir + +wget "http://dl.dafont.com/dl/?f=$1" -O /tmp/dafont.zip +unzip /tmp/dafont.zip -d ~/.local/share/fonts -x *.txt +rm -rf /tmp/dafont.zip diff --git a/scripts/debloc.sh b/scripts/debloc similarity index 69% rename from scripts/debloc.sh rename to scripts/debloc index b365047..7d45d9c 100755 --- a/scripts/debloc.sh +++ b/scripts/debloc @@ -2,17 +2,15 @@ # Installs Debian packages on a Debian system # with no root access, in the user home -# (sourceable) -if [ ! -f /etc/apt/sources.list ]; then - # Not a Debian system - return 0 +if [[ ! $(which apt &> /dev/null) ]]; then + echo "This is not a Debian system (or apt is not installed)." + exit 1 fi - -ARCH=$(dpkg --print-architecture) -DEBLOC_DB=$HOME/.config/debloc/$ARCH -DEBLOC_ROOT=$HOME/.debloc/$ARCH +[ -z $DEBLOC_PREFIX ] && DEBLOC_PREFIX=$(dpkg --print-architecture) +[ -z $DEBLOC_DB ] && DEBLOC_DB=${XDG_CONFIG_HOME:-$HOME/.config}/$DEBLOC_PREFIX +[ -z $DEBLOC_ROOT ] && DEBLOC_ROOT=$HOME/.debloc/$DEBLOC_PREFIX DEBLOC_LD=$DEBLOC_ROOT/ld if [ -z $DEBIAN_MIRROR ]; then @@ -23,17 +21,6 @@ fi mkdir -p $DEBLOC_DB &> /dev/null mkdir -p $DEBLOC_ROOT &> /dev/null -function _debloc-setVars { - export PATH="$1/usr/bin:$1/usr/games/:$1/usr/lib/git-core:$PATH" - export LIBRARY_PATH="$2:$LIBRARY_PATH" - export C_INCLUDE_PATH="$1/usr/include:$C_INCLUDE_PATH" - export CPLUS_INCLUDE_PATH="$1/usr/include:$CPLUS_INCLUDE_PATH" - export LD_LIBRARY_PATH="$2:$LD_LIBRARY_PATH" - export PYTHONPATH="$1/usr/lib/python3/dist-packages:$PYTHONPATH" - export QT_QPA_PLATFORM_PLUGIN_PATH="$1/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms" -} -_debloc-setVars "$DEBLOC_ROOT" "$DEBLOC_LD" - # Tell if a package exists function _debloc-exists { # package if [[ -n $DEBIAN_DB && -f $DEBIAN_DB ]]; then @@ -242,8 +229,38 @@ function _debloc-installDeps { # package return 0 } -# Install package with dependencies (user version with verifications) -function debloc-install { # package +# USER FUNCTIONS +function debloc_env { + export PATH="$DEBLOC_ROOT/usr/bin:$DEBLOC_ROOT/usr/games/:$DEBLOC_ROOT/usr/lib/git-core:$PATH" + export LIBRARY_PATH="$DEBLOC_LD:$LIBRARY_PATH" + export C_INCLUDE_PATH="$DEBLOC_ROOT/usr/include:$C_INCLUDE_PATH" + export CPLUS_INCLUDE_PATH="$DEBLOC_ROOT/usr/include:$CPLUS_INCLUDE_PATH" + export LD_LIBRARY_PATH="$DEBLOC_LD:$LD_LIBRARY_PATH" + export PYTHONPATH="$DEBLOC_ROOT/usr/lib/python3/dist-packages:$PYTHONPATH" + export QT_QPA_PLATFORM_PLUGIN_PATH="$DEBLOC_ROOT/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms" +} + +function debloc_info { + echo "DEBLOC_PREFIX=$DEBLOC_PREFIX" + echo "DEBLOC_ROOT=$DEBLOC_ROOT" + echo "DEBLOC_DB=$DEBLOC_DB" + echo "DEBLOC_LD=$DEBLOC_LD" + echo "DEBIAN_MIRROR=$DEBIAN_MIRROR" + echo "DEBIAN_DB=$DEBIAN_DB" +} + +function debloc_install_help { + echo "Usage: $0 install PACKAGE" + echo + echo "Arguments:" + echo " PACKAGE Package name" + return 0 +} + +function debloc_install { # package + if [ -z $1 ]; then + debloc_deb_help + fi for pkg in $*; do pkg=$(_debloc-filterVirtual $pkg) _debloc-exists $pkg @@ -267,8 +284,18 @@ function debloc-install { # package } -# Install debian archive (user version with verifications) -function debloc-deb { # path +function debloc_deb_help { + echo "Usage: $0 deb PATH" + echo + echo "Arguments:" + echo " PATH Path to the .deb file" + return 0 +} + +function debloc_deb { # path + if [ -z $1 ]; then + debloc_deb_help + fi for path in $*; do if [ ! -f "$path" ]; then echo "$path is not a file" @@ -281,8 +308,48 @@ function debloc-deb { # path } -# Remove every package installed with Debloc -function debloc-flush { +function debloc_flush { rm -rf $DEBLOC_ROOT/* &> /dev/null rm -f $DEBLOC_DB/* &> /dev/null } + +# TODO Other word for 'fake filesystem' and/or explain what this is +function debloc_help { + command="$1" + if [ -n "$command" ]; then + if type "debloc_${command}_help" &> /dev/null; then + shift + "debloc_${command}_help" "$@" + return $? + fi + fi + echo "Usage: $0 COMMAND" + echo + echo "Commands:" + echo " env Sets the environment variables required to run applications from the fake filesystem" + echo " info Gives some information about the fake filesystem" + echo " install Install a debian package in the fake filesystem" + echo " deb Install from a .deb file in the fake filesystem" + echo " flush Remove every package installed from the fake filesystem" + echo " help Get help with commands" + echo + echo "Environment variables:" + echo " DEBLOC_PREFIX Name of the fake filesystem to use (default: uses dpkg architecture)" + echo " DEBLOC_ROOT Path of the fake filesystem (default: ~/.debloc/\$DEBLOC_PREFIX/)" + echo " DEBLOC_DB Database of the fake filesystem (default: \$XDG_CONFIG_HOME/debloc/\$DEBLOC_PREFIX)" + echo " DEBIAN_MIRROR Multiline list of debian mirror (default: uses /etc/apt/sources.list)" + echo " DEBIAN_DB Path to a file with all packages description (default: uses apt-cache showpkg)" + echo " help Get help with commands" + return 0 +} + +# MAIN + +command="$1" +shift +if type "debloc_$command" &> /dev/null; then + "debloc_$command" "$@" +else + debloc_help +fi + diff --git a/scripts/dotfiles.sh b/scripts/dotfiles similarity index 84% rename from scripts/dotfiles.sh rename to scripts/dotfiles index d811342..c345bbb 100755 --- a/scripts/dotfiles.sh +++ b/scripts/dotfiles @@ -1,9 +1,7 @@ -#!/usrenv bash - +#!/usr/bin/env bash # Handles dotfiles # Yes there are tons of similar scipts yet I wanted no more nor less than what I needed -# (sourceable) # Config @@ -156,7 +154,19 @@ function _dotfiles-install-dir { # dir # Script functions -function dotfiles-link { # file +function dotfiles_link_help { + echo "Usage: $0 link DOTFILE" + echo + echo "Arguments:" + echo " DOTFILE Path to the dotfile" + return 0 + +} +function dotfiles_link { # file + if [ -z $1 ]; then + dotfiles_link_help + return 1 + fi absSource="$(realpath $1 2> /dev/null)" if [[ $? != 0 || ! -e "$absSource" ]]; then echo "[ERROR] $1: no such file or directory" @@ -194,10 +204,41 @@ function dotfiles-link { # file } -function dotfiles-install { +function dotfiles_install { _dotfiles-install-dir / } +function dotfiles_help { + command="$1" + if [ -n "$command" ]; then + if type "dotfiles_${command}_help" &> /dev/null; then + shift + "dotfiles_${command}_help" "$@" + return $? + fi + fi + echo "Usage: $0 COMMAND" + echo + echo "Commands:" + echo " install Install dotfiles from repository" + echo " link Add dotfile to repository" + echo " help Get help with commands" + echo + echo "Environment variables:" + echo " DOTHOME Where to install dotfiles" + echo " DOTREPO Where do the dotfiles comes from" + return 0 +} + +# MAIN +command="$1" +shift +if type "dotfiles_$command" &> /dev/null; then + "dotfiles_$command" "$@" +else + dotfiles_help +fi + # TODO dotfiles-{link,unlink,clean,uninstall}, better handling of DRY_RUN (use functions probably), clarify source/target thingy # Link and Unlink should have a clever behavior regarding # recusive folders diff --git a/scripts/emergency-clean b/scripts/emergency-clean new file mode 100755 index 0000000..be88836 --- /dev/null +++ b/scripts/emergency-clean @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +# Clears everything it can to save space + +rm -rf $HOME/.cache +if which pacman &> /dev/null; then + sudo pacman -Scc +elif which apt-get &> /deb/null; then + sudo apt-get clean +fi +if which journalctl &> /dev/null; then + sudo journalctl --vacuum-size=100M +fi diff --git a/scripts/index.sh b/scripts/index.sh deleted file mode 100755 index 55348d1..0000000 --- a/scripts/index.sh +++ /dev/null @@ -1,10 +0,0 @@ -source ~/.scripts/proxy.sh -source ~/.scripts/machines.sh -source ~/.scripts/debloc.sh -source ~/.scripts/dotfiles.sh -source ~/.scripts/installPreferences.sh -source ~/.scripts/installArch.sh -function optimize { - bash ~/.scripts/optimize.sh -} -alias beep=~/.scripts/beep.sh diff --git a/scripts/install-arch b/scripts/install-arch new file mode 100755 index 0000000..d0cb678 --- /dev/null +++ b/scripts/install-arch @@ -0,0 +1,106 @@ +#!/usr/bin/env bash + +# Setups an Arch Linux system the way I like it +# (requires sudo) + +if which pacman &> /dev/null; then + echo "This is not an Arch Linux system (or pacman isn't installed)" + return 1 +fi + +# Configuration +function prompt { # text + while true; do + read -p "$1 [yn] " yn + case $yn in + [Yy]* ) return 1;; + [Nn]* ) return 0;; + * ) echo "Please answer yes or no.";; + esac + done +} + +# Don't ask for things that are already there +if which yaourt &> /dev/null; then + local YAOURT=1 +fi +if which bauerbill &> /dev/null; then + local BAUERBILL=1 +fi + +if [ -z $YAOURT ]; then + prompt "Do you want yaourt on this machine?" + local YAOURT=$? +fi +if [ $YAOURT == 1 ]; then + if [ -z $BAUERBILL ]; then + prompt "Do you want bauerbill on this machine?" + local BAUERBILL=$? + fi +else + BAUERBILL=0 +fi + +# COMMON + +# Install packages if they aren't installed +function inst { + for pkg in $*; do + pacman -Q $pkg &> /dev/null + if [ $? == 1 ]; then + sudo pacman -S $pkg --noconfirm + fi + done +} + +# Install package from PKGBUILD file +function installPKGBUILD { # url + TMP_DIR="$(mktemp -d /tmp/pkgbuild.XXXXXXXXXX)" + cd "$TMP_DIR" + wget "$1" -O PKGBUILD + makepkg -si + cd - + rm -rf "$TMP_DIR" +} + +# SYSTEM +inst wget + +pacman -Q yaourt &> /dev/null +if [[ $YAOURT == 1 && $? == 1 ]]; then + installPKGBUILD "https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=package-query" + installPKGBUILD "https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=yaourt" +fi + +if pacman -Q pamac ; then + sudo pacman -Rsc pamac +fi + +pacman -Q bauerbill &> /dev/null +if [[ $BAUERBILL == 1 && $? == 1 ]]; then + sudo pacman -Sy manjaro-{hotfixes,keyring,release,system} --noconfirm + + gpg --recv-keys 1D1F0DC78F173680 + installPKGBUILD http://xyne.archlinux.ca/projects/reflector/pkgbuild/PKGBUILD + yaourt -S bauerbill --noconfirm + + bb-wrapper -Su + # TODO Prompt if all went well, if not restart +else + sudo pacman -Syu +fi + +# Disable predictable network names +sudo ln -s /dev/null /etc/udev/rules.d/80-net-setup-link.rules + +# TLP +# sudo pacman -S tlp +# sudo systemctl enable tlp.service tlp-sleep.service +# sudo systemctl disable systemd-rfkill + +# TODO +# make -j8 in MAKEPKG +# time +# nfs +# hibernate + diff --git a/scripts/install-prefs b/scripts/install-prefs new file mode 100755 index 0000000..c601be3 --- /dev/null +++ b/scripts/install-prefs @@ -0,0 +1,294 @@ +#!/usr/bin/env bash + +# Installs user preferences the way I like it + +# Configuration +function prompt { # text + while true; do + read -p "$1 [yn] " yn + case $yn in + [Yy]* ) return 1;; + [Nn]* ) return 0;; + * ) echo "Please answer yes or no.";; + esac + done +} + +# Don't ask for things that are already there +local TERMUX=0 +if [ -d /data/data/com.termux/files ]; then + local TERMUX=1 + local GUI=0 +fi + +if which i3 &> /dev/null; then + local GUI=1 +fi + +if [ -z $ADMIN ]; then + prompt "Are you a superuser on this machine?" + local ADMIN=$? +fi +if [ -z $GUI ]; then + prompt "Do you want a X environment on this machine?" + local GUI=$? +fi +if [ -z $EXTRA ]; then + prompt "Do you want not-so-needed software on this machine?" + local EXTRA=$? +fi + +# TODO Verify if the package exists before installing it + +# System detection +if which pacman &> /dev/null; then + ARCH=1 + if [ $ADMIN == 1 ]; then + sudo pacman -Sy + function installOne { # package + pacman -Q $1 &> /dev/null + if [ $? == 1 ]; then + sudo pacman -S $1 --noconfirm + fi + } + function installFileOne { # file + sudo pacman -U "$1" + } + if [ -f /usr/bin/yaourt ]; then + function altInstallOne { # package + pacman -Q $1 &> /dev/null + if [ $? == 1 ]; then + yaourt -S "$1" --noconfirm + fi + } + else + # Install package from PKGBUILD file + function installPKGBUILD { # url + TMP_DIR="$(mktemp -d /tmp/pkgbuild.XXXXXXXXXX)" + cd "$TMP_DIR" + wget "$1" -O PKGBUILD + makepkg -si + cd - + rm -rf "$TMP_DIR" + } + + function altInstallOne { # package + pacman -Q $1 &> /dev/null + if [ $? == 1 ]; then + installPKGBUILD "https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=$1" + fi + } + fi + else + echo "You're on a Arch System but it's not yours? Did Arch got that popular?" + return 42 + fi + +elif which dpkg &> /dev/null; then + DEBIAN=1 + if [[ $ADMIN == 1 || $TERMUX == 1 ]]; then + if [ $TERMUX == 1 ]; then + DEBIAN=0 + apt update -y + else + sudo apt-get update -y + fi + function installOne { # package + + # Finding out if it's already installed or not + STATUS=$(mktemp) + LANG=C dpkg-query --status $1 &> $STATUS + local installed=0 + if [ $? == 0 ]; then + cat $STATUS | grep '^Status:' | grep ' installed' --quiet + if [ $? == 0 ]; then + installed=1 + fi + fi + rm -f $STATUS > /dev/null + + echo 101 $1 $installed + # Installing if it's not installed + if [ $installed == 0 ]; then + # TODO noconfirm + if [ $TERMUX == 1 ]; then + apt install $1 -y + else + sudo apt-get install $1 -y + fi + fi + } + function installFileOne { # file + dpkg -i "$1" + } + else + function installOne { # package + debloc-install $1 + } + function installFileOne { # file + debloc-deb "$1" + } + fi + function altInstallOne { + echo "[ERROR] There's no alternate installer for this distribution. Can't install $1." + } +else + echo "Uuuh, what kind of distribution is this?" + return 1 +fi + +# Install package with the standard +# package manager for the distribution +function inst { + for pkg in $*; do + installOne $pkg + done +} + +# Install package FILE with the standard +# package manager for the distribution +function instFile { + for pkg in $*; do + installFileOne $pkg + done +} + +# Install package with the alternate +# package manager for the distribution +function altInst { + for pkg in $*; do + altInstallOne $pkg + done +} + + + +# Common CLI + +# Utils +inst grep sed sh tar +if [ $TERMUX == 1 ]; then + inst coreutils man termux-api openssl-tool + if [ $ADMIN == 1 ]; then + inst tsu + fi +fi +inst moreutils screen ncdu lsof htop proxytunnel pv curl wget sshfs netcat mosh +if [ $ARCH == 1 ]; then + inst gopass +else + inst pass +fi +if [[ $ARCH == 1 && $ADMIN == 1 ]]; then + inst pkgfile + systemctl enable pkgfile-update.timer +fi + +# Dev +if [ $DEBIAN == 1 ]; then + inst build-essential +elif [ $ARCH == 1 ]; then + inst base-devel +else + inst make +fi +inst git cmake clang llvm + + +# Text editor +if [ $TERMUX == 1 ]; then + inst vim-python +elif [ $DEBIAN == 1 ]; then + inst vim-youcompleteme + ln -s $DEBLOC_ROOT/usr/bin/vim{.nox,} +else + inst vim +fi +if [ $DEBIAN == 1 ]; then + inst exuberant-ctags +else + inst ctags +fi +git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim +vim +PluginInstall +qall + +# YouCompleteMe (vim plugin) +if [ $DEBIAN != 1 ]; then + if [ $DEBIAN == 1 || $TERMUX == 1 ]; then + inst python-dev python3-dev + fi + local YCM_ARGS="" + if [ $TERMUX == 0 ]; then + YCM_ARGS="$YCM_ARGS --clang-completer --tern-completer" + fi + python $HOME/.vim/bundle/YouCompleteMe/install.py $YCM_ARGS +fi + +# Common GUI + +if [ $GUI == 1 ]; then + # Desktop manager + inst i3 i3lock i3status dunst unclutter xautolock feh numlockx scrot + if [ $DEBIAN == 1 ]; then + inst suckless-tools + if [ $ADMIN == 0 ]; then + ln -s $DEBLOC_ROOT/usr/bin/dmenu{.xft,} + fi + else + inst dmenu + fi + if [ "$(source /etc/os-release; echo $NAME)" == "Manjaro Linux" ]; then + inst menda-themes menda-circle-icon-theme xcursor-menda + fi + + # qutebrowser + if [ $DEBIAN == 1 ]; then + inst python3-lxml python-tox python3-pyqt5 python3-pyqt5.qtwebkit python3-pyqt5.qtquick python3-sip python3-jinja2 python3-pygments python3-yaml + TMP_DIR=$(mktemp -d) + $(cd $TMP_DIR; wget https://qutebrowser.org/python3-pypeg2_2.15.2-1_all.deb) + $(cd $TMP_DIR; wget https://github.com/qutebrowser/qutebrowser/releases/download/v0.9.1/qutebrowser_0.9.1-2_all.deb) + instFile $TMP_DIR/*.deb + rm -rf $TMP_DIR + + elif [ $ARCH == 1 ]; then + altInst qutebrowser + fi + + # Screen filter + if [ $ARCH == 1 ]; then + altInst sct + elif [ $DEBIAN == 1 ]; then + if [ ! -f $DEBLOC_ROOT/usr/bin/sct ]; then + TMP=$(mktemp) + wget http://www.tedunangst.com/flak/files/sct.c -O $TMP + cc -std=c99 -O2 -I /usr/X11R6/include -o $DEBLOC_ROOT/usr/bin/sct $TMP -L /usr/X11R6/lib -lm -lX11 -lXrandr + fi + fi + + # Graphical vim + if [ $DEBIAN == 1 ]; then + inst vim-gtk + else + inst gvim + fi +fi + +if [ $EXTRA == 1 ]; then + # Extra CLI + inst sl ffmpeg youtube-dl + + if [ $ARCH == 1 ]; then + altInst pdftk + fi + + # Extra GUI + if [ $GUI == 1 ]; then + inst vlc gimp mpd vimpc + + if [ $ARCH == 1 ]; then + inst simplescreenrecorder + fi + + fi +fi + diff --git a/scripts/installArch.sh b/scripts/installArch.sh deleted file mode 100755 index 1be25b2..0000000 --- a/scripts/installArch.sh +++ /dev/null @@ -1,111 +0,0 @@ -#!/usr/bin/env bash - -# Setups an Arch Linux system the way I like it -# (sourceable, requires sudo) - -if which pacman &> /dev/null; then - # Not an Arch system - return 0 -fi - -# Configuration - -function install-arch { - - # Configuration - function prompt { # text - while true; do - read -p "$1 [yn] " yn - case $yn in - [Yy]* ) return 1;; - [Nn]* ) return 0;; - * ) echo "Please answer yes or no.";; - esac - done - } - - # Don't ask for things that are already there - if which yaourt &> /dev/null; then - local YAOURT=1 - fi - if which bauerbill &> /dev/null; then - local BAUERBILL=1 - fi - - if [ -z $YAOURT ]; then - prompt "Do you want yaourt on this machine?" - local YAOURT=$? - fi - if [ $YAOURT == 1 ]; then - if [ -z $BAUERBILL ]; then - prompt "Do you want bauerbill on this machine?" - local BAUERBILL=$? - fi - else - BAUERBILL=0 - fi - - # COMMON - - # Install packages if they aren't installed - function inst { - for pkg in $*; do - pacman -Q $pkg &> /dev/null - if [ $? == 1 ]; then - sudo pacman -S $pkg --noconfirm - fi - done - } - - # Install package from PKGBUILD file - function installPKGBUILD { # url - TMP_DIR="$(mktemp -d /tmp/pkgbuild.XXXXXXXXXX)" - cd "$TMP_DIR" - wget "$1" -O PKGBUILD - makepkg -si - cd - - rm -rf "$TMP_DIR" - } - - # SYSTEM - inst wget - - pacman -Q yaourt &> /dev/null - if [[ $YAOURT == 1 && $? == 1 ]]; then - installPKGBUILD "https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=package-query" - installPKGBUILD "https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=yaourt" - fi - - if pacman -Q pamac ; then - sudo pacman -Rsc pamac - fi - - pacman -Q bauerbill &> /dev/null - if [[ $BAUERBILL == 1 && $? == 1 ]]; then - sudo pacman -Sy manjaro-{hotfixes,keyring,release,system} --noconfirm - - gpg --recv-keys 1D1F0DC78F173680 - installPKGBUILD http://xyne.archlinux.ca/projects/reflector/pkgbuild/PKGBUILD - yaourt -S bauerbill --noconfirm - - bb-wrapper -Su - # TODO Prompt if all went well, if not restart - else - sudo pacman -Syu - fi - - # Disable predictable network names - sudo ln -s /dev/null /etc/udev/rules.d/80-net-setup-link.rules - - # TLP - # sudo pacman -S tlp - # sudo systemctl enable tlp.service tlp-sleep.service - # sudo systemctl disable systemd-rfkill - - # TODO - # make -j8 in MAKEPKG - # time - # nfs - # hibernate - -} diff --git a/scripts/installPreferences.sh b/scripts/installPreferences.sh deleted file mode 100755 index 593d776..0000000 --- a/scripts/installPreferences.sh +++ /dev/null @@ -1,294 +0,0 @@ -#!/usr/bin/env bash - -# Installs user preferences the way I like it -# (sourceable) - -function install-preferences { - # Configuration - function prompt { # text - while true; do - read -p "$1 [yn] " yn - case $yn in - [Yy]* ) return 1;; - [Nn]* ) return 0;; - * ) echo "Please answer yes or no.";; - esac - done - } - - # Don't ask for things that are already there - local TERMUX=0 - if [ -d /data/data/com.termux/files ]; then - local TERMUX=1 - local GUI=0 - fi - - if which i3 &> /dev/null; then - local GUI=1 - fi - - if [ -z $ADMIN ]; then - prompt "Are you a superuser on this machine?" - local ADMIN=$? - fi - if [ -z $GUI ]; then - prompt "Do you want a X environment on this machine?" - local GUI=$? - fi - if [ -z $EXTRA ]; then - prompt "Do you want not-so-needed software on this machine?" - local EXTRA=$? - fi - - # TODO Verify if the package exists before installing it - - # System detection - if which pacman &> /dev/null; then - ARCH=1 - if [ $ADMIN == 1 ]; then - sudo pacman -Sy - function installOne { # package - pacman -Q $1 &> /dev/null - if [ $? == 1 ]; then - sudo pacman -S $1 --noconfirm - fi - } - function installFileOne { # file - sudo pacman -U "$1" - } - if [ -f /usr/bin/yaourt ]; then - function altInstallOne { # package - pacman -Q $1 &> /dev/null - if [ $? == 1 ]; then - yaourt -S "$1" --noconfirm - fi - } - else - # Install package from PKGBUILD file - function installPKGBUILD { # url - TMP_DIR="$(mktemp -d /tmp/pkgbuild.XXXXXXXXXX)" - cd "$TMP_DIR" - wget "$1" -O PKGBUILD - makepkg -si - cd - - rm -rf "$TMP_DIR" - } - - function altInstallOne { # package - pacman -Q $1 &> /dev/null - if [ $? == 1 ]; then - installPKGBUILD "https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=$1" - fi - } - fi - else - echo "You're on a Arch System but it's not yours? Did Arch got that popular?" - return 42 - fi - - elif which dpkg &> /dev/null; then - DEBIAN=1 - if [[ $ADMIN == 1 || $TERMUX == 1 ]]; then - if [ $TERMUX == 1 ]; then - DEBIAN=0 - apt update -y - else - sudo apt-get update -y - fi - function installOne { # package - - # Finding out if it's already installed or not - STATUS=$(mktemp) - LANG=C dpkg-query --status $1 &> $STATUS - local installed=0 - if [ $? == 0 ]; then - cat $STATUS | grep '^Status:' | grep ' installed' --quiet - if [ $? == 0 ]; then - installed=1 - fi - fi - rm -f $STATUS > /dev/null - - echo 101 $1 $installed - # Installing if it's not installed - if [ $installed == 0 ]; then - # TODO noconfirm - if [ $TERMUX == 1 ]; then - apt install $1 -y - else - sudo apt-get install $1 -y - fi - fi - } - function installFileOne { # file - dpkg -i "$1" - } - else - function installOne { # package - debloc-install $1 - } - function installFileOne { # file - debloc-deb "$1" - } - fi - function altInstallOne { - echo "[ERROR] There's no alternate installer for this distribution. Can't install $1." - } - else - echo "Uuuh, what kind of distribution is this?" - return 1 - fi - - # Install package with the standard - # package manager for the distribution - function inst { - for pkg in $*; do - installOne $pkg - done - } - - # Install package FILE with the standard - # package manager for the distribution - function instFile { - for pkg in $*; do - installFileOne $pkg - done - } - - # Install package with the alternate - # package manager for the distribution - function altInst { - for pkg in $*; do - altInstallOne $pkg - done - } - - - - # Common CLI - - # Utils - inst grep sed sh tar - if [ $TERMUX == 1 ]; then - inst coreutils man termux-api openssl-tool - if [ $ADMIN == 1 ]; then - inst tsu - fi - fi - inst moreutils screen ncdu lsof htop proxytunnel pv curl wget sshfs netcat mosh - if [ $ARCH == 1 ]; then - inst gopass - else - inst pass - fi - if [[ $ARCH == 1 && $ADMIN == 1 ]]; then - inst pkgfile - systemctl enable pkgfile-update.timer - fi - - # Dev - if [ $DEBIAN == 1 ]; then - inst build-essential - elif [ $ARCH == 1 ]; then - inst base-devel - else - inst make - fi - inst git cmake clang llvm - - - # Text editor - if [ $TERMUX == 1 ]; then - inst vim-python - elif [ $DEBIAN == 1 ]; then - inst vim-youcompleteme - ln -s $DEBLOC_ROOT/usr/bin/vim{.nox,} - else - inst vim - fi - if [ $DEBIAN == 1 ]; then - inst exuberant-ctags - else - inst ctags - fi - git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim - vim +PluginInstall +qall - - # YouCompleteMe (vim plugin) - if [ $DEBIAN != 1 ]; then - if [ $DEBIAN == 1 || $TERMUX == 1 ]; then - inst python-dev python3-dev - fi - local YCM_ARGS="" - if [ $TERMUX == 0 ]; then - YCM_ARGS="$YCM_ARGS --clang-completer --tern-completer" - fi - python $HOME/.vim/bundle/YouCompleteMe/install.py $YCM_ARGS - fi - - # Common GUI - - if [ $GUI == 1 ]; then - # Desktop manager - inst i3 i3lock i3status dunst unclutter xautolock feh numlockx scrot - if [ $DEBIAN == 1 ]; then - inst suckless-tools - if [ $ADMIN == 0 ]; then - ln -s $DEBLOC_ROOT/usr/bin/dmenu{.xft,} - fi - else - inst dmenu - fi - if [ "$(source /etc/os-release; echo $NAME)" == "Manjaro Linux" ]; then - inst menda-themes menda-circle-icon-theme xcursor-menda - fi - - # qutebrowser - if [ $DEBIAN == 1 ]; then - inst python3-lxml python-tox python3-pyqt5 python3-pyqt5.qtwebkit python3-pyqt5.qtquick python3-sip python3-jinja2 python3-pygments python3-yaml - TMP_DIR=$(mktemp -d) - $(cd $TMP_DIR; wget https://qutebrowser.org/python3-pypeg2_2.15.2-1_all.deb) - $(cd $TMP_DIR; wget https://github.com/qutebrowser/qutebrowser/releases/download/v0.9.1/qutebrowser_0.9.1-2_all.deb) - instFile $TMP_DIR/*.deb - rm -rf $TMP_DIR - - elif [ $ARCH == 1 ]; then - altInst qutebrowser - fi - - # Screen filter - if [ $ARCH == 1 ]; then - altInst sct - elif [ $DEBIAN == 1 ]; then - if [ ! -f $DEBLOC_ROOT/usr/bin/sct ]; then - TMP=$(mktemp) - wget http://www.tedunangst.com/flak/files/sct.c -O $TMP - cc -std=c99 -O2 -I /usr/X11R6/include -o $DEBLOC_ROOT/usr/bin/sct $TMP -L /usr/X11R6/lib -lm -lX11 -lXrandr - fi - if [ $DEBIAN == 1 ]; then - inst vim-gtk - else - inst gvim - fi - fi - - if [ $EXTRA == 1 ]; then - # Extra CLI - inst sl ffmpeg youtube-dl - - if [ $ARCH == 1 ]; then - altInst pdftk - fi - - # Extra GUI - if [ $GUI == 1 ]; then - inst vlc gimp mpd vimpc - - if [ $ARCH == 1 ]; then - inst simplescreenrecorder - fi - - fi - fi -} - diff --git a/scripts/machines.sh b/scripts/machines similarity index 58% rename from scripts/machines.sh rename to scripts/machines index ce3053e..aacbbb2 100755 --- a/scripts/machines.sh +++ b/scripts/machines @@ -2,7 +2,6 @@ # Handles indexing and SSH keys of machines I # have access on -# (sourceable) MACHINES_HOME=$HOME MACHINES_CONFIG=$HOME/.config/machines @@ -51,6 +50,11 @@ function _machines-api { route=$1 shift wget $MACHINES_API/$route --content-on-error --quiet --output-document=- "$@" + result=$? + if [ $result != 0 ]; then + echo "[ERROR] wget returned $result..." + exit 2 + fi } function _machines-apiToken { @@ -59,6 +63,7 @@ function _machines-apiToken { } function _machines-apiSigned { + _machines-ensureAdmin _machines-api "$@" --certificate=$MACHINES_CONFIG/machines.crt --private-key=$MACHINES_CONFIG/machines.key } @@ -72,24 +77,10 @@ function _machines-pubFromCrt { openssl x509 -in $MACHINES_CONFIG/machines.crt -pubkey -noout > $MACHINES_CONFIG/machines.pub } -function _machines-regenKey { - if [[ -e $MACHINES_CONFIG/machines.key || -e $MACHINES_CONFIG/machines.pub || -e $MACHINES_CONFIG/machines.crt ]]; then - echo "[ERROR] Please delete the pem files manually to prove you know what you're doing." - else - openssl genrsa -out $MACHINES_CONFIG/machines.key 4096 - chmod 600 $MACHINES_CONFIG/machines.key - openssl req -key $MACHINES_CONFIG/machines.key -new -out $MACHINES_CONFIG/machines.csr - openssl x509 -req -days 1826 -in $MACHINES_CONFIG/machines.csr -signkey $MACHINES_CONFIG/machines.key -out $MACHINES_CONFIG/machines.crt - _machines-pubFromCrt - fi -} - function _machines-verifyCertificate { if openssl verify $MACHINES_CONFIG/machines.crt | grep -v 'error 18' | grep 'error' --quiet; then echo "[ERROR] Invalid certificate" - return 1 - else - return 0 + exit 1 fi } @@ -104,19 +95,23 @@ function _machines-ensurePub { mv $CERT_FILE $MACHINES_CONFIG/machines.crt &> /dev/null else echo "[ERROR] Certificate rejected." - return 1 + exit 1 fi fi _machines-verifyCertificate - if [ $? != 0 ]; then - return 1 - fi if [ ! -f $MACHINES_CONFIG/machines.pub ]; then _machines-pubFromCrt fi return 0 } +function _machines-ensureAdmin { + if [ ! -f $MACHINES_CONFIG/machines.key ]; then + echo "[ERROR] You need have to have the private key to do that" + exit 1 + fi +} + # SSH ACCESS KEYS function _machines-signAkey { # network @@ -130,9 +125,6 @@ function _machines-signAkey { # network function _machines-getAkey { # network _machines-ensurePub - if [ $? != 0 ]; then - return 1 - fi KEY_FILE=$(mktemp) SIGN_FILE=$(mktemp) _machines-api akey/$1 > $KEY_FILE @@ -140,11 +132,12 @@ function _machines-getAkey { # network openssl dgst -sha256 -verify $MACHINES_CONFIG/machines.pub -signature $SIGN_FILE $KEY_FILE &> /dev/null if [ $? == 0 ]; then cat $KEY_FILE + rm $KEY_FILE $SIGN_FILE &> /dev/null return 0 else - return 1 + rm $KEY_FILE $SIGN_FILE &> /dev/null + exit 1 fi - rm $KEY_FILE $SIGN_FILE &> /dev/null } function _machines-updateAkey { @@ -158,50 +151,10 @@ function _machines-updateAkey { cat $KEY_FILE echo "[ERROR] Authorized keys are not properly signed" rm $KEY_FILE - return 1 + exit 1 fi } -# USER ADMIN FUNCTIONS - -function machines-verifyLog { - if [ -f $MACHINES_CONFIG/lastVerifiedLog ]; then - from=$(<"$MACHINES_CONFIG/lastVerifiedLog") - else - from=0 - fi - d=$(date +%s) - _machines-apiSigned log?from=$from | less - prompt "Is this OK?" - if [ $? == 1 ]; then - echo $d > $MACHINES_CONFIG/lastVerifiedLog - return 0 - else - return 1 - fi -} - -function machines-sign { - machines-verifyLog - if [ $? != 0 ]; then - return 1 - fi - echo "Signing default network authorized_keys..." - _machines-signAkey - _machines-apiSigned network | while read network; do - echo "Signing network $network authorized_keys..." - _machines-signAkey $network - done -} - -function machines-list { - _machines-apiSigned machine -} - -function machines-listNetwork { - _machines-apiSigned network -} - function _machines-postFile { # filename cat $1 | while read line; do parameter=$(echo $line | cut -d '=' -f 1) @@ -217,87 +170,233 @@ function _machines-addElement { # element elementType default $EDITOR $FILE data=$(_machines-postFile $FILE) rm $FILE &> /dev/null - err=$(_machines-apiSigned $2 --post-data "name=$1$data") - if [ $? != 0 ]; then - echo "[ERROR] $err" - return 2 - fi -} - -function machines-add { # machine - _machines-addElement $1 machine "host[]=\nnetwork=\nuserkey=\nhostkey=\nuser=" -} - -function machines-addNetwork { # network - _machines-addElement $1 network "allowed[]=\nsecure=false" + machines-apiSigned $2 --post-data "name=$1$data" } function _machines-editElement { # element elementType FILE=$(mktemp) - _machines-apiSigned $2/$1 > $FILE - if [ $? != 0 ]; then - echo "[ERROR] $(cat $FILE)" - rm $FILE &> /dev/null - return 1 - fi + _machines-apiSigned $2/$1 $EDITOR $FILE data=$(_machines-postFile $FILE) rm $FILE &> /dev/null err=$(_machines-apiSigned $2/$1 --post-data "$data") - if [ $? != 0 ]; then - echo "[ERROR] $err" - return 2 - fi -} - -function machines-edit { # machine - _machines-editElement $1 machine -} - -function machines-editNetwork { # network - _machines-editElement $1 network } function _machines-deleteElement { # element elementType err=$(_machines-apiSigned $2/$1 --method=DELETE) - if [ $? != 0 ]; then - echo "[ERROR] $err" - return 2 +} + + +# USER ADMIN FUNCTIONS + +function machines_history { + if [ -f $MACHINES_CONFIG/lastVerifiedLog ]; then + from=$(<"$MACHINES_CONFIG/lastVerifiedLog") + else + from=0 + fi + d=$(date +%s) + _machines-apiSigned log?from=$from | less + prompt "Is this OK?" + if [ $? == 1 ]; then + echo $d > $MACHINES_CONFIG/lastVerifiedLog + return 0 + else + echo "Houston, we have a problem..." + exit 1 fi } -function machines-delete { # machine +function machines_sign { + machines_history + echo "Signing default network authorized_keys..." + _machines-signAkey + _machines-apiSigned network | while read network; do + echo "Signing network $network authorized_keys..." + _machines-signAkey $network + done +} + +function machines_machine_list { + _machines-apiSigned machine +} + +function machines_network_list { + _machines-apiSigned network +} + +function machines_machine_add_help { + echo "Usage: $0 machine|mac|m add MACHINE" + echo + echo "Arguments:" + echo " MACHINE machine to add" + return 0 +} +function machines_machine_add { # machine + if [ -z $1 ]; then + machines_machine_add_help + exit 1 + fi + _machines-addElement $1 machine "allowed[]=\nsecure=false" + _machines-addElement $1 machine "host[]=\nnetwork=\nuserkey=\nhostkey=\nuser=" +} + +function machines_network_add_help { + echo "Usage: $0 network|net|n add NETWORK" + echo + echo "Arguments:" + echo " NETWORK Network to add" + return 0 +} +function machines_network_add { # network + if [ -z $1 ]; then + machines_network_add_help + exit 1 + fi + _machines-addElement $1 network "allowed[]=\nsecure=false" +} + +function machines_machine_edit_help { + echo "Usage: $0 machine|mac|m edit MACHINE" + echo + echo "Arguments:" + echo " MACHINE machine to remove" + return 0 +} +function machines_machine_edit { # machine + if [ -z $1 ]; then + machines_machine_edit_help + exit 1 + fi + _machines-editElement $1 machine +} + +function machines_network_edit_help { + echo "Usage: $0 network|net|n edit NETWORK" + echo + echo "Arguments:" + echo " NETWORK Network to remove" + return 0 +} +function machines_network_edit { # network + if [ -z $1 ]; then + machines_network_edit_help + exit 1 + fi + _machines-editElement $1 network +} + +function machines_machine_delete_help { + echo "Usage: $0 machine|mac|m delete machine" + echo + echo "Arguments:" + echo " MACHINE machine to remove" + return 0 +} +function machines_machine_delete { # machine + if [ -z $1 ]; then + machines_machine_delete_help + exit 1 + fi _machines-deleteElement $1 machine } -function machines-deleteNetwork { # network +function machines_network_delete_help { + echo "Usage: $0 network|net|n delete NETWORK" + echo + echo "Arguments:" + echo " NETWORK Network to remove" + return 0 +} +function machines_network_delete { # network + if [ -z $1 ]; then + machines_network_delete_help + exit 1 + fi _machines-deleteElement $1 network } -function machines-updateAll { - machines-list | while read machine; do +function machines_machine_help { + echo "Usage: $0 machine|mac|m COMMAND" + echo + echo "Commands:" + echo " list List all machines" + echo " add Interactively add a machine" + echo " edit Interactively edit a specified machine" + echo " delete Remove a specified machine" + echo " help Get help with commands" + return 0 +} +function machines_machine { + command="$1" + shift + if type "machines_machine_$command" &> /dev/null; then + "machines_machine_$command" "$@" + else + machines_machine_help + fi +} + +function machines_network_help { + echo "Usage: $0 network|net|n COMMAND" + echo + echo "Commands:" + echo " list List all networks" + echo " add Interactively add a network" + echo " edit Interactively edit a specified network" + echo " delete Remove a specified network" + echo " help Get help with commands" + return 0 +} +function machines_network { + command="$1" + shift + if type "machines_network_$command" &> /dev/null; then + "machines_network_$command" "$@" + else + machines_network_help + fi +} + +machines_mac() { machines_machine "$@"; } +machines_m() { machines_machine "$@"; } +machines_net() { machines_network "$@"; } +machines_n() { machines_network "$@"; } +machines_mac_help() { machines_machine_help "$@"; } +machines_m_help() { machines_machine_help "$@"; } +machines_net_help() { machines_network_help "$@"; } +machines_n_help() { machines_network_help "$@"; } + +function machines_update-all { + machines_list | while read machine; do echo "Updating $machine..." ssh $machine 'machines-update' & done } -# USER FUNCTIONS - -function machines-update { - _machines-api machine/$(cat $MACHINES_CONFIG/this.name) > $MACHINES_CONFIG/this - _machines-updateAkey +function machines_regen-keys { + if [[ -e $MACHINES_CONFIG/machines.key || -e $MACHINES_CONFIG/machines.pub || -e $MACHINES_CONFIG/machines.crt ]]; then + echo "[ERROR] Please delete the pem files manually to prove you know what you're doing." + exit 1 + else + openssl genrsa -out $MACHINES_CONFIG/machines.key 4096 + chmod 600 $MACHINES_CONFIG/machines.key + openssl req -key $MACHINES_CONFIG/machines.key -new -out $MACHINES_CONFIG/machines.csr + openssl x509 -req -days 1826 -in $MACHINES_CONFIG/machines.csr -signkey $MACHINES_CONFIG/machines.key -out $MACHINES_CONFIG/machines.crt + _machines-pubFromCrt + fi } -function machines-setup { + +# USER FUNCTIONS + +function machines_setup { if [ -e $MACHINES_CONFIG/this.name ]; then echo "[ERROR] This machine is already set up" - return 1 + exit 1 fi _machines-ensurePub - if [ $? != 0 ]; then - return 1 - fi # Variables read -p 'Machine name? ' name @@ -324,13 +423,47 @@ function machines-setup { data="$data&host[]=$(urlencode "$host")" done - err=$(_machines-apiToken machine --post-data "$data") - if [ $? != 0 ]; then - echo "[ERROR] $err" - return 3 - fi + _machines-apiToken machine --post-data "$data" echo $name > $MACHINES_CONFIG/this.name machines-update } +function machines_update { + _machines-api machine/$(cat $MACHINES_CONFIG/this.name) > $MACHINES_CONFIG/this + _machines-updateAkey +} + + +function machines_help { + command="$1" + if [ -n "$command" ]; then + if type "machines_${command}_help" &> /dev/null; then + shift + "machines_${command}_help" "$@" + return $? + fi + fi + echo "Usage: $0 COMMAND" + echo + echo "User commands:" + echo " setup Interactive initial setup for new machine" + echo " update Update this machine" + echo " help Get help with commands" + echo + echo "Admin commands:" + echo " machine|mac|m Modify machines" + echo " network|net|n Modify networks" + echo " update-all Update all machines available via SSH" + echo " regen-keys Regenerate system keys" + return 0 +} + +# MAIN +command="$1" +shift +if type "machines_$command" &> /dev/null; then + "machines_$command" "$@" +else + machines_help +fi diff --git a/scripts/optimize.sh b/scripts/optimize similarity index 98% rename from scripts/optimize.sh rename to scripts/optimize index d329111..8f2831d 100755 --- a/scripts/optimize.sh +++ b/scripts/optimize @@ -121,7 +121,7 @@ do temp=$(mktemp --suffix .svg) cp "$image" "$temp" - svgo --quiet --config $HOME/.scripts/svgo.yml "$temp" + svgo --quiet --config $HOME/.config/optiSvgo.yml "$temp" echo "→ Optimize done" replaceImg "$temp" "$image" diff --git a/scripts/proxy b/scripts/proxy new file mode 100755 index 0000000..cca5e19 --- /dev/null +++ b/scripts/proxy @@ -0,0 +1,88 @@ +#!/usr/bin/env bash + +# Allows easy manipulation of the proxy variables + +function proxy_set_help { + echo "Usage: $0 set ADDRESS" + echo + echo "Arguments:" + echo " ADDRESS Address of the proxy" + return 0 +} + +function proxy_set { + if [ -z $1 ]; then + proxy_set_help + return 1 + fi + export http_proxy=$1 + export https_proxy=$1 + export ftp_proxy=$1 + export rsync_proxy=$1 + echo "Proxy changed" + exit 0 +} + +function proxy_setup { + export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com" + + if (( $# > 0 )); then + valid=$(echo $@ | sed -n 's/\([0-9]\{1,3\}.\)\{4\}:\([0-9]\+\)/&/p') + if [[ $valid != $@ ]]; then + >&2 echo "Invalid address" + return 1 + fi + proxy_set "http://$1/" + return 0 + fi + + echo -n "User: "; read username + if [[ $username != "" ]]; then + echo -n "Password: " + read -es password + local pre="$username:$password@" + fi + + echo -n "Server: "; read server + echo -n "Port: "; read port + proxy_set "http://$pre$server:$port/" + return 0 +} + +function proxy_off { + unset http_proxy + unset https_proxy + unset ftp_proxy + unset rsync_proxy + echo -e "Proxy removed" + return 0 +} + +function proxy_help { + command="$1" + if [ -n "$command" ]; then + if type "proxy_${command}_help" &> /dev/null; then + shift + "proxy_${command}_help" "$@" + return $? + fi + fi + echo "Usage: $0 COMMAND" + echo + echo "Commands:" + echo " setup Interactively setup proxy" + echo " set Set proxy from address" + echo " off Turn off proxy" + echo " help Get help with commands" + return 0 +} + +# MAIN +command="$1" +shift +if type "proxy_$command" &> /dev/null; then + "proxy_$command" "$@" +else + proxy_help +fi + diff --git a/scripts/proxy.sh b/scripts/proxy.sh deleted file mode 100755 index 16ed33e..0000000 --- a/scripts/proxy.sh +++ /dev/null @@ -1,44 +0,0 @@ - -# Proxy -function proxy_set { - export http_proxy=$1 - export https_proxy=$1 - export ftp_proxy=$1 - export rsync_proxy=$1 - echo "Proxy changed" -} - -function proxy_on { - export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com" - - if (( $# > 0 )); then - valid=$(echo $@ | sed -n 's/\([0-9]\{1,3\}.\)\{4\}:\([0-9]\+\)/&/p') - if [[ $valid != $@ ]]; then - >&2 echo "Invalid address" - return 1 - fi - proxy_set "http://$1/" - return 0 - fi - - echo -n "User: "; read username - if [[ $username != "" ]]; then - echo -n "Password: " - read -es password - local pre="$username:$password@" - fi - - echo -n "Server: "; read server - echo -n "Port: "; read port - proxy_set "http://$pre$server:$port/" -} - -function proxy_off { - unset http_proxy - unset https_proxy - unset ftp_proxy - unset rsync_proxy - echo -e "Proxy removed" -} -alias po=proxy_off - diff --git a/scripts/tunnel b/scripts/tunnel index 0af646c..e0e1f91 100755 --- a/scripts/tunnel +++ b/scripts/tunnel @@ -1,4 +1,9 @@ #!/usr/bin/env bash + +# Dynamically determines if the ssh connection +# is to be proxied through `proxytunnel` +# To be used with ssh_config ProxyCommand + host="$1" port="$2" From cb8ca9c9048d8c2338e5f6ae414317d51730f249 Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Sun, 12 Feb 2017 13:29:03 +0100 Subject: [PATCH 10/44] Supplementary merge --- scripts/debloc | 32 ++++++++++++++++++++++++++++++-- scripts/install-prefs | 37 +++++++++++++++++++------------------ 2 files changed, 49 insertions(+), 20 deletions(-) diff --git a/scripts/debloc b/scripts/debloc index 7d45d9c..a778d81 100755 --- a/scripts/debloc +++ b/scripts/debloc @@ -234,7 +234,7 @@ function debloc_env { export PATH="$DEBLOC_ROOT/usr/bin:$DEBLOC_ROOT/usr/games/:$DEBLOC_ROOT/usr/lib/git-core:$PATH" export LIBRARY_PATH="$DEBLOC_LD:$LIBRARY_PATH" export C_INCLUDE_PATH="$DEBLOC_ROOT/usr/include:$C_INCLUDE_PATH" - export CPLUS_INCLUDE_PATH="$DEBLOC_ROOT/usr/include:$CPLUS_INCLUDE_PATH" + export CPLUS_INCLUDE_PATH="$DEBLOC_ROOT/usr/include:$DEBLOC_ROOT/usr/include/python2.7/:$DEBLOC_ROOT/usr/include/x86_64-linux-gnu/python2.7/:$CPLUS_INCLUDE_PATH" export LD_LIBRARY_PATH="$DEBLOC_LD:$LD_LIBRARY_PATH" export PYTHONPATH="$DEBLOC_ROOT/usr/lib/python3/dist-packages:$PYTHONPATH" export QT_QPA_PLATFORM_PLUGIN_PATH="$DEBLOC_ROOT/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms" @@ -291,7 +291,6 @@ function debloc_deb_help { echo " PATH Path to the .deb file" return 0 } - function debloc_deb { # path if [ -z $1 ]; then debloc_deb_help @@ -308,6 +307,34 @@ function debloc_deb { # path } +function debloc_altern_help { + echo "Usage: $0 altern PROGRAM ALTERNATIVE" + echo + echo "Arguments:" + echo " PROGRAM Program to set the alternative for" + echo " ALTERNATIVE Alternative to set" + echo + echo "Examples:" + echo " $0 altern vim nox" + echo " $0 altern dmenu xft" + return 0 +} +function debloc_altern { # program alternative + if [ -z $1 || -z $2 ]; then + debloc_altern_help + fi + dest="$DEBLOC_ROOT/usr/bin/$1" + alte="$DEBLOC_ROOT/usr/bin/$1.$2" + if [ ! -f "$alt" ]; then + echo "Unknown alternative for $1 : $2" + exit 1 + fi + if [ -e "$dest" ]; then + rm $dest + fi + ln -s "$alte" "$dest" +} + function debloc_flush { rm -rf $DEBLOC_ROOT/* &> /dev/null rm -f $DEBLOC_DB/* &> /dev/null @@ -330,6 +357,7 @@ function debloc_help { echo " info Gives some information about the fake filesystem" echo " install Install a debian package in the fake filesystem" echo " deb Install from a .deb file in the fake filesystem" + echo " altern Update alternative" echo " flush Remove every package installed from the fake filesystem" echo " help Get help with commands" echo diff --git a/scripts/install-prefs b/scripts/install-prefs index c601be3..a84c8b3 100755 --- a/scripts/install-prefs +++ b/scripts/install-prefs @@ -123,10 +123,10 @@ elif which dpkg &> /dev/null; then } else function installOne { # package - debloc-install $1 + debloc install $1 } function installFileOne { # file - debloc-deb "$1" + debloc deb "$1" } fi function altInstallOne { @@ -192,15 +192,15 @@ elif [ $ARCH == 1 ]; then else inst make fi -inst git cmake clang llvm +inst git # Text editor if [ $TERMUX == 1 ]; then inst vim-python elif [ $DEBIAN == 1 ]; then - inst vim-youcompleteme - ln -s $DEBLOC_ROOT/usr/bin/vim{.nox,} + inst vim-nox + debloc altern vim nox else inst vim fi @@ -213,16 +213,14 @@ git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim vim +PluginInstall +qall # YouCompleteMe (vim plugin) -if [ $DEBIAN != 1 ]; then - if [ $DEBIAN == 1 || $TERMUX == 1 ]; then - inst python-dev python3-dev - fi - local YCM_ARGS="" - if [ $TERMUX == 0 ]; then - YCM_ARGS="$YCM_ARGS --clang-completer --tern-completer" - fi - python $HOME/.vim/bundle/YouCompleteMe/install.py $YCM_ARGS +if [ $DEBIAN == 1 || $TERMUX == 1 ]; then + inst python-dev python3-dev fi +local YCM_ARGS="" +if [ $TERMUX != 1 ]; then + YCM_ARGS="$YCM_ARGS --clang-completer --tern-completer" +fi +python $HOME/.vim/bundle/YouCompleteMe/install.py $YCM_ARGS # Common GUI @@ -232,7 +230,7 @@ if [ $GUI == 1 ]; then if [ $DEBIAN == 1 ]; then inst suckless-tools if [ $ADMIN == 0 ]; then - ln -s $DEBLOC_ROOT/usr/bin/dmenu{.xft,} + debloc altern dmenu xft fi else inst dmenu @@ -257,11 +255,11 @@ if [ $GUI == 1 ]; then # Screen filter if [ $ARCH == 1 ]; then altInst sct - elif [ $DEBIAN == 1 ]; then - if [ ! -f $DEBLOC_ROOT/usr/bin/sct ]; then + elif [ $TERMUX != 1 ]; then + if [ ! -f $HOME/.gscripts/sct ]; then TMP=$(mktemp) wget http://www.tedunangst.com/flak/files/sct.c -O $TMP - cc -std=c99 -O2 -I /usr/X11R6/include -o $DEBLOC_ROOT/usr/bin/sct $TMP -L /usr/X11R6/lib -lm -lX11 -lXrandr + cc -std=c99 -O2 -I /usr/X11R6/include -o $HOME/.gscripts/sct $TMP -L /usr/X11R6/lib -lm -lX11 -lXrandr fi fi @@ -274,6 +272,9 @@ if [ $GUI == 1 ]; then fi if [ $EXTRA == 1 ]; then + # Extra dev + inst cmake clang llvm + # Extra CLI inst sl ffmpeg youtube-dl From 0952eab0de695502bd1f53387aabc9169937c7ad Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Sun, 12 Feb 2017 15:14:51 +0100 Subject: [PATCH 11/44] Modifications, again --- bashrc | 25 +++++++++++----------- profile | 5 ++--- scripts/debloc | 50 ++++++++++++++++++++++++++++++------------- scripts/install-prefs | 11 +++++----- scripts/proxy | 2 +- 5 files changed, 56 insertions(+), 37 deletions(-) diff --git a/bashrc b/bashrc index 35a3cba..69cb8f7 100644 --- a/bashrc +++ b/bashrc @@ -50,7 +50,6 @@ alias s='sudo -s -E' alias po='proxy off' alias nw="sudo systemctl restart NetworkManager" alias mc="machines" - # Superseding commands with better ones if they are present if which vim &> /dev/null; then alias vi='vim' @@ -88,28 +87,28 @@ elif [[ $USER == 'geoffrey' || $USER == 'gbontoux' || $USER == 'gpreud' ]]; then else col=33; fi -PS1="\[\e]2;\u@\h \w\a\]\[\e[0;37m\][\[\e[0;${col}m\]\u\[\e[0;37m\]@\[\e[0;34m\]\h \[\e[0;36m\]\W\[\e[0;37m\]]\$\[\e[0m\] " -PS2="> " -PS3="+ " -PS4="- " +export PS1="\[\e]2;\u@\h \w\a\]\[\e[0;37m\][\[\e[0;${col}m\]\u\[\e[0;37m\]@\[\e[0;34m\]\h \[\e[0;36m\]\W\[\e[0;37m\]]\$\[\e[0m\] " +export PS2="> " +export PS3="+ " +export PS4="- " + +# CUSTOM SCRIPTS + +export PATH="$HOME/.scripts/:$PATH" +[ -f ~/.gscripts/gprofile ] && source ~/.gscripts/gprofile # UTILITIES # Bash completion [ -f /etc/bash_completion ] && . /etc/bash_completion -# Command not found handlers -[ -r /usr/share/doc/pkgfile/command-not-found.bash ] && . /usr/share/doc/pkgfile/command-not-found.bash # Arch -[ -r /etc/profile.d/cnf.sh ] && . /etc/profile.d/cnf.sh # Arch (alternative, for Manjaro mostly) - # Bad day mood-saver if which thefuck &> /dev/null; then alias fuck='TF_CMD=$(TF_ALIAS=fuck PYTHONIOENCODING=utf-8 TF_SHELL_ALIASES=$(alias) thefuck $(fc -ln -1)) && eval $TF_CMD && history -s $TF_CMD' alias FUCK='fuck' fi -# CUSTOM SCRIPTS - -export PATH="$HOME/.scripts/:$PATH" -[ -f ~/.gscripts/gprofile ] && source ~/.gscripts/gprofile +# Command not found handlers +[ -r /usr/share/doc/pkgfile/command-not-found.bash ] && . /usr/share/doc/pkgfile/command-not-found.bash # Arch +[ -r /etc/profile.d/cnf.sh ] && . /etc/profile.d/cnf.sh # Arch (alternative, for Manjaro mostly) diff --git a/profile b/profile index fd47441..4de32f2 100644 --- a/profile +++ b/profile @@ -3,11 +3,10 @@ # # SSH agent -[ -z "$SSH_AUTH_SOCK" ] && eval `ssh-agent -s` &> /dev/null +[[ -z "$SSH_AUTH_SOCK" && -x "$(which ssh-agent)" ]] && eval `ssh-agent -s` &> /dev/null # TTY Colors [ -f "$HOME/.config/linuxColors.sh" ] && . "$HOME/.config/linuxColors.sh" # Bashrc -#[ -f ~/.bashrc ] && . ~/.bashrc -# TODO Is this really useful? +[ -f ~/.bashrc ] && . ~/.bashrc diff --git a/scripts/debloc b/scripts/debloc index a778d81..478b15e 100755 --- a/scripts/debloc +++ b/scripts/debloc @@ -3,10 +3,20 @@ # Installs Debian packages on a Debian system # with no root access, in the user home -if [[ ! $(which apt &> /dev/null) ]]; then - echo "This is not a Debian system (or apt is not installed)." +# CONFIGURATION + +# Verifications + +if [[ -z $DEBIAN_MIRROR && ! -f /etc/apt/sources.list ]]; then + echo "Unable to find a mirror. Try setting DEBIAN_MIRROR (see help)." exit 1 fi +if [[ -z $DEBIAN_DB && ! $(which apt &> /dev/null) ]]; then + echo "Unable to find a database for packages to install. Try setting DEBIAN_DB (see help)." + exit 1 +fi + +# Overrides [ -z $DEBLOC_PREFIX ] && DEBLOC_PREFIX=$(dpkg --print-architecture) [ -z $DEBLOC_DB ] && DEBLOC_DB=${XDG_CONFIG_HOME:-$HOME/.config}/$DEBLOC_PREFIX @@ -18,9 +28,13 @@ if [ -z $DEBIAN_MIRROR ]; then DEBIAN_MIRROR="$(echo -e "$DEBIAN_MIRROR" | cut -d ' ' -f 2 | sed 's/\/$//' | sort | uniq)" fi +# Preparation + mkdir -p $DEBLOC_DB &> /dev/null mkdir -p $DEBLOC_ROOT &> /dev/null +# PRIVATE FUNCTIONS + # Tell if a package exists function _debloc-exists { # package if [[ -n $DEBIAN_DB && -f $DEBIAN_DB ]]; then @@ -229,15 +243,16 @@ function _debloc-installDeps { # package return 0 } -# USER FUNCTIONS +# PUBLIC FUNCTIONS + function debloc_env { - export PATH="$DEBLOC_ROOT/usr/bin:$DEBLOC_ROOT/usr/games/:$DEBLOC_ROOT/usr/lib/git-core:$PATH" - export LIBRARY_PATH="$DEBLOC_LD:$LIBRARY_PATH" - export C_INCLUDE_PATH="$DEBLOC_ROOT/usr/include:$C_INCLUDE_PATH" - export CPLUS_INCLUDE_PATH="$DEBLOC_ROOT/usr/include:$DEBLOC_ROOT/usr/include/python2.7/:$DEBLOC_ROOT/usr/include/x86_64-linux-gnu/python2.7/:$CPLUS_INCLUDE_PATH" - export LD_LIBRARY_PATH="$DEBLOC_LD:$LD_LIBRARY_PATH" - export PYTHONPATH="$DEBLOC_ROOT/usr/lib/python3/dist-packages:$PYTHONPATH" - export QT_QPA_PLATFORM_PLUGIN_PATH="$DEBLOC_ROOT/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms" + echo "export PATH=\"$DEBLOC_ROOT/usr/bin:$DEBLOC_ROOT/usr/games/:$DEBLOC_ROOT/usr/lib/git-core:\$PATH\"" + echo "export LIBRARY_PATH=\"$DEBLOC_LD:\$LIBRARY_PATH\"" + echo "export C_INCLUDE_PATH=\"$DEBLOC_ROOT/usr/include:\$C_INCLUDE_PATH\"" + echo "export CPLUS_INCLUDE_PATH=\"$DEBLOC_ROOT/usr/include:$DEBLOC_ROOT/usr/include/python2.7/:$DEBLOC_ROOT/usr/include/x86_64-linux-gnu/python2.7/:\$CPLUS_INCLUDE_PATH\"" + echo "export LD_LIBRARY_PATH=\"$DEBLOC_LD:\$LD_LIBRARY_PATH\"" + echo "export PYTHONPATH=\"$DEBLOC_ROOT/usr/lib/python3/dist-packages:\$PYTHONPATH\"" + echo "export QT_QPA_PLATFORM_PLUGIN_PATH=\"$DEBLOC_ROOT/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms\"" } function debloc_info { @@ -320,12 +335,17 @@ function debloc_altern_help { return 0 } function debloc_altern { # program alternative - if [ -z $1 || -z $2 ]; then + if [[ -z $1 || -z $2 ]]; then debloc_altern_help + exit 1 fi - dest="$DEBLOC_ROOT/usr/bin/$1" - alte="$DEBLOC_ROOT/usr/bin/$1.$2" - if [ ! -f "$alt" ]; then + if [ -f "$DEBLOC_ROOT/usr/bin/$1.$2" ]; then + dest="$DEBLOC_ROOT/usr/bin/$1" + alte="$DEBLOC_ROOT/usr/bin/$1.$2" + elif [ -f "$DEBLOC_ROOT/bin/$1.$2" ]; then + dest="$DEBLOC_ROOT/bin/$1" + alte="$DEBLOC_ROOT/bin/$1.$2" + else echo "Unknown alternative for $1 : $2" exit 1 fi @@ -353,7 +373,7 @@ function debloc_help { echo "Usage: $0 COMMAND" echo echo "Commands:" - echo " env Sets the environment variables required to run applications from the fake filesystem" + echo " env Provides the environment variables required to run applications from the fake filesystem" echo " info Gives some information about the fake filesystem" echo " install Install a debian package in the fake filesystem" echo " deb Install from a .deb file in the fake filesystem" diff --git a/scripts/install-prefs b/scripts/install-prefs index a84c8b3..6dfe8b2 100755 --- a/scripts/install-prefs +++ b/scripts/install-prefs @@ -54,7 +54,7 @@ if which pacman &> /dev/null; then function installFileOne { # file sudo pacman -U "$1" } - if [ -f /usr/bin/yaourt ]; then + if which yaourt &> /dev/null; then function altInstallOne { # package pacman -Q $1 &> /dev/null if [ $? == 1 ]; then @@ -162,13 +162,12 @@ function altInst { } - # Common CLI # Utils -inst grep sed sh tar +inst coreutils man openssl-tool grep sed sh tar if [ $TERMUX == 1 ]; then - inst coreutils man termux-api openssl-tool + inst termux-api if [ $ADMIN == 1 ]; then inst tsu fi @@ -200,7 +199,9 @@ if [ $TERMUX == 1 ]; then inst vim-python elif [ $DEBIAN == 1 ]; then inst vim-nox - debloc altern vim nox + if [ $ADMIN == 0 ]; then + debloc altern vim nox + fi else inst vim fi diff --git a/scripts/proxy b/scripts/proxy index cca5e19..6da0e0f 100755 --- a/scripts/proxy +++ b/scripts/proxy @@ -19,7 +19,7 @@ function proxy_set { export https_proxy=$1 export ftp_proxy=$1 export rsync_proxy=$1 - echo "Proxy changed" + echo "Proxy set" exit 0 } From f30dc1adc4891a4abcb4ddfb4e5d26533052f156 Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Sun, 12 Feb 2017 15:31:40 +0100 Subject: [PATCH 12/44] Moar colors --- config/i3/config | 36 ++++++++++++++++++------------------ config/i3/dmenu_cmd | 2 +- config/i3/sshmenu | 4 ++-- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/config/i3/config b/config/i3/config index ece5de8..98a525d 100644 --- a/config/i3/config +++ b/config/i3/config @@ -133,27 +133,27 @@ bindsym $mod+a focus parent bindsym $mod+q focus child # Workspace names -set $WS1 1 Édition -set $WS2 2 Éxecution -set $WS3 3 Organisation -set $WS4 4 Référence -set $WS5 5 Divers 1 -set $WS6 6 Divers 2 -set $WS7 7 Contact -set $WS8 8 Social -set $WS9 9 Veille +set $WS1 1 Édition +set $WS2 2 Éxecution +set $WS3 3 Organisation +set $WS4 4 Référence +set $WS5 5 Divers 1 +set $WS6 6 Divers 2 +set $WS7 7 Contact +set $WS8 8 Social +set $WS9 9 Veille set $WS10 10 Musique # Workspace output -workspace "$WS1" output LVDS1 -workspace "$WS2" output VGA1 -workspace "$WS3" output LVDS1 -workspace "$WS4" output VGA1 -workspace "$WS5" output LVDS1 -workspace "$WS6" output VGA1 -workspace "$WS7" output LVDS1 -workspace "$WS8" output VGA1 -workspace "$WS9" output LVDS1 +workspace "$WS1" output LVDS1 +workspace "$WS2" output VGA1 +workspace "$WS3" output LVDS1 +workspace "$WS4" output VGA1 +workspace "$WS5" output LVDS1 +workspace "$WS6" output VGA1 +workspace "$WS7" output LVDS1 +workspace "$WS8" output VGA1 +workspace "$WS9" output LVDS1 workspace "$WS10" output VGA1 # switch to workspace diff --git a/config/i3/dmenu_cmd b/config/i3/dmenu_cmd index e1d3599..a02a9b2 100755 --- a/config/i3/dmenu_cmd +++ b/config/i3/dmenu_cmd @@ -1,2 +1,2 @@ #!/bin/sh -dmenu -fn 'DejaVu Sans Mono-10' -nb '#222222' -nf '#888888' -sb '#4E9C00' -sf '#FFFFFF' -l 8 -f -i -h 19 "$@" +dmenu -fn 'DejaVu Sans Mono-10' -nb '#48483e' -nf '#f1ebeb' -sb '#8fc029' -sf '#272822' -l 8 -f -i -h 19 "$@" diff --git a/config/i3/sshmenu b/config/i3/sshmenu index 00cf7fa..7b3fdc5 100755 --- a/config/i3/sshmenu +++ b/config/i3/sshmenu @@ -1,9 +1,9 @@ #!/bin/bash if [ "$1" == 'root' ]; then a=" (root)" - b="sudo -E " + b="-t 'sudo -s'" fi machine=$(cat ~/.ssh/config | grep '^Host ' | cut -d ' ' -f 2 | grep -v '*' | sort | $HOME/.config/i3/dmenu_cmd -p "SSH$a to ") if [ ! -z $machine ]; then - xterm -e "ssh $machine -t '${b}bash --login'" + xterm -e "ssh $machine $b" fi From 761ea3b890c342f2046723b8db1ab615fcc984b4 Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Sun, 12 Feb 2017 16:46:30 +0100 Subject: [PATCH 13/44] I wonder if I have been too far with this... --- bashrc | 2 +- scripts/debloc | 7 +++++++ scripts/proxy | 35 +++++++++++++++++++++++++---------- 3 files changed, 33 insertions(+), 11 deletions(-) diff --git a/bashrc b/bashrc index 69cb8f7..837c5b9 100644 --- a/bashrc +++ b/bashrc @@ -47,7 +47,7 @@ alias la="ls -la $LS_OPTIONS" alias al=sl alias x='startx; logout' alias s='sudo -s -E' -alias po='proxy off' +alias po='eval $(proxy off)' alias nw="sudo systemctl restart NetworkManager" alias mc="machines" # Superseding commands with better ones if they are present diff --git a/scripts/debloc b/scripts/debloc index 478b15e..6f2c5d4 100755 --- a/scripts/debloc +++ b/scripts/debloc @@ -245,6 +245,13 @@ function _debloc-installDeps { # package # PUBLIC FUNCTIONS +function proxy_set_help { + echo "Usage: $0 env" + echo + echo "Examples:" + echo ' eval "$(debloc env)"' + return 0 +} function debloc_env { echo "export PATH=\"$DEBLOC_ROOT/usr/bin:$DEBLOC_ROOT/usr/games/:$DEBLOC_ROOT/usr/lib/git-core:\$PATH\"" echo "export LIBRARY_PATH=\"$DEBLOC_LD:\$LIBRARY_PATH\"" diff --git a/scripts/proxy b/scripts/proxy index 6da0e0f..44322b5 100755 --- a/scripts/proxy +++ b/scripts/proxy @@ -7,6 +7,9 @@ function proxy_set_help { echo echo "Arguments:" echo " ADDRESS Address of the proxy" + echo + echo "Examples:" + echo ' eval "$(proxy set http://proxy.mycompany.com:3128/)"' return 0 } @@ -15,14 +18,20 @@ function proxy_set { proxy_set_help return 1 fi - export http_proxy=$1 - export https_proxy=$1 - export ftp_proxy=$1 - export rsync_proxy=$1 - echo "Proxy set" + echo "export http_proxy='$1'" + echo "export https_proxy='$1'" + echo "export ftp_proxy='$1'" + echo "export rsync_proxy='$1'" exit 0 } +function proxy_setup_help { + echo "Usage: $0 setup" + echo + echo "Examples:" + echo " proxy_set # Then eval the output" + return 0 +} function proxy_setup { export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com" @@ -49,12 +58,18 @@ function proxy_setup { return 0 } +function proxy_off_help { + echo "Usage: $0 off" + echo + echo "Examples:" + echo ' eval $(proxy off)' + return 0 +} function proxy_off { - unset http_proxy - unset https_proxy - unset ftp_proxy - unset rsync_proxy - echo -e "Proxy removed" + echo 'unset http_proxy' + echo 'unset https_proxy' + echo 'unset ftp_proxy' + echo 'unset rsync_proxy' return 0 } From 4bdcd73d0ca561cdcbacef3dd16e69aab38cd3b9 Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Sun, 12 Feb 2017 17:22:17 +0100 Subject: [PATCH 14/44] Yay, multiline, I forgot about that --- scripts/debloc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/debloc b/scripts/debloc index 6f2c5d4..252c72c 100755 --- a/scripts/debloc +++ b/scripts/debloc @@ -267,7 +267,7 @@ function debloc_info { echo "DEBLOC_ROOT=$DEBLOC_ROOT" echo "DEBLOC_DB=$DEBLOC_DB" echo "DEBLOC_LD=$DEBLOC_LD" - echo "DEBIAN_MIRROR=$DEBIAN_MIRROR" + echo "DEBIAN_MIRROR='$DEBIAN_MIRROR'" echo "DEBIAN_DB=$DEBIAN_DB" } From f42c8e0a3eadaedc9da94a0e972ed3ad124b475f Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Mon, 13 Feb 2017 06:40:24 +0100 Subject: [PATCH 15/44] Things again --- bashrc | 2 +- config/htop/htoprc | 2 +- vimrc | 40 ++++++++++++++++------------------------ 3 files changed, 18 insertions(+), 26 deletions(-) diff --git a/bashrc b/bashrc index 837c5b9..ce2bf9e 100644 --- a/bashrc +++ b/bashrc @@ -11,7 +11,7 @@ export TZ=/usr/share/zoneinfo/Europe/Paris # Favourite commands export PAGER=less export EDITOR=vim -export VISUAL=gvim +export VISUAL=vim export BROWSER=qutebrowser # Some programs need those changes diff --git a/config/htop/htoprc b/config/htop/htoprc index 51bf9c4..882a239 100644 --- a/config/htop/htoprc +++ b/config/htop/htoprc @@ -1,7 +1,7 @@ # Beware! This file is rewritten by htop when settings are changed in the interface. # The parser is also very primitive, and not human-friendly. fields=0 48 17 18 38 39 40 2 46 47 49 1 -sort_key=47 +sort_key=46 sort_direction=1 hide_threads=0 hide_kernel_threads=0 diff --git a/vimrc b/vimrc index b79815c..e5df06c 100644 --- a/vimrc +++ b/vimrc @@ -14,8 +14,8 @@ Plugin 'gmarik/Vundle.vim' Plugin 'L9' Plugin 'rstacruz/sparkup', {'rtp': 'vim/'} Plugin 'tomasr/molokai' -Bundle 'Shougo/neosnippet' -Bundle 'Shougo/neosnippet-snippets' +"Bundle 'Shougo/neosnippet' +"Bundle 'Shougo/neosnippet-snippets' Plugin 'tpope/vim-surround' Plugin 'tpope/vim-fugitive' Plugin 'tpope/vim-repeat' @@ -24,22 +24,23 @@ Plugin 'vim-airline/vim-airline-themes' Plugin 'airblade/vim-gitgutter' Plugin 'kien/ctrlp.vim' Plugin 'mbbill/undotree' -"Plugin 'scrooloose/nerdtree' -"Plugin 'Xuyuanp/nerdtree-git-plugin' Plugin 'xolox/vim-misc' Plugin 'xolox/vim-easytags' Plugin 'majutsushi/tagbar' -"Plugin 'gilligan/vim-lldb' Plugin 'wellle/targets.vim' Plugin 'Chiel92/vim-autoformat' Plugin 'Valloric/YouCompleteMe' -"Plugin 'Raimondi/delimitMate' -"Plugin 'Cocophotos/vim-ycm-latex-semantic-completer' -"Plugin 'IN3D/vim-raml' +Plugin 'artur-shaik/vim-javacomplete2' +Plugin 'tomtom/tcomment_vim' +Plugin 'Shougo/denite.nvim' call vundle#end() " required filetype plugin indent on " required +""" UNDOTREE """ + +nmap :UndotreeToggle:UndotreeFocus + """ CTRLP """ let g:ctrlp_custom_ignore = { @@ -48,6 +49,10 @@ let g:ctrlp_custom_ignore = { \ 'link': 'SOME_BAD_SYMBOLIC_LINKS', \ } +""" TAGBAR """ + +nmap :TagbarToggle + """ VIM-AIRLINE """ set noshowmode @@ -61,24 +66,13 @@ let g:airline_section_b = airline#section#create(['branch', 'hunks']) let g:airline_section_z = airline#section#create(['%B', '@', '%l', ':', '%c']) let g:airline_theme = 'wombat' -""" NERDTREE-GIT-PLUGIN """ - -let g:NERDTreeIndicatorMapCustom = { - \ "Modified" : "✹", - \ "Staged" : "✚", - \ "Untracked" : "✭", - \ "Renamed" : "➜", - \ "Unmerged" : "═", - \ "Deleted" : "✖", - \ "Dirty" : "✗", - \ "Clean" : "✔︎", - \ "Unknown" : "?" - \ } - """ YOUCOMPLETEME """ let g:ycm_global_ycm_extra_conf = '~/.config/ycm_extra_conf.py' +""" JAVACOMPLETE """ + +autocmd FileType java setlocal omnifunc=javacomplete#Complete """ VIM SETTINGS """ @@ -114,8 +108,6 @@ set cursorcolumn syntax enable -"set t_Co=256 -"let g:molokai_original = 1 set background=dark colorscheme molokai From 76360d09fa267c605f90dd7658961c984e27a74a Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Sat, 18 Feb 2017 16:47:30 +0100 Subject: [PATCH 16/44] Change PDF metadata --- scripts/install-prefs | 2 +- scripts/pdfrename | 49 +++++++++++++++++++++++++++++++++++++++++++ vimrc | 2 +- 3 files changed, 51 insertions(+), 2 deletions(-) create mode 100755 scripts/pdfrename diff --git a/scripts/install-prefs b/scripts/install-prefs index 6dfe8b2..191a76c 100755 --- a/scripts/install-prefs +++ b/scripts/install-prefs @@ -280,7 +280,7 @@ if [ $EXTRA == 1 ]; then inst sl ffmpeg youtube-dl if [ $ARCH == 1 ]; then - altInst pdftk + altInst pdftk translate-shell fi # Extra GUI diff --git a/scripts/pdfrename b/scripts/pdfrename new file mode 100755 index 0000000..7cfdd9c --- /dev/null +++ b/scripts/pdfrename @@ -0,0 +1,49 @@ +#!/usr/bin/env bash + +# Change the title of a PDF file + +if [[ -z "$1" || -z "$2" ]]; then + echo "Usage: $0 FILE TITLE [CREATOR [PRODUCER]]" + echo + echo "Arguments:" + echo " FILE Path to the PDF document" + echo " TITLE Content of the Title tag" + echo " CREATOR Content of the Creator tag" + echo " PRODUCER Title to give" + exit 1 +fi + +file="$1" +title="$2" +creator="$3" +producer="$4" + +if [ ! -f "$1" ]; then + echo "No such file or directory: $1" >> /dev/stderr + exit 2 +fi + +instructions=$(mktemp) + +echo "InfoBegin" >> "$instructions" +echo "InfoKey: Title" >> "$instructions" +echo "InfoValue: $title" >> "$instructions" +if [ -n "$creator" ]; then + echo "InfoBegin" >> "$instructions" + echo "InfoKey: Creator" >> "$instructions" + echo "InfoValue: $creator" >> "$instructions" +fi +if [ -n "$producer" ]; then + echo "InfoBegin" >> "$instructions" + echo "InfoKey: Producer" >> "$instructions" + echo "InfoValue: $producer" >> "$instructions" +fi + +copy=$(mktemp) +cp "$file" "$copy" + +pdftk "$copy" update_info "$instructions" output "$file" + +rm "$instructions" "$copy" + + diff --git a/vimrc b/vimrc index e5df06c..c2d7a89 100644 --- a/vimrc +++ b/vimrc @@ -22,7 +22,7 @@ Plugin 'tpope/vim-repeat' Plugin 'vim-airline/vim-airline' Plugin 'vim-airline/vim-airline-themes' Plugin 'airblade/vim-gitgutter' -Plugin 'kien/ctrlp.vim' +Plugin 'ctrlpvim/ctrlp.vim' Plugin 'mbbill/undotree' Plugin 'xolox/vim-misc' Plugin 'xolox/vim-easytags' From b5b3a20c2557773ff2daea2986b6738175c74652 Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Mon, 13 Mar 2017 10:42:50 +0100 Subject: [PATCH 17/44] Typos --- scripts/.gitignore | 1 + scripts/debloc | 4 ++-- xprofile | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 scripts/.gitignore diff --git a/scripts/.gitignore b/scripts/.gitignore new file mode 100644 index 0000000..28a5280 --- /dev/null +++ b/scripts/.gitignore @@ -0,0 +1 @@ +sct diff --git a/scripts/debloc b/scripts/debloc index 252c72c..c371598 100755 --- a/scripts/debloc +++ b/scripts/debloc @@ -19,11 +19,11 @@ fi # Overrides [ -z $DEBLOC_PREFIX ] && DEBLOC_PREFIX=$(dpkg --print-architecture) -[ -z $DEBLOC_DB ] && DEBLOC_DB=${XDG_CONFIG_HOME:-$HOME/.config}/$DEBLOC_PREFIX +[ -z $DEBLOC_DB ] && DEBLOC_DB=${XDG_CONFIG_HOME:-$HOME/.config}/debloc/$DEBLOC_PREFIX [ -z $DEBLOC_ROOT ] && DEBLOC_ROOT=$HOME/.debloc/$DEBLOC_PREFIX DEBLOC_LD=$DEBLOC_ROOT/ld -if [ -z $DEBIAN_MIRROR ]; then +if [ -z "$DEBIAN_MIRROR" ]; then DEBIAN_MIRROR="$(cat /etc/apt/sources.list | grep '^deb ' | grep main | grep -v backports)" DEBIAN_MIRROR="$(echo -e "$DEBIAN_MIRROR" | cut -d ' ' -f 2 | sed 's/\/$//' | sort | uniq)" fi diff --git a/xprofile b/xprofile index 978c2d6..0a6e061 100755 --- a/xprofile +++ b/xprofile @@ -9,6 +9,7 @@ [ -f ~/.Xresources ] && xrdb ~/.Xresources setxkbmap fr oss +xset b off export GTK2_RC_FILES="$HOME/.gtkrc-2.0" From b7b5cf178c779cf35b6265539e84787246fba68a Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Mon, 27 Mar 2017 10:03:44 +0200 Subject: [PATCH 18/44] Yay, commit --- scripts/install-prefs | 18 ++++++++-------- scripts/install-termux | 41 +++++++++++++++++++++++++++++++++++++ .tern-config => tern-config | 0 3 files changed, 50 insertions(+), 9 deletions(-) create mode 100755 scripts/install-termux rename .tern-config => tern-config (100%) diff --git a/scripts/install-prefs b/scripts/install-prefs index 191a76c..4b70dfd 100755 --- a/scripts/install-prefs +++ b/scripts/install-prefs @@ -15,27 +15,27 @@ function prompt { # text } # Don't ask for things that are already there -local TERMUX=0 +TERMUX=0 if [ -d /data/data/com.termux/files ]; then - local TERMUX=1 - local GUI=0 + TERMUX=1 + GUI=0 fi if which i3 &> /dev/null; then - local GUI=1 + GUI=1 fi if [ -z $ADMIN ]; then prompt "Are you a superuser on this machine?" - local ADMIN=$? + ADMIN=$? fi if [ -z $GUI ]; then prompt "Do you want a X environment on this machine?" - local GUI=$? + GUI=$? fi if [ -z $EXTRA ]; then prompt "Do you want not-so-needed software on this machine?" - local EXTRA=$? + EXTRA=$? fi # TODO Verify if the package exists before installing it @@ -98,7 +98,7 @@ elif which dpkg &> /dev/null; then # Finding out if it's already installed or not STATUS=$(mktemp) LANG=C dpkg-query --status $1 &> $STATUS - local installed=0 + installed=0 if [ $? == 0 ]; then cat $STATUS | grep '^Status:' | grep ' installed' --quiet if [ $? == 0 ]; then @@ -217,7 +217,7 @@ vim +PluginInstall +qall if [ $DEBIAN == 1 || $TERMUX == 1 ]; then inst python-dev python3-dev fi -local YCM_ARGS="" +YCM_ARGS="" if [ $TERMUX != 1 ]; then YCM_ARGS="$YCM_ARGS --clang-completer --tern-completer" fi diff --git a/scripts/install-termux b/scripts/install-termux new file mode 100755 index 0000000..51e3437 --- /dev/null +++ b/scripts/install-termux @@ -0,0 +1,41 @@ +#!/data/data/com.termux/files/usr/bin/env bash + +# Setups a Termux system the way I like it + +if [ ! -d /data/data/com.termux/files ]; then + echo "This is not a Termux system (or pacman isn't installed)" + return 1 +fi + +# Configuration +function prompt { # text + while true; do + read -p "$1 [yn] " yn + case $yn in + [Yy]* ) return 1;; + [Nn]* ) return 0;; + * ) echo "Please answer yes or no.";; + esac + done +} + +if [ -z $ROOT ]; then + prompt "Is this device rooted and BusyBox installed in /system/xbin/?" + ROOT=$? +fi + +# Update +apt update +apt upgrade + +# (needed for install-prefs) +apt install coreutils +apt install grep + +# Config +touch ~/.hushlogin + +if [ $ROOT == 1 ]; then + apt install tsu + echo '/system/xbin/mount -o remount,rw /; ln -s /data/data/com.termux/files/usr /usr; /system/xbin/mount -o remount,ro /' | tsu +fi diff --git a/.tern-config b/tern-config similarity index 100% rename from .tern-config rename to tern-config From d985e70520986c4f2566df921ff7d2bfdcdba295 Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Mon, 27 Mar 2017 10:05:29 +0200 Subject: [PATCH 19/44] Another commit yay! --- gitignore | 1 + scripts/install-prefs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/gitignore b/gitignore index 3819313..55b5b75 100644 --- a/gitignore +++ b/gitignore @@ -1,2 +1,3 @@ *.swp *.swo +*.ycm_extra_conf.py diff --git a/scripts/install-prefs b/scripts/install-prefs index 191a76c..123b404 100755 --- a/scripts/install-prefs +++ b/scripts/install-prefs @@ -172,7 +172,7 @@ if [ $TERMUX == 1 ]; then inst tsu fi fi -inst moreutils screen ncdu lsof htop proxytunnel pv curl wget sshfs netcat mosh +inst moreutils screen ncdu lsof htop proxytunnel pv curl wget sshfs netcat mosh bash-completion if [ $ARCH == 1 ]; then inst gopass else From a5a3ae373c6c7749d3a424db5163c1319ed75e1c Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Sat, 22 Apr 2017 18:04:17 +0200 Subject: [PATCH 20/44] cccccache ! --- bashrc | 9 ++++----- config/htop/htoprc | 2 +- scripts/sedrename | 47 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 6 deletions(-) create mode 100755 scripts/sedrename diff --git a/bashrc b/bashrc index ce2bf9e..caac99c 100644 --- a/bashrc +++ b/bashrc @@ -15,10 +15,9 @@ export VISUAL=vim export BROWSER=qutebrowser # Some programs need those changes -if [ -d $HOME/.gem/ruby ]; then - ls $HOME/.gem/ruby | while read rubyVer; do - export PATH="$PATH:$HOME/.gem/ruby/$rubyVer/bin/" - done +export PATH="/usr/lib/ccache/bin/:$PATH" +if [ -d $HOME/.gem/ruby/2.4.0/bin ]; then + export PATH="$HOME/.gem/ruby/2.4.0/bin/:$PATH" fi #export PATH="$(echo "$PATH" | sed 's|:|\n|g' | sort | uniq | tr '\n' ':' | sed 's|:$||')" export JAVA_FONTS=/usr/share/fonts/TTF @@ -29,7 +28,7 @@ export XDG_CONFIG_HOME=$HOME/.config # ALIASES # Completion for existing commands -export LS_OPTIONS='--group-directories-first --time-style=+"%d/%m/%Y %H:%M" --color=auto --classify --human-readable' +export LS_OPTIONS='--group-directories-first --time-style=+"%d/%m/%Y %H:%M:%S" --color=auto --classify --human-readable' alias ls="ls $LS_OPTIONS" alias grep='grep --color=tty -d skip' alias mkdir='mkdir -v' diff --git a/config/htop/htoprc b/config/htop/htoprc index 882a239..51bf9c4 100644 --- a/config/htop/htoprc +++ b/config/htop/htoprc @@ -1,7 +1,7 @@ # Beware! This file is rewritten by htop when settings are changed in the interface. # The parser is also very primitive, and not human-friendly. fields=0 48 17 18 38 39 40 2 46 47 49 1 -sort_key=46 +sort_key=47 sort_direction=1 hide_threads=0 hide_kernel_threads=0 diff --git a/scripts/sedrename b/scripts/sedrename new file mode 100755 index 0000000..9c0f6b4 --- /dev/null +++ b/scripts/sedrename @@ -0,0 +1,47 @@ +#!/usr/bin/env bash + +# Rename a list of files with a sed pattern + +usage() { + echo "Usage: $0 PATTERN [-d] < filelist" + echo + echo "Arguments:" + echo " PATTERN Sed pattern to apply" + echo + echo "Options:" + echo " -d Dry run" + exit 1 +} + +if [[ -z "$1" ]]; then + usage +fi + +pattern="$1" + +dry=1 +if [[ -n "$2" ]]; then + if [[ "$2" = '-d' ]]; then + dry=0 + else + usage + fi +fi + +while read src +do + dst="$(echo "$src" | sed "$pattern")" + if [[ $? != 0 ]]; then + echo "ERREUR Invalid sed pattern" + exit 2 + fi + if [[ $dry == 0 ]]; then + echo "$src" → "$dst" + else + mv "$src" "$dst" + fi + +done + + + From 1f62bb41a7ff1a6f0e88dfa3c97e6724eab5d411 Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Wed, 14 Jun 2017 08:06:40 +0200 Subject: [PATCH 21/44] Commit in a looong time --- bashrc | 20 +++++++- config/htop/htoprc | 4 +- config/i3/config | 2 +- config/i3status/config | 10 ++-- scripts/.gitignore | 1 + scripts/html2pdf | 52 +++++++++++++++++++ scripts/md2html | 113 +++++++++++++++++++++++++++++++++++++++++ scripts/package.json | 22 ++++++++ scripts/remcrlf | 5 ++ scripts/transfer | 20 ++++++++ vimrc | 2 +- 11 files changed, 241 insertions(+), 10 deletions(-) create mode 100755 scripts/html2pdf create mode 100755 scripts/md2html create mode 100644 scripts/package.json create mode 100755 scripts/remcrlf create mode 100755 scripts/transfer diff --git a/bashrc b/bashrc index caac99c..a673ee2 100644 --- a/bashrc +++ b/bashrc @@ -24,6 +24,9 @@ export JAVA_FONTS=/usr/share/fonts/TTF export ANDROID_HOME=/opt/android-sdk export GOPATH=$HOME/.go export XDG_CONFIG_HOME=$HOME/.config +export ARDUINO=/usr/share/arduino +export ARDUINO_DIR=$ARDUINO +export ARDMK_VENDOR=archlinux-arduino # ALIASES @@ -39,6 +42,12 @@ alias rm='rm -Iv --one-file-system' alias free='free -m' alias df='df -h' alias pacman='pacman --color auto' +alias dmesg='dmesg --ctime' + +# Frequent mistakes +alias systemclt=systemctl +alias docker='sudo docker' +alias docker-compose='sudo docker-compose' # Shortcuts for commonly used commands alias ll="ls -l $LS_OPTIONS" @@ -49,6 +58,10 @@ alias s='sudo -s -E' alias po='eval $(proxy off)' alias nw="sudo systemctl restart NetworkManager" alias mc="machines" +alias vpn="sudo systemctl start openvpn-client@$HOSTNAME" +alias vpno="sudo systemctl stop openvpn-client@$HOSTNAME" +alias vpns="sudo systemctl status openvpn-client@$HOSTNAME" +alias vpnr="sudo systemctl restart openvpn-client@$HOSTNAME" # Superseding commands with better ones if they are present if which vim &> /dev/null; then alias vi='vim' @@ -73,7 +86,7 @@ shopt -s extglob shopt -s histappend shopt -s hostcomplete -export HISTSIZE=10000 +export HISTSIZE=100000 export HISTFILESIZE=${HISTSIZE} export HISTCONTROL=ignoreboth @@ -111,3 +124,8 @@ fi [ -r /usr/share/doc/pkgfile/command-not-found.bash ] && . /usr/share/doc/pkgfile/command-not-found.bash # Arch [ -r /etc/profile.d/cnf.sh ] && . /etc/profile.d/cnf.sh # Arch (alternative, for Manjaro mostly) +# Node Version Manager +export NVM_DIR="$HOME/.nvm" +[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" + +[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion diff --git a/config/htop/htoprc b/config/htop/htoprc index 51bf9c4..ee794e5 100644 --- a/config/htop/htoprc +++ b/config/htop/htoprc @@ -1,14 +1,14 @@ # Beware! This file is rewritten by htop when settings are changed in the interface. # The parser is also very primitive, and not human-friendly. fields=0 48 17 18 38 39 40 2 46 47 49 1 -sort_key=47 +sort_key=46 sort_direction=1 hide_threads=0 hide_kernel_threads=0 hide_userland_threads=0 shadow_other_users=0 show_thread_names=0 -show_program_path=1 +show_program_path=0 highlight_base_name=0 highlight_megabytes=0 highlight_threads=1 diff --git a/config/i3/config b/config/i3/config index 98a525d..5da53bb 100644 --- a/config/i3/config +++ b/config/i3/config @@ -51,7 +51,7 @@ set $up_bar killall -USR1 i3status # Start Applications bindsym $mod+Return exec xterm bindsym $mod+p exec thunar -bindsym $mod+m exec qutebrowser +bindsym $mod+m exec qutebrowser --override-restore # Volume control #bindsym XF86AudioRaiseVolume exec amixer -q set Master 5+ unmute; exec $up_bar diff --git a/config/i3status/config b/config/i3status/config index 4e38eb4..5860ec6 100644 --- a/config/i3status/config +++ b/config/i3status/config @@ -36,7 +36,7 @@ ethernet eth0 { ethernet usb0 { # if you use %speed, i3status requires the cap_net_admin capability format_up = " %ip" - format_down = "" + format_down = "📱" } cpu_usage { @@ -56,11 +56,11 @@ battery 0 { path_exists VPN { # path exists when a VPN tunnel launched by nmcli/nm-applet is active path = "/proc/sys/net/ipv4/conf/tun0" - format = "" + format = "🔐" } tztime local { - format = "%d/%m/%Y %H:%M:%S" + format = "🕘 %d/%m/%Y %H:%M:%S" timezone = "Europe/Paris" } @@ -76,8 +76,8 @@ disk "/home" { format = " %avail / %total" } volume master { - format = " %volume" - format_muted = " %volume" + format = "🔈 %volume" + format_muted = "🔇 %volume" device = "default" mixer = "Master" mixer_idx = 0 diff --git a/scripts/.gitignore b/scripts/.gitignore index 28a5280..98b66d7 100644 --- a/scripts/.gitignore +++ b/scripts/.gitignore @@ -1 +1,2 @@ sct +node_modules diff --git a/scripts/html2pdf b/scripts/html2pdf new file mode 100755 index 0000000..8095bd4 --- /dev/null +++ b/scripts/html2pdf @@ -0,0 +1,52 @@ +#!/usr/bin/env node + +// Imports +var fs = require('fs'); +var pdf = require('html-pdf'); +var yargs = require('yargs'); + + +// Understanding +var argv = yargs + .usage("Usage: $0 -o out.pdf [options]") + .example('$0 -i doc.pdf -o doc.pdf', 'Convert doc.html to PDF using the default values') + .help('h') + .alias('h', 'help') + + .describe('i', 'Input file') + .alias('i', 'input') + .default('i', '/dev/stdin') + + .describe('o', 'Output file') + .alias('o', 'output') + + .describe('t', 'Title of file') + .alias('t', 'title') + .default('t', 'Sans titre') + + .demandOption(['o']) + .argv; + + +// Settings +options = { + "base": "file://" + process.cwd() + '/', + "format": "A4", + "orientation": "portrait", + "border": "2cm", + + "footer": { + "height": "10mm", + "contents": { + default: '
' + argv.title + '
{{page}}/{{pages}}
', + } + }, +} + +// Reading +htmlString = fs.readFileSync(argv.i, "utf8"); + +// Conversion +pdf.create(htmlString, options).toFile(argv.o, function(err, res) { + if (err) console.error(err); +}); diff --git a/scripts/md2html b/scripts/md2html new file mode 100755 index 0000000..d284ada --- /dev/null +++ b/scripts/md2html @@ -0,0 +1,113 @@ +#!/usr/bin/env node + +// Imports +var fs = require('fs'); +var marked = require('marked'); +var highlight = require('highlight.js'); +var katex = require('katex'); +var yargs = require('yargs'); +var extend = require('util')._extend; + + +// Constants +var template = ' %TITLE%
%BODY%
' + + +// Understanding +var argv = yargs + .usage("Usage: $0 [options]") + .example('$0 -i doc.md -o doc.html', 'Convert doc.md to HTML using the default template') + .help('h') + .alias('h', 'help') + + .describe('i', 'Input file') + .alias('i', 'input') + .default('i', '/dev/stdin') + + .describe('o', 'Output file') + .alias('o', 'output') + .default('o', '/dev/stdout') + + .describe('t', 'Template file (%BODY% is replaced by the text)') + .alias('t', 'template') + + .argv; + +if (argv.t) { + template = fs.readFileSync(argv.t, "utf8"); +} + + +// Settings + +var extraLangages = { + avrpseudo: function (hljs) { + lang = extend({}, highlight.getLanguage('avrasm')); + lang.keywords.keyword += ' Si Alors Sinon FinSi TantQue FinTantQue Pour FinPour allant de à ←'; + lang.keywords.keyword += ' Lire Sortir sur Appeler Retourner'; + lang.keywords.keyword += ' DecalerDroite DecalerGauche'; + lang.keywords.keyword += ' Incrementer Decrementer'; + lang.keywords.built_in += ' vrai faux'; + lang.contains.push({ + className: 'meta', + begin: /Configurer.+/, + end: /\n/, + }); + return lang; + }, + avrasmplus: function (hljs) { + lang = extend({}, highlight.getLanguage('avrasm')); + lang.keywords.keyword += ' si saut alors et ou if then goto && || <-'; + lang.contains.push({ + className: 'meta', + begin: /@\w+/, + }); + return lang; + }, +}; + +for (lang in extraLangages) { + // This must be done before any call to highlight.highlight :/ + highlight.registerLanguage(lang, extraLangages[lang]); +} + +var renderer = new marked.Renderer(); +marked.setOptions({ + highlight: function (code, lang) { + if (highlight.getLanguage(lang)) { + return highlight.highlight(lang, code).value; + } else { + // if (extraLangages[lang]) { + // highlight.registerLanguage(lang, extraLangages[lang]); + // return highlight.highlight(lang, code).value; + // } else { + // } + console.warn("Unknown language: " + lang); + return highlight.highlightAuto(code).value; + } + } +}); + + +// Processing +markdownString = fs.readFileSync(argv.i, "utf8"); + +// TeX +markdownString = markdownString.replace(/\\\$/g, '$') +markdownString = markdownString.replace(/\$\$([\s\S]+)\$\$/gm, function(glob, formula) { + return katex.renderToString(formula, {displayMode: true}); +}); +markdownString = markdownString.replace(/\$([^$]+)\$/g, function(glob, formula) { + return katex.renderToString(formula, {displayMode: false}); +}); + +// Conversion +htmlString = marked(markdownString, {renderer: renderer}); +fullHtmlString = template.replace('%BODY%', htmlString); + +// Saving +if (argv.o == '/dev/stdout') { + console.log(fullHtmlString); +} else { + fs.writeFileSync(argv.o, fullHtmlString); +} diff --git a/scripts/package.json b/scripts/package.json new file mode 100644 index 0000000..2d615ab --- /dev/null +++ b/scripts/package.json @@ -0,0 +1,22 @@ +{ + "name": "geoffreyfrogeye-dotfiles-scripts", + "version": "1.0.0", + "description": "Stores dependencies used for GeoffreyFrogeye's dotfiles scripts.", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "https://git.frogeye.fr/geoffrey/dotfiles" + }, + "author": "GeoffreyFrogeye", + "license": "GPL-3.0", + "dependencies": { + "highlight.js": "^9.11.0", + "html-pdf": "^2.1.0", + "katex": "^0.7.1", + "marked": "^0.3.6", + "yargs": "^8.0.1" + } +} diff --git a/scripts/remcrlf b/scripts/remcrlf new file mode 100755 index 0000000..ca0f98c --- /dev/null +++ b/scripts/remcrlf @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +# Removes CRLF (^M or \r) from a file + +sed -e "s/^M//" $1 -i diff --git a/scripts/transfer b/scripts/transfer new file mode 100755 index 0000000..a937228 --- /dev/null +++ b/scripts/transfer @@ -0,0 +1,20 @@ +#!/usr/bin/env sh + +if [ $# -eq 0 ] +then + echo -e "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md" + return 1 +fi + +tmpfile=$( mktemp -t transferXXX ) + +if tty -s +then + basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9._-]/-/g') + curl --progress-bar --upload-file "$1" "https://transfer.sh/$basefile" >> $tmpfile +else + curl --progress-bar --upload-file "-" "https://transfer.sh/$1" >> $tmpfile +fi + +cat $tmpfile +rm -f $tmpfile diff --git a/vimrc b/vimrc index c2d7a89..9f319f7 100644 --- a/vimrc +++ b/vimrc @@ -44,7 +44,7 @@ nmap :UndotreeToggle:UndotreeFocus """ CTRLP """ let g:ctrlp_custom_ignore = { - \ 'dir': '\v([\/]\.(git|hg|svn)|node_modules|bower_components|__pycache__|vendor)$', + \ 'dir': '\v([\/]\.(git|hg|svn)|node_modules|bower_components|__pycache__|vendor|output)$', \ 'file': '\v\.(exe|so|dll)$', \ 'link': 'SOME_BAD_SYMBOLIC_LINKS', \ } From c129191829d111e18a4875e77eb54ef0170f01f6 Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Wed, 14 Jun 2017 08:30:08 +0200 Subject: [PATCH 22/44] Separated qutebrowser in public and private --- config/qutebrowser/.dfrecur | 0 config/qutebrowser/keys.conf | 695 ++++++++++++ config/qutebrowser/qutebrowser.conf | 1582 +++++++++++++++++++++++++++ 3 files changed, 2277 insertions(+) create mode 100644 config/qutebrowser/.dfrecur create mode 100644 config/qutebrowser/keys.conf create mode 100644 config/qutebrowser/qutebrowser.conf diff --git a/config/qutebrowser/.dfrecur b/config/qutebrowser/.dfrecur new file mode 100644 index 0000000..e69de29 diff --git a/config/qutebrowser/keys.conf b/config/qutebrowser/keys.conf new file mode 100644 index 0000000..4eaaf91 --- /dev/null +++ b/config/qutebrowser/keys.conf @@ -0,0 +1,695 @@ +# vim: ft=conf +# +# In this config file, qutebrowser's key bindings are configured. +# The format looks like this: +# +# [keymode] +# +# command +# keychain +# keychain2 +# ... +# +# All blank lines and lines starting with '#' are ignored. +# Inline-comments are not permitted. +# +# keymode is a comma separated list of modes in which the key binding should be +# active. If keymode starts with !, the key binding is active in all modes +# except the listed modes. +# +# For special keys (can't be part of a keychain), enclose them in `<`...`>`. +# For modifiers, you can use either `-` or `+` as delimiters, and these names: +# +# * Control: `Control`, `Ctrl` +# * Meta: `Meta`, `Windows`, `Mod4` +# * Alt: `Alt`, `Mod1` +# * Shift: `Shift` +# +# For simple keys (no `<>`-signs), a capital letter means the key is pressed +# with Shift. For special keys (with `<>`-signs), you need to explicitly add +# `Shift-` to match a key pressed with shift. +# +# Note that default keybindings are always bound, and need to be explicitly +# unbound if you wish to remove them: +# +# +# keychain +# keychain2 +# ... + +[!normal] + +leave-mode + + + +[normal] +# Keybindings for normal mode. + +clear-keychain ;; search ;; fullscreen --leave + + +set-cmd-text -s :open + o + +set-cmd-text :open {url:pretty} + go + +set-cmd-text -s :open -t + O + +set-cmd-text :open -t -i {url:pretty} + gO + +set-cmd-text -s :open -b + xo + +set-cmd-text :open -b -i {url:pretty} + xO + +set-cmd-text -s :open -w + wo + +set-cmd-text :open -w {url:pretty} + wO + +set-cmd-text / + / + +set-cmd-text ? + ? + +set-cmd-text : + : + +open -t + ga + + +open -w + + +tab-close + d + + +tab-close -o + D + +tab-only + co + +tab-focus + T + +tab-move + gm + +tab-move - + gl + +tab-move + + gr + +tab-next + J + + +tab-prev + K + + +tab-clone + gC + +reload + r + + +reload -f + R + + +back + H + + +back -t + th + +back -w + wh + +forward + L + + +forward -t + tl + +forward -w + wl + +fullscreen + + +hint + f + +hint all tab + F + +hint all window + wf + +hint all tab-bg + ;b + +hint all tab-fg + ;f + +hint all hover + ;h + +hint images + ;i + +hint images tab + ;I + +hint links fill :open {hint-url} + ;o + +hint links fill :open -t -i {hint-url} + ;O + +hint links yank + ;y + +hint links yank-primary + ;Y + +hint --rapid links tab-bg + ;r + +hint --rapid links window + ;R + +hint links download + ;d + +hint inputs + ;t + +scroll left + h + +scroll down + j + +scroll up + k + +scroll right + l + +undo + u + + +scroll-perc 0 + gg + +scroll-perc + G + +search-next + n + +search-prev + N + +enter-mode insert + i + +enter-mode caret + v + +enter-mode set_mark + ` + +enter-mode jump_mark + ' + +yank + yy + +yank -s + yY + +yank title + yt + +yank title -s + yT + +yank domain + yd + +yank domain -s + yD + +yank pretty-url + yp + +yank pretty-url -s + yP + +open -- {clipboard} + pp + +open -- {primary} + pP + +open -t -- {clipboard} + Pp + +open -t -- {primary} + PP + +open -w -- {clipboard} + wp + +open -w -- {primary} + wP + +quickmark-save + m + +set-cmd-text -s :quickmark-load + b + +set-cmd-text -s :quickmark-load -t + B + +set-cmd-text -s :quickmark-load -w + wb + +bookmark-add + M + +set-cmd-text -s :bookmark-load + gb + +set-cmd-text -s :bookmark-load -t + gB + +set-cmd-text -s :bookmark-load -w + wB + +save + sf + +set-cmd-text -s :set + ss + +set-cmd-text -s :set -t + sl + +set-cmd-text -s :bind + sk + +zoom-out + - + +zoom-in + + + +zoom + = + +navigate prev + [[ + +navigate next + ]] + +navigate prev -t + {{ + +navigate next -t + }} + +navigate up + gu + +navigate up -t + gU + +navigate increment + + +navigate decrement + + +inspector + wi + +download + gd + +download-cancel + ad + +download-clear + cd + +view-source + gf + +set-cmd-text -s :buffer + gt + +tab-focus last + + +enter-mode passthrough + + +quit + + +scroll-page 0 1 + + +scroll-page 0 -1 + + +scroll-page 0 0.5 + + +scroll-page 0 -0.5 + + +tab-focus 1 + + +tab-focus 2 + + +tab-focus 3 + + +tab-focus 4 + + +tab-focus 5 + + +tab-focus 6 + + +tab-focus 7 + + +tab-focus 8 + + +tab-focus 9 + + +home + + +stop + + +print + + +open qute:settings + Ss + +follow-selected + + + + + + + +follow-selected -t + + + +repeat-command + . + +record-macro + q + +run-macro + @ + +wq + ZZ + +[insert] +# Keybindings for insert mode. +# Since normal keypresses are passed through, only special keys are +# supported in this mode. +# Useful hidden commands to map in this section: +# * `open-editor`: Open a texteditor with the focused field. +# * `paste-primary`: Paste primary selection at cursor position. + +open-editor + + +insert-text {primary} + + +[hint] +# Keybindings for hint mode. +# Since normal keypresses are passed through, only special keys are +# supported in this mode. +# Useful hidden commands to map in this section: +# * `follow-hint`: Follow the currently selected hint. + +follow-hint + + + + + + + +hint --rapid links tab-bg + + +hint links + + +hint all tab-bg + + +[command] +# Keybindings for command mode. +# Since normal keypresses are passed through, only special keys are +# supported in this mode. +# Useful hidden commands to map in this section: +# * `command-history-prev`: Switch to previous command in history. +# * `command-history-next`: Switch to next command in history. +# * `completion-item-focus`: Select another item in completion. +# * `command-accept`: Execute the command currently in the commandline. + +command-history-prev + + +command-history-next + + +completion-item-focus prev + + + +completion-item-focus next + + + +completion-item-focus next-category + + +completion-item-focus prev-category + + +completion-item-del + + +command-accept + + + + + + + +[prompt] +# Keybindings for prompts in the status line. +# You can bind normal keys in this mode, but they will be only active +# when a yes/no-prompt is asked. For other prompt modes, you can only +# bind special keys. +# Useful hidden commands to map in this section: +# * `prompt-accept`: Confirm the entered value. +# * `prompt-accept yes`: Answer yes to a yes/no question. +# * `prompt-accept no`: Answer no to a yes/no question. + +prompt-accept + + + + + + + +prompt-accept yes + y + +prompt-accept no + n + +prompt-open-download + + +prompt-item-focus prev + + + +prompt-item-focus next + + + +[command,prompt] + +rl-backward-char + + +rl-forward-char + + +rl-backward-word + + +rl-forward-word + + +rl-beginning-of-line + + +rl-end-of-line + + +rl-unix-line-discard + + +rl-kill-line + + +rl-kill-word + + +rl-unix-word-rubout + + +rl-backward-kill-word + + +rl-yank + + +rl-delete-char + + +rl-backward-delete-char + + +[caret] + +toggle-selection + v + + +drop-selection + + +enter-mode normal + c + +move-to-next-line + j + +move-to-prev-line + k + +move-to-next-char + l + +move-to-prev-char + h + +move-to-end-of-word + e + +move-to-next-word + w + +move-to-prev-word + b + +move-to-start-of-next-block + ] + +move-to-start-of-prev-block + [ + +move-to-end-of-next-block + } + +move-to-end-of-prev-block + { + +move-to-start-of-line + 0 + +move-to-end-of-line + $ + +move-to-start-of-document + gg + +move-to-end-of-document + G + +yank selection -s + Y + +yank selection + y + + + + + + + +scroll left + H + +scroll down + J + +scroll up + K + +scroll right + L + diff --git a/config/qutebrowser/qutebrowser.conf b/config/qutebrowser/qutebrowser.conf new file mode 100644 index 0000000..db7c1a9 --- /dev/null +++ b/config/qutebrowser/qutebrowser.conf @@ -0,0 +1,1582 @@ +# vim: ft=dosini + +# Configfile for qutebrowser. +# +# This configfile is parsed by python's configparser in extended +# interpolation mode. The format is very INI-like, so there are +# categories like [general] with "key = value"-pairs. +# +# Note that you shouldn't add your own comments, as this file is +# regenerated every time the config is saved. +# +# Interpolation looks like ${value} or ${section:value} and will be +# replaced by the respective value. +# +# Some settings will expand environment variables. Note that, since +# interpolation is run first, you will need to escape the $ char as +# described below. +# +# This is the default config, so if you want to remove anything from +# here (as opposed to change/add), for example a key binding, set it to +# an empty value. +# +# You will need to escape the following values: +# - # at the start of the line (at the first position of the key) (\#) +# - $ in a value ($$) + +[general] +# General/miscellaneous options. +# +# ignore-case (IgnoreCase): +# Whether to find text on a page case-insensitively. +# true: Search case-insensitively +# false: Search case-sensitively +# smart: Search case-sensitively if there are capital chars +# Default: smart +# +# startpage (List of String): +# The default page(s) to open at the start, separated by commas. +# Default: https://start.duckduckgo.com +# +# yank-ignored-url-parameters (List of String): +# The URL parameters to strip with :yank url, separated by commas. +# Default: +# ref,utm_source,utm_medium,utm_campaign,utm_term,utm_content +# +# default-open-dispatcher (String): +# The default program used to open downloads. Set to an empty string +# to use the default internal handler. +# Any {} in the string will be expanded to the filename, else the +# filename will be appended. +# Default: +# +# default-page (FuzzyUrl): +# The page to open if :open -t/-b/-w is used without URL. Use +# `about:blank` for a blank page. +# Default: ${startpage} +# +# auto-search (AutoSearch): +# Whether to start a search when something else than a URL is +# entered. +# naive: Use simple/naive check. +# dns: Use DNS requests (might be slow!). +# false: Never search automatically. +# Default: naive +# +# auto-save-config (Bool): +# Whether to save the config automatically on quit. +# Valid values: true, false +# Default: true +# +# auto-save-interval (Int): +# How often (in milliseconds) to auto-save config/cookies/etc. +# Default: 15000 +# +# editor (ShellCommand): +# The editor (and arguments) to use for the `open-editor` command. +# The arguments get split like in a shell, so you can use `"` or `'` +# to quote them. +# `{}` gets replaced by the filename of the file to be edited. +# Default: gvim -f "{}" +# +# editor-encoding (Encoding): +# Encoding to use for editor. +# Default: utf-8 +# +# private-browsing (Bool): +# Do not record visited pages in the history or store web page +# icons. +# Valid values: true, false +# Default: false +# +# developer-extras (Bool): +# Enable extra tools for Web developers. +# This needs to be enabled for `:inspector` to work and also adds an +# _Inspect_ entry to the context menu. For QtWebEngine, see +# 'qutebrowser --help' instead. +# Valid values: true, false +# Default: false +# +# print-element-backgrounds (Bool): +# Whether the background color and images are also drawn when the +# page is printed. +# This setting only works with Qt 5.8 or newer when using the +# QtWebEngine backend. +# Valid values: true, false +# Default: true +# +# xss-auditing (Bool): +# Whether load requests should be monitored for cross-site scripting +# attempts. +# Suspicious scripts will be blocked and reported in the inspector's +# JavaScript console. Enabling this feature might have an impact on +# performance. +# Valid values: true, false +# Default: false +# +# site-specific-quirks (Bool): +# Enable QtWebKit workarounds for broken sites. +# Valid values: true, false +# Default: true +# +# default-encoding (String): +# Default encoding to use for websites. +# The encoding must be a string describing an encoding such as +# _utf-8_, _iso-8859-1_, etc. If left empty a default value will be +# used. +# Default: +# +# new-instance-open-target (String): +# How to open links in an existing instance if a new one is +# launched. +# tab: Open a new tab in the existing window and activate the +# window. +# tab-bg: Open a new background tab in the existing window and +# activate the window. +# tab-silent: Open a new tab in the existing window without +# activating the window. +# tab-bg-silent: Open a new background tab in the existing +# window without activating the window. +# window: Open in a new window. +# Default: tab +# +# new-instance-open-target.window (String): +# Which window to choose when opening links as new tabs. +# first-opened: Open new tabs in the first (oldest) opened +# window. +# last-opened: Open new tabs in the last (newest) opened window. +# last-focused: Open new tabs in the most recently focused +# window. +# last-visible: Open new tabs in the most recently visible +# window. +# Default: last-focused +# +# log-javascript-console (String): +# How to log javascript console messages. +# none: Don't log messages. +# debug: Log messages with debug level. +# info: Log messages with info level. +# Default: debug +# +# save-session (Bool): +# Whether to always save the open pages. +# Valid values: true, false +# Default: false +# +# session-default-name (SessionName): +# The name of the session to save by default, or empty for the last +# loaded session. +# Default: +# +# url-incdec-segments (FlagList): +# The URL segments where `:navigate increment/decrement` will search +# for a number. +# Valid values: host, path, query, anchor +# Default: path,query +ignore-case = smart +startpage = https://geoffrey.frogeye.fr/home.php?eo46hQ7nc9mFMapvuWUyOOm8Ld86eh +yank-ignored-url-parameters = ref,utm_source,utm_medium,utm_campaign,utm_term,utm_content +default-open-dispatcher = +default-page = ${startpage} +auto-search = naive +auto-save-config = true +auto-save-interval = 15000 +editor = gvim -f "{}" +editor-encoding = utf-8 +private-browsing = false +developer-extras = true +print-element-backgrounds = true +xss-auditing = false +site-specific-quirks = false +default-encoding = +new-instance-open-target = tab +new-instance-open-target.window = last-focused +log-javascript-console = debug +save-session = false +session-default-name = +url-incdec-segments = path,query + +[ui] +# General options related to the user interface. +# +# zoom-levels (List of Perc): +# The available zoom levels, separated by commas. +# Default: +# 25%,33%,50%,67%,75%,90%,100%,110%,125%,150%,175%,200%,250%,300%,400%,500% +# +# default-zoom (Perc): +# The default zoom level. +# Default: 100% +# +# downloads-position (VerticalPosition): +# Where to show the downloaded files. +# Valid values: top, bottom +# Default: top +# +# status-position (VerticalPosition): +# The position of the status bar. +# Valid values: top, bottom +# Default: bottom +# +# message-timeout (Int): +# Time (in ms) to show messages in the statusbar for. +# Default: 2000 +# +# message-unfocused (Bool): +# Whether to show messages in unfocused windows. +# Valid values: true, false +# Default: false +# +# confirm-quit (ConfirmQuit): +# Whether to confirm quitting the application. +# always: Always show a confirmation. +# multiple-tabs: Show a confirmation if multiple tabs are +# opened. +# downloads: Show a confirmation if downloads are running +# never: Never show a confirmation. +# Default: never +# +# zoom-text-only (Bool): +# Whether the zoom factor on a frame applies only to the text or to +# all content. +# Valid values: true, false +# Default: false +# +# frame-flattening (Bool): +# Whether to expand each subframe to its contents. +# This will flatten all the frames to become one scrollable page. +# Valid values: true, false +# Default: false +# +# user-stylesheet (File): +# User stylesheet to use (absolute filename or filename relative to +# the config directory). Will expand environment variables. +# Default: +# +# hide-scrollbar (Bool): +# Hide the main scrollbar. +# Valid values: true, false +# Default: true +# +# css-media-type (String): +# Set the CSS media type. +# Default: +# +# smooth-scrolling (Bool): +# Whether to enable smooth scrolling for webpages. +# Valid values: true, false +# Default: false +# +# remove-finished-downloads (Int): +# Number of milliseconds to wait before removing finished downloads. +# Will not be removed if value is -1. +# Default: -1 +# +# hide-statusbar (Bool): +# Whether to hide the statusbar unless a message is shown. +# Valid values: true, false +# Default: false +# +# statusbar-padding (Padding): +# Padding for statusbar (top, bottom, left, right). +# Default: 1,1,0,0 +# +# window-title-format (FormatString): +# The format to use for the window title. The following placeholders +# are defined: +# * `{perc}`: The percentage as a string like `[10%]`. +# * `{perc_raw}`: The raw percentage, e.g. `10` +# * `{title}`: The title of the current web page +# * `{title_sep}`: The string ` - ` if a title is set, empty +# otherwise. +# * `{id}`: The internal window ID of this window. +# * `{scroll_pos}`: The page scroll position. +# * `{host}`: The host of the current web page. +# * `{backend}`: Either 'webkit' or 'webengine' +# Default: {perc}{title}{title_sep}qutebrowser +# +# modal-js-dialog (Bool): +# Use standard JavaScript modal dialog for alert() and confirm() +# Valid values: true, false +# Default: false +# +# hide-wayland-decoration (Bool): +# Hide the window decoration when using wayland (requires restart) +# Valid values: true, false +# Default: false +# +# keyhint-blacklist (List of String): +# Keychains that shouldn't be shown in the keyhint dialog +# Globs are supported, so ';*' will blacklist all keychainsstarting +# with ';'. Use '*' to disable keyhints +# Default: +# +# prompt-radius (Int): +# The rounding radius for the edges of prompts. +# Default: 8 +# +# prompt-filebrowser (Bool): +# Show a filebrowser in upload/download prompts. +# Valid values: true, false +# Default: true +zoom-levels = 25%,33%,50%,67%,75%,90%,100%,110%,125%,150%,175%,200%,250%,300%,400%,500% +default-zoom = 100% +downloads-position = top +status-position = bottom +message-timeout = 2000 +message-unfocused = false +confirm-quit = never +zoom-text-only = false +frame-flattening = false +user-stylesheet = +hide-scrollbar = true +css-media-type = +smooth-scrolling = false +remove-finished-downloads = -1 +hide-statusbar = false +statusbar-padding = 1,1,0,0 +window-title-format = {perc}{title}{title_sep}qutebrowser +modal-js-dialog = false +hide-wayland-decoration = false +keyhint-blacklist = +prompt-radius = 8 +prompt-filebrowser = true + +[network] +# Settings related to the network. +# +# do-not-track (Bool): +# Value to send in the `DNT` header. +# Valid values: true, false +# Default: true +# +# accept-language (String): +# Value to send in the `accept-language` header. +# Default: en-US,en +# +# referer-header (String): +# Send the Referer header +# always: Always send. +# never: Never send; this is not recommended, as some sites may +# break. +# same-domain: Only send for the same domain. This will still +# protect your privacy, but shouldn't break any sites. +# Default: same-domain +# +# user-agent (UserAgent): +# User agent to send. Empty to send the default. +# Default: +# +# proxy (Proxy): +# The proxy to use. +# In addition to the listed values, you can use a `socks://...` or +# `http://...` URL. +# This setting only works with Qt 5.8 or newer when using the +# QtWebEngine backend. +# system: Use the system wide proxy. +# none: Don't use any proxy +# Default: system +# +# proxy-dns-requests (Bool): +# Whether to send DNS requests over the configured proxy. +# Valid values: true, false +# Default: true +# +# ssl-strict (BoolAsk): +# Whether to validate SSL handshakes. +# Valid values: true, false, ask +# Default: ask +# +# dns-prefetch (Bool): +# Whether to try to pre-fetch DNS entries to speed up browsing. +# Valid values: true, false +# Default: true +# +# custom-headers (HeaderDict): +# Set custom headers for qutebrowser HTTP requests. +# Default: +# +# netrc-file (File): +# Set location of a netrc-file for HTTP authentication. If empty, +# ~/.netrc is used. +# Default: +do-not-track = true +accept-language = fr-FR,en-US,en +referer-header = same-domain +user-agent = +proxy = system +proxy-dns-requests = true +ssl-strict = ask +dns-prefetch = true +custom-headers = +netrc-file = + +[completion] +# Options related to completion and command history. +# +# show (String): +# When to show the autocompletion window. +# always: Whenever a completion is available. +# auto: Whenever a completion is requested. +# never: Never. +# Default: always +# +# download-path-suggestion (String): +# What to display in the download filename input. +# path: Show only the download path. +# filename: Show only download filename. +# both: Show download path and filename. +# Default: path +# +# timestamp-format (TimestampTemplate): +# How to format timestamps (e.g. for history) +# Default: %Y-%m-%d +# +# height (PercOrInt): +# The height of the completion, in px or as percentage of the +# window. +# Default: 50% +# +# cmd-history-max-items (Int): +# How many commands to save in the command history. +# 0: no history / -1: unlimited +# Default: 100 +# +# web-history-max-items (Int): +# How many URLs to show in the web history. +# 0: no history / -1: unlimited +# Default: 1000 +# +# quick-complete (Bool): +# Whether to move on to the next part when there's only one possible +# completion left. +# Valid values: true, false +# Default: true +# +# shrink (Bool): +# Whether to shrink the completion to be smaller than the configured +# size if there are no scrollbars. +# Valid values: true, false +# Default: false +# +# scrollbar-width (Int): +# Width of the scrollbar in the completion window (in px). +# Default: 12 +# +# scrollbar-padding (Int): +# Padding of scrollbar handle in completion window (in px). +# Default: 2 +show = always +download-path-suggestion = path +timestamp-format = %Y-%m-%d +height = 50% +cmd-history-max-items = 100 +web-history-max-items = 1000 +quick-complete = true +shrink = false +scrollbar-width = 12 +scrollbar-padding = 2 + +[input] +# Options related to input modes. +# +# timeout (Int): +# Timeout (in milliseconds) for ambiguous key bindings. +# If the current input forms both a complete match and a partial +# match, the complete match will be executed after this time. +# Default: 500 +# +# partial-timeout (Int): +# Timeout (in milliseconds) for partially typed key bindings. +# If the current input forms only partial matches, the keystring +# will be cleared after this time. +# Default: 5000 +# +# insert-mode-on-plugins (Bool): +# Whether to switch to insert mode when clicking flash and other +# plugins. +# Valid values: true, false +# Default: false +# +# auto-leave-insert-mode (Bool): +# Whether to leave insert mode if a non-editable element is clicked. +# Valid values: true, false +# Default: true +# +# auto-insert-mode (Bool): +# Whether to automatically enter insert mode if an editable element +# is focused after page load. +# Valid values: true, false +# Default: false +# +# forward-unbound-keys (String): +# Whether to forward unbound keys to the webview in normal mode. +# all: Forward all unbound keys. +# auto: Forward unbound non-alphanumeric keys. +# none: Don't forward any keys. +# Default: auto +# +# spatial-navigation (Bool): +# Enables or disables the Spatial Navigation feature. +# Spatial navigation consists in the ability to navigate between +# focusable elements in a Web page, such as hyperlinks and form +# controls, by using Left, Right, Up and Down arrow keys. For +# example, if a user presses the Right key, heuristics determine +# whether there is an element he might be trying to reach towards +# the right and which element he probably wants. +# Valid values: true, false +# Default: false +# +# links-included-in-focus-chain (Bool): +# Whether hyperlinks should be included in the keyboard focus chain. +# Valid values: true, false +# Default: true +# +# rocker-gestures (Bool): +# Whether to enable Opera-like mouse rocker gestures. This disables +# the context menu. +# Valid values: true, false +# Default: false +# +# mouse-zoom-divider (Int): +# How much to divide the mouse wheel movements to translate them +# into zoom increments. +# Default: 512 +timeout = 500 +partial-timeout = 1000 +insert-mode-on-plugins = false +auto-leave-insert-mode = true +auto-insert-mode = false +forward-unbound-keys = auto +spatial-navigation = false +links-included-in-focus-chain = true +rocker-gestures = false +mouse-zoom-divider = 512 + +[tabs] +# Configuration of the tab bar. +# +# background-tabs (Bool): +# Whether to open new tabs (middleclick/ctrl+click) in background. +# Valid values: true, false +# Default: false +# +# select-on-remove (SelectOnRemove): +# Which tab to select when the focused tab is removed. +# prev: Select the tab which came before the closed one (left in +# horizontal, above in vertical). +# next: Select the tab which came after the closed one (right in +# horizontal, below in vertical). +# last-used: Select the previously selected tab. +# Default: next +# +# new-tab-position (NewTabPosition): +# How new tabs are positioned. +# prev: Before the current tab. +# next: After the current tab. +# first: At the beginning. +# last: At the end. +# Default: next +# +# new-tab-position-explicit (NewTabPosition): +# How new tabs opened explicitly are positioned. +# prev: Before the current tab. +# next: After the current tab. +# first: At the beginning. +# last: At the end. +# Default: last +# +# last-close (String): +# Behavior when the last tab is closed. +# ignore: Don't do anything. +# blank: Load a blank page. +# startpage: Load the start page. +# default-page: Load the default page. +# close: Close the window. +# Default: ignore +# +# show (String): +# When to show the tab bar +# always: Always show the tab bar. +# never: Always hide the tab bar. +# multiple: Hide the tab bar if only one tab is open. +# switching: Show the tab bar when switching tabs. +# Default: always +# +# show-switching-delay (Int): +# Time to show the tab bar before hiding it when tabs->show is set +# to 'switching'. +# Default: 800 +# +# wrap (Bool): +# Whether to wrap when changing tabs. +# Valid values: true, false +# Default: true +# +# movable (Bool): +# Whether tabs should be movable. +# Valid values: true, false +# Default: true +# +# close-mouse-button (String): +# On which mouse button to close tabs. +# right: Close tabs on right-click. +# middle: Close tabs on middle-click. +# none: Don't close tabs using the mouse. +# Default: middle +# +# position (Position): +# The position of the tab bar. +# Valid values: top, bottom, left, right +# Default: top +# +# show-favicons (Bool): +# Whether to show favicons in the tab bar. +# Valid values: true, false +# Default: true +# +# width (PercOrInt): +# The width of the tab bar if it's vertical, in px or as percentage +# of the window. +# Default: 20% +# +# indicator-width (Int): +# Width of the progress indicator (0 to disable). +# Default: 3 +# +# tabs-are-windows (Bool): +# Whether to open windows instead of tabs. +# Valid values: true, false +# Default: false +# +# title-format (FormatString): +# The format to use for the tab title. The following placeholders +# are defined: +# * `{perc}`: The percentage as a string like `[10%]`. +# * `{perc_raw}`: The raw percentage, e.g. `10` +# * `{title}`: The title of the current web page +# * `{title_sep}`: The string ` - ` if a title is set, empty +# otherwise. +# * `{index}`: The index of this tab. +# * `{id}`: The internal tab ID of this tab. +# * `{scroll_pos}`: The page scroll position. +# * `{host}`: The host of the current web page. +# * `{backend}`: Either 'webkit' or 'webengine' +# Default: {index}: {title} +# +# title-alignment (TextAlignment): +# Alignment of the text inside of tabs +# Valid values: left, right, center +# Default: left +# +# mousewheel-tab-switching (Bool): +# Switch between tabs using the mouse wheel. +# Valid values: true, false +# Default: true +# +# padding (Padding): +# Padding for tabs (top, bottom, left, right). +# Default: 0,0,5,5 +# +# indicator-padding (Padding): +# Padding for indicators (top, bottom, left, right). +# Default: 2,2,0,4 +background-tabs = false +select-on-remove = next +new-tab-position = next +new-tab-position-explicit = last +last-close = ignore +show = multiple +show-switching-delay = 800 +wrap = true +movable = true +close-mouse-button = middle +position = top +show-favicons = true +width = 20% +indicator-width = 3 +tabs-are-windows = true +title-format = {index}: {title} +title-alignment = left +mousewheel-tab-switching = true +padding = 0,0,5,5 +indicator-padding = 2,2,0,4 + +[storage] +# Settings related to cache and storage. +# +# download-directory (Directory): +# The directory to save downloads to. An empty value selects a +# sensible os-specific default. Will expand environment variables. +# Default: +# +# prompt-download-directory (Bool): +# Whether to prompt the user for the download location. +# If set to false, 'download-directory' will be used. +# Valid values: true, false +# Default: true +# +# remember-download-directory (Bool): +# Whether to remember the last used download directory. +# Valid values: true, false +# Default: true +# +# maximum-pages-in-cache (Int): +# The maximum number of pages to hold in the global memory page +# cache. +# The Page Cache allows for a nicer user experience when navigating +# forth or back to pages in the forward/back history, by pausing and +# resuming up to _n_ pages. +# For more information about the feature, please refer to: +# http://webkit.org/blog/427/webkit-page-cache-i-the-basics/ +# Default: +# +# object-cache-capacities (List of WebKitBytes): +# The capacities for the global memory cache for dead objects such +# as stylesheets or scripts. Syntax: cacheMinDeadCapacity, +# cacheMaxDead, totalCapacity. +# The _cacheMinDeadCapacity_ specifies the minimum number of bytes +# that dead objects should consume when the cache is under pressure. +# _cacheMaxDead_ is the maximum number of bytes that dead objects +# should consume when the cache is *not* under pressure. +# _totalCapacity_ specifies the maximum number of bytes that the +# cache should consume *overall*. +# Default: +# +# offline-storage-default-quota (WebKitBytes): +# Default quota for new offline storage databases. +# Default: +# +# offline-web-application-cache-quota (WebKitBytes): +# Quota for the offline web application cache. +# Default: +# +# offline-storage-database (Bool): +# Whether support for the HTML 5 offline storage feature is enabled. +# Valid values: true, false +# Default: true +# +# offline-web-application-storage (Bool): +# Whether support for the HTML 5 web application cache feature is +# enabled. +# An application cache acts like an HTTP cache in some sense. For +# documents that use the application cache via JavaScript, the +# loader engine will first ask the application cache for the +# contents, before hitting the network. +# The feature is described in details at: +# http://dev.w3.org/html5/spec/Overview.html#appcache +# Valid values: true, false +# Default: true +# +# local-storage (Bool): +# Whether support for the HTML 5 local storage feature is enabled. +# Valid values: true, false +# Default: true +# +# cache-size (Int): +# Size of the HTTP network cache. Empty to use the default value. +# Default: +download-directory = +prompt-download-directory = true +remember-download-directory = true +maximum-pages-in-cache = +object-cache-capacities = +offline-storage-default-quota = +offline-web-application-cache-quota = +offline-storage-database = true +offline-web-application-storage = true +local-storage = true +cache-size = 52428800 + +[content] +# Loaded plugins/scripts and allowed actions. +# +# allow-images (Bool): +# Whether images are automatically loaded in web pages. +# Valid values: true, false +# Default: true +# +# allow-javascript (Bool): +# Enables or disables the running of JavaScript programs. +# Valid values: true, false +# Default: true +# +# allow-plugins (Bool): +# Enables or disables plugins in Web pages. +# Qt plugins with a mimetype such as "application/x-qt-plugin" are +# not affected by this setting. +# Valid values: true, false +# Default: false +# +# webgl (Bool): +# Enables or disables WebGL. +# Valid values: true, false +# Default: true +# +# css-regions (Bool): +# Enable or disable support for CSS regions. +# Valid values: true, false +# Default: true +# +# hyperlink-auditing (Bool): +# Enable or disable hyperlink auditing (). +# Valid values: true, false +# Default: false +# +# geolocation (BoolAsk): +# Allow websites to request geolocations. +# Valid values: true, false, ask +# Default: ask +# +# notifications (BoolAsk): +# Allow websites to show notifications. +# Valid values: true, false, ask +# Default: ask +# +# media-capture (BoolAsk): +# Allow websites to record audio/video. +# Valid values: true, false, ask +# Default: ask +# +# javascript-can-open-windows-automatically (Bool): +# Whether JavaScript programs can open new windows without user +# interaction. +# Valid values: true, false +# Default: false +# +# javascript-can-close-windows (Bool): +# Whether JavaScript programs can close windows. +# Valid values: true, false +# Default: false +# +# javascript-can-access-clipboard (Bool): +# Whether JavaScript programs can read or write to the clipboard. +# With QtWebEngine, writing the clipboard as response to a user +# interaction is always allowed. +# Valid values: true, false +# Default: false +# +# ignore-javascript-prompt (Bool): +# Whether all javascript prompts should be ignored. +# Valid values: true, false +# Default: false +# +# ignore-javascript-alert (Bool): +# Whether all javascript alerts should be ignored. +# Valid values: true, false +# Default: false +# +# local-content-can-access-remote-urls (Bool): +# Whether locally loaded documents are allowed to access remote +# urls. +# Valid values: true, false +# Default: false +# +# local-content-can-access-file-urls (Bool): +# Whether locally loaded documents are allowed to access other local +# urls. +# Valid values: true, false +# Default: true +# +# cookies-accept (String): +# Control which cookies to accept. +# all: Accept all cookies. +# no-3rdparty: Accept cookies from the same origin only. +# no-unknown-3rdparty: Accept cookies from the same origin only, +# unless a cookie is already set for the domain. +# never: Don't accept cookies at all. +# Default: no-3rdparty +# +# cookies-store (Bool): +# Whether to store cookies. Note this option needs a restart with +# QtWebEngine. +# Valid values: true, false +# Default: true +# +# host-block-lists (List of Url): +# List of URLs of lists which contain hosts to block. +# The file can be in one of the following formats: +# - An '/etc/hosts'-like file +# - One host per line +# - A zip-file of any of the above, with either only one file, or a +# file named 'hosts' (with any extension). +# Default: +# https://www.malwaredomainlist.com/hostslist/hosts.txt,http://someonewhocares.org/hosts/hosts,http://winhelp2002.mvps.org/hosts.zip,http://malwaredomains.lehigh.edu/files/justdomains.zip,https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&mimetype=plaintext +# +# host-blocking-enabled (Bool): +# Whether host blocking is enabled. +# Valid values: true, false +# Default: true +# +# host-blocking-whitelist (List of String): +# List of domains that should always be loaded, despite being +# ad-blocked. +# Domains may contain * and ? wildcards and are otherwise required +# to exactly match the requested domain. +# Local domains are always exempt from hostblocking. +# Default: piwik.org +# +# enable-pdfjs (Bool): +# Enable pdf.js to view PDF files in the browser. +# Note that the files can still be downloaded by clicking the +# download button in the pdf.js viewer. +# Valid values: true, false +# Default: false +allow-images = true +allow-javascript = true +allow-plugins = false +webgl = true +css-regions = true +hyperlink-auditing = false +geolocation = ask +notifications = true +media-capture = ask +javascript-can-open-windows-automatically = false +javascript-can-close-windows = false +javascript-can-access-clipboard = false +ignore-javascript-prompt = false +ignore-javascript-alert = false +local-content-can-access-remote-urls = false +local-content-can-access-file-urls = true +cookies-accept = no-3rdparty +cookies-store = true +host-block-lists = http://www.malwaredomainlist.com/hostslist/hosts.txt,http://someonewhocares.org/hosts/hosts,http://winhelp2002.mvps.org/hosts.zip,http://malwaredomains.lehigh.edu/files/justdomains.zip,http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&mimetype=plaintext +host-blocking-enabled = true +host-blocking-whitelist = piwik.org +enable-pdfjs = false + +[hints] +# Hinting settings. +# +# border (String): +# CSS border value for hints. +# Default: 1px solid #E3BE23 +# +# mode (String): +# Mode to use for hints. +# number: Use numeric hints. (In this mode you can also type +# letters form the hinted element to filter and reduce the number of +# elements that are hinted.) +# letter: Use the chars in the hints -> chars setting. +# word: Use hints words based on the html elements and the extra +# words. +# Default: letter +# +# chars (UniqueCharString): +# Chars used for hint strings. +# Default: asdfghjkl +# +# min-chars (Int): +# Minimum number of chars used for hint strings. +# Default: 1 +# +# scatter (Bool): +# Whether to scatter hint key chains (like Vimium) or not (like +# dwb). Ignored for number hints. +# Valid values: true, false +# Default: true +# +# uppercase (Bool): +# Make chars in hint strings uppercase. +# Valid values: true, false +# Default: false +# +# dictionary (File): +# The dictionary file to be used by the word hints. +# Default: /usr/share/dict/words +# +# auto-follow (String): +# Controls when a hint can be automatically followed without the +# user pressing Enter. +# always: Auto-follow whenever there is only a single hint on a +# page. +# unique-match: Auto-follow whenever there is a unique non-empty +# match in either the hint string (word mode) or filter (number +# mode). +# full-match: Follow the hint when the user typed the whole hint +# (letter, word or number mode) or the element's text (only in +# number mode). +# never: The user will always need to press Enter to follow a +# hint. +# Default: unique-match +# +# auto-follow-timeout (Int): +# A timeout (in milliseconds) to inhibit normal-mode key bindings +# after a successful auto-follow. +# Default: 0 +# +# next-regexes (List of Regex): +# A comma-separated list of regexes to use for 'next' links. +# Default: +# \bnext\b,\bmore\b,\bnewer\b,\b[>→≫]\b,\b(>>|»)\b,\bcontinue\b +# +# prev-regexes (List of Regex): +# A comma-separated list of regexes to use for 'prev' links. +# Default: \bprev(ious)?\b,\bback\b,\bolder\b,\b[<←≪]\b,\b(<<|«)\b +# +# find-implementation (String): +# Which implementation to use to find elements to hint. +# javascript: Better but slower +# python: Slightly worse but faster +# Default: python +# +# hide-unmatched-rapid-hints (Bool): +# Controls hiding unmatched hints in rapid mode. +# Valid values: true, false +# Default: true +border = 1px solid #E3BE23 +mode = letter +chars = asdfghjkl +min-chars = 1 +scatter = true +uppercase = false +dictionary = /usr/share/dict/words +auto-follow = unique-match +auto-follow-timeout = 0 +next-regexes = \bnext\b,\bmore\b,\bnewer\b,\b[>→≫]\b,\b(>>|»)\b,\bcontinue\b +prev-regexes = \bprev(ious)?\b,\bback\b,\bolder\b,\b[<←≪]\b,\b(<<|«)\b +find-implementation = python +hide-unmatched-rapid-hints = true + +[searchengines] +# Definitions of search engines which can be used via the address bar. +# The searchengine named `DEFAULT` is used when `general -> auto-search` +# is true and something else than a URL was entered to be opened. Other +# search engines can be used by prepending the search engine name to the +# search term, e.g. `:open google qutebrowser`. The string `{}` will be +# replaced by the search term, use `{{` and `}}` for literal `{`/`}` +# signs. +DEFAULT = https://www.qwant.com/?t=web&q={} +arch = https://wiki.archlinux.org/?search={} +gfr = https://www.google.fr/search?hl=fr&q={} +archp = https://www.archlinux.org/packages/?q={} +github = https://github.com/search?q={} +yt = https://www.youtube.com/results?search_query={} +aur = https://aur.archlinux.org/packages/?K={} +gi = http://images.google.com/search?q={} +g = https://www.google.fr/search?q={} +wa = https://www.wolframalpha.com/input/?i={} +dockerhub = https://hub.docker.com/search/?isAutomated=0&isOfficial=0&page=1&pullCount=0&q={}&starCount=0 + +[aliases] +# Aliases for commands. +# By default, no aliases are defined. Example which adds a new command +# `:qtb` to open qutebrowsers website: +# `qtb = open https://www.qutebrowser.org/` + +[colors] +# Colors used in the UI. +# A value can be in one of the following format: +# * `#RGB`/`#RRGGBB`/`#RRRGGGBBB`/`#RRRRGGGGBBBB` +# * An SVG color name as specified in http://www.w3.org/TR/SVG/types.html#ColorKeywords[the W3C specification]. +# * transparent (no color) +# * `rgb(r, g, b)` / `rgba(r, g, b, a)` (values 0-255 or percentages) +# * `hsv(h, s, v)` / `hsva(h, s, v, a)` (values 0-255, hue 0-359) +# * A gradient as explained in http://doc.qt.io/qt-5/stylesheet-reference.html#list-of-property-types[the Qt documentation] under ``Gradient''. +# A *.system value determines the color system to use for color +# interpolation between similarly-named *.start and *.stop entries, +# regardless of how they are defined in the options. Valid values are +# 'rgb', 'hsv', and 'hsl'. +# The `hints.*` values are a special case as they're real CSS colors, not Qt-CSS colors. There, for a gradient, you need to use `-webkit-gradient`, see https://www.webkit.org/blog/175/introducing-css-gradients/[the WebKit documentation]. +# +# completion.fg (QtColor): +# Text color of the completion widget. +# Default: white +# +# completion.bg (QssColor): +# Background color of the completion widget. +# Default: #333333 +# +# completion.alternate-bg (QssColor): +# Alternating background color of the completion widget. +# Default: #444444 +# +# completion.category.fg (QtColor): +# Foreground color of completion widget category headers. +# Default: white +# +# completion.category.bg (QssColor): +# Background color of the completion widget category headers. +# Default: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #888888, +# stop:1 #505050) +# +# completion.category.border.top (QssColor): +# Top border color of the completion widget category headers. +# Default: black +# +# completion.category.border.bottom (QssColor): +# Bottom border color of the completion widget category headers. +# Default: ${completion.category.border.top} +# +# completion.item.selected.fg (QtColor): +# Foreground color of the selected completion item. +# Default: black +# +# completion.item.selected.bg (QssColor): +# Background color of the selected completion item. +# Default: #e8c000 +# +# completion.item.selected.border.top (QssColor): +# Top border color of the completion widget category headers. +# Default: #bbbb00 +# +# completion.item.selected.border.bottom (QssColor): +# Bottom border color of the selected completion item. +# Default: ${completion.item.selected.border.top} +# +# completion.match.fg (QssColor): +# Foreground color of the matched text in the completion. +# Default: #ff4444 +# +# completion.scrollbar.fg (QssColor): +# Color of the scrollbar handle in completion view. +# Default: ${completion.fg} +# +# completion.scrollbar.bg (QssColor): +# Color of the scrollbar in completion view +# Default: ${completion.bg} +# +# statusbar.fg (QssColor): +# Foreground color of the statusbar. +# Default: white +# +# statusbar.bg (QssColor): +# Background color of the statusbar. +# Default: black +# +# statusbar.fg.insert (QssColor): +# Foreground color of the statusbar in insert mode. +# Default: ${statusbar.fg} +# +# statusbar.bg.insert (QssColor): +# Background color of the statusbar in insert mode. +# Default: darkgreen +# +# statusbar.fg.command (QssColor): +# Foreground color of the statusbar in command mode. +# Default: ${statusbar.fg} +# +# statusbar.bg.command (QssColor): +# Background color of the statusbar in command mode. +# Default: ${statusbar.bg} +# +# statusbar.fg.caret (QssColor): +# Foreground color of the statusbar in caret mode. +# Default: ${statusbar.fg} +# +# statusbar.bg.caret (QssColor): +# Background color of the statusbar in caret mode. +# Default: purple +# +# statusbar.fg.caret-selection (QssColor): +# Foreground color of the statusbar in caret mode with a selection +# Default: ${statusbar.fg} +# +# statusbar.bg.caret-selection (QssColor): +# Background color of the statusbar in caret mode with a selection +# Default: #a12dff +# +# statusbar.progress.bg (QssColor): +# Background color of the progress bar. +# Default: white +# +# statusbar.url.fg (QssColor): +# Default foreground color of the URL in the statusbar. +# Default: ${statusbar.fg} +# +# statusbar.url.fg.success (QssColor): +# Foreground color of the URL in the statusbar on successful load +# (http). +# Default: white +# +# statusbar.url.fg.success.https (QssColor): +# Foreground color of the URL in the statusbar on successful load +# (https). +# Default: lime +# +# statusbar.url.fg.error (QssColor): +# Foreground color of the URL in the statusbar on error. +# Default: orange +# +# statusbar.url.fg.warn (QssColor): +# Foreground color of the URL in the statusbar when there's a +# warning. +# Default: yellow +# +# statusbar.url.fg.hover (QssColor): +# Foreground color of the URL in the statusbar for hovered links. +# Default: aqua +# +# tabs.fg.odd (QtColor): +# Foreground color of unselected odd tabs. +# Default: white +# +# tabs.bg.odd (QtColor): +# Background color of unselected odd tabs. +# Default: grey +# +# tabs.fg.even (QtColor): +# Foreground color of unselected even tabs. +# Default: white +# +# tabs.bg.even (QtColor): +# Background color of unselected even tabs. +# Default: darkgrey +# +# tabs.fg.selected.odd (QtColor): +# Foreground color of selected odd tabs. +# Default: white +# +# tabs.bg.selected.odd (QtColor): +# Background color of selected odd tabs. +# Default: black +# +# tabs.fg.selected.even (QtColor): +# Foreground color of selected even tabs. +# Default: ${tabs.fg.selected.odd} +# +# tabs.bg.selected.even (QtColor): +# Background color of selected even tabs. +# Default: ${tabs.bg.selected.odd} +# +# tabs.bg.bar (QtColor): +# Background color of the tab bar. +# Default: #555555 +# +# tabs.indicator.start (QtColor): +# Color gradient start for the tab indicator. +# Default: #0000aa +# +# tabs.indicator.stop (QtColor): +# Color gradient end for the tab indicator. +# Default: #00aa00 +# +# tabs.indicator.error (QtColor): +# Color for the tab indicator on errors.. +# Default: #ff0000 +# +# tabs.indicator.system (ColorSystem): +# Color gradient interpolation system for the tab indicator. +# rgb: Interpolate in the RGB color system. +# hsv: Interpolate in the HSV color system. +# hsl: Interpolate in the HSL color system. +# none: Don't show a gradient. +# Default: rgb +# +# hints.fg (QssColor): +# Font color for hints. +# Default: black +# +# hints.bg (QssColor): +# Background color for hints. Note that you can use a `rgba(...)` +# value for transparency. +# Default: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 rgba(255, +# 247, 133, 0.8), stop:1 rgba(255, 197, 66, 0.8)) +# +# hints.fg.match (QssColor): +# Font color for the matched part of hints. +# Default: green +# +# downloads.bg.bar (QssColor): +# Background color for the download bar. +# Default: black +# +# downloads.fg.start (QtColor): +# Color gradient start for download text. +# Default: white +# +# downloads.bg.start (QtColor): +# Color gradient start for download backgrounds. +# Default: #0000aa +# +# downloads.fg.stop (QtColor): +# Color gradient end for download text. +# Default: ${downloads.fg.start} +# +# downloads.bg.stop (QtColor): +# Color gradient stop for download backgrounds. +# Default: #00aa00 +# +# downloads.fg.system (ColorSystem): +# Color gradient interpolation system for download text. +# rgb: Interpolate in the RGB color system. +# hsv: Interpolate in the HSV color system. +# hsl: Interpolate in the HSL color system. +# none: Don't show a gradient. +# Default: rgb +# +# downloads.bg.system (ColorSystem): +# Color gradient interpolation system for download backgrounds. +# rgb: Interpolate in the RGB color system. +# hsv: Interpolate in the HSV color system. +# hsl: Interpolate in the HSL color system. +# none: Don't show a gradient. +# Default: rgb +# +# downloads.fg.error (QtColor): +# Foreground color for downloads with errors. +# Default: white +# +# downloads.bg.error (QtColor): +# Background color for downloads with errors. +# Default: red +# +# webpage.bg (QtColor): +# Background color for webpages if unset (or empty to use the +# theme's color) +# Default: white +# +# keyhint.fg (QssColor): +# Text color for the keyhint widget. +# Default: #FFFFFF +# +# keyhint.fg.suffix (CssColor): +# Highlight color for keys to complete the current keychain +# Default: #FFFF00 +# +# keyhint.bg (QssColor): +# Background color of the keyhint widget. +# Default: rgba(0, 0, 0, 80%) +# +# messages.fg.error (QssColor): +# Foreground color of an error message. +# Default: white +# +# messages.bg.error (QssColor): +# Background color of an error message. +# Default: red +# +# messages.border.error (QssColor): +# Border color of an error message. +# Default: #bb0000 +# +# messages.fg.warning (QssColor): +# Foreground color a warning message. +# Default: white +# +# messages.bg.warning (QssColor): +# Background color of a warning message. +# Default: darkorange +# +# messages.border.warning (QssColor): +# Border color of an error message. +# Default: #d47300 +# +# messages.fg.info (QssColor): +# Foreground color an info message. +# Default: white +# +# messages.bg.info (QssColor): +# Background color of an info message. +# Default: black +# +# messages.border.info (QssColor): +# Border color of an info message. +# Default: #333333 +# +# prompts.fg (QssColor): +# Foreground color for prompts. +# Default: white +# +# prompts.bg (QssColor): +# Background color for prompts. +# Default: darkblue +# +# prompts.selected.bg (QssColor): +# Background color for the selected item in filename prompts. +# Default: #308cc6 +completion.fg = #f1ebeb +completion.bg = #58584e +completion.alternate-bg = #48483e +completion.category.fg = #f1ebeb +completion.category.bg = qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #76715e, stop:1 #48483e) +completion.category.border.top = #272822 +completion.category.border.bottom = ${completion.category.border.top} +completion.item.selected.fg = ${completion.fg} +completion.item.selected.bg = #d4c96e +completion.item.selected.border.top = #e7db75 +completion.item.selected.border.bottom = ${completion.item.selected.border.top} +completion.match.fg = #fa2772 +completion.scrollbar.fg = ${completion.fg} +completion.scrollbar.bg = ${completion.bg} +statusbar.fg = #f1ebeb +statusbar.bg = #272822 +statusbar.fg.insert = ${statusbar.fg} +statusbar.bg.insert = #8fc029 +statusbar.fg.command = ${statusbar.fg} +statusbar.bg.command = ${statusbar.bg} +statusbar.fg.caret = ${statusbar.fg} +statusbar.bg.caret = #9358fe +statusbar.fg.caret-selection = ${statusbar.fg} +statusbar.bg.caret-selection = #55bcce +statusbar.progress.bg = ${statusbar.fg} +statusbar.url.fg = ${statusbar.fg} +statusbar.url.fg.success = #66efd5 +statusbar.url.fg.success.https = #a7e22e +statusbar.url.fg.error = #fa2772 +statusbar.url.fg.warn = #e7db75 +statusbar.url.fg.hover = #ae82ff +tabs.fg.odd = ${completion.fg} +tabs.bg.odd = ${completion.bg} +tabs.fg.even = ${completion.fg} +tabs.bg.even = ${completion.alternate-bg} +tabs.fg.selected.odd = ${completion.item.selected.fg} +tabs.bg.selected.odd = ${completion.item.selected.bg} +tabs.fg.selected.even = ${tabs.fg.selected.odd} +tabs.bg.selected.even = ${tabs.bg.selected.odd} +tabs.bg.bar = ${statusbar.bg} +tabs.indicator.start = #55bcce +tabs.indicator.stop = #8fc029 +tabs.indicator.error = #dc2566 +tabs.indicator.system = rgb +hints.fg = #272822 +hints.bg = qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 rgba(212, 201, 110, 0.8), stop:1 rgba(231, 219, 117, 0.8)) +hints.fg.match = #8fc029 +downloads.bg.bar = ${statusbar.bg} +downloads.fg.start = ${statusbar.fg} +downloads.bg.start = #48483e +downloads.fg.stop = ${downloads.fg.start} +downloads.bg.stop = #8fc029 +downloads.fg.system = rgb +downloads.bg.system = rgb +downloads.fg.error = ${downloads.fg.start} +downloads.bg.error = ${messages.bg.error} +webpage.bg = white +keyhint.fg = #FFFFFF +keyhint.fg.suffix = #FFFF00 +keyhint.bg = rgba(0, 0, 0, 80%) +messages.fg.error = ${statusbar.fg} +messages.bg.error = #dc2566 +messages.border.error = #fa2772 +messages.fg.warning = ${statusbar.fg} +messages.bg.warning = #d4c96e +messages.border.warning = #e7db75 +messages.fg.info = ${statusbar.fg} +messages.bg.info = #55bcce +messages.border.info = #66d9ee +prompts.fg = ${statusbar.fg} +prompts.bg = #56b7a5 +prompts.selected.bg = #55bcce + +[fonts] +# Fonts used for the UI, with optional style/weight/size. +# * Style: `normal`/`italic`/`oblique` +# * Weight: `normal`, `bold`, `100`..`900` +# * Size: _number_ `px`/`pt` +# +# _monospace (Font): +# Default monospace fonts. +# Default: Terminus, Monospace, "DejaVu Sans Mono", Monaco, +# "Bitstream Vera Sans Mono", "Andale Mono", "Courier New", Courier, +# "Liberation Mono", monospace, Fixed, Consolas, Terminal +# +# completion (Font): +# Font used in the completion widget. +# Default: 8pt ${_monospace} +# +# completion.category (Font): +# Font used in the completion categories. +# Default: bold ${completion} +# +# tabbar (QtFont): +# Font used in the tab bar. +# Default: 8pt ${_monospace} +# +# statusbar (Font): +# Font used in the statusbar. +# Default: 8pt ${_monospace} +# +# downloads (Font): +# Font used for the downloadbar. +# Default: 8pt ${_monospace} +# +# hints (Font): +# Font used for the hints. +# Default: bold 13px ${_monospace} +# +# debug-console (QtFont): +# Font used for the debugging console. +# Default: 8pt ${_monospace} +# +# web-family-standard (FontFamily): +# Font family for standard fonts. +# Default: +# +# web-family-fixed (FontFamily): +# Font family for fixed fonts. +# Default: +# +# web-family-serif (FontFamily): +# Font family for serif fonts. +# Default: +# +# web-family-sans-serif (FontFamily): +# Font family for sans-serif fonts. +# Default: +# +# web-family-cursive (FontFamily): +# Font family for cursive fonts. +# Default: +# +# web-family-fantasy (FontFamily): +# Font family for fantasy fonts. +# Default: +# +# web-size-minimum (Int): +# The hard minimum font size. +# Default: +# +# web-size-minimum-logical (Int): +# The minimum logical font size that is applied when zooming out. +# Default: +# +# web-size-default (Int): +# The default font size for regular text. +# Default: +# +# web-size-default-fixed (Int): +# The default font size for fixed-pitch text. +# Default: +# +# keyhint (Font): +# Font used in the keyhint widget. +# Default: 8pt ${_monospace} +# +# messages.error (Font): +# Font used for error messages. +# Default: 8pt ${_monospace} +# +# messages.warning (Font): +# Font used for warning messages. +# Default: 8pt ${_monospace} +# +# messages.info (Font): +# Font used for info messages. +# Default: 8pt ${_monospace} +# +# prompts (Font): +# Font used for prompts. +# Default: 8pt sans-serif +_monospace = Terminus, Monospace, "DejaVu Sans Mono", Monaco, "Bitstream Vera Sans Mono", "Andale Mono", "Courier New", Courier, "Liberation Mono", monospace, Fixed, Consolas, Terminal +completion = 8pt ${_monospace} +completion.category = bold ${completion} +tabbar = 8pt ${_monospace} +statusbar = 8pt ${_monospace} +downloads = 8pt ${_monospace} +hints = bold 13px ${_monospace} +debug-console = 8pt ${_monospace} +web-family-standard = +web-family-fixed = +web-family-serif = +web-family-sans-serif = +web-family-cursive = +web-family-fantasy = +web-size-minimum = +web-size-minimum-logical = +web-size-default = +web-size-default-fixed = +keyhint = 8pt ${_monospace} +messages.error = 8pt ${_monospace} +messages.warning = 8pt ${_monospace} +messages.info = 8pt ${_monospace} +prompts = 8pt sans-serif From e17af8c95c275f49fc092d577090877ca2c0f1e2 Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Wed, 14 Jun 2017 09:26:25 +0200 Subject: [PATCH 23/44] Dynamic loading of some scripts --- bashrc | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/bashrc b/bashrc index a673ee2..784433b 100644 --- a/bashrc +++ b/bashrc @@ -115,17 +115,31 @@ export PATH="$HOME/.scripts/:$PATH" [ -f /etc/bash_completion ] && . /etc/bash_completion # Bad day mood-saver -if which thefuck &> /dev/null; then - alias fuck='TF_CMD=$(TF_ALIAS=fuck PYTHONIOENCODING=utf-8 TF_SHELL_ALIASES=$(alias) thefuck $(fc -ln -1)) && eval $TF_CMD && history -s $TF_CMD' - alias FUCK='fuck' -fi +fuck() { + if which thefuck &> /dev/null + then + eval $(thefuck --alias) + fuck + else + echo "thefuck is not installed on this system." + fi +} +alias FUCK='fuck' + +# Node Version Manager +nvm() { + if [ -s "$NVM_DIR/nvm.sh" ] + then + . "$NVM_DIR/nvm.sh" + [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" + export NVM_DIR="$HOME/.nvm" + nvm + else + echo "NVM is not installed on this system." + fi +} # Command not found handlers [ -r /usr/share/doc/pkgfile/command-not-found.bash ] && . /usr/share/doc/pkgfile/command-not-found.bash # Arch [ -r /etc/profile.d/cnf.sh ] && . /etc/profile.d/cnf.sh # Arch (alternative, for Manjaro mostly) -# Node Version Manager -export NVM_DIR="$HOME/.nvm" -[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" - -[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion From aa493e63df2bc8922238ed030c6dc492eeb7dc4c Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Wed, 14 Jun 2017 13:04:36 +0200 Subject: [PATCH 24/44] jjdlsqkjdlskq --- config/qutebrowser/qutebrowser.conf | 1 + scripts/install-prefs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/config/qutebrowser/qutebrowser.conf b/config/qutebrowser/qutebrowser.conf index db7c1a9..1d9b006 100644 --- a/config/qutebrowser/qutebrowser.conf +++ b/config/qutebrowser/qutebrowser.conf @@ -1057,6 +1057,7 @@ gi = http://images.google.com/search?q={} g = https://www.google.fr/search?q={} wa = https://www.wolframalpha.com/input/?i={} dockerhub = https://hub.docker.com/search/?isAutomated=0&isOfficial=0&page=1&pullCount=0&q={}&starCount=0 +npm = https://www.npmjs.com/search?q={} [aliases] # Aliases for commands. diff --git a/scripts/install-prefs b/scripts/install-prefs index 1522b67..33f4601 100755 --- a/scripts/install-prefs +++ b/scripts/install-prefs @@ -274,13 +274,13 @@ fi if [ $EXTRA == 1 ]; then # Extra dev - inst cmake clang llvm + inst cmake clang llvm npm # Extra CLI inst sl ffmpeg youtube-dl if [ $ARCH == 1 ]; then - altInst pdftk translate-shell + altInst pdftk translate-shell git-lfs js-beautify fi # Extra GUI From be3f7a031897a7b94a0c94f21be823c6c61fdacd Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Wed, 14 Jun 2017 18:26:55 +0200 Subject: [PATCH 25/44] Whooops Security by obscurity is never the solution, especially if you're not very enlightened... --- config/i3/config | 2 +- config/qutebrowser/qutebrowser.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/i3/config b/config/i3/config index 5da53bb..092b4cd 100644 --- a/config/i3/config +++ b/config/i3/config @@ -102,7 +102,7 @@ bindsym $mod+Shift+l move right #bindsym $mod+Shift+Right move right # workspace back and forth (with/without active container) -workspace_auto_back_and_forth yes +workspace_auto_back_and_forth no bindsym $mod+b workspace back_and_forth bindsym $mod+Shift+b move container to workspace back_and_forth; workspace back_and_forth diff --git a/config/qutebrowser/qutebrowser.conf b/config/qutebrowser/qutebrowser.conf index 1d9b006..64d282d 100644 --- a/config/qutebrowser/qutebrowser.conf +++ b/config/qutebrowser/qutebrowser.conf @@ -174,7 +174,7 @@ # Valid values: host, path, query, anchor # Default: path,query ignore-case = smart -startpage = https://geoffrey.frogeye.fr/home.php?eo46hQ7nc9mFMapvuWUyOOm8Ld86eh +startpage = https://geoffrey.frogeye.fr/home.php yank-ignored-url-parameters = ref,utm_source,utm_medium,utm_campaign,utm_term,utm_content default-open-dispatcher = default-page = ${startpage} From d419726ba6160302b4508116ac2408ef4fcc4c4a Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Wed, 21 Jun 2017 20:02:03 +0200 Subject: [PATCH 26/44] rep rep rep --- scripts/install-prefs | 2 +- scripts/rep | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 scripts/rep diff --git a/scripts/install-prefs b/scripts/install-prefs index 33f4601..e0960d2 100755 --- a/scripts/install-prefs +++ b/scripts/install-prefs @@ -250,7 +250,7 @@ if [ $GUI == 1 ]; then rm -rf $TMP_DIR elif [ $ARCH == 1 ]; then - altInst qutebrowser + inst qutebrowser qt5-webengine fi # Screen filter diff --git a/scripts/rep b/scripts/rep new file mode 100644 index 0000000..217c415 --- /dev/null +++ b/scripts/rep @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +mv "$1" "$2" +ln -s "$2" "$1" From 1d0147c8fe36128a17d3d5aeb009030ce79c186c Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Wed, 21 Jun 2017 20:05:05 +0200 Subject: [PATCH 27/44] Old bash --- bashrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bashrc b/bashrc index 784433b..0de3cba 100644 --- a/bashrc +++ b/bashrc @@ -115,7 +115,7 @@ export PATH="$HOME/.scripts/:$PATH" [ -f /etc/bash_completion ] && . /etc/bash_completion # Bad day mood-saver -fuck() { +function fuck { if which thefuck &> /dev/null then eval $(thefuck --alias) @@ -127,7 +127,7 @@ fuck() { alias FUCK='fuck' # Node Version Manager -nvm() { +function nvm { if [ -s "$NVM_DIR/nvm.sh" ] then . "$NVM_DIR/nvm.sh" From d11432643fbcc53db19f25fa4dadcee2fd2dfa65 Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Wed, 21 Jun 2017 20:06:36 +0200 Subject: [PATCH 28/44] +x --- scripts/rep | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 scripts/rep diff --git a/scripts/rep b/scripts/rep old mode 100644 new mode 100755 From b44b414829a8613fb75630f116fe4f486f64cf64 Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Tue, 27 Jun 2017 08:14:12 +0200 Subject: [PATCH 29/44] Thingies --- bashrc | 2 -- inputrc | 36 +++++++++++++++++++++++++++--------- scripts/install-prefs | 2 +- vimrc | 2 +- 4 files changed, 29 insertions(+), 13 deletions(-) diff --git a/bashrc b/bashrc index 0de3cba..ba88ae3 100644 --- a/bashrc +++ b/bashrc @@ -46,8 +46,6 @@ alias dmesg='dmesg --ctime' # Frequent mistakes alias systemclt=systemctl -alias docker='sudo docker' -alias docker-compose='sudo docker-compose' # Shortcuts for commonly used commands alias ll="ls -l $LS_OPTIONS" diff --git a/inputrc b/inputrc index c95c889..9f4f421 100644 --- a/inputrc +++ b/inputrc @@ -1,16 +1,34 @@ $include /etc/inputrc +set bell-style none +set completion-ignore-case on +set completion-prefix-display-length 4 +set completion-query-items 200 set editing-mode vi +set history-preserve-point on +set history-size 10000 +set horizontal-scroll-mode on +set mark-directories on +set mark-modified-lines off +set mark-symlinked-directories on +set match-hidden-files on +set page-completions on +set print-completions-horizontally on +set revert-all-at-newline off set show-all-if-ambiguous on +set show-all-if-unmodified on +set skip-completed-text on set visible-stats on -set page-completions off + $if mode=vi -set keymap vi-command -# these are for vi-command mode -"\e[A": history-search-backward -"\e[B": history-search-forward -set keymap vi-insert -# these are for vi-insert mode -"\e[A": history-search-backward -"\e[B": history-search-forward + set keymap vi-command + # these are for vi-command mode + "\e[A": history-search-backward + "\e[B": history-search-forward + Control-l: clear-screen + set keymap vi-insert + # these are for vi-insert mode + "\e[A": history-search-backward + "\e[B": history-search-forward + Control-l: clear-screen $endif diff --git a/scripts/install-prefs b/scripts/install-prefs index e0960d2..68fadb7 100755 --- a/scripts/install-prefs +++ b/scripts/install-prefs @@ -280,7 +280,7 @@ if [ $EXTRA == 1 ]; then inst sl ffmpeg youtube-dl if [ $ARCH == 1 ]; then - altInst pdftk translate-shell git-lfs js-beautify + altInst pdftk translate-shell git-lfs js-beautify insect fi # Extra GUI diff --git a/vimrc b/vimrc index 9f319f7..b4a254c 100644 --- a/vimrc +++ b/vimrc @@ -44,7 +44,7 @@ nmap :UndotreeToggle:UndotreeFocus """ CTRLP """ let g:ctrlp_custom_ignore = { - \ 'dir': '\v([\/]\.(git|hg|svn)|node_modules|bower_components|__pycache__|vendor|output)$', + \ 'dir': '\v([\/]\.(git|hg|svn)|node_modules|bower_components|__pycache__|vendor|output|buildroot)$', \ 'file': '\v\.(exe|so|dll)$', \ 'link': 'SOME_BAD_SYMBOLIC_LINKS', \ } From 291597424bc5289018fed791e17ce6a81d197a66 Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Tue, 27 Jun 2017 09:19:26 +0200 Subject: [PATCH 30/44] Thingies in a parallel universe --- bashrc | 8 +++----- inputrc | 2 ++ scripts/install-prefs | 8 +++++--- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/bashrc b/bashrc index 784433b..244e02f 100644 --- a/bashrc +++ b/bashrc @@ -46,8 +46,6 @@ alias dmesg='dmesg --ctime' # Frequent mistakes alias systemclt=systemctl -alias docker='sudo docker' -alias docker-compose='sudo docker-compose' # Shortcuts for commonly used commands alias ll="ls -l $LS_OPTIONS" @@ -119,7 +117,7 @@ fuck() { if which thefuck &> /dev/null then eval $(thefuck --alias) - fuck + fuck $@ else echo "thefuck is not installed on this system." fi @@ -128,12 +126,12 @@ alias FUCK='fuck' # Node Version Manager nvm() { + export NVM_DIR="$HOME/.nvm" if [ -s "$NVM_DIR/nvm.sh" ] then . "$NVM_DIR/nvm.sh" [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" - export NVM_DIR="$HOME/.nvm" - nvm + nvm $@ else echo "NVM is not installed on this system." fi diff --git a/inputrc b/inputrc index c95c889..0ac0721 100644 --- a/inputrc +++ b/inputrc @@ -8,9 +8,11 @@ set keymap vi-command # these are for vi-command mode "\e[A": history-search-backward "\e[B": history-search-forward +Control-l: clear-screen set keymap vi-insert # these are for vi-insert mode "\e[A": history-search-backward "\e[B": history-search-forward +Control-l: clear-screen $endif diff --git a/scripts/install-prefs b/scripts/install-prefs index 33f4601..7159c13 100755 --- a/scripts/install-prefs +++ b/scripts/install-prefs @@ -164,6 +164,8 @@ function altInst { # Common CLI +.Xresources.d/configure + # Utils inst coreutils man openssl-tool grep sed sh tar if [ $TERMUX == 1 ]; then @@ -180,7 +182,7 @@ else fi if [[ $ARCH == 1 && $ADMIN == 1 ]]; then inst pkgfile - systemctl enable pkgfile-update.timer + sudo systemctl enable pkgfile-update.timer fi # Dev @@ -227,7 +229,7 @@ python $HOME/.vim/bundle/YouCompleteMe/install.py $YCM_ARGS if [ $GUI == 1 ]; then # Desktop manager - inst i3 i3lock i3status dunst unclutter xautolock feh numlockx scrot + inst i3 i3lock i3status dunst unclutter xautolock feh numlockx scrot xterm xclip if [ $DEBIAN == 1 ]; then inst suckless-tools if [ $ADMIN == 0 ]; then @@ -285,7 +287,7 @@ if [ $EXTRA == 1 ]; then # Extra GUI if [ $GUI == 1 ]; then - inst vlc gimp mpd vimpc + inst vlc gimp mpd vimpc alsa-utils if [ $ARCH == 1 ]; then inst simplescreenrecorder From ef42de3a2da885ef375ba6ac093a3812acb00f46 Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Tue, 27 Jun 2017 09:19:59 +0200 Subject: [PATCH 31/44] Three screens setup --- config/i3/config | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/config/i3/config b/config/i3/config index 5da53bb..ec526a2 100644 --- a/config/i3/config +++ b/config/i3/config @@ -51,7 +51,7 @@ set $up_bar killall -USR1 i3status # Start Applications bindsym $mod+Return exec xterm bindsym $mod+p exec thunar -bindsym $mod+m exec qutebrowser --override-restore +bindsym $mod+m exec qutebrowser --override-restore --backend=webengine # Volume control #bindsym XF86AudioRaiseVolume exec amixer -q set Master 5+ unmute; exec $up_bar @@ -102,7 +102,7 @@ bindsym $mod+Shift+l move right #bindsym $mod+Shift+Right move right # workspace back and forth (with/without active container) -workspace_auto_back_and_forth yes +workspace_auto_back_and_forth no bindsym $mod+b workspace back_and_forth bindsym $mod+Shift+b move container to workspace back_and_forth; workspace back_and_forth @@ -145,16 +145,16 @@ set $WS9 9 Veille set $WS10 10 Musique # Workspace output -workspace "$WS1" output LVDS1 -workspace "$WS2" output VGA1 -workspace "$WS3" output LVDS1 -workspace "$WS4" output VGA1 -workspace "$WS5" output LVDS1 -workspace "$WS6" output VGA1 -workspace "$WS7" output LVDS1 -workspace "$WS8" output VGA1 -workspace "$WS9" output LVDS1 -workspace "$WS10" output VGA1 +workspace "$WS1" output DP-5 +workspace "$WS2" output DP-3 +workspace "$WS3" output VGA-0 +workspace "$WS4" output DP-5 +workspace "$WS5" output DP-3 +workspace "$WS6" output VGA-0 +workspace "$WS7" output DP-5 +workspace "$WS8" output DP-3 +workspace "$WS9" output VGA-0 +workspace "$WS10" output DP-5 # switch to workspace bindsym $mod+1 workspace $WS1 @@ -312,7 +312,9 @@ mode "$mode_screen_select" { bindsym Return mode "default" bindsym Escape mode "default" } -bindsym $mod+t mode "$mode_screen_select" +#bindsym $mod+t mode "$mode_screen_select" +set $screen_config xrandr --output DP-3 --output VGA-0 --auto --right-of DP-3 --output DP-5 --auto --left-of DP-3 --dpi 100; $background +bindsym $mod+t exec "$screen_config" set $mode_screen_VGA1 VGA [R] Right [L] Left [U] Up [D] Down [C] Copy [O] Off mode "$mode_screen_VGA1" { @@ -398,6 +400,7 @@ bar { } # Inactivity settings +exec "$screen_config" exec --no-startup-id xautolock -time 10 -locker 'xset dpms force standby' -killtime 1 -killer '$locker' bindsym $mod+F4 exec --no-startup-id xautolock -disable bindsym $mod+F5 exec --no-startup-id xautolock -enable From 652fa6ac2b04d5e83cbcf637c0e28cfa33a815c1 Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Sun, 2 Jul 2017 22:06:24 +0200 Subject: [PATCH 32/44] polyyyybark --- Xresources.d/xterm | 3 + config/i3/config | 30 ++-- config/polybar/: | 23 +++ config/polybar/config | 335 +++++++++++++++++++++++++++++++++++++++ config/polybar/launch.sh | 16 ++ scripts/install-prefs | 7 +- scripts/optimize | 10 +- scripts/rep | 21 +++ vimrc | 1 + 9 files changed, 426 insertions(+), 20 deletions(-) create mode 100644 config/polybar/: create mode 100644 config/polybar/config create mode 100755 config/polybar/launch.sh diff --git a/Xresources.d/xterm b/Xresources.d/xterm index 7eedaa8..40f323f 100644 --- a/Xresources.d/xterm +++ b/Xresources.d/xterm @@ -10,3 +10,6 @@ xterm*rightScrollBar: false xterm*jumpScroll: true xterm*multiScroll: true xterm*toolBar: false +XTerm.vt100.translations: #override \n\ + Ctrl Shift C: copy-selection(CLIPBOARD) \n\ + Ctrl Shift V: insert-selection(CLIPBOARD) diff --git a/config/i3/config b/config/i3/config index 092b4cd..5d07b70 100644 --- a/config/i3/config +++ b/config/i3/config @@ -22,6 +22,7 @@ hide_edge_borders both # Font for window titles. Will also be used by the bar unless a different font # is used in the bar {} block below. +font pango:Source Code Pro 8 font pango:DejaVu Sans Mono 8 font pango:Sans 8 @@ -51,7 +52,7 @@ set $up_bar killall -USR1 i3status # Start Applications bindsym $mod+Return exec xterm bindsym $mod+p exec thunar -bindsym $mod+m exec qutebrowser --override-restore +bindsym $mod+m exec qutebrowser --override-restore --backend=webengine # Volume control #bindsym XF86AudioRaiseVolume exec amixer -q set Master 5+ unmute; exec $up_bar @@ -133,16 +134,16 @@ bindsym $mod+a focus parent bindsym $mod+q focus child # Workspace names -set $WS1 1 Édition -set $WS2 2 Éxecution -set $WS3 3 Organisation -set $WS4 4 Référence -set $WS5 5 Divers 1 -set $WS6 6 Divers 2 -set $WS7 7 Contact -set $WS8 8 Social -set $WS9 9 Veille -set $WS10 10 Musique +set $WS1 1 +set $WS2 2 +set $WS3 3 +set $WS4 4 +set $WS5 5 +set $WS6 6 +set $WS7 7 +set $WS8 8 +set $WS9 9 +set $WS10 10 # Workspace output workspace "$WS1" output LVDS1 @@ -379,9 +380,9 @@ set $15 #cfd0c2 # Start i3bar to display a workspace bar (plus the system information i3status if available) bar { - #i3bar_command ~/.config/lemonbar/i3_lemonbar.sh - mode hide - status_command i3status + i3bar_command ~/.config/polybar/launch.sh + #mode hide + #status_command ~/c.sh # wheel_up_cmd nop # wheel_down_cmd nop font pango:DejaVu Sans Mono 9 @@ -414,6 +415,7 @@ exec --no-startup-id numlockx on # Activate Num lock exec --no-startup-id unclutter # Hide mouse cursor after some time exec --no-startup-id dunst # Notifications exec --no-startup-id $HOME/.config/i3/clipmenud # Clipboard manager +exec --no-startup-id mpd # Music Player Daemon # Autostart programs #exec --no-startup-id i3-msg 'workspace $WS8; exec firefox --new-window tweetdeck.twitter.com' diff --git a/config/polybar/: b/config/polybar/: new file mode 100644 index 0000000..a2e6a43 --- /dev/null +++ b/config/polybar/: @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +# Terminate already running bar instances +killall -q polybar + +# Wait until the processes have been shut down +while pgrep -x polybar >/dev/null; do sleep 1; done + +function sth() { + echo sth +} + +trap SIGCONT sth + +# Launch bar for each display +polybar -m | cut -d':' -f1 | while read display +do + MONITOR=$display polybar example & +done + +echo "Bars launched..." + +wait diff --git a/config/polybar/config b/config/polybar/config new file mode 100644 index 0000000..7a97ac2 --- /dev/null +++ b/config/polybar/config @@ -0,0 +1,335 @@ +;===================================================== +; +; To learn more about how to configure Polybar +; go to https://github.com/jaagr/polybar +; +; The README contains alot of information +; +;===================================================== + +[theme] +foreground = #f1ebeb +background = #272822 +blackB = #48483e +blackF = #76715e +redB = #dc2566 +redF = #fa2772 +greenB = #8fc029 +greenF = #a7e22e +yellowB = #d4c96e +yellowF = #e7db75 +blueB = #55bcce +blueF = #66d9ee +magentaB = #9358fe +magentaF = #ae82ff +cyanB = #56b7a5 +cyanF = #66efd5 +whiteB = #acada1 +whiteF = #cfd0c2 + +[colors] +background = ${theme.blackB} +foreground = ${theme.foreground} + +[bar/example] +;separator = | +monitor = ${env:MONITOR:LVDS1} +width = 100% +height = 22 +;offset-x = 1% +;offset-y = 1% +;radius = 6.0 +fixed-center = false + +background = ${colors.background} +foreground = ${colors.foreground} + +line-size = 2 + +border-size = 0 +border-color = ${colors.background} + +padding-left = 1 +padding-right = 1 + +module-margin-left = 1 +module-margin-right = 1 + +font-0 = "Font Awesome:size=10;0" +font-1 = "DejaVu Sans:size=10;0" +font-2 = "DejaVu Sans Mono for Powerline:pixelsize=10;0" + +modules-left = i3 +modules-center = mpd +modules-right = cpu memory temperature eth wlan filesystem xbacklight volume battery date + +tray-position = right +tray-padding = 2 +tray-transparent = false + +;wm-restack = bspwm +wm-restack = i3 + +;override-redirect = true + +;scroll-up = bspwm-desknext +;scroll-down = bspwm-deskprev + +;scroll-up = i3wm-wsnext +;scroll-down = i3wm-wsprev + +bottom = true + +enable-ipc = true + +[module/filesystem] +type = internal/fs +interval = 25 + +mount-0 = / +mount-1 = /home + +label-mounted-underline = ${theme.magentaB} +label-mounted = %{F#ae81ff}%mountpoint%%{F-} %free% +label-unmounted = + +[module/i3] +type = internal/i3 +pin-workspaces = true +strip-wsnumbers = false +index-sort = true +enable-click = true +enable-scroll = true +wrapping-scroll = false +reverse-scroll = true +fuzzy-match = false + +ws-icon-0 = "1;" +ws-icon-1 = "2;" +ws-icon-2 = "3;" +ws-icon-3 = "4;" +ws-icon-4 = "5;▲" +ws-icon-5 = "6;▲" +ws-icon-6 = "7;" +ws-icon-7 = "8;" +ws-icon-8 = "9;" +ws-icon-9 = "10;" +ws-icon-default = ? + +format = + +label-mode = %mode% +label-mode-padding = 2 +label-mode-background = ${theme.redB} + +label-focused = %index% %icon% +label-focused-foreground = ${theme.background} +label-focused-background = ${theme.greenB} +label-focused-underline = ${theme.greenF} +label-focused-padding = 2 + +label-unfocused = ${self.label-focused} +label-unfocused-padding = ${self.label-focused-padding} + +label-visible = ${self.label-focused} +label-visible-padding = ${self.label-focused-padding} +label-visible-underline = ${theme.greenF} + +label-urgent = ${self.label-focused} +label-urgent-padding = ${self.label-focused-padding} +label-urgent-foreground = ${theme.foreground} +label-urgent-background = ${theme.redB} + +[module/mpd] +type = internal/mpd +; format-online = +format-online = +format-playing = ${self.format-online} +format-paused = ${self.format-online} +format-stopped = + +label-song =  %title% - %artist% +label-song-maxlen = 25 +label-song-ellipsis = true + +label-time = %elapsed%/%total% + +label-offline = + +icon-play =  +icon-pause =  +icon-stop =  +icon-prev =  +icon-next =  +icon-seekb =  +icon-seekf =  +icon-random =  +icon-repeat =  +icon-repeatone = 1 + +toggle-on-foreground = ${theme.foreground} +toggle-off-foreground = #55 + + +[module/xbacklight] +type = internal/xbacklight +output = LVDS1 +enable-scroll = true +format = +ramp-0 = 🌕 +ramp-1 = 🌔 +ramp-2 = 🌓 +ramp-3 = 🌒 +ramp-4 = 🌑 +format-underline = ${theme.redB} + +[module/backlight-acpi] +inherit = module/xbacklight +type = internal/backlight +card = intel_backlight + +[module/cpu] +type = internal/cpu +interval = 0.5 +format = +format-underline = ${theme.redB} +ramp-coreload-0 = ▁ +ramp-coreload-1 = ▂ +ramp-coreload-2 = ▃ +ramp-coreload-3 = ▄ +ramp-coreload-4 = ▅ +ramp-coreload-5 = ▆ +ramp-coreload-6 = ▇ +ramp-coreload-7 = █ + +[module/memory] +type = internal/memory +interval = 2 +format-underline = ${theme.greenB} +label =  %gb_free% + +[module/eth] +type = internal/network +interface = eth0 +interval = 1 + +format-connected =  +;label-connected = %local_ip% (↑%upspeed% ↓%downspeed%) +label-connected = %local_ip% +format-connected-underline = ${theme.blueB} + +format-disconnected = + +[module/wlan] +type = internal/network +interface = wlan0 +interval = 1 + +format-connected =  +;label-connected = %local_ip% %essid% (↑%upspeed% ↓%downspeed%) +label-connected = %local_ip% %essid% +format-connected-underline = ${theme.cyanB} + +format-disconnected = + +ramp-signal-0 = ▁ +ramp-signal-1 = ▂ +ramp-signal-2 = ▃ +ramp-signal-3 = ▄ +ramp-signal-4 = ▅ +ramp-signal-5 = ▆ +ramp-signal-6 = ▇ +ramp-signal-7 = █ + +animation-packetloss-0 =  +animation-packetloss-1 =  +animation-packetloss-framerate = 500 + +[module/date] +type = internal/date +interval = 1 + +date = +date-alt = " %d/%m/%Y" + +time =  %H:%M +time-alt =  %H:%M:%S + +format = ). # Valid values: true, false # Default: false -# +hyperlink-auditing = false + # geolocation (BoolAsk): # Allow websites to request geolocations. # Valid values: true, false, ask # Default: ask -# +geolocation = ask + # notifications (BoolAsk): # Allow websites to show notifications. # Valid values: true, false, ask # Default: ask -# +notifications = ask + # media-capture (BoolAsk): # Allow websites to record audio/video. # Valid values: true, false, ask # Default: ask -# +media-capture = ask + # javascript-can-open-windows-automatically (Bool): # Whether JavaScript programs can open new windows without user # interaction. # Valid values: true, false # Default: false -# +javascript-can-open-windows-automatically = false + # javascript-can-close-windows (Bool): # Whether JavaScript programs can close windows. # Valid values: true, false # Default: false -# +javascript-can-close-windows = false + # javascript-can-access-clipboard (Bool): # Whether JavaScript programs can read or write to the clipboard. # With QtWebEngine, writing the clipboard as response to a user # interaction is always allowed. # Valid values: true, false # Default: false -# +javascript-can-access-clipboard = false + # ignore-javascript-prompt (Bool): # Whether all javascript prompts should be ignored. # Valid values: true, false # Default: false -# +ignore-javascript-prompt = false + # ignore-javascript-alert (Bool): # Whether all javascript alerts should be ignored. # Valid values: true, false # Default: false -# +ignore-javascript-alert = false + # local-content-can-access-remote-urls (Bool): # Whether locally loaded documents are allowed to access remote # urls. # Valid values: true, false # Default: false -# +local-content-can-access-remote-urls = false + # local-content-can-access-file-urls (Bool): # Whether locally loaded documents are allowed to access other local # urls. # Valid values: true, false # Default: true -# +local-content-can-access-file-urls = true + # cookies-accept (String): # Control which cookies to accept. # all: Accept all cookies. @@ -886,13 +894,15 @@ cache-size = 52428800 # unless a cookie is already set for the domain. # never: Don't accept cookies at all. # Default: no-3rdparty -# +cookies-accept = no-3rdparty + # cookies-store (Bool): # Whether to store cookies. Note this option needs a restart with -# QtWebEngine. +# QtWebEngine on Qt < 5.9. # Valid values: true, false # Default: true -# +cookies-store = true + # host-block-lists (List of Url): # List of URLs of lists which contain hosts to block. # The file can be in one of the following formats: @@ -902,12 +912,14 @@ cache-size = 52428800 # file named 'hosts' (with any extension). # Default: # https://www.malwaredomainlist.com/hostslist/hosts.txt,http://someonewhocares.org/hosts/hosts,http://winhelp2002.mvps.org/hosts.zip,http://malwaredomains.lehigh.edu/files/justdomains.zip,https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&mimetype=plaintext -# +host-block-lists = http://www.malwaredomainlist.com/hostslist/hosts.txt,http://someonewhocares.org/hosts/hosts,http://winhelp2002.mvps.org/hosts.zip,http://malwaredomains.lehigh.edu/files/justdomains.zip,http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&mimetype=plaintext + # host-blocking-enabled (Bool): # Whether host blocking is enabled. # Valid values: true, false # Default: true -# +host-blocking-enabled = true + # host-blocking-whitelist (List of String): # List of domains that should always be loaded, despite being # ad-blocked. @@ -915,43 +927,25 @@ cache-size = 52428800 # to exactly match the requested domain. # Local domains are always exempt from hostblocking. # Default: piwik.org -# +host-blocking-whitelist = piwik.org + # enable-pdfjs (Bool): # Enable pdf.js to view PDF files in the browser. # Note that the files can still be downloaded by clicking the # download button in the pdf.js viewer. # Valid values: true, false # Default: false -allow-images = true -allow-javascript = true -allow-plugins = false -webgl = true -css-regions = true -hyperlink-auditing = false -geolocation = ask -notifications = true -media-capture = ask -javascript-can-open-windows-automatically = false -javascript-can-close-windows = false -javascript-can-access-clipboard = false -ignore-javascript-prompt = false -ignore-javascript-alert = false -local-content-can-access-remote-urls = false -local-content-can-access-file-urls = true -cookies-accept = no-3rdparty -cookies-store = true -host-block-lists = http://www.malwaredomainlist.com/hostslist/hosts.txt,http://someonewhocares.org/hosts/hosts,http://winhelp2002.mvps.org/hosts.zip,http://malwaredomains.lehigh.edu/files/justdomains.zip,http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&mimetype=plaintext -host-blocking-enabled = true -host-blocking-whitelist = piwik.org enable-pdfjs = false -[hints] + # Hinting settings. -# +[hints] + # border (String): # CSS border value for hints. # Default: 1px solid #E3BE23 -# +border = 1px solid #E3BE23 + # mode (String): # Mode to use for hints. # number: Use numeric hints. (In this mode you can also type @@ -961,30 +955,36 @@ enable-pdfjs = false # word: Use hints words based on the html elements and the extra # words. # Default: letter -# +mode = letter + # chars (UniqueCharString): # Chars used for hint strings. # Default: asdfghjkl -# +chars = asdfghjkl + # min-chars (Int): # Minimum number of chars used for hint strings. # Default: 1 -# +min-chars = 1 + # scatter (Bool): # Whether to scatter hint key chains (like Vimium) or not (like # dwb). Ignored for number hints. # Valid values: true, false # Default: true -# +scatter = true + # uppercase (Bool): # Make chars in hint strings uppercase. # Valid values: true, false # Default: false -# +uppercase = false + # dictionary (File): # The dictionary file to be used by the word hints. # Default: /usr/share/dict/words -# +dictionary = /usr/share/dict/words + # auto-follow (String): # Controls when a hint can be automatically followed without the # user pressing Enter. @@ -999,46 +999,39 @@ enable-pdfjs = false # never: The user will always need to press Enter to follow a # hint. # Default: unique-match -# +auto-follow = unique-match + # auto-follow-timeout (Int): # A timeout (in milliseconds) to inhibit normal-mode key bindings # after a successful auto-follow. # Default: 0 -# +auto-follow-timeout = 0 + # next-regexes (List of Regex): # A comma-separated list of regexes to use for 'next' links. # Default: # \bnext\b,\bmore\b,\bnewer\b,\b[>→≫]\b,\b(>>|»)\b,\bcontinue\b -# +next-regexes = \bnext\b,\bmore\b,\bnewer\b,\b[>→≫]\b,\b(>>|»)\b,\bcontinue\b + # prev-regexes (List of Regex): # A comma-separated list of regexes to use for 'prev' links. # Default: \bprev(ious)?\b,\bback\b,\bolder\b,\b[<←≪]\b,\b(<<|«)\b -# +prev-regexes = \bprev(ious)?\b,\bback\b,\bolder\b,\b[<←≪]\b,\b(<<|«)\b + # find-implementation (String): # Which implementation to use to find elements to hint. # javascript: Better but slower # python: Slightly worse but faster # Default: python -# +find-implementation = python + # hide-unmatched-rapid-hints (Bool): # Controls hiding unmatched hints in rapid mode. # Valid values: true, false # Default: true -border = 1px solid #E3BE23 -mode = letter -chars = asdfghjkl -min-chars = 1 -scatter = true -uppercase = false -dictionary = /usr/share/dict/words -auto-follow = unique-match -auto-follow-timeout = 0 -next-regexes = \bnext\b,\bmore\b,\bnewer\b,\b[>→≫]\b,\b(>>|»)\b,\bcontinue\b -prev-regexes = \bprev(ious)?\b,\bback\b,\bolder\b,\b[<←≪]\b,\b(<<|«)\b -find-implementation = python hide-unmatched-rapid-hints = true -[searchengines] + # Definitions of search engines which can be used via the address bar. # The searchengine named `DEFAULT` is used when `general -> auto-search` # is true and something else than a URL was entered to be opened. Other @@ -1046,6 +1039,7 @@ hide-unmatched-rapid-hints = true # search term, e.g. `:open google qutebrowser`. The string `{}` will be # replaced by the search term, use `{{` and `}}` for literal `{`/`}` # signs. +[searchengines] DEFAULT = https://www.qwant.com/?t=web&q={} arch = https://wiki.archlinux.org/?search={} gfr = https://www.google.fr/search?hl=fr&q={} @@ -1059,13 +1053,14 @@ wa = https://www.wolframalpha.com/input/?i={} dockerhub = https://hub.docker.com/search/?isAutomated=0&isOfficial=0&page=1&pullCount=0&q={}&starCount=0 npm = https://www.npmjs.com/search?q={} -[aliases] + # Aliases for commands. # By default, no aliases are defined. Example which adds a new command # `:qtb` to open qutebrowsers website: # `qtb = open https://www.qutebrowser.org/` +[aliases] + -[colors] # Colors used in the UI. # A value can be in one of the following format: # * `#RGB`/`#RRGGBB`/`#RRRGGGBBB`/`#RRRRGGGGBBBB` @@ -1079,183 +1074,249 @@ npm = https://www.npmjs.com/search?q={} # regardless of how they are defined in the options. Valid values are # 'rgb', 'hsv', and 'hsl'. # The `hints.*` values are a special case as they're real CSS colors, not Qt-CSS colors. There, for a gradient, you need to use `-webkit-gradient`, see https://www.webkit.org/blog/175/introducing-css-gradients/[the WebKit documentation]. -# +[colors] + # completion.fg (QtColor): # Text color of the completion widget. # Default: white -# +completion.fg = #f1ebeb + # completion.bg (QssColor): # Background color of the completion widget. # Default: #333333 -# +completion.bg = #58584e + # completion.alternate-bg (QssColor): # Alternating background color of the completion widget. # Default: #444444 -# +completion.alternate-bg = #48483e + # completion.category.fg (QtColor): # Foreground color of completion widget category headers. # Default: white -# +completion.category.fg = #f1ebeb + # completion.category.bg (QssColor): # Background color of the completion widget category headers. # Default: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #888888, # stop:1 #505050) -# +completion.category.bg = qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #76715e, stop:1 #48483e) + # completion.category.border.top (QssColor): # Top border color of the completion widget category headers. # Default: black -# +completion.category.border.top = #272822 + # completion.category.border.bottom (QssColor): # Bottom border color of the completion widget category headers. # Default: ${completion.category.border.top} -# +completion.category.border.bottom = ${completion.category.border.top} + # completion.item.selected.fg (QtColor): # Foreground color of the selected completion item. # Default: black -# +completion.item.selected.fg = ${completion.fg} + # completion.item.selected.bg (QssColor): # Background color of the selected completion item. # Default: #e8c000 -# +completion.item.selected.bg = #d4c96e + # completion.item.selected.border.top (QssColor): # Top border color of the completion widget category headers. # Default: #bbbb00 -# +completion.item.selected.border.top = #e7db75 + # completion.item.selected.border.bottom (QssColor): # Bottom border color of the selected completion item. # Default: ${completion.item.selected.border.top} -# +completion.item.selected.border.bottom = ${completion.item.selected.border.top} + # completion.match.fg (QssColor): # Foreground color of the matched text in the completion. # Default: #ff4444 -# +completion.match.fg = #fa2772 + # completion.scrollbar.fg (QssColor): # Color of the scrollbar handle in completion view. # Default: ${completion.fg} -# +completion.scrollbar.fg = ${completion.fg} + # completion.scrollbar.bg (QssColor): # Color of the scrollbar in completion view # Default: ${completion.bg} -# +completion.scrollbar.bg = ${completion.bg} + # statusbar.fg (QssColor): # Foreground color of the statusbar. # Default: white -# +statusbar.fg = #f1ebeb + # statusbar.bg (QssColor): # Background color of the statusbar. # Default: black -# +statusbar.bg = #272822 + +# statusbar.fg.private (QssColor): +# Foreground color of the statusbar in private browsing mode. +# Default: ${statusbar.fg} +statusbar.fg.private = ${statusbar.fg} + +# statusbar.bg.private (QssColor): +# Background color of the statusbar in private browsing mode. +# Default: #666666 +statusbar.bg.private = #666666 + # statusbar.fg.insert (QssColor): # Foreground color of the statusbar in insert mode. # Default: ${statusbar.fg} -# +statusbar.fg.insert = ${statusbar.fg} + # statusbar.bg.insert (QssColor): # Background color of the statusbar in insert mode. # Default: darkgreen -# +statusbar.bg.insert = #8fc029 + # statusbar.fg.command (QssColor): # Foreground color of the statusbar in command mode. # Default: ${statusbar.fg} -# +statusbar.fg.command = ${statusbar.fg} + # statusbar.bg.command (QssColor): # Background color of the statusbar in command mode. # Default: ${statusbar.bg} -# +statusbar.bg.command = ${statusbar.bg} + +# statusbar.fg.command.private (QssColor): +# Foreground color of the statusbar in private browsing + command +# mode. +# Default: ${statusbar.fg.private} +statusbar.fg.command.private = ${statusbar.fg.private} + +# statusbar.bg.command.private (QssColor): +# Background color of the statusbar in private browsing + command +# mode. +# Default: ${statusbar.bg.private} +statusbar.bg.command.private = ${statusbar.bg.private} + # statusbar.fg.caret (QssColor): # Foreground color of the statusbar in caret mode. # Default: ${statusbar.fg} -# +statusbar.fg.caret = ${statusbar.fg} + # statusbar.bg.caret (QssColor): # Background color of the statusbar in caret mode. # Default: purple -# +statusbar.bg.caret = #9358fe + # statusbar.fg.caret-selection (QssColor): # Foreground color of the statusbar in caret mode with a selection # Default: ${statusbar.fg} -# +statusbar.fg.caret-selection = ${statusbar.fg} + # statusbar.bg.caret-selection (QssColor): # Background color of the statusbar in caret mode with a selection # Default: #a12dff -# +statusbar.bg.caret-selection = #55bcce + # statusbar.progress.bg (QssColor): # Background color of the progress bar. # Default: white -# +statusbar.progress.bg = ${statusbar.fg} + # statusbar.url.fg (QssColor): # Default foreground color of the URL in the statusbar. # Default: ${statusbar.fg} -# +statusbar.url.fg = ${statusbar.fg} + # statusbar.url.fg.success (QssColor): # Foreground color of the URL in the statusbar on successful load # (http). # Default: white -# +statusbar.url.fg.success = #66efd5 + # statusbar.url.fg.success.https (QssColor): # Foreground color of the URL in the statusbar on successful load # (https). # Default: lime -# +statusbar.url.fg.success.https = #a7e22e + # statusbar.url.fg.error (QssColor): # Foreground color of the URL in the statusbar on error. # Default: orange -# +statusbar.url.fg.error = #fa2772 + # statusbar.url.fg.warn (QssColor): # Foreground color of the URL in the statusbar when there's a # warning. # Default: yellow -# +statusbar.url.fg.warn = #e7db75 + # statusbar.url.fg.hover (QssColor): # Foreground color of the URL in the statusbar for hovered links. # Default: aqua -# +statusbar.url.fg.hover = #ae82ff + # tabs.fg.odd (QtColor): # Foreground color of unselected odd tabs. # Default: white -# +tabs.fg.odd = ${completion.fg} + # tabs.bg.odd (QtColor): # Background color of unselected odd tabs. # Default: grey -# +tabs.bg.odd = ${completion.bg} + # tabs.fg.even (QtColor): # Foreground color of unselected even tabs. # Default: white -# +tabs.fg.even = ${completion.fg} + # tabs.bg.even (QtColor): # Background color of unselected even tabs. # Default: darkgrey -# +tabs.bg.even = ${completion.alternate-bg} + # tabs.fg.selected.odd (QtColor): # Foreground color of selected odd tabs. # Default: white -# +tabs.fg.selected.odd = ${completion.item.selected.fg} + # tabs.bg.selected.odd (QtColor): # Background color of selected odd tabs. # Default: black -# +tabs.bg.selected.odd = ${completion.item.selected.bg} + # tabs.fg.selected.even (QtColor): # Foreground color of selected even tabs. # Default: ${tabs.fg.selected.odd} -# +tabs.fg.selected.even = ${tabs.fg.selected.odd} + # tabs.bg.selected.even (QtColor): # Background color of selected even tabs. # Default: ${tabs.bg.selected.odd} -# +tabs.bg.selected.even = ${tabs.bg.selected.odd} + # tabs.bg.bar (QtColor): # Background color of the tab bar. # Default: #555555 -# +tabs.bg.bar = ${statusbar.bg} + # tabs.indicator.start (QtColor): # Color gradient start for the tab indicator. # Default: #0000aa -# +tabs.indicator.start = #55bcce + # tabs.indicator.stop (QtColor): # Color gradient end for the tab indicator. # Default: #00aa00 -# +tabs.indicator.stop = #8fc029 + # tabs.indicator.error (QtColor): # Color for the tab indicator on errors.. # Default: #ff0000 -# +tabs.indicator.error = #dc2566 + # tabs.indicator.system (ColorSystem): # Color gradient interpolation system for the tab indicator. # rgb: Interpolate in the RGB color system. @@ -1263,41 +1324,50 @@ npm = https://www.npmjs.com/search?q={} # hsl: Interpolate in the HSL color system. # none: Don't show a gradient. # Default: rgb -# +tabs.indicator.system = rgb + # hints.fg (QssColor): # Font color for hints. # Default: black -# +hints.fg = #272822 + # hints.bg (QssColor): # Background color for hints. Note that you can use a `rgba(...)` # value for transparency. # Default: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 rgba(255, # 247, 133, 0.8), stop:1 rgba(255, 197, 66, 0.8)) -# +hints.bg = qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 rgba(212, 201, 110, 0.8), stop:1 rgba(231, 219, 117, 0.8)) + # hints.fg.match (QssColor): # Font color for the matched part of hints. # Default: green -# +hints.fg.match = #8fc029 + # downloads.bg.bar (QssColor): # Background color for the download bar. # Default: black -# +downloads.bg.bar = ${statusbar.bg} + # downloads.fg.start (QtColor): # Color gradient start for download text. # Default: white -# +downloads.fg.start = ${statusbar.fg} + # downloads.bg.start (QtColor): # Color gradient start for download backgrounds. # Default: #0000aa -# +downloads.bg.start = #48483e + # downloads.fg.stop (QtColor): # Color gradient end for download text. # Default: ${downloads.fg.start} -# +downloads.fg.stop = ${downloads.fg.start} + # downloads.bg.stop (QtColor): # Color gradient stop for download backgrounds. # Default: #00aa00 -# +downloads.bg.stop = #8fc029 + # downloads.fg.system (ColorSystem): # Color gradient interpolation system for download text. # rgb: Interpolate in the RGB color system. @@ -1305,7 +1375,8 @@ npm = https://www.npmjs.com/search?q={} # hsl: Interpolate in the HSL color system. # none: Don't show a gradient. # Default: rgb -# +downloads.fg.system = rgb + # downloads.bg.system (ColorSystem): # Color gradient interpolation system for download backgrounds. # rgb: Interpolate in the RGB color system. @@ -1313,271 +1384,219 @@ npm = https://www.npmjs.com/search?q={} # hsl: Interpolate in the HSL color system. # none: Don't show a gradient. # Default: rgb -# +downloads.bg.system = rgb + # downloads.fg.error (QtColor): # Foreground color for downloads with errors. # Default: white -# +downloads.fg.error = ${downloads.fg.start} + # downloads.bg.error (QtColor): # Background color for downloads with errors. # Default: red -# +downloads.bg.error = ${messages.bg.error} + # webpage.bg (QtColor): # Background color for webpages if unset (or empty to use the # theme's color) # Default: white -# +webpage.bg = white + # keyhint.fg (QssColor): # Text color for the keyhint widget. # Default: #FFFFFF -# +keyhint.fg = #FFFFFF + # keyhint.fg.suffix (CssColor): # Highlight color for keys to complete the current keychain # Default: #FFFF00 -# +keyhint.fg.suffix = #FFFF00 + # keyhint.bg (QssColor): # Background color of the keyhint widget. # Default: rgba(0, 0, 0, 80%) -# +keyhint.bg = rgba(0, 0, 0, 80%) + # messages.fg.error (QssColor): # Foreground color of an error message. # Default: white -# +messages.fg.error = ${statusbar.fg} + # messages.bg.error (QssColor): # Background color of an error message. # Default: red -# +messages.bg.error = #dc2566 + # messages.border.error (QssColor): # Border color of an error message. # Default: #bb0000 -# +messages.border.error = #fa2772 + # messages.fg.warning (QssColor): # Foreground color a warning message. # Default: white -# +messages.fg.warning = ${statusbar.fg} + # messages.bg.warning (QssColor): # Background color of a warning message. # Default: darkorange -# +messages.bg.warning = #d4c96e + # messages.border.warning (QssColor): # Border color of an error message. # Default: #d47300 -# +messages.border.warning = #e7db75 + # messages.fg.info (QssColor): # Foreground color an info message. # Default: white -# +messages.fg.info = ${statusbar.fg} + # messages.bg.info (QssColor): # Background color of an info message. # Default: black -# +messages.bg.info = #55bcce + # messages.border.info (QssColor): # Border color of an info message. # Default: #333333 -# +messages.border.info = #66d9ee + # prompts.fg (QssColor): # Foreground color for prompts. # Default: white -# +prompts.fg = ${statusbar.fg} + # prompts.bg (QssColor): # Background color for prompts. # Default: darkblue -# +prompts.bg = #56b7a5 + # prompts.selected.bg (QssColor): # Background color for the selected item in filename prompts. # Default: #308cc6 -completion.fg = #f1ebeb -completion.bg = #58584e -completion.alternate-bg = #48483e -completion.category.fg = #f1ebeb -completion.category.bg = qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #76715e, stop:1 #48483e) -completion.category.border.top = #272822 -completion.category.border.bottom = ${completion.category.border.top} -completion.item.selected.fg = ${completion.fg} -completion.item.selected.bg = #d4c96e -completion.item.selected.border.top = #e7db75 -completion.item.selected.border.bottom = ${completion.item.selected.border.top} -completion.match.fg = #fa2772 -completion.scrollbar.fg = ${completion.fg} -completion.scrollbar.bg = ${completion.bg} -statusbar.fg = #f1ebeb -statusbar.bg = #272822 -statusbar.fg.insert = ${statusbar.fg} -statusbar.bg.insert = #8fc029 -statusbar.fg.command = ${statusbar.fg} -statusbar.bg.command = ${statusbar.bg} -statusbar.fg.caret = ${statusbar.fg} -statusbar.bg.caret = #9358fe -statusbar.fg.caret-selection = ${statusbar.fg} -statusbar.bg.caret-selection = #55bcce -statusbar.progress.bg = ${statusbar.fg} -statusbar.url.fg = ${statusbar.fg} -statusbar.url.fg.success = #66efd5 -statusbar.url.fg.success.https = #a7e22e -statusbar.url.fg.error = #fa2772 -statusbar.url.fg.warn = #e7db75 -statusbar.url.fg.hover = #ae82ff -tabs.fg.odd = ${completion.fg} -tabs.bg.odd = ${completion.bg} -tabs.fg.even = ${completion.fg} -tabs.bg.even = ${completion.alternate-bg} -tabs.fg.selected.odd = ${completion.item.selected.fg} -tabs.bg.selected.odd = ${completion.item.selected.bg} -tabs.fg.selected.even = ${tabs.fg.selected.odd} -tabs.bg.selected.even = ${tabs.bg.selected.odd} -tabs.bg.bar = ${statusbar.bg} -tabs.indicator.start = #55bcce -tabs.indicator.stop = #8fc029 -tabs.indicator.error = #dc2566 -tabs.indicator.system = rgb -hints.fg = #272822 -hints.bg = qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 rgba(212, 201, 110, 0.8), stop:1 rgba(231, 219, 117, 0.8)) -hints.fg.match = #8fc029 -downloads.bg.bar = ${statusbar.bg} -downloads.fg.start = ${statusbar.fg} -downloads.bg.start = #48483e -downloads.fg.stop = ${downloads.fg.start} -downloads.bg.stop = #8fc029 -downloads.fg.system = rgb -downloads.bg.system = rgb -downloads.fg.error = ${downloads.fg.start} -downloads.bg.error = ${messages.bg.error} -webpage.bg = white -keyhint.fg = #FFFFFF -keyhint.fg.suffix = #FFFF00 -keyhint.bg = rgba(0, 0, 0, 80%) -messages.fg.error = ${statusbar.fg} -messages.bg.error = #dc2566 -messages.border.error = #fa2772 -messages.fg.warning = ${statusbar.fg} -messages.bg.warning = #d4c96e -messages.border.warning = #e7db75 -messages.fg.info = ${statusbar.fg} -messages.bg.info = #55bcce -messages.border.info = #66d9ee -prompts.fg = ${statusbar.fg} -prompts.bg = #56b7a5 prompts.selected.bg = #55bcce -[fonts] + # Fonts used for the UI, with optional style/weight/size. # * Style: `normal`/`italic`/`oblique` # * Weight: `normal`, `bold`, `100`..`900` # * Size: _number_ `px`/`pt` -# +[fonts] + # _monospace (Font): # Default monospace fonts. -# Default: Terminus, Monospace, "DejaVu Sans Mono", Monaco, -# "Bitstream Vera Sans Mono", "Andale Mono", "Courier New", Courier, -# "Liberation Mono", monospace, Fixed, Consolas, Terminal -# +# Default: xos4 Terminus, Terminus, Monospace, "DejaVu Sans Mono", +# Monaco, "Bitstream Vera Sans Mono", "Andale Mono", "Courier New", +# Courier, "Liberation Mono", monospace, Fixed, Consolas, Terminal +_monospace = Terminus, Monospace, "DejaVu Sans Mono", Monaco, "Bitstream Vera Sans Mono", "Andale Mono", "Courier New", Courier, "Liberation Mono", monospace, Fixed, Consolas, Terminal + # completion (Font): # Font used in the completion widget. # Default: 8pt ${_monospace} -# +completion = 8pt ${_monospace} + # completion.category (Font): # Font used in the completion categories. # Default: bold ${completion} -# +completion.category = bold ${completion} + # tabbar (QtFont): # Font used in the tab bar. # Default: 8pt ${_monospace} -# +tabbar = 8pt ${_monospace} + # statusbar (Font): # Font used in the statusbar. # Default: 8pt ${_monospace} -# +statusbar = 8pt ${_monospace} + # downloads (Font): # Font used for the downloadbar. # Default: 8pt ${_monospace} -# +downloads = 8pt ${_monospace} + # hints (Font): # Font used for the hints. # Default: bold 13px ${_monospace} -# +hints = bold 13px ${_monospace} + # debug-console (QtFont): # Font used for the debugging console. # Default: 8pt ${_monospace} -# +debug-console = 8pt ${_monospace} + # web-family-standard (FontFamily): # Font family for standard fonts. # Default: -# +web-family-standard = + # web-family-fixed (FontFamily): # Font family for fixed fonts. # Default: -# +web-family-fixed = + # web-family-serif (FontFamily): # Font family for serif fonts. # Default: -# +web-family-serif = + # web-family-sans-serif (FontFamily): # Font family for sans-serif fonts. # Default: -# +web-family-sans-serif = + # web-family-cursive (FontFamily): # Font family for cursive fonts. # Default: -# +web-family-cursive = + # web-family-fantasy (FontFamily): # Font family for fantasy fonts. # Default: -# +web-family-fantasy = + # web-size-minimum (Int): # The hard minimum font size. -# Default: -# +# Default: 0 +web-size-minimum = 0 + # web-size-minimum-logical (Int): # The minimum logical font size that is applied when zooming out. -# Default: -# +# Default: 6 +web-size-minimum-logical = 6 + # web-size-default (Int): # The default font size for regular text. -# Default: -# +# Default: 16 +web-size-default = 16 + # web-size-default-fixed (Int): # The default font size for fixed-pitch text. -# Default: -# +# Default: 13 +web-size-default-fixed = 13 + # keyhint (Font): # Font used in the keyhint widget. # Default: 8pt ${_monospace} -# +keyhint = 8pt ${_monospace} + # messages.error (Font): # Font used for error messages. # Default: 8pt ${_monospace} -# +messages.error = 8pt ${_monospace} + # messages.warning (Font): # Font used for warning messages. # Default: 8pt ${_monospace} -# +messages.warning = 8pt ${_monospace} + # messages.info (Font): # Font used for info messages. # Default: 8pt ${_monospace} -# +messages.info = 8pt ${_monospace} + # prompts (Font): # Font used for prompts. # Default: 8pt sans-serif -_monospace = Terminus, Monospace, "DejaVu Sans Mono", Monaco, "Bitstream Vera Sans Mono", "Andale Mono", "Courier New", Courier, "Liberation Mono", monospace, Fixed, Consolas, Terminal -completion = 8pt ${_monospace} -completion.category = bold ${completion} -tabbar = 8pt ${_monospace} -statusbar = 8pt ${_monospace} -downloads = 8pt ${_monospace} -hints = bold 13px ${_monospace} -debug-console = 8pt ${_monospace} -web-family-standard = -web-family-fixed = -web-family-serif = -web-family-sans-serif = -web-family-cursive = -web-family-fantasy = -web-size-minimum = -web-size-minimum-logical = -web-size-default = -web-size-default-fixed = -keyhint = 8pt ${_monospace} -messages.error = 8pt ${_monospace} -messages.warning = 8pt ${_monospace} -messages.info = 8pt ${_monospace} prompts = 8pt sans-serif diff --git a/scripts/docker-rm b/scripts/docker-rm new file mode 100755 index 0000000..a9d6631 --- /dev/null +++ b/scripts/docker-rm @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +docker kill $(docker ps -q) +docker container prune -f +docker network prune -f diff --git a/scripts/install-prefs b/scripts/install-prefs index cd4124e..10710df 100755 --- a/scripts/install-prefs +++ b/scripts/install-prefs @@ -231,12 +231,12 @@ if [ $GUI == 1 ]; then # Desktop manager inst i3 i3lock i3status dunst unclutter xautolock feh numlockx scrot xterm xclip if [ $ARCH == 1 ]; then - altInst polybar-git ttf-font-awesome autorandr-git + altInst polybar-git ttf-font-awesome autorandr-git keynav-enhanced else echo "TODO compile polybar-git autorandr-git" fi if [ $DEBIAN == 1 ]; then - inst suckless-tools + inst suckless-tools keynav if [ $ADMIN == 0 ]; then debloc altern dmenu xft fi @@ -257,7 +257,7 @@ if [ $GUI == 1 ]; then rm -rf $TMP_DIR elif [ $ARCH == 1 ]; then - inst qutebrowser qt5-webengine + inst qutebrowser qt5-webengine python-opengl fi # Screen filter diff --git a/vimrc b/vimrc index 7540ee6..6711788 100644 --- a/vimrc +++ b/vimrc @@ -19,6 +19,7 @@ Plugin 'tomasr/molokai' Plugin 'tpope/vim-surround' Plugin 'tpope/vim-fugitive' Plugin 'tpope/vim-repeat' +Plugin 'tpope/tpope-vim-abolish' Plugin 'vim-airline/vim-airline' Plugin 'vim-airline/vim-airline-themes' Plugin 'airblade/vim-gitgutter' @@ -29,10 +30,11 @@ Plugin 'xolox/vim-easytags' Plugin 'majutsushi/tagbar' Plugin 'wellle/targets.vim' Plugin 'Chiel92/vim-autoformat' -Plugin 'Valloric/YouCompleteMe' +" Plugin 'Valloric/YouCompleteMe' Plugin 'artur-shaik/vim-javacomplete2' Plugin 'tomtom/tcomment_vim' Plugin 'Shougo/denite.nvim' +Plugin 'tomlion/vim-solidity' call vundle#end() " required filetype plugin indent on " required @@ -44,11 +46,15 @@ nmap :UndotreeToggle:UndotreeFocus """ CTRLP """ let g:ctrlp_custom_ignore = { - \ 'dir': '\v([\/]\.(git|hg|svn)|node_modules|bower_components|__pycache__|vendor|output|buildroot)$', - \ 'file': '\v\.(exe|so|dll)$', + \ 'dir': '\v([\/]\.(git|hg|svn)|log|node_modules|bower_components|__pycache__|vendor|output|buildroot)$', + \ 'file': '\v\.(exe|so|dll|o|pyc)$', \ 'link': 'SOME_BAD_SYMBOLIC_LINKS', \ } +let g:ctrlp_map = '' +let g:ctrlp_cmd = 'CtrlPMixed' +map :CtrlPMRUFiles + """ TAGBAR """ nmap :TagbarToggle @@ -68,7 +74,12 @@ let g:airline_theme = 'wombat' """ YOUCOMPLETEME """ -let g:ycm_global_ycm_extra_conf = '~/.config/ycm_extra_conf.py' +" let g:ycm_global_ycm_extra_conf = '~/.config/ycm_extra_conf.py' +let g:ycm_global_ycm_extra_conf = '/usr/share/vim/vimfiles/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py' +let g:ycm_server_python_interpreter = '/usr/bin/python2' + +""" AUTOFORMAT """ +nmap :Autoformat """ JAVACOMPLETE """ @@ -135,7 +146,14 @@ if has('persistent_undo') set undofile endif +" Allow saving of files as sudo when I forgot to start vim using sudo. +" From https://stackoverflow.com/a/7078429 +cmap w!! w !sudo tee > /dev/null % + imap jk imap mù map o +nmap :bp +nmap :bn + From 5fd28ca3f1ed268797f3cfdd441b48fdbd21f990 Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Tue, 22 Aug 2017 07:47:09 +0200 Subject: [PATCH 40/44] Something --- config/htop/htoprc | 4 ++-- scripts/install-prefs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/htop/htoprc b/config/htop/htoprc index ee794e5..c731a6d 100644 --- a/config/htop/htoprc +++ b/config/htop/htoprc @@ -4,8 +4,8 @@ fields=0 48 17 18 38 39 40 2 46 47 49 1 sort_key=46 sort_direction=1 hide_threads=0 -hide_kernel_threads=0 -hide_userland_threads=0 +hide_kernel_threads=1 +hide_userland_threads=1 shadow_other_users=0 show_thread_names=0 show_program_path=0 diff --git a/scripts/install-prefs b/scripts/install-prefs index cab5f7e..f085d5f 100755 --- a/scripts/install-prefs +++ b/scripts/install-prefs @@ -290,7 +290,7 @@ if [ $EXTRA == 1 ]; then inst cmake clang llvm npm # Extra CLI - inst sl ffmpeg youtube-dl + inst sl ffmpeg youtube-dl optipng if [ $ARCH == 1 ]; then altInst pdftk translate-shell git-lfs js-beautify insect visidata-git From dd53e9333a68d36807a3007aee3b19097fb7dc32 Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Tue, 22 Aug 2017 07:57:52 +0200 Subject: [PATCH 41/44] Something else --- bashrc | 1 + config/qutebrowser/keys.conf | 14 +- config/qutebrowser/qutebrowser.conf | 1065 ++++++++++++++------------- 3 files changed, 553 insertions(+), 527 deletions(-) diff --git a/bashrc b/bashrc index ba88ae3..ea5383e 100644 --- a/bashrc +++ b/bashrc @@ -56,6 +56,7 @@ alias s='sudo -s -E' alias po='eval $(proxy off)' alias nw="sudo systemctl restart NetworkManager" alias mc="machines" +alias tracefiles="strace -f -t -e trace=file" alias vpn="sudo systemctl start openvpn-client@$HOSTNAME" alias vpno="sudo systemctl stop openvpn-client@$HOSTNAME" alias vpns="sudo systemctl status openvpn-client@$HOSTNAME" diff --git a/config/qutebrowser/keys.conf b/config/qutebrowser/keys.conf index 4eaaf91..06724c4 100644 --- a/config/qutebrowser/keys.conf +++ b/config/qutebrowser/keys.conf @@ -112,11 +112,11 @@ tab-move + gr tab-next - J + L tab-prev - K + H tab-clone @@ -131,7 +131,7 @@ reload -f back - H + J back -t @@ -141,7 +141,7 @@ back -w wh forward - L + K forward -t @@ -454,6 +454,12 @@ run-macro wq ZZ +tab-focus -1 + g$ + +tab-pin + + [insert] # Keybindings for insert mode. # Since normal keypresses are passed through, only special keys are diff --git a/config/qutebrowser/qutebrowser.conf b/config/qutebrowser/qutebrowser.conf index 64d282d..3300234 100644 --- a/config/qutebrowser/qutebrowser.conf +++ b/config/qutebrowser/qutebrowser.conf @@ -24,37 +24,43 @@ # - # at the start of the line (at the first position of the key) (\#) # - $ in a value ($$) -[general] + # General/miscellaneous options. -# +[general] + # ignore-case (IgnoreCase): # Whether to find text on a page case-insensitively. # true: Search case-insensitively # false: Search case-sensitively # smart: Search case-sensitively if there are capital chars # Default: smart -# +ignore-case = smart + # startpage (List of String): # The default page(s) to open at the start, separated by commas. # Default: https://start.duckduckgo.com -# +startpage = https://geoffrey.frogeye.fr/home.php + # yank-ignored-url-parameters (List of String): # The URL parameters to strip with :yank url, separated by commas. # Default: # ref,utm_source,utm_medium,utm_campaign,utm_term,utm_content -# +yank-ignored-url-parameters = ref,utm_source,utm_medium,utm_campaign,utm_term,utm_content + # default-open-dispatcher (String): # The default program used to open downloads. Set to an empty string # to use the default internal handler. # Any {} in the string will be expanded to the filename, else the # filename will be appended. # Default: -# +default-open-dispatcher = + # default-page (FuzzyUrl): # The page to open if :open -t/-b/-w is used without URL. Use # `about:blank` for a blank page. # Default: ${startpage} -# +default-page = ${startpage} + # auto-search (AutoSearch): # Whether to start a search when something else than a URL is # entered. @@ -62,33 +68,39 @@ # dns: Use DNS requests (might be slow!). # false: Never search automatically. # Default: naive -# +auto-search = naive + # auto-save-config (Bool): # Whether to save the config automatically on quit. # Valid values: true, false # Default: true -# +auto-save-config = true + # auto-save-interval (Int): # How often (in milliseconds) to auto-save config/cookies/etc. # Default: 15000 -# +auto-save-interval = 15000 + # editor (ShellCommand): # The editor (and arguments) to use for the `open-editor` command. # The arguments get split like in a shell, so you can use `"` or `'` # to quote them. # `{}` gets replaced by the filename of the file to be edited. # Default: gvim -f "{}" -# +editor = gvim -f "{}" + # editor-encoding (Encoding): # Encoding to use for editor. # Default: utf-8 -# +editor-encoding = utf-8 + # private-browsing (Bool): -# Do not record visited pages in the history or store web page -# icons. +# Open new windows in private browsing mode which does not record +# visited pages. # Valid values: true, false # Default: false -# +private-browsing = false + # developer-extras (Bool): # Enable extra tools for Web developers. # This needs to be enabled for `:inspector` to work and also adds an @@ -96,7 +108,8 @@ # 'qutebrowser --help' instead. # Valid values: true, false # Default: false -# +developer-extras = true + # print-element-backgrounds (Bool): # Whether the background color and images are also drawn when the # page is printed. @@ -104,7 +117,8 @@ # QtWebEngine backend. # Valid values: true, false # Default: true -# +print-element-backgrounds = true + # xss-auditing (Bool): # Whether load requests should be monitored for cross-site scripting # attempts. @@ -113,19 +127,15 @@ # performance. # Valid values: true, false # Default: false -# -# site-specific-quirks (Bool): -# Enable QtWebKit workarounds for broken sites. -# Valid values: true, false -# Default: true -# +xss-auditing = false + # default-encoding (String): # Default encoding to use for websites. # The encoding must be a string describing an encoding such as -# _utf-8_, _iso-8859-1_, etc. If left empty a default value will be -# used. -# Default: -# +# _utf-8_, _iso-8859-1_, etc. +# Default: iso-8859-1 +default-encoding = iso-8859-1 + # new-instance-open-target (String): # How to open links in an existing instance if a new one is # launched. @@ -139,7 +149,8 @@ # window without activating the window. # window: Open in a new window. # Default: tab -# +new-instance-open-target = tab + # new-instance-open-target.window (String): # Which window to choose when opening links as new tabs. # first-opened: Open new tabs in the first (oldest) opened @@ -150,83 +161,81 @@ # last-visible: Open new tabs in the most recently visible # window. # Default: last-focused -# +new-instance-open-target.window = last-focused + # log-javascript-console (String): # How to log javascript console messages. # none: Don't log messages. # debug: Log messages with debug level. # info: Log messages with info level. # Default: debug -# +log-javascript-console = debug + # save-session (Bool): # Whether to always save the open pages. # Valid values: true, false # Default: false -# +save-session = false + # session-default-name (SessionName): # The name of the session to save by default, or empty for the last # loaded session. # Default: -# +session-default-name = + # url-incdec-segments (FlagList): # The URL segments where `:navigate increment/decrement` will search # for a number. # Valid values: host, path, query, anchor # Default: path,query -ignore-case = smart -startpage = https://geoffrey.frogeye.fr/home.php -yank-ignored-url-parameters = ref,utm_source,utm_medium,utm_campaign,utm_term,utm_content -default-open-dispatcher = -default-page = ${startpage} -auto-search = naive -auto-save-config = true -auto-save-interval = 15000 -editor = gvim -f "{}" -editor-encoding = utf-8 -private-browsing = false -developer-extras = true -print-element-backgrounds = true -xss-auditing = false -site-specific-quirks = false -default-encoding = -new-instance-open-target = tab -new-instance-open-target.window = last-focused -log-javascript-console = debug -save-session = false -session-default-name = url-incdec-segments = path,query -[ui] + # General options related to the user interface. -# +[ui] + +# history-session-interval (Int): +# The maximum time in minutes between two history items for them to +# be considered being from the same session. Use -1 to disable +# separation. +# Default: 30 +history-session-interval = 30 + # zoom-levels (List of Perc): # The available zoom levels, separated by commas. # Default: # 25%,33%,50%,67%,75%,90%,100%,110%,125%,150%,175%,200%,250%,300%,400%,500% -# +zoom-levels = 25%,33%,50%,67%,75%,90%,100%,110%,125%,150%,175%,200%,250%,300%,400%,500% + # default-zoom (Perc): # The default zoom level. # Default: 100% -# +default-zoom = 100% + # downloads-position (VerticalPosition): # Where to show the downloaded files. # Valid values: top, bottom # Default: top -# +downloads-position = top + # status-position (VerticalPosition): # The position of the status bar. # Valid values: top, bottom # Default: bottom -# +status-position = bottom + # message-timeout (Int): # Time (in ms) to show messages in the statusbar for. +# Set to 0 to never clear messages. # Default: 2000 -# +message-timeout = 2000 + # message-unfocused (Bool): # Whether to show messages in unfocused windows. # Valid values: true, false # Default: false -# +message-unfocused = false + # confirm-quit (ConfirmQuit): # Whether to confirm quitting the application. # always: Always show a confirmation. @@ -235,52 +244,58 @@ url-incdec-segments = path,query # downloads: Show a confirmation if downloads are running # never: Never show a confirmation. # Default: never -# +confirm-quit = never + # zoom-text-only (Bool): # Whether the zoom factor on a frame applies only to the text or to # all content. # Valid values: true, false # Default: false -# +zoom-text-only = false + # frame-flattening (Bool): # Whether to expand each subframe to its contents. # This will flatten all the frames to become one scrollable page. # Valid values: true, false # Default: false -# +frame-flattening = false + # user-stylesheet (File): # User stylesheet to use (absolute filename or filename relative to # the config directory). Will expand environment variables. # Default: -# +user-stylesheet = + # hide-scrollbar (Bool): # Hide the main scrollbar. # Valid values: true, false # Default: true -# -# css-media-type (String): -# Set the CSS media type. -# Default: -# +hide-scrollbar = true + # smooth-scrolling (Bool): -# Whether to enable smooth scrolling for webpages. +# Whether to enable smooth scrolling for web pages. Note smooth +# scrolling does not work with the :scroll-px command. # Valid values: true, false # Default: false -# +smooth-scrolling = false + # remove-finished-downloads (Int): # Number of milliseconds to wait before removing finished downloads. # Will not be removed if value is -1. # Default: -1 -# +remove-finished-downloads = -1 + # hide-statusbar (Bool): # Whether to hide the statusbar unless a message is shown. # Valid values: true, false # Default: false -# +hide-statusbar = false + # statusbar-padding (Padding): # Padding for statusbar (top, bottom, left, right). # Default: 1,1,0,0 -# +statusbar-padding = 1,1,0,0 + # window-title-format (FormatString): # The format to use for the window title. The following placeholders # are defined: @@ -293,67 +308,60 @@ url-incdec-segments = path,query # * `{scroll_pos}`: The page scroll position. # * `{host}`: The host of the current web page. # * `{backend}`: Either 'webkit' or 'webengine' +# * `{private}` : Indicates when private mode is enabled. # Default: {perc}{title}{title_sep}qutebrowser -# +window-title-format = {perc}{title}{title_sep}qutebrowser + # modal-js-dialog (Bool): # Use standard JavaScript modal dialog for alert() and confirm() # Valid values: true, false # Default: false -# +modal-js-dialog = false + # hide-wayland-decoration (Bool): # Hide the window decoration when using wayland (requires restart) # Valid values: true, false # Default: false -# +hide-wayland-decoration = false + # keyhint-blacklist (List of String): # Keychains that shouldn't be shown in the keyhint dialog # Globs are supported, so ';*' will blacklist all keychainsstarting # with ';'. Use '*' to disable keyhints # Default: -# +keyhint-blacklist = + +# keyhint-delay (Int): +# Time from pressing a key to seeing the keyhint dialog (ms) +# Default: 500 +keyhint-delay = 500 + # prompt-radius (Int): # The rounding radius for the edges of prompts. # Default: 8 -# +prompt-radius = 8 + # prompt-filebrowser (Bool): # Show a filebrowser in upload/download prompts. # Valid values: true, false # Default: true -zoom-levels = 25%,33%,50%,67%,75%,90%,100%,110%,125%,150%,175%,200%,250%,300%,400%,500% -default-zoom = 100% -downloads-position = top -status-position = bottom -message-timeout = 2000 -message-unfocused = false -confirm-quit = never -zoom-text-only = false -frame-flattening = false -user-stylesheet = -hide-scrollbar = true -css-media-type = -smooth-scrolling = false -remove-finished-downloads = -1 -hide-statusbar = false -statusbar-padding = 1,1,0,0 -window-title-format = {perc}{title}{title_sep}qutebrowser -modal-js-dialog = false -hide-wayland-decoration = false -keyhint-blacklist = -prompt-radius = 8 prompt-filebrowser = true -[network] + # Settings related to the network. -# +[network] + # do-not-track (Bool): # Value to send in the `DNT` header. # Valid values: true, false # Default: true -# +do-not-track = true + # accept-language (String): # Value to send in the `accept-language` header. # Default: en-US,en -# +accept-language = fr-FR,en-US,en + # referer-header (String): # Send the Referer header # always: Always send. @@ -362,160 +370,164 @@ prompt-filebrowser = true # same-domain: Only send for the same domain. This will still # protect your privacy, but shouldn't break any sites. # Default: same-domain -# +referer-header = same-domain + # user-agent (UserAgent): # User agent to send. Empty to send the default. # Default: -# +user-agent = + # proxy (Proxy): # The proxy to use. # In addition to the listed values, you can use a `socks://...` or # `http://...` URL. -# This setting only works with Qt 5.8 or newer when using the -# QtWebEngine backend. # system: Use the system wide proxy. # none: Don't use any proxy # Default: system -# +proxy = system + # proxy-dns-requests (Bool): # Whether to send DNS requests over the configured proxy. # Valid values: true, false # Default: true -# +proxy-dns-requests = true + # ssl-strict (BoolAsk): # Whether to validate SSL handshakes. # Valid values: true, false, ask # Default: ask -# +ssl-strict = ask + # dns-prefetch (Bool): # Whether to try to pre-fetch DNS entries to speed up browsing. # Valid values: true, false # Default: true -# +dns-prefetch = true + # custom-headers (HeaderDict): # Set custom headers for qutebrowser HTTP requests. # Default: -# +custom-headers = + # netrc-file (File): # Set location of a netrc-file for HTTP authentication. If empty, # ~/.netrc is used. # Default: -do-not-track = true -accept-language = fr-FR,en-US,en -referer-header = same-domain -user-agent = -proxy = system -proxy-dns-requests = true -ssl-strict = ask -dns-prefetch = true -custom-headers = netrc-file = -[completion] + # Options related to completion and command history. -# +[completion] + # show (String): # When to show the autocompletion window. # always: Whenever a completion is available. # auto: Whenever a completion is requested. # never: Never. # Default: always -# +show = always + # download-path-suggestion (String): # What to display in the download filename input. # path: Show only the download path. # filename: Show only download filename. # both: Show download path and filename. # Default: path -# +download-path-suggestion = path + # timestamp-format (TimestampTemplate): # How to format timestamps (e.g. for history) # Default: %Y-%m-%d -# +timestamp-format = %Y-%m-%d + # height (PercOrInt): # The height of the completion, in px or as percentage of the # window. # Default: 50% -# +height = 50% + # cmd-history-max-items (Int): # How many commands to save in the command history. # 0: no history / -1: unlimited # Default: 100 -# +cmd-history-max-items = 100 + # web-history-max-items (Int): # How many URLs to show in the web history. # 0: no history / -1: unlimited # Default: 1000 -# +web-history-max-items = 1000 + # quick-complete (Bool): # Whether to move on to the next part when there's only one possible # completion left. # Valid values: true, false # Default: true -# +quick-complete = true + # shrink (Bool): # Whether to shrink the completion to be smaller than the configured # size if there are no scrollbars. # Valid values: true, false # Default: false -# +shrink = false + # scrollbar-width (Int): # Width of the scrollbar in the completion window (in px). # Default: 12 -# +scrollbar-width = 12 + # scrollbar-padding (Int): # Padding of scrollbar handle in completion window (in px). # Default: 2 -show = always -download-path-suggestion = path -timestamp-format = %Y-%m-%d -height = 50% -cmd-history-max-items = 100 -web-history-max-items = 1000 -quick-complete = true -shrink = false -scrollbar-width = 12 scrollbar-padding = 2 -[input] + # Options related to input modes. -# +[input] + # timeout (Int): # Timeout (in milliseconds) for ambiguous key bindings. # If the current input forms both a complete match and a partial # match, the complete match will be executed after this time. # Default: 500 -# +timeout = 500 + # partial-timeout (Int): # Timeout (in milliseconds) for partially typed key bindings. # If the current input forms only partial matches, the keystring # will be cleared after this time. # Default: 5000 -# +partial-timeout = 1000 + # insert-mode-on-plugins (Bool): # Whether to switch to insert mode when clicking flash and other # plugins. # Valid values: true, false # Default: false -# +insert-mode-on-plugins = false + # auto-leave-insert-mode (Bool): # Whether to leave insert mode if a non-editable element is clicked. # Valid values: true, false # Default: true -# +auto-leave-insert-mode = true + # auto-insert-mode (Bool): # Whether to automatically enter insert mode if an editable element # is focused after page load. # Valid values: true, false # Default: false -# +auto-insert-mode = false + # forward-unbound-keys (String): # Whether to forward unbound keys to the webview in normal mode. # all: Forward all unbound keys. # auto: Forward unbound non-alphanumeric keys. # none: Don't forward any keys. # Default: auto -# +forward-unbound-keys = auto + # spatial-navigation (Bool): # Enables or disables the Spatial Navigation feature. # Spatial navigation consists in the ability to navigate between @@ -526,41 +538,37 @@ scrollbar-padding = 2 # the right and which element he probably wants. # Valid values: true, false # Default: false -# +spatial-navigation = false + # links-included-in-focus-chain (Bool): # Whether hyperlinks should be included in the keyboard focus chain. # Valid values: true, false # Default: true -# +links-included-in-focus-chain = true + # rocker-gestures (Bool): # Whether to enable Opera-like mouse rocker gestures. This disables # the context menu. # Valid values: true, false # Default: false -# +rocker-gestures = false + # mouse-zoom-divider (Int): # How much to divide the mouse wheel movements to translate them # into zoom increments. # Default: 512 -timeout = 500 -partial-timeout = 1000 -insert-mode-on-plugins = false -auto-leave-insert-mode = true -auto-insert-mode = false -forward-unbound-keys = auto -spatial-navigation = false -links-included-in-focus-chain = true -rocker-gestures = false mouse-zoom-divider = 512 -[tabs] + # Configuration of the tab bar. -# +[tabs] + # background-tabs (Bool): # Whether to open new tabs (middleclick/ctrl+click) in background. # Valid values: true, false # Default: false -# +background-tabs = false + # select-on-remove (SelectOnRemove): # Which tab to select when the focused tab is removed. # prev: Select the tab which came before the closed one (left in @@ -569,7 +577,8 @@ mouse-zoom-divider = 512 # horizontal, below in vertical). # last-used: Select the previously selected tab. # Default: next -# +select-on-remove = next + # new-tab-position (NewTabPosition): # How new tabs are positioned. # prev: Before the current tab. @@ -577,7 +586,8 @@ mouse-zoom-divider = 512 # first: At the beginning. # last: At the end. # Default: next -# +new-tab-position = next + # new-tab-position-explicit (NewTabPosition): # How new tabs opened explicitly are positioned. # prev: Before the current tab. @@ -585,7 +595,8 @@ mouse-zoom-divider = 512 # first: At the beginning. # last: At the end. # Default: last -# +new-tab-position-explicit = last + # last-close (String): # Behavior when the last tab is closed. # ignore: Don't do anything. @@ -594,7 +605,8 @@ mouse-zoom-divider = 512 # default-page: Load the default page. # close: Close the window. # Default: ignore -# +last-close = ignore + # show (String): # When to show the tab bar # always: Always show the tab bar. @@ -602,53 +614,74 @@ mouse-zoom-divider = 512 # multiple: Hide the tab bar if only one tab is open. # switching: Show the tab bar when switching tabs. # Default: always -# +show = multiple + # show-switching-delay (Int): # Time to show the tab bar before hiding it when tabs->show is set # to 'switching'. # Default: 800 -# +show-switching-delay = 800 + # wrap (Bool): # Whether to wrap when changing tabs. # Valid values: true, false # Default: true -# +wrap = true + # movable (Bool): # Whether tabs should be movable. # Valid values: true, false # Default: true -# +movable = true + # close-mouse-button (String): # On which mouse button to close tabs. # right: Close tabs on right-click. # middle: Close tabs on middle-click. # none: Don't close tabs using the mouse. # Default: middle -# +close-mouse-button = middle + # position (Position): # The position of the tab bar. # Valid values: top, bottom, left, right # Default: top -# +position = top + # show-favicons (Bool): # Whether to show favicons in the tab bar. # Valid values: true, false # Default: true -# +show-favicons = true + +# favicon-scale (Float): +# Scale for favicons in the tab bar. The tab size is unchanged, so +# big favicons also require extra `tabs->padding`. +# Default: 1.0 +favicon-scale = 1.0 + # width (PercOrInt): # The width of the tab bar if it's vertical, in px or as percentage # of the window. # Default: 20% -# +width = 20% + +# pinned-width (Int): +# The width for pinned tabs with a horizontal tabbar, in px. +# Default: 43 +pinned-width = 43 + # indicator-width (Int): # Width of the progress indicator (0 to disable). # Default: 3 -# +indicator-width = 3 + # tabs-are-windows (Bool): # Whether to open windows instead of tabs. # Valid values: true, false # Default: false -# +tabs-are-windows = true + # title-format (FormatString): # The format to use for the tab title. The following placeholders # are defined: @@ -662,65 +695,61 @@ mouse-zoom-divider = 512 # * `{scroll_pos}`: The page scroll position. # * `{host}`: The host of the current web page. # * `{backend}`: Either 'webkit' or 'webengine' +# * `{private}` : Indicates when private mode is enabled. # Default: {index}: {title} -# +title-format = {index}: {title} + +# title-format-pinned (FormatString): +# The format to use for the tab title for pinned tabs. The same +# placeholders like for title-format are defined. +# Default: {index} +title-format-pinned = {index} + # title-alignment (TextAlignment): # Alignment of the text inside of tabs # Valid values: left, right, center # Default: left -# +title-alignment = left + # mousewheel-tab-switching (Bool): # Switch between tabs using the mouse wheel. # Valid values: true, false # Default: true -# +mousewheel-tab-switching = true + # padding (Padding): # Padding for tabs (top, bottom, left, right). # Default: 0,0,5,5 -# +padding = 0,0,5,5 + # indicator-padding (Padding): # Padding for indicators (top, bottom, left, right). # Default: 2,2,0,4 -background-tabs = false -select-on-remove = next -new-tab-position = next -new-tab-position-explicit = last -last-close = ignore -show = multiple -show-switching-delay = 800 -wrap = true -movable = true -close-mouse-button = middle -position = top -show-favicons = true -width = 20% -indicator-width = 3 -tabs-are-windows = true -title-format = {index}: {title} -title-alignment = left -mousewheel-tab-switching = true -padding = 0,0,5,5 indicator-padding = 2,2,0,4 -[storage] + # Settings related to cache and storage. -# +[storage] + # download-directory (Directory): # The directory to save downloads to. An empty value selects a # sensible os-specific default. Will expand environment variables. # Default: -# +download-directory = + # prompt-download-directory (Bool): # Whether to prompt the user for the download location. # If set to false, 'download-directory' will be used. # Valid values: true, false # Default: true -# +prompt-download-directory = true + # remember-download-directory (Bool): # Whether to remember the last used download directory. # Valid values: true, false # Default: true -# +remember-download-directory = true + # maximum-pages-in-cache (Int): # The maximum number of pages to hold in the global memory page # cache. @@ -729,34 +758,10 @@ indicator-padding = 2,2,0,4 # resuming up to _n_ pages. # For more information about the feature, please refer to: # http://webkit.org/blog/427/webkit-page-cache-i-the-basics/ -# Default: -# -# object-cache-capacities (List of WebKitBytes): -# The capacities for the global memory cache for dead objects such -# as stylesheets or scripts. Syntax: cacheMinDeadCapacity, -# cacheMaxDead, totalCapacity. -# The _cacheMinDeadCapacity_ specifies the minimum number of bytes -# that dead objects should consume when the cache is under pressure. -# _cacheMaxDead_ is the maximum number of bytes that dead objects -# should consume when the cache is *not* under pressure. -# _totalCapacity_ specifies the maximum number of bytes that the -# cache should consume *overall*. -# Default: -# -# offline-storage-default-quota (WebKitBytes): -# Default quota for new offline storage databases. -# Default: -# -# offline-web-application-cache-quota (WebKitBytes): -# Quota for the offline web application cache. -# Default: -# -# offline-storage-database (Bool): -# Whether support for the HTML 5 offline storage feature is enabled. -# Valid values: true, false -# Default: true -# -# offline-web-application-storage (Bool): +# Default: 0 +maximum-pages-in-cache = 0 + +# offline-web-application-cache (Bool): # Whether support for the HTML 5 web application cache feature is # enabled. # An application cache acts like an HTTP cache in some sense. For @@ -767,117 +772,120 @@ indicator-padding = 2,2,0,4 # http://dev.w3.org/html5/spec/Overview.html#appcache # Valid values: true, false # Default: true -# +offline-web-application-cache = true + # local-storage (Bool): -# Whether support for the HTML 5 local storage feature is enabled. +# Whether support for HTML 5 local storage and Web SQL is enabled. # Valid values: true, false # Default: true -# +local-storage = true + # cache-size (Int): # Size of the HTTP network cache. Empty to use the default value. # Default: -download-directory = -prompt-download-directory = true -remember-download-directory = true -maximum-pages-in-cache = -object-cache-capacities = -offline-storage-default-quota = -offline-web-application-cache-quota = -offline-storage-database = true -offline-web-application-storage = true -local-storage = true cache-size = 52428800 -[content] + # Loaded plugins/scripts and allowed actions. -# +[content] + # allow-images (Bool): # Whether images are automatically loaded in web pages. # Valid values: true, false # Default: true -# +allow-images = true + # allow-javascript (Bool): # Enables or disables the running of JavaScript programs. # Valid values: true, false # Default: true -# +allow-javascript = true + # allow-plugins (Bool): # Enables or disables plugins in Web pages. # Qt plugins with a mimetype such as "application/x-qt-plugin" are # not affected by this setting. # Valid values: true, false # Default: false -# +allow-plugins = false + # webgl (Bool): # Enables or disables WebGL. # Valid values: true, false # Default: true -# -# css-regions (Bool): -# Enable or disable support for CSS regions. -# Valid values: true, false -# Default: true -# +webgl = true + # hyperlink-auditing (Bool): # Enable or disable hyperlink auditing (). # Valid values: true, false # Default: false -# +hyperlink-auditing = false + # geolocation (BoolAsk): # Allow websites to request geolocations. # Valid values: true, false, ask # Default: ask -# +geolocation = ask + # notifications (BoolAsk): # Allow websites to show notifications. # Valid values: true, false, ask # Default: ask -# +notifications = true + # media-capture (BoolAsk): # Allow websites to record audio/video. # Valid values: true, false, ask # Default: ask -# +media-capture = ask + # javascript-can-open-windows-automatically (Bool): # Whether JavaScript programs can open new windows without user # interaction. # Valid values: true, false # Default: false -# +javascript-can-open-windows-automatically = false + # javascript-can-close-windows (Bool): # Whether JavaScript programs can close windows. # Valid values: true, false # Default: false -# +javascript-can-close-windows = false + # javascript-can-access-clipboard (Bool): # Whether JavaScript programs can read or write to the clipboard. # With QtWebEngine, writing the clipboard as response to a user # interaction is always allowed. # Valid values: true, false # Default: false -# +javascript-can-access-clipboard = false + # ignore-javascript-prompt (Bool): # Whether all javascript prompts should be ignored. # Valid values: true, false # Default: false -# +ignore-javascript-prompt = false + # ignore-javascript-alert (Bool): # Whether all javascript alerts should be ignored. # Valid values: true, false # Default: false -# +ignore-javascript-alert = false + # local-content-can-access-remote-urls (Bool): # Whether locally loaded documents are allowed to access remote # urls. # Valid values: true, false # Default: false -# +local-content-can-access-remote-urls = false + # local-content-can-access-file-urls (Bool): # Whether locally loaded documents are allowed to access other local # urls. # Valid values: true, false # Default: true -# +local-content-can-access-file-urls = true + # cookies-accept (String): # Control which cookies to accept. # all: Accept all cookies. @@ -886,13 +894,15 @@ cache-size = 52428800 # unless a cookie is already set for the domain. # never: Don't accept cookies at all. # Default: no-3rdparty -# +cookies-accept = no-3rdparty + # cookies-store (Bool): # Whether to store cookies. Note this option needs a restart with -# QtWebEngine. +# QtWebEngine on Qt < 5.9. # Valid values: true, false # Default: true -# +cookies-store = true + # host-block-lists (List of Url): # List of URLs of lists which contain hosts to block. # The file can be in one of the following formats: @@ -902,12 +912,14 @@ cache-size = 52428800 # file named 'hosts' (with any extension). # Default: # https://www.malwaredomainlist.com/hostslist/hosts.txt,http://someonewhocares.org/hosts/hosts,http://winhelp2002.mvps.org/hosts.zip,http://malwaredomains.lehigh.edu/files/justdomains.zip,https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&mimetype=plaintext -# +host-block-lists = http://www.malwaredomainlist.com/hostslist/hosts.txt,http://someonewhocares.org/hosts/hosts,http://winhelp2002.mvps.org/hosts.zip,http://malwaredomains.lehigh.edu/files/justdomains.zip,http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&mimetype=plaintext + # host-blocking-enabled (Bool): # Whether host blocking is enabled. # Valid values: true, false # Default: true -# +host-blocking-enabled = true + # host-blocking-whitelist (List of String): # List of domains that should always be loaded, despite being # ad-blocked. @@ -915,43 +927,25 @@ cache-size = 52428800 # to exactly match the requested domain. # Local domains are always exempt from hostblocking. # Default: piwik.org -# +host-blocking-whitelist = piwik.org + # enable-pdfjs (Bool): # Enable pdf.js to view PDF files in the browser. # Note that the files can still be downloaded by clicking the # download button in the pdf.js viewer. # Valid values: true, false # Default: false -allow-images = true -allow-javascript = true -allow-plugins = false -webgl = true -css-regions = true -hyperlink-auditing = false -geolocation = ask -notifications = true -media-capture = ask -javascript-can-open-windows-automatically = false -javascript-can-close-windows = false -javascript-can-access-clipboard = false -ignore-javascript-prompt = false -ignore-javascript-alert = false -local-content-can-access-remote-urls = false -local-content-can-access-file-urls = true -cookies-accept = no-3rdparty -cookies-store = true -host-block-lists = http://www.malwaredomainlist.com/hostslist/hosts.txt,http://someonewhocares.org/hosts/hosts,http://winhelp2002.mvps.org/hosts.zip,http://malwaredomains.lehigh.edu/files/justdomains.zip,http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&mimetype=plaintext -host-blocking-enabled = true -host-blocking-whitelist = piwik.org enable-pdfjs = false -[hints] + # Hinting settings. -# +[hints] + # border (String): # CSS border value for hints. # Default: 1px solid #E3BE23 -# +border = 1px solid #E3BE23 + # mode (String): # Mode to use for hints. # number: Use numeric hints. (In this mode you can also type @@ -961,30 +955,36 @@ enable-pdfjs = false # word: Use hints words based on the html elements and the extra # words. # Default: letter -# +mode = letter + # chars (UniqueCharString): # Chars used for hint strings. # Default: asdfghjkl -# +chars = asdfghjkl + # min-chars (Int): # Minimum number of chars used for hint strings. # Default: 1 -# +min-chars = 1 + # scatter (Bool): # Whether to scatter hint key chains (like Vimium) or not (like # dwb). Ignored for number hints. # Valid values: true, false # Default: true -# +scatter = true + # uppercase (Bool): # Make chars in hint strings uppercase. # Valid values: true, false # Default: false -# +uppercase = false + # dictionary (File): # The dictionary file to be used by the word hints. # Default: /usr/share/dict/words -# +dictionary = /usr/share/dict/words + # auto-follow (String): # Controls when a hint can be automatically followed without the # user pressing Enter. @@ -999,46 +999,39 @@ enable-pdfjs = false # never: The user will always need to press Enter to follow a # hint. # Default: unique-match -# +auto-follow = unique-match + # auto-follow-timeout (Int): # A timeout (in milliseconds) to inhibit normal-mode key bindings # after a successful auto-follow. # Default: 0 -# +auto-follow-timeout = 0 + # next-regexes (List of Regex): # A comma-separated list of regexes to use for 'next' links. # Default: # \bnext\b,\bmore\b,\bnewer\b,\b[>→≫]\b,\b(>>|»)\b,\bcontinue\b -# +next-regexes = \bnext\b,\bmore\b,\bnewer\b,\b[>→≫]\b,\b(>>|»)\b,\bcontinue\b + # prev-regexes (List of Regex): # A comma-separated list of regexes to use for 'prev' links. # Default: \bprev(ious)?\b,\bback\b,\bolder\b,\b[<←≪]\b,\b(<<|«)\b -# +prev-regexes = \bprev(ious)?\b,\bback\b,\bolder\b,\b[<←≪]\b,\b(<<|«)\b + # find-implementation (String): # Which implementation to use to find elements to hint. # javascript: Better but slower # python: Slightly worse but faster # Default: python -# +find-implementation = python + # hide-unmatched-rapid-hints (Bool): # Controls hiding unmatched hints in rapid mode. # Valid values: true, false # Default: true -border = 1px solid #E3BE23 -mode = letter -chars = asdfghjkl -min-chars = 1 -scatter = true -uppercase = false -dictionary = /usr/share/dict/words -auto-follow = unique-match -auto-follow-timeout = 0 -next-regexes = \bnext\b,\bmore\b,\bnewer\b,\b[>→≫]\b,\b(>>|»)\b,\bcontinue\b -prev-regexes = \bprev(ious)?\b,\bback\b,\bolder\b,\b[<←≪]\b,\b(<<|«)\b -find-implementation = python hide-unmatched-rapid-hints = true -[searchengines] + # Definitions of search engines which can be used via the address bar. # The searchengine named `DEFAULT` is used when `general -> auto-search` # is true and something else than a URL was entered to be opened. Other @@ -1046,6 +1039,7 @@ hide-unmatched-rapid-hints = true # search term, e.g. `:open google qutebrowser`. The string `{}` will be # replaced by the search term, use `{{` and `}}` for literal `{`/`}` # signs. +[searchengines] DEFAULT = https://www.qwant.com/?t=web&q={} arch = https://wiki.archlinux.org/?search={} gfr = https://www.google.fr/search?hl=fr&q={} @@ -1059,13 +1053,14 @@ wa = https://www.wolframalpha.com/input/?i={} dockerhub = https://hub.docker.com/search/?isAutomated=0&isOfficial=0&page=1&pullCount=0&q={}&starCount=0 npm = https://www.npmjs.com/search?q={} -[aliases] + # Aliases for commands. # By default, no aliases are defined. Example which adds a new command # `:qtb` to open qutebrowsers website: # `qtb = open https://www.qutebrowser.org/` +[aliases] + -[colors] # Colors used in the UI. # A value can be in one of the following format: # * `#RGB`/`#RRGGBB`/`#RRRGGGBBB`/`#RRRRGGGGBBBB` @@ -1079,183 +1074,249 @@ npm = https://www.npmjs.com/search?q={} # regardless of how they are defined in the options. Valid values are # 'rgb', 'hsv', and 'hsl'. # The `hints.*` values are a special case as they're real CSS colors, not Qt-CSS colors. There, for a gradient, you need to use `-webkit-gradient`, see https://www.webkit.org/blog/175/introducing-css-gradients/[the WebKit documentation]. -# +[colors] + # completion.fg (QtColor): # Text color of the completion widget. # Default: white -# +completion.fg = #f1ebeb + # completion.bg (QssColor): # Background color of the completion widget. # Default: #333333 -# +completion.bg = #58584e + # completion.alternate-bg (QssColor): # Alternating background color of the completion widget. # Default: #444444 -# +completion.alternate-bg = #48483e + # completion.category.fg (QtColor): # Foreground color of completion widget category headers. # Default: white -# +completion.category.fg = #f1ebeb + # completion.category.bg (QssColor): # Background color of the completion widget category headers. # Default: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #888888, # stop:1 #505050) -# +completion.category.bg = qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #76715e, stop:1 #48483e) + # completion.category.border.top (QssColor): # Top border color of the completion widget category headers. # Default: black -# +completion.category.border.top = #272822 + # completion.category.border.bottom (QssColor): # Bottom border color of the completion widget category headers. # Default: ${completion.category.border.top} -# +completion.category.border.bottom = ${completion.category.border.top} + # completion.item.selected.fg (QtColor): # Foreground color of the selected completion item. # Default: black -# +completion.item.selected.fg = ${completion.fg} + # completion.item.selected.bg (QssColor): # Background color of the selected completion item. # Default: #e8c000 -# +completion.item.selected.bg = #d4c96e + # completion.item.selected.border.top (QssColor): # Top border color of the completion widget category headers. # Default: #bbbb00 -# +completion.item.selected.border.top = #e7db75 + # completion.item.selected.border.bottom (QssColor): # Bottom border color of the selected completion item. # Default: ${completion.item.selected.border.top} -# +completion.item.selected.border.bottom = ${completion.item.selected.border.top} + # completion.match.fg (QssColor): # Foreground color of the matched text in the completion. # Default: #ff4444 -# +completion.match.fg = #fa2772 + # completion.scrollbar.fg (QssColor): # Color of the scrollbar handle in completion view. # Default: ${completion.fg} -# +completion.scrollbar.fg = ${completion.fg} + # completion.scrollbar.bg (QssColor): # Color of the scrollbar in completion view # Default: ${completion.bg} -# +completion.scrollbar.bg = ${completion.bg} + # statusbar.fg (QssColor): # Foreground color of the statusbar. # Default: white -# +statusbar.fg = #f1ebeb + # statusbar.bg (QssColor): # Background color of the statusbar. # Default: black -# +statusbar.bg = #272822 + +# statusbar.fg.private (QssColor): +# Foreground color of the statusbar in private browsing mode. +# Default: ${statusbar.fg} +statusbar.fg.private = ${statusbar.fg} + +# statusbar.bg.private (QssColor): +# Background color of the statusbar in private browsing mode. +# Default: #666666 +statusbar.bg.private = #666666 + # statusbar.fg.insert (QssColor): # Foreground color of the statusbar in insert mode. # Default: ${statusbar.fg} -# +statusbar.fg.insert = ${statusbar.fg} + # statusbar.bg.insert (QssColor): # Background color of the statusbar in insert mode. # Default: darkgreen -# +statusbar.bg.insert = #8fc029 + # statusbar.fg.command (QssColor): # Foreground color of the statusbar in command mode. # Default: ${statusbar.fg} -# +statusbar.fg.command = ${statusbar.fg} + # statusbar.bg.command (QssColor): # Background color of the statusbar in command mode. # Default: ${statusbar.bg} -# +statusbar.bg.command = ${statusbar.bg} + +# statusbar.fg.command.private (QssColor): +# Foreground color of the statusbar in private browsing + command +# mode. +# Default: ${statusbar.fg.private} +statusbar.fg.command.private = ${statusbar.fg.private} + +# statusbar.bg.command.private (QssColor): +# Background color of the statusbar in private browsing + command +# mode. +# Default: ${statusbar.bg.private} +statusbar.bg.command.private = ${statusbar.bg.private} + # statusbar.fg.caret (QssColor): # Foreground color of the statusbar in caret mode. # Default: ${statusbar.fg} -# +statusbar.fg.caret = ${statusbar.fg} + # statusbar.bg.caret (QssColor): # Background color of the statusbar in caret mode. # Default: purple -# +statusbar.bg.caret = #9358fe + # statusbar.fg.caret-selection (QssColor): # Foreground color of the statusbar in caret mode with a selection # Default: ${statusbar.fg} -# +statusbar.fg.caret-selection = ${statusbar.fg} + # statusbar.bg.caret-selection (QssColor): # Background color of the statusbar in caret mode with a selection # Default: #a12dff -# +statusbar.bg.caret-selection = #55bcce + # statusbar.progress.bg (QssColor): # Background color of the progress bar. # Default: white -# +statusbar.progress.bg = ${statusbar.fg} + # statusbar.url.fg (QssColor): # Default foreground color of the URL in the statusbar. # Default: ${statusbar.fg} -# +statusbar.url.fg = ${statusbar.fg} + # statusbar.url.fg.success (QssColor): # Foreground color of the URL in the statusbar on successful load # (http). # Default: white -# +statusbar.url.fg.success = #66efd5 + # statusbar.url.fg.success.https (QssColor): # Foreground color of the URL in the statusbar on successful load # (https). # Default: lime -# +statusbar.url.fg.success.https = #a7e22e + # statusbar.url.fg.error (QssColor): # Foreground color of the URL in the statusbar on error. # Default: orange -# +statusbar.url.fg.error = #fa2772 + # statusbar.url.fg.warn (QssColor): # Foreground color of the URL in the statusbar when there's a # warning. # Default: yellow -# +statusbar.url.fg.warn = #e7db75 + # statusbar.url.fg.hover (QssColor): # Foreground color of the URL in the statusbar for hovered links. # Default: aqua -# +statusbar.url.fg.hover = #ae82ff + # tabs.fg.odd (QtColor): # Foreground color of unselected odd tabs. # Default: white -# +tabs.fg.odd = ${completion.fg} + # tabs.bg.odd (QtColor): # Background color of unselected odd tabs. # Default: grey -# +tabs.bg.odd = ${completion.bg} + # tabs.fg.even (QtColor): # Foreground color of unselected even tabs. # Default: white -# +tabs.fg.even = ${completion.fg} + # tabs.bg.even (QtColor): # Background color of unselected even tabs. # Default: darkgrey -# +tabs.bg.even = ${completion.alternate-bg} + # tabs.fg.selected.odd (QtColor): # Foreground color of selected odd tabs. # Default: white -# +tabs.fg.selected.odd = ${completion.item.selected.fg} + # tabs.bg.selected.odd (QtColor): # Background color of selected odd tabs. # Default: black -# +tabs.bg.selected.odd = ${completion.item.selected.bg} + # tabs.fg.selected.even (QtColor): # Foreground color of selected even tabs. # Default: ${tabs.fg.selected.odd} -# +tabs.fg.selected.even = ${tabs.fg.selected.odd} + # tabs.bg.selected.even (QtColor): # Background color of selected even tabs. # Default: ${tabs.bg.selected.odd} -# +tabs.bg.selected.even = ${tabs.bg.selected.odd} + # tabs.bg.bar (QtColor): # Background color of the tab bar. # Default: #555555 -# +tabs.bg.bar = ${statusbar.bg} + # tabs.indicator.start (QtColor): # Color gradient start for the tab indicator. # Default: #0000aa -# +tabs.indicator.start = #55bcce + # tabs.indicator.stop (QtColor): # Color gradient end for the tab indicator. # Default: #00aa00 -# +tabs.indicator.stop = #8fc029 + # tabs.indicator.error (QtColor): # Color for the tab indicator on errors.. # Default: #ff0000 -# +tabs.indicator.error = #dc2566 + # tabs.indicator.system (ColorSystem): # Color gradient interpolation system for the tab indicator. # rgb: Interpolate in the RGB color system. @@ -1263,41 +1324,50 @@ npm = https://www.npmjs.com/search?q={} # hsl: Interpolate in the HSL color system. # none: Don't show a gradient. # Default: rgb -# +tabs.indicator.system = rgb + # hints.fg (QssColor): # Font color for hints. # Default: black -# +hints.fg = #272822 + # hints.bg (QssColor): # Background color for hints. Note that you can use a `rgba(...)` # value for transparency. # Default: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 rgba(255, # 247, 133, 0.8), stop:1 rgba(255, 197, 66, 0.8)) -# +hints.bg = qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 rgba(212, 201, 110, 0.8), stop:1 rgba(231, 219, 117, 0.8)) + # hints.fg.match (QssColor): # Font color for the matched part of hints. # Default: green -# +hints.fg.match = #8fc029 + # downloads.bg.bar (QssColor): # Background color for the download bar. # Default: black -# +downloads.bg.bar = ${statusbar.bg} + # downloads.fg.start (QtColor): # Color gradient start for download text. # Default: white -# +downloads.fg.start = ${statusbar.fg} + # downloads.bg.start (QtColor): # Color gradient start for download backgrounds. # Default: #0000aa -# +downloads.bg.start = #48483e + # downloads.fg.stop (QtColor): # Color gradient end for download text. # Default: ${downloads.fg.start} -# +downloads.fg.stop = ${downloads.fg.start} + # downloads.bg.stop (QtColor): # Color gradient stop for download backgrounds. # Default: #00aa00 -# +downloads.bg.stop = #8fc029 + # downloads.fg.system (ColorSystem): # Color gradient interpolation system for download text. # rgb: Interpolate in the RGB color system. @@ -1305,7 +1375,8 @@ npm = https://www.npmjs.com/search?q={} # hsl: Interpolate in the HSL color system. # none: Don't show a gradient. # Default: rgb -# +downloads.fg.system = rgb + # downloads.bg.system (ColorSystem): # Color gradient interpolation system for download backgrounds. # rgb: Interpolate in the RGB color system. @@ -1313,271 +1384,219 @@ npm = https://www.npmjs.com/search?q={} # hsl: Interpolate in the HSL color system. # none: Don't show a gradient. # Default: rgb -# +downloads.bg.system = rgb + # downloads.fg.error (QtColor): # Foreground color for downloads with errors. # Default: white -# +downloads.fg.error = ${downloads.fg.start} + # downloads.bg.error (QtColor): # Background color for downloads with errors. # Default: red -# +downloads.bg.error = ${messages.bg.error} + # webpage.bg (QtColor): # Background color for webpages if unset (or empty to use the # theme's color) # Default: white -# +webpage.bg = white + # keyhint.fg (QssColor): # Text color for the keyhint widget. # Default: #FFFFFF -# +keyhint.fg = #FFFFFF + # keyhint.fg.suffix (CssColor): # Highlight color for keys to complete the current keychain # Default: #FFFF00 -# +keyhint.fg.suffix = #FFFF00 + # keyhint.bg (QssColor): # Background color of the keyhint widget. # Default: rgba(0, 0, 0, 80%) -# +keyhint.bg = rgba(0, 0, 0, 80%) + # messages.fg.error (QssColor): # Foreground color of an error message. # Default: white -# +messages.fg.error = ${statusbar.fg} + # messages.bg.error (QssColor): # Background color of an error message. # Default: red -# +messages.bg.error = #dc2566 + # messages.border.error (QssColor): # Border color of an error message. # Default: #bb0000 -# +messages.border.error = #fa2772 + # messages.fg.warning (QssColor): # Foreground color a warning message. # Default: white -# +messages.fg.warning = ${statusbar.fg} + # messages.bg.warning (QssColor): # Background color of a warning message. # Default: darkorange -# +messages.bg.warning = #d4c96e + # messages.border.warning (QssColor): # Border color of an error message. # Default: #d47300 -# +messages.border.warning = #e7db75 + # messages.fg.info (QssColor): # Foreground color an info message. # Default: white -# +messages.fg.info = ${statusbar.fg} + # messages.bg.info (QssColor): # Background color of an info message. # Default: black -# +messages.bg.info = #55bcce + # messages.border.info (QssColor): # Border color of an info message. # Default: #333333 -# +messages.border.info = #66d9ee + # prompts.fg (QssColor): # Foreground color for prompts. # Default: white -# +prompts.fg = ${statusbar.fg} + # prompts.bg (QssColor): # Background color for prompts. # Default: darkblue -# +prompts.bg = #56b7a5 + # prompts.selected.bg (QssColor): # Background color for the selected item in filename prompts. # Default: #308cc6 -completion.fg = #f1ebeb -completion.bg = #58584e -completion.alternate-bg = #48483e -completion.category.fg = #f1ebeb -completion.category.bg = qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #76715e, stop:1 #48483e) -completion.category.border.top = #272822 -completion.category.border.bottom = ${completion.category.border.top} -completion.item.selected.fg = ${completion.fg} -completion.item.selected.bg = #d4c96e -completion.item.selected.border.top = #e7db75 -completion.item.selected.border.bottom = ${completion.item.selected.border.top} -completion.match.fg = #fa2772 -completion.scrollbar.fg = ${completion.fg} -completion.scrollbar.bg = ${completion.bg} -statusbar.fg = #f1ebeb -statusbar.bg = #272822 -statusbar.fg.insert = ${statusbar.fg} -statusbar.bg.insert = #8fc029 -statusbar.fg.command = ${statusbar.fg} -statusbar.bg.command = ${statusbar.bg} -statusbar.fg.caret = ${statusbar.fg} -statusbar.bg.caret = #9358fe -statusbar.fg.caret-selection = ${statusbar.fg} -statusbar.bg.caret-selection = #55bcce -statusbar.progress.bg = ${statusbar.fg} -statusbar.url.fg = ${statusbar.fg} -statusbar.url.fg.success = #66efd5 -statusbar.url.fg.success.https = #a7e22e -statusbar.url.fg.error = #fa2772 -statusbar.url.fg.warn = #e7db75 -statusbar.url.fg.hover = #ae82ff -tabs.fg.odd = ${completion.fg} -tabs.bg.odd = ${completion.bg} -tabs.fg.even = ${completion.fg} -tabs.bg.even = ${completion.alternate-bg} -tabs.fg.selected.odd = ${completion.item.selected.fg} -tabs.bg.selected.odd = ${completion.item.selected.bg} -tabs.fg.selected.even = ${tabs.fg.selected.odd} -tabs.bg.selected.even = ${tabs.bg.selected.odd} -tabs.bg.bar = ${statusbar.bg} -tabs.indicator.start = #55bcce -tabs.indicator.stop = #8fc029 -tabs.indicator.error = #dc2566 -tabs.indicator.system = rgb -hints.fg = #272822 -hints.bg = qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 rgba(212, 201, 110, 0.8), stop:1 rgba(231, 219, 117, 0.8)) -hints.fg.match = #8fc029 -downloads.bg.bar = ${statusbar.bg} -downloads.fg.start = ${statusbar.fg} -downloads.bg.start = #48483e -downloads.fg.stop = ${downloads.fg.start} -downloads.bg.stop = #8fc029 -downloads.fg.system = rgb -downloads.bg.system = rgb -downloads.fg.error = ${downloads.fg.start} -downloads.bg.error = ${messages.bg.error} -webpage.bg = white -keyhint.fg = #FFFFFF -keyhint.fg.suffix = #FFFF00 -keyhint.bg = rgba(0, 0, 0, 80%) -messages.fg.error = ${statusbar.fg} -messages.bg.error = #dc2566 -messages.border.error = #fa2772 -messages.fg.warning = ${statusbar.fg} -messages.bg.warning = #d4c96e -messages.border.warning = #e7db75 -messages.fg.info = ${statusbar.fg} -messages.bg.info = #55bcce -messages.border.info = #66d9ee -prompts.fg = ${statusbar.fg} -prompts.bg = #56b7a5 prompts.selected.bg = #55bcce -[fonts] + # Fonts used for the UI, with optional style/weight/size. # * Style: `normal`/`italic`/`oblique` # * Weight: `normal`, `bold`, `100`..`900` # * Size: _number_ `px`/`pt` -# +[fonts] + # _monospace (Font): # Default monospace fonts. -# Default: Terminus, Monospace, "DejaVu Sans Mono", Monaco, -# "Bitstream Vera Sans Mono", "Andale Mono", "Courier New", Courier, -# "Liberation Mono", monospace, Fixed, Consolas, Terminal -# +# Default: xos4 Terminus, Terminus, Monospace, "DejaVu Sans Mono", +# Monaco, "Bitstream Vera Sans Mono", "Andale Mono", "Courier New", +# Courier, "Liberation Mono", monospace, Fixed, Consolas, Terminal +_monospace = Terminus, Monospace, "DejaVu Sans Mono", Monaco, "Bitstream Vera Sans Mono", "Andale Mono", "Courier New", Courier, "Liberation Mono", monospace, Fixed, Consolas, Terminal + # completion (Font): # Font used in the completion widget. # Default: 8pt ${_monospace} -# +completion = 8pt ${_monospace} + # completion.category (Font): # Font used in the completion categories. # Default: bold ${completion} -# +completion.category = bold ${completion} + # tabbar (QtFont): # Font used in the tab bar. # Default: 8pt ${_monospace} -# +tabbar = 8pt ${_monospace} + # statusbar (Font): # Font used in the statusbar. # Default: 8pt ${_monospace} -# +statusbar = 8pt ${_monospace} + # downloads (Font): # Font used for the downloadbar. # Default: 8pt ${_monospace} -# +downloads = 8pt ${_monospace} + # hints (Font): # Font used for the hints. # Default: bold 13px ${_monospace} -# +hints = bold 13px ${_monospace} + # debug-console (QtFont): # Font used for the debugging console. # Default: 8pt ${_monospace} -# +debug-console = 8pt ${_monospace} + # web-family-standard (FontFamily): # Font family for standard fonts. # Default: -# +web-family-standard = + # web-family-fixed (FontFamily): # Font family for fixed fonts. # Default: -# +web-family-fixed = + # web-family-serif (FontFamily): # Font family for serif fonts. # Default: -# +web-family-serif = + # web-family-sans-serif (FontFamily): # Font family for sans-serif fonts. # Default: -# +web-family-sans-serif = + # web-family-cursive (FontFamily): # Font family for cursive fonts. # Default: -# +web-family-cursive = + # web-family-fantasy (FontFamily): # Font family for fantasy fonts. # Default: -# +web-family-fantasy = + # web-size-minimum (Int): # The hard minimum font size. -# Default: -# +# Default: 0 +web-size-minimum = 0 + # web-size-minimum-logical (Int): # The minimum logical font size that is applied when zooming out. -# Default: -# +# Default: 6 +web-size-minimum-logical = 6 + # web-size-default (Int): # The default font size for regular text. -# Default: -# +# Default: 16 +web-size-default = 16 + # web-size-default-fixed (Int): # The default font size for fixed-pitch text. -# Default: -# +# Default: 13 +web-size-default-fixed = 13 + # keyhint (Font): # Font used in the keyhint widget. # Default: 8pt ${_monospace} -# +keyhint = 8pt ${_monospace} + # messages.error (Font): # Font used for error messages. # Default: 8pt ${_monospace} -# +messages.error = 8pt ${_monospace} + # messages.warning (Font): # Font used for warning messages. # Default: 8pt ${_monospace} -# +messages.warning = 8pt ${_monospace} + # messages.info (Font): # Font used for info messages. # Default: 8pt ${_monospace} -# +messages.info = 8pt ${_monospace} + # prompts (Font): # Font used for prompts. # Default: 8pt sans-serif -_monospace = Terminus, Monospace, "DejaVu Sans Mono", Monaco, "Bitstream Vera Sans Mono", "Andale Mono", "Courier New", Courier, "Liberation Mono", monospace, Fixed, Consolas, Terminal -completion = 8pt ${_monospace} -completion.category = bold ${completion} -tabbar = 8pt ${_monospace} -statusbar = 8pt ${_monospace} -downloads = 8pt ${_monospace} -hints = bold 13px ${_monospace} -debug-console = 8pt ${_monospace} -web-family-standard = -web-family-fixed = -web-family-serif = -web-family-sans-serif = -web-family-cursive = -web-family-fantasy = -web-size-minimum = -web-size-minimum-logical = -web-size-default = -web-size-default-fixed = -keyhint = 8pt ${_monospace} -messages.error = 8pt ${_monospace} -messages.warning = 8pt ${_monospace} -messages.info = 8pt ${_monospace} prompts = 8pt sans-serif From 29478ead07ffda4a4564fc47e49b75cd4d70e810 Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Fri, 1 Sep 2017 18:39:06 +0200 Subject: [PATCH 42/44] From internship --- bashrc | 3 ++- bin/.gitignore | 2 ++ config/htop/htoprc | 4 ++-- config/i3/lock.png | Bin 524 -> 266 bytes inputrc | 3 +-- scripts/docker-image-childs | 11 +++++++++++ scripts/docker-rm | 1 + scripts/install-prefs | 7 ++++--- scripts/lorem | 22 ++++++++++++++++++++++ scripts/machines | 3 ++- vimrc | 16 +++++++++++++--- 11 files changed, 60 insertions(+), 12 deletions(-) create mode 100644 bin/.gitignore create mode 100755 scripts/docker-image-childs create mode 100755 scripts/lorem diff --git a/bashrc b/bashrc index 98d0e92..c321755 100644 --- a/bashrc +++ b/bashrc @@ -23,6 +23,7 @@ fi export JAVA_FONTS=/usr/share/fonts/TTF export ANDROID_HOME=/opt/android-sdk export GOPATH=$HOME/.go +export PATH=$GOPATH/bin:$PATH export XDG_CONFIG_HOME=$HOME/.config export ARDUINO=/usr/share/arduino export ARDUINO_DIR=$ARDUINO @@ -104,7 +105,7 @@ export PS4="- " # CUSTOM SCRIPTS -export PATH="$HOME/.scripts/:$PATH" +export PATH="$HOME/.bin/:$HOME/.scripts/:$PATH" [ -f ~/.gscripts/gprofile ] && source ~/.gscripts/gprofile # UTILITIES diff --git a/bin/.gitignore b/bin/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/bin/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/config/htop/htoprc b/config/htop/htoprc index 9b71608..7374ae2 100644 --- a/config/htop/htoprc +++ b/config/htop/htoprc @@ -1,7 +1,7 @@ # Beware! This file is rewritten by htop when settings are changed in the interface. # The parser is also very primitive, and not human-friendly. fields=0 48 17 18 38 39 40 2 46 47 49 1 -sort_key=47 +sort_key=46 sort_direction=1 hide_threads=0 hide_kernel_threads=1 @@ -12,7 +12,7 @@ show_program_path=0 highlight_base_name=1 highlight_megabytes=0 highlight_threads=1 -tree_view=1 +tree_view=0 header_margin=0 detailed_cpu_time=0 cpu_count_from_zero=0 diff --git a/config/i3/lock.png b/config/i3/lock.png index 33f04e2b47bda7fddc797b411983e68ba389cae6..70cc80b9e4849ec73eb585040a3730f890fbd254 100644 GIT binary patch delta 214 zcmeBS>0+9o!YDB@QKsHSHY|vNfnlwui(`nz>C#IZ1rIq0upCVEVr1C(fSdV~in3E9 z2ZQs0``-JX=lX6ff5-Q>Z@KsG&Bkx<^&1sbP5ZjSS!wbK6{Aic7!`eKf^O!CeVIpq zs4nvW5dF(M4Mb75HcT^Hv&2+8^K4d>;rG-yZR=`%ug{@3&%V=s{;qoW`Z>Se_rgs< eH4~Nho8jiC#x@6O%|f8d89ZJ6T-G@yGywq9C0-!_ literal 524 zcmeAS@N?(olHy`uVBq!ia0vp^#vshX3?xtV>q-JCmUKs7M+SzC{oH>NS%G|oWRD45bDP46hOx7_4S6Fo+k-*%fF5l#mYa32{woXKY%+SUr!? zuY}Pphtao~F{Oi{dM@Mt|NrF`CQk$^V@&dPcj0KeH?<1L;VkfoEC#ygHwZIwmz&N8 z3bL1Y`ns||WaQ^IG?`!Q-VPMn;_2cTVsX0k(r!^EM;_Qtx@k?|BvY?Vem1XKyGyBLU zSCwd&O}>V=MU0nD&}`*7k?vsUTqHT^G|$a56VBfI#QH1Y+hpa_^ODZztVoGm3Nom7 z640R1N0I9Dco*GNnB|*vQ)Qa2(oLmFxm`Dx&CqQ1(M)l$WBvp*V?s>YiL|yHwfe?g z*UwCAKk5&3ziNqVL`h0wNvc(HQ7VvPFfuSS*EKNIH8c$|G_*3Yv@$i)HZZg@Fo@HB zFNmTcH$NpatrE8e{j%`2Kn;>08-nxGO3D+9QW?t2%k?tzvWt@w3sUv+i_&MmvylQS OV(@hJb6Mw<&;$VS=&%L= diff --git a/inputrc b/inputrc index 4c211de..bb2af3c 100644 --- a/inputrc +++ b/inputrc @@ -6,7 +6,7 @@ set completion-query-items 200 set editing-mode vi set history-preserve-point on set history-size 10000 -set horizontal-scroll-mode on +set horizontal-scroll-mode off set mark-directories on set mark-modified-lines off set mark-symlinked-directories on @@ -28,7 +28,6 @@ $if mode=vi set keymap vi-insert # these are for vi-insert mode "jk": vi-movement-mode - "mù": vi-movement-mode "\e[A": history-search-backward "\e[B": history-search-forward Control-l: clear-screen diff --git a/scripts/docker-image-childs b/scripts/docker-image-childs new file mode 100755 index 0000000..cf72ad1 --- /dev/null +++ b/scripts/docker-image-childs @@ -0,0 +1,11 @@ +#!/usr/bin/env sh + +# Find the dependent child image from an image + +parent="$1" + +# From https://stackoverflow.com/a/41634462 +for i in $(docker images -q) +do + docker history "$i" | grep -q "$parent" && echo "$i" +done | grep -v "$parent" | sort -u diff --git a/scripts/docker-rm b/scripts/docker-rm index a9d6631..aadc6fb 100755 --- a/scripts/docker-rm +++ b/scripts/docker-rm @@ -1,4 +1,5 @@ #!/usr/bin/env sh +docker unpause $(docker ps -q) docker kill $(docker ps -q) docker container prune -f docker network prune -f diff --git a/scripts/install-prefs b/scripts/install-prefs index 9674f42..cc24ce0 100755 --- a/scripts/install-prefs +++ b/scripts/install-prefs @@ -237,7 +237,7 @@ fi if [ $GUI == 1 ]; then # Desktop manager - inst i3 i3lock i3status dunst unclutter xautolock feh numlockx scrot xterm xclip + inst i3 i3lock dunst unclutter xautolock feh numlockx scrot xterm xclip if [ $ARCH == 1 ]; then altInst polybar-git ttf-font-awesome autorandr-git keynav-enhanced else @@ -272,10 +272,11 @@ if [ $GUI == 1 ]; then if [ $ARCH == 1 ]; then altInst sct elif [ $TERMUX != 1 ]; then - if [ ! -f $HOME/.gscripts/sct ]; then + if [ ! -f $HOME/.bin/sct ]; then TMP=$(mktemp) wget http://www.tedunangst.com/flak/files/sct.c -O $TMP - cc -std=c99 -O2 -I /usr/X11R6/include -o $HOME/.gscripts/sct $TMP -L /usr/X11R6/lib -lm -lX11 -lXrandr + cc -std=c99 -O2 -I /usr/X11R6/include -o $HOME/.bin/sct $TMP -L /usr/X11R6/lib -lm -lX11 -lXrandr + rm $TMP fi fi diff --git a/scripts/lorem b/scripts/lorem new file mode 100755 index 0000000..77e3998 --- /dev/null +++ b/scripts/lorem @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +# Generates Lorem Ipsum + +original="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a, semper congue, euismod non, mi. Proin porttitor, orci nec nonummy molestie, enim est eleifend mi, non fermentum diam nisl sit amet erat. Duis semper. Duis arcu massa, scelerisque vitae, consequat in, pretium a, enim. Pellentesque congue. Ut in risus volutpat libero pharetra tempor. Cras vestibulum bibendum augue. Praesent egestas leo in pede. Praesent blandit odio eu enim. Pellentesque sed dui ut augue blandit sodales. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aliquam nibh. Mauris ac mauris sed pede pellentesque fermentum. Maecenas adipiscing ante non diam sodales hendrerit. + +Ut velit mauris, egestas sed, gravida nec, ornare ut, mi. Aenean ut orci vel massa suscipit pulvinar. Nulla sollicitudin. Fusce varius, ligula non tempus aliquam, nunc turpis ullamcorper nibh, in tempus sapien eros vitae ligula. Pellentesque rhoncus nunc et augue. Integer id felis. Curabitur aliquet pellentesque diam. Integer quis metus vitae elit lobortis egestas. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi vel erat non mauris convallis vehicula. Nulla et sapien. Integer tortor tellus, aliquam faucibus, convallis id, congue eu, quam. Mauris ullamcorper felis vitae erat. Proin feugiat, augue non elementum posuere, metus purus iaculis lectus, et tristique ligula justo vitae magna. + +Aliquam convallis sollicitudin purus. Praesent aliquam, enim at fermentum mollis, ligula massa adipiscing nisl, ac euismod nibh nisl eu lectus. Fusce vulputate sem at sapien. Vivamus leo. Aliquam euismod libero eu enim. Nulla nec felis sed leo placerat imperdiet. Aenean suscipit nulla in justo. Suspendisse cursus rutrum augue. Nulla tincidunt tincidunt mi. Curabitur iaculis, lorem vel rhoncus faucibus, felis magna fermentum augue, et ultricies lacus lorem varius purus. Curabitur eu amet. +" + +repet=$1 + +if [ -z $repet ]; then + repet=1 +fi + +for i in $(seq 1 $repet) +do + echo -e "$original" +done + diff --git a/scripts/machines b/scripts/machines index aacbbb2..3e6450b 100755 --- a/scripts/machines +++ b/scripts/machines @@ -78,6 +78,7 @@ function _machines-pubFromCrt { } function _machines-verifyCertificate { + return if openssl verify $MACHINES_CONFIG/machines.crt | grep -v 'error 18' | grep 'error' --quiet; then echo "[ERROR] Invalid certificate" exit 1 @@ -426,7 +427,7 @@ function machines_setup { _machines-apiToken machine --post-data "$data" echo $name > $MACHINES_CONFIG/this.name - machines-update + machines_update } function machines_update { diff --git a/vimrc b/vimrc index 6711788..6e10446 100644 --- a/vimrc +++ b/vimrc @@ -35,6 +35,7 @@ Plugin 'artur-shaik/vim-javacomplete2' Plugin 'tomtom/tcomment_vim' Plugin 'Shougo/denite.nvim' Plugin 'tomlion/vim-solidity' +Plugin 'godlygeek/tabular' call vundle#end() " required filetype plugin indent on " required @@ -46,7 +47,7 @@ nmap :UndotreeToggle:UndotreeFocus """ CTRLP """ let g:ctrlp_custom_ignore = { - \ 'dir': '\v([\/]\.(git|hg|svn)|log|node_modules|bower_components|__pycache__|vendor|output|buildroot)$', + \ 'dir': '\v([\/]\.(git|hg|svn)|log|node_modules|bower_components|__pycache__|vendor|output|buildroot|doc)$', \ 'file': '\v\.(exe|so|dll|o|pyc)$', \ 'link': 'SOME_BAD_SYMBOLIC_LINKS', \ } @@ -78,6 +79,13 @@ let g:airline_theme = 'wombat' let g:ycm_global_ycm_extra_conf = '/usr/share/vim/vimfiles/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py' let g:ycm_server_python_interpreter = '/usr/bin/python2' +nmap gTi :YcmCompleter GoToInclude +nmap gTc :YcmCompleter GoToDeclaration +nmap gTf :YcmCompleter GoToDefinition +nmap gt :YcmCompleter GoTo +nmap gT :YcmCompleter GoToImprecise +nmap gTr :YcmCompleter GoToReference + """ AUTOFORMAT """ nmap :Autoformat @@ -153,7 +161,9 @@ cmap w!! w !sudo tee > /dev/null % imap jk imap mù map o -nmap :bp -nmap :bn +nmap :bp +nmap :bn +nmap kkkkkkkkkkkkkkkkkkkkk +nmap jjjjjjjjjjjjjjjjjjjjj From 2a0d5f00b2ad969e38be6a3931e5df7cccc02c45 Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Fri, 1 Sep 2017 18:40:03 +0200 Subject: [PATCH 43/44] Premerge --- bashrc | 2 +- config/htop/htoprc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bashrc b/bashrc index ea5383e..d2cd398 100644 --- a/bashrc +++ b/bashrc @@ -31,7 +31,7 @@ export ARDMK_VENDOR=archlinux-arduino # ALIASES # Completion for existing commands -export LS_OPTIONS='--group-directories-first --time-style=+"%d/%m/%Y %H:%M:%S" --color=auto --classify --human-readable' +export LS_OPTIONS='--group-directories-first --time-style=+"%d/%m/%Y %H:%M:%S" --color=auto --file-type --human-readable' alias ls="ls $LS_OPTIONS" alias grep='grep --color=tty -d skip' alias mkdir='mkdir -v' diff --git a/config/htop/htoprc b/config/htop/htoprc index c731a6d..5ac1cb1 100644 --- a/config/htop/htoprc +++ b/config/htop/htoprc @@ -1,7 +1,7 @@ # Beware! This file is rewritten by htop when settings are changed in the interface. # The parser is also very primitive, and not human-friendly. fields=0 48 17 18 38 39 40 2 46 47 49 1 -sort_key=46 +sort_key=47 sort_direction=1 hide_threads=0 hide_kernel_threads=1 From f1cb4233cbc0ebf7dbbc8f63a7ebdfda5a95cc35 Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Fri, 1 Sep 2017 18:44:59 +0200 Subject: [PATCH 44/44] Revert "Three screens setup" This reverts commit ef42de3a2da885ef375ba6ac093a3812acb00f46. --- config/i3/config | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/config/i3/config b/config/i3/config index 4ba6edc..00565de 100644 --- a/config/i3/config +++ b/config/i3/config @@ -146,16 +146,16 @@ set $WS9 9 set $WS10 10 # Workspace output -workspace "$WS1" output DP-5 -workspace "$WS2" output DP-3 -workspace "$WS3" output VGA-0 -workspace "$WS4" output DP-5 -workspace "$WS5" output DP-3 -workspace "$WS6" output VGA-0 -workspace "$WS7" output DP-5 -workspace "$WS8" output DP-3 -workspace "$WS9" output VGA-0 -workspace "$WS10" output DP-5 +workspace "$WS1" output LVDS1 +workspace "$WS2" output VGA1 +workspace "$WS3" output LVDS1 +workspace "$WS4" output VGA1 +workspace "$WS5" output LVDS1 +workspace "$WS6" output VGA1 +workspace "$WS7" output LVDS1 +workspace "$WS8" output VGA1 +workspace "$WS9" output LVDS1 +workspace "$WS10" output VGA1 # switch to workspace bindsym $mod+1 workspace $WS1 @@ -353,7 +353,6 @@ set $14 #66efd5 set $15 #cfd0c2 # Inactivity settings -exec "$screen_config" exec --no-startup-id xautolock -time 10 -locker 'xset dpms force standby' -killtime 1 -killer '$locker' bindsym $mod+F4 exec --no-startup-id xautolock -disable bindsym $mod+F5 exec --no-startup-id xautolock -enable