From 87e0feeab0375055b66a2bf4e51de418bb12d6da Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Thu, 8 Sep 2022 00:43:28 +0200 Subject: [PATCH] config: improve documentation and update a few options --- .config/Stretchly/config.json | 12 +++---- .local/bin/scripts/moul | 1 + .local/bin/scripts/walli | 4 +-- .zshenv | 4 +-- README.org | 60 +++++++++++++++++++++++++---------- 5 files changed, 54 insertions(+), 27 deletions(-) diff --git a/.config/Stretchly/config.json b/.config/Stretchly/config.json index 8d6ac7a..fecfd6e 100644 --- a/.config/Stretchly/config.json +++ b/.config/Stretchly/config.json @@ -17,14 +17,14 @@ "microbreakPostponeTime": 120000, "breakPostponeTime": 300000, "microbreakPostponesLimit": 1, - "microbreakPostponableDurationPercent": 30, - "breakPostponesLimit": 1, - "breakPostponableDurationPercent": 30, + "microbreakPostponableDurationPercent": 20, + "breakPostponesLimit": 3, + "breakPostponableDurationPercent": 20, "mainColor": "#633738", "transparentMode": false, - "opacity": 0.9, + "opacity": 0.8, "audio": "crystal-glass", - "volume": 1, + "volume": 0.4, "fullscreen": true, "ideas": true, "naturalBreaks": true, @@ -454,4 +454,4 @@ "screen": "primary", "timeToBreakInTray": false, "currentTimeInBreaks": false -} \ No newline at end of file +} diff --git a/.local/bin/scripts/moul b/.local/bin/scripts/moul index 4a4a783..d291812 100755 --- a/.local/bin/scripts/moul +++ b/.local/bin/scripts/moul @@ -1,5 +1,6 @@ #!/bin/sh -e # Mount a partition by label or device identifier automatically +# TODO make this interactive with a fuzzy finder :) _help="$0 [mountpoint] [options...]" case $1 in ("") ds && echo "$_help" && exit 2;; diff --git a/.local/bin/scripts/walli b/.local/bin/scripts/walli index 8e0e2dc..bc6902a 100755 --- a/.local/bin/scripts/walli +++ b/.local/bin/scripts/walli @@ -1,6 +1,6 @@ #!/bin/sh -e # Blocks internet at night using iptables and enables it only upon request -# TODO Migrate to nftables +# REPLACED by netkeeper with nftables # Auto-elevate test ${EUID:-0} -eq 0 || exec sudo "$0" "$@" @@ -15,8 +15,6 @@ time9=$(date -u -d "$(date -d 9:00)" +%k) iptables -A chain-times -m owner --uid-owner janek -j DROP -m time \ --timestart $(date -u -d "$(date -d "${1:-15 min}")" +%k:%M) --timestop $(expr $time9):00 -# TODO Only 10 minutes every hour, anything else needs justification - # Only allow periodical internet access in the morning #iptables -A chain-times -m owner --uid-owner janek -j DROP -m time --weekdays 1-5 \ # --timestart $time9:20 --timestop $(expr $time9 + 1):00 diff --git a/.zshenv b/.zshenv index 4b3e088..b669cf7 100644 --- a/.zshenv +++ b/.zshenv @@ -105,7 +105,7 @@ export LESS_TERMCAP_se=$'\e[0m' # reset reverse video export LESS_TERMCAP_ue=$'\e[0m' # reset underline export GROFF_NO_SGR=1 # for konsole and gnome-terminal ## fzf defaults -[[ "$(fzf --version 2>/dev/null | grep --only-matching '[0-9]\.[^. ]*')" > 0.24 ]] && _fzf_latest=true || _fzf_latest=false +[[ "$(fzf --version 2>/dev/null | grep --only-matching '[0-9]\.[^. ]*')" > 0.31 ]] && _fzf_latest=true || _fzf_latest=false FZF_BINDINGS=$(echo " change:top alt-enter:execute(test -O {} && $EDITOR {} || sudoedit {}) @@ -125,7 +125,7 @@ alt-shift-down:preview-down,alt-shift-up:preview-up,esc:close") export FZF_HISTDIR="$XDG_STATE_HOME/fzf" mkdir -p "$XDG_STATE_HOME/fzf" export FZF_DEFAULT_OPTS="--select-1 --ansi ---tiebreak=chunk,end,length --history=$FZF_HISTDIR/history --bind='$FZF_BINDINGS' +--tiebreak=$($_fzf_latest && echo "chunk,")end,length --history=$FZF_HISTDIR/history --bind='$FZF_BINDINGS' $($_fzf_latest && echo '--preview-window=60%,border-left --marker=o')" FD_BASE="fd --hidden --color=always --no-ignore-vcs" export FZF_DEFAULT_COMMAND="$FD_BASE --type file" diff --git a/README.org b/README.org index 3bac5b7..e73cd40 100644 --- a/README.org +++ b/README.org @@ -1,16 +1,51 @@ * Dotfiles +Welcome to Janek's dotfiles, +thousands of lines of handcraft shell code +to make the live of a linux sysadmin +and developer easier! + I mainly use Arch Linux, -currently with the KDE desktop environment -with the intention of moving a tiling WM (Awesome or Sway) soon. +currently with the KDE desktop environment with tiling extension +with the intention of moving a proper tiling WM (Awesome or Sway) soon. +This config is opinionated, +but currently deployed on multiple machines +including some other eager users +who run Manjaro Sway. +Thus I am progressively generalising it. + +If you are not one of those, +you can safely skip the following section. +** Usage +Here are some basic commands you should remember: +- ~u~ to upgrade everything (works on arch-based systems with topgrade installed and any debian-based system, with safeguards to ensure upgrade stability even on longtime dormant machines) +- yas :: interactively install software packages +- yar :: interactively uninstall software packages +- loc :: quickly find a file on your system, case-insensitive +- loca :: do a deep search for a file on the whole system, case-insensitive +- loce :: find a file/directory with exact name match + +To mount a device, +first check ~ds~ ([d]isk [s]tats, a prettification of ~lsblk --fs~) +and find your device, +then call ~moul~ with the respective name or label, +e.g. ~moul my-usb~ or ~moul sdc2~. +This will mount the device and jump to the mounted directory. + +As long as you are in the device directory +you can unmount it simply by calling ~umoul~, +otherwise provide the argument used above again. +* Overview If you are looking to snag some of my handy tools, -focus on [[.local/bin/scripts]] and [[.config/shell]]. -Among daily use are ~b~, ~edbin~, ~edconf~, ~edit~, ~help~, [[.config/shell/arch][~yas~]] +focus on [[./.local/bin/scripts][.local/bin/scripts]] and [[./.config/shell][.config/shell]]. +Among daily use are ~b~, ~edit-*~, ~help~, [[./.config/shell/arch][~yas~]] and [[https://github.com/ajeetdsouza/zoxide][zoxide]]-based ~d~ / ~di~ -which in turn use ~zfz~, ~zf~ & ~locz~. +which in turn use ~zfz~, ~zf~ and ~locz~. -~ex~, ~m~, ~moul~, ~rpl~, ~s~, ~sd~, ~tl~, ~walli~ are also commonly used conveniences. -** Root +~ex~, ~m~, ~moul~, ~grpr~ / ~rpl~, ~s~, ~sd~, ~tl~ are also commonly used conveniences. + +Below is an overview of the structure +** Home I am trying to keep my home clean, but some files unfortunately cannot be moved. Out of these, only [[.zprofile][.zprofile]] is of interest, @@ -26,7 +61,7 @@ and configuration for ~less~ and ~fzf~. - [[.local/bin/scripts][scripts]] :: lots of useful scripts, most have a short documentation header - including many essential git scripts -* Packages +* Package Setup (moving to [[https://git.jfischer.org/xeruf/instalee][Instalee]]) : pacman -Qe | cut -d\ -f1 | xclip -selection clipboard - dotfiles :: yadm : yadm clone --bootstrap git@git.jfischer.org:xeruf/dotfiles.git @@ -86,14 +121,7 @@ https://addons.mozilla.org/firefox/addon/passff https://addons.mozilla.org/firefox/addon/masterpassword-firefox **** [[https://addons.mozilla.org/en-US/firefox/collections/15727735/integration?collection_sort=-popularity][System Integration]] **** [[https://addons.mozilla.org/en-US/firefox/collections/15727735/privacy?collection_sort=-popularity][Privacy]] -* Setup Tools to consider -** Ansible -:PROPERTIES: -:ID: ansible -:END: -https://github.com/Oefenweb/ansible-updatedb * Issues -- emacstty sometimes breaks terminals ** Manjaro Sway - zsh vim bindings don't work properly -- clipboard sync does not work in Doom Emacs +- clipboard sync does not work in Doom Emacs (fixed?)