*: Wrap lines at 80 columns where appropriate

Wrap lines at 80 columns where appropriate and I had the energy to think
about how/where to wrap.

There are still lines longer than that, which I plan to wrap in the
future. But that is enough for now.
This commit is contained in:
2022-05-11 14:58:08 +02:00
parent 3ced540d3a
commit b96d32996b
18 changed files with 165 additions and 65 deletions

View File

@@ -1,4 +1,5 @@
# This file is based on the standard dircolors but with bright colors when using bold font
# This file is based on the standard dircolors but with bright colors when using
# bold font
TERM Eterm
TERM ansi

View File

@@ -126,7 +126,12 @@ bindsym $mod+Shift+c reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+r restart
# exit i3 (logs you out of your X session)
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'"
bindsym $mod+Shift+e exec \
i3-nagbar \
-t warning \
-m 'Do you really want to exit i3? This will end your X session.' \
-b 'Yes' \
'i3-msg exit'
# resize window (you can also use the mouse for that)
mode "resize" {
@@ -163,10 +168,14 @@ bindsym $mod+r mode "resize"
bindsym XF86MonBrightnessDown exec xbacklight -dec 5
bindsym XF86MonBrightnessUp exec xbacklight -inc 5
# Volume controls (see https://faq.i3wm.org/question/125/how-to-change-the-systems-volume.1.html)
bindsym XF86AudioRaiseVolume exec --no-startup-id amixer -q -D pulse sset Master 5%+ unmute
bindsym XF86AudioLowerVolume exec --no-startup-id amixer -q -D pulse sset Master 5%- unmute
bindsym XF86AudioMute exec --no-startup-id amixer -q -D pulse sset Master toggle-mute
# Volume controls
# See: https://faq.i3wm.org/question/125/how-to-change-the-systems-volume.1.html
bindsym XF86AudioRaiseVolume exec --no-startup-id \
amixer -q -D pulse sset Master 5%+ unmute
bindsym XF86AudioLowerVolume exec --no-startup-id \
amixer -q -D pulse sset Master 5%- unmute
bindsym XF86AudioMute exec --no-startup-id \
amixer -q -D pulse sset Master toggle-mute
# Lock
bindsym $mod+mod1+l exec xset s activate
@@ -188,22 +197,34 @@ for_window [class="^$TERMINAL-256color$" title="^scratchpad-terminal$"] \
resize set 1600 900, \
move position center
# Toggle the scratchpad-terminal or create a new one if none exists.
bindsym $mod+comma exec i3-msg '[class="^$TERMINAL-256color$" title="^scratchpad-terminal$"] scratchpad show' || $TERMINAL -A 0.45 -d "$(xcwd)" -c $TERMINAL-256color -t scratchpad-terminal
bindsym $mod+comma exec \
i3-msg '[class="^$TERMINAL-256color$" title="^scratchpad-terminal$"]
scratchpad show' \
|| $TERMINAL -A 0.45 \
-d "$(xcwd)" \
-c $TERMINAL-256color \
-t scratchpad-terminal
for_window [class="^TelegramDesktop$"] \
move scratchpad, \
scratchpad show
bindsym $mod+Shift+t exec i3-msg '[class="^TelegramDesktop$"] scratchpad show' || telegram-desktop
bindsym $mod+Shift+t exec \
i3-msg '[class="^TelegramDesktop$"] scratchpad show' \
|| telegram-desktop
for_window [class="^Signal$"] \
move scratchpad, \
scratchpad show
bindsym $mod+Shift+s exec i3-msg '[class="^Signal$"] scratchpad show' || signal-desktop
bindsym $mod+Shift+s exec \
i3-msg '[class="^Signal$"] scratchpad show' \
|| signal-desktop
for_window [class="^Bitwarden$"] \
move scratchpad, \
scratchpad show
bindsym $mod+Shift+b exec i3-msg '[class="^Bitwarden$"] scratchpad show' || bitwarden
bindsym $mod+Shift+b exec \
i3-msg '[class="^Bitwarden$"] scratchpad show' \
|| bitwarden
for_window [class="^$TERMINAL-256color$" title="^polybar-datetime-calendar$"] \
floating enable, \
@@ -222,6 +243,8 @@ for_window [class="^$TERMINAL-256color$" title="^fzf-monitor-setup$"] \
border pixel 3, \
resize set 378 300, \
move position 1 32
bindsym $mod+m exec pkill -f fzf-monitor-setup -O 1 || $TERMINAL -t fzf-monitor-setup -e ~/.local/bin/monitor-setup
bindsym $mod+m exec \
pkill -f fzf-monitor-setup -O 1 \
|| $TERMINAL -t fzf-monitor-setup -e ~/.local/bin/monitor-setup
# vim: ft=i3

View File

@@ -2,7 +2,9 @@
if [ 1 -lt "$(xrandr -q | grep " connected" | wc -l)" ]; then
# scale second monitor to 3200x1800 and put to the left
xrandr --output eDP1 --auto --pos 0x0 --primary --output DP1 --auto --scale-from 3200x1800 --pos 3200x0 --fb 6400x1800
xrandr --output eDP1 --auto --pos 0x0 --primary \
--output DP1 --auto --scale-from 3200x1800 --pos 3200x0 \
--fb 6400x1800
feh --bg-scale --no-fehbg "$HOME"/pics/wallpapers/wallpaper
killall -q polybar
while pgrep -x polybar >/dev/null; do sleep 1; done

View File

@@ -5,14 +5,24 @@ bluetooth_print() {
bluetoothctl | while read -r; do
if [[ "$(systemctl is-active "bluetooth.service")" = "active" ]]; then
devices_paired=$(echo paired-devices | bluetoothctl | sed -n '/paired-devices/,$p' | grep Device | cut -d ' ' -f 2)
devices_paired=$(
echo paired-devices \
| bluetoothctl \
| sed -n '/paired-devices/,$p' \
| grep Device \
| cut -d ' ' -f 2
)
counter=0
echo "$devices_paired" | while read -r line; do
device_info=$(echo "info $line" | bluetoothctl)
if echo "$device_info" | grep -q "Connected: yes"; then
device_alias=$(echo "$device_info" | grep "Alias" | cut -d ' ' -f 2-)
device_alias=$(
echo "$device_info" \
| grep "Alias" \
| cut -d ' ' -f 2-
)
if [[ $counter -gt 0 ]]; then
printf ", %s" "$device_alias"
@@ -39,12 +49,24 @@ bluetooth_toggle() {
echo "power on" | bluetoothctl >> /dev/null
sleep 1
devices_paired=$(echo paired-devices | bluetoothctl | sed -n '/paired-devices/,$p' | grep Device | cut -d ' ' -f 2)
devices_paired=$(
echo paired-devices
| bluetoothctl \
| sed -n '/paired-devices/,$p' \
| grep Device \
| cut -d ' ' -f 2
)
echo "$devices_paired" | while read -r line; do
echo "connect $line" | bluetoothctl >> /dev/null
done
else
devices_paired=$(echo paired-devices | bluetoothctl | sed -n '/paired-devices/,$p' | grep Device | cut -d ' ' -f 2)
devices_paired=$(
echo paired-devices \
| bluetoothctl \
| sed -n '/paired-devices/,$p' \
| grep Device \
| cut -d ' ' -f 2
)
echo "$devices_paired" | while read -r line; do
device_info=$(echo "info $line" | bluetoothctl)

View File

@@ -2,10 +2,11 @@
command -v playerctl >/dev/null 2>&1 || { printf "playerctl not found.\n" >&2; exit 1; }
# metadata="$(playerctl metadata --format '{{status}} {{artist}} - {{title}} ({{duration(position)}}|{{duration(mpris:length)}})')"
metadata="$(playerctl metadata --format '{{status}} {{artist}}' 2>/dev/null)"
title="$(playerctl metadata --format '{{title}}' 2>/dev/null)"
duration="$(playerctl metadata --format '({{duration(position)}}|{{duration(mpris:length)}})' 2>/dev/null)"
duration="$(2>/dev/null playerctl metadata \
--format '({{duration(position)}}|{{duration(mpris:length)}})'
)"
if [ -n "$metadata" ] && [ "$metadata" != "No players found" ]; then

View File

@@ -6,8 +6,8 @@ if [ -n "$connection" ]; then
exit 0
fi
# [o] is a hack to not grep the grep-command
# see: https://stackoverflow.com/questions/9375711/more-elegant-ps-aux-grep-v-grep
# [o] is a hack to not grep the grep-command. See:
# https://stackoverflow.com/questions/9375711/more-elegant-ps-aux-grep-v-grep
if ps ax | grep -q "[o]penvpn"; then
echo "VPN"
exit 0

View File

@@ -27,7 +27,8 @@ set confirm_on_delete always
# README.md for dependencies) to preview images, archives, etc.
#set preview_script ~/.config/ranger/scope.sh
# Use the external preview script or display simple plain text or image previews?
# Use the external preview script or display simple plain text or image
# previews?
set use_preview_script true
# Automatically count files in the directory, even before entering them?
@@ -111,8 +112,8 @@ set iterm2_font_height 11
# Use a unicode "..." character to mark cut-off filenames?
set unicode_ellipsis false
# BIDI support - try to properly display file names in RTL languages (Hebrew, Arabic).
# Requires the python-bidi pip package
# BIDI support - try to properly display file names in RTL languages (Hebrew,
# Arabic). Requires the python-bidi pip package
set bidi_support false
# Show dotfiles in the bookmark preview box?
@@ -273,8 +274,8 @@ set one_indexed false
# Save tabs on exit
set save_tabs_on_exit false
# Enable scroll wrapping - moving down while on the last item will wrap around to
# the top and vice versa.
# Enable scroll wrapping - moving down while on the last item will wrap around
# to the top and vice versa.
set wrap_scroll true
# Set the global_inode_type_filter to nothing. Possible options: d, f and l for

View File

@@ -1,5 +1,6 @@
#!/usr/bin/env bash
# Inspired by https://github.com/cramermarius/rofi-menus/blob/master/scripts/powermenu.sh
# Inspired by:
# https://github.com/cramermarius/rofi-menus/blob/master/scripts/powermenu.sh
# entries with associated commands
declare -A entries

View File

@@ -30,10 +30,21 @@ KNOWNCON=$(nmcli connection show)
# Really janky way of telling if there is currently a connection
CONSTATE=$(nmcli -fields WIFI g)
CURRSSID=$(LANGUAGE=C nmcli -t -f active,ssid dev wifi | awk -F: '$1 ~ /^yes/ {print $2}')
CURRSSID=$(LANGUAGE=C \
nmcli -t -f active,ssid dev wifi \
| awk -F: '$1 ~ /^yes/ {print $2}'
)
if [[ ! -z $CURRSSID ]]; then
HIGHLINE=$(echo "$(echo "$LIST" | awk -F "[ ]{2,}" '{print $1}' | grep -Fxn -m 1 "$CURRSSID" | awk -F ":" '{print $1}') + 1" | bc )
HIGHLINE=$(
echo "$(
echo "$LIST" \
| awk -F "[ ]{2,}" '{print $1}' \
| grep -Fxn -m 1 "$CURRSSID" \
| awk -F ":" '{print $1}'
) + 1" \
| bc
)
fi
# HOPEFULLY you won't need this as often as I do
@@ -53,15 +64,25 @@ fi
CHENTRY=$(echo -e "$TOGGLE\nmanual\n$LIST" | uniq -u | rofi -dmenu -p "Wi-Fi SSID: " -lines "$LINENUM" -a "$HIGHLINE" -location "$POSITION" -yoffset "$YOFF" -xoffset "$XOFF" -font "$FONT" -width -"$RWIDTH")
CHENTRY=$(
echo -e "$TOGGLE\nmanual\n$LIST" \
| uniq -u \
| rofi -dmenu -p "Wi-Fi SSID: " -lines "$LINENUM" -a "$HIGHLINE" \
-location "$POSITION" -yoffset "$YOFF" -xoffset "$XOFF" \
-font "$FONT" -width -"$RWIDTH"
)
#echo "$CHENTRY"
CHSSID=$(echo "$CHENTRY" | sed 's/\s\{2,\}/\|/g' | awk -F "|" '{print $1}')
#echo "$CHSSID"
# If the user inputs "manual" as their SSID in the start window, it will bring them to this screen
# If the user inputs "manual" as their SSID in the start window, it will bring
# them to this screen
if [ "$CHENTRY" = "manual" ] ; then
# Manual entry of the SSID and password (if appplicable)
MSSID=$(echo "enter the SSID of the network (SSID,password)" | rofi -dmenu -p "Manual Entry: " -font "$FONT" -lines 1)
MSSID=$(
echo "enter the SSID of the network (SSID,password)" \
| rofi -dmenu -p "Manual Entry: " -font "$FONT" -lines 1
)
# Separating the password from the entered string
MPASS=$(echo "$MSSID" | awk -F "," '{print $2}')
@@ -83,17 +104,26 @@ elif [ "$CHENTRY" = "toggle off" ]; then
else
# If the connection is already in use, then this will still be able to get the SSID
# If the connection is already in use, then this will still be able to get
# the SSID
if [ "$CHSSID" = "*" ]; then
CHSSID=$(echo "$CHENTRY" | sed 's/\s\{2,\}/\|/g' | awk -F "|" '{print $3}')
CHSSID=$(
echo "$CHENTRY" \
| sed 's/\s\{2,\}/\|/g' \
| awk -F "|" '{print $3}'
)
fi
# Parses the list of preconfigured connections to see if it already contains the chosen SSID. This speeds up the connection process
# Parses the list of preconfigured connections to see if it already contains
# the chosen SSID. This speeds up the connection process
if [[ $(echo "$KNOWNCON" | grep "$CHSSID") = "$CHSSID" ]]; then
nmcli con up "$CHSSID"
else
if [[ "$CHENTRY" =~ "WPA2" ]] || [[ "$CHENTRY" =~ "WEP" ]]; then
WIFIPASS=$(echo "if connection is stored, hit enter" | rofi -dmenu -p "password: " -lines 1 -font "$FONT" )
WIFIPASS=$(
echo "if connection is stored, hit enter" \
| rofi -dmenu -p "password: " -lines 1 -font "$FONT"
)
fi
nmcli dev wifi con "$CHSSID" password "$WIFIPASS"
fi

View File

@@ -6,7 +6,8 @@ set -g mode-keys vi
# Disable xterm escape sequences for setting clipboard
set -s set-clipboard off
# Copy selection into primary selection (without aborting)
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-no-clear "xclip -se p"
bind-key -T copy-mode-vi MouseDragEnd1Pane \
send-keys -X copy-pipe-no-clear "xclip -se p"
# https://github.com/neovim/neovim/wiki/FAQ#cursor-shape-doesnt-change-in-tmux
set -ga terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q'
@@ -26,7 +27,8 @@ bind-key > split-window -h -c "#{pane_current_path}"
bind-key -T prefix c new-window -c "#{pane_current_path}"
# Resource config
bind-key -T prefix R source-file "$XDG_CONFIG_HOME/tmux/tmux.conf" \; display-message "Sourced $XDG_CONFIG_HOME/tmux/tmux.conf"
bind-key -T prefix R source-file "$XDG_CONFIG_HOME/tmux/tmux.conf" \; \
display-message "Sourced $XDG_CONFIG_HOME/tmux/tmux.conf"
# Fullscreen pane (toggle)
bind-key -T prefix F resize-pane -Z
@@ -101,9 +103,12 @@ set -g @resurrect-strategy-vim 'session'
set -g @resurrect-strategy-nvim 'session'
# Save sessions before detaching
unbind -T prefix d
bind-key -T prefix d run-shell "$XDG_CONFIG_HOME/tmux/plugins/tmux-resurrect/scripts/save.sh" \; detach-client
bind-key -T prefix d \
run-shell "$XDG_CONFIG_HOME/tmux/plugins/tmux-resurrect/scripts/save.sh" \; \
detach-client
## Theming (inspired by https://github.com/Who23/dots/blob/21976e76644d8d9261ebdcf61733d2181a1612eb/tmux.conf)
## Theming. Inspired by:
## https://github.com/Who23/dots/blob/21976e76644d8d9261ebdcf61733d2181a1612eb/tmux.conf
set -g status-style bg=default,fg=white
set -g message-command-style bg=default,fg=brightyellow
set -g message-style bg=brightyellow,fg=black
@@ -124,5 +129,5 @@ set -g status-justify centre
set -g window-status-current-format "#[fg=brightyellow bold]#I #W"
set -g window-status-format "#[fg=brightblack]#I #W"
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
# Initialize TMUX plugin manager. Keep this line at the very bottom.
run -b "$XDG_CONFIG_HOME/tmux/plugins/tpm/tpm"

View File

@@ -1,27 +1,32 @@
# specifies the time (in seconds) to wait for response to a prompt by auth_x11 before giving up and
# reverting to the screen saver.
# specifies the time (in seconds) to wait for response to a prompt by auth_x11
# before giving up and reverting to the screen saver.
export XSECURELOCK_AUTH_TIMEOUT=10
# specifies the time (in seconds) before telling X11 to fully blank the screen; a negative value
# disables X11 blanking. The time is measured since the closing of the auth window or xsecurelock
# startup. Setting this to 0 is rather nonsensical, as key-release events (e.g. from the keystroke
# to launch xsecurelock or from pressing escape to close the auth dialog) always wake up the screen.
# specifies the time (in seconds) before telling X11 to fully blank the screen;
# a negative value disables X11 blanking. The time is measured since the closing
# of the auth window or xsecurelock startup. Setting this to 0 is rather
# nonsensical, as key-release events (e.g. from the keystroke to launch
# xsecurelock or from pressing escape to close the auth dialog) always wake up
# the screen.
export XSECURELOCK_BLANK_TIMEOUT=10
# the date format to show. Defaults to the locale settings.
export XSECURELOCK_DATETIME_FORMAT="%F %T "
# time_ shows the current time since the epoch on each keystroke. This may be the most secure mode,
# as it gives feedback to keystroke based exclusively on public information, and does not carry
# over any state between keystrokes whatsoever - not even some form of randomness.
# time: shows the current time since the epoch on each keystroke. This may be
# the most secure mode, as it gives feedback to keystroke based
# exclusively on public information, and does not carry over any state
# between keystrokes whatsoever - not even some form of randomness.
#
# time_hex: same as time, but in microseconds and hexadecimal. "Because we can".
export XSECURELOCK_PASSWORD_PROMPT=time_hex
# whether to show local date and time on the login. Disabled by default.
export XSECURELOCK_SHOW_DATETIME=1
# whether to show the hostname on the login screen of auth_x11. Possible values are 0 for not
# showing the hostname, 1 for showing the short form, and 2 for showing the long form.
# whether to show the hostname on the login screen of auth_x11. Possible
# values are 0 for not showing the hostname, 1 for showing the short form, and 2
# for showing the long form.
export XSECURELOCK_SHOW_HOSTNAME=0
# whether to show the username on the login screen of auth_x11.

View File

@@ -1,7 +1,7 @@
## Author: druckdev
## Created: 2018-11-23
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.config/zsh/.zshrc.
# Enable Powerlevel10k instant prompt. Should stay close to the top.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then

View File

@@ -43,7 +43,8 @@ pushd -q "$WORKTREE_PATH"
# Restart the shell (forcefully interactive) until the worktree is removed
until [[ ! -e "$WORKTREE_PATH" ]] || git worktree remove "$WORKTREE_PATH"; do
[[ -t 0 ]] || >&2 printf "Dropping into interactive shell to resolve conflicts\n"
[[ -t 0 ]] ||
>&2 printf "Dropping into interactive shell to resolve conflicts\n"
"$SHELL" -i && errc=$? || errc=$?
done

View File

@@ -12,7 +12,9 @@ zstyle ':completion:*' menu select=2
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
zstyle ':completion:*' list-colors ''
zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s
zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' 'm:{-_a-zA-Z}={_-A-Za-z}' 'r:|[._-]=* r:|=* l:|=*'
zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' \
'm:{-_a-zA-Z}={_-A-Za-z}' \
'r:|[._-]=* r:|=* l:|=*'
zstyle ':completion:*' menu select=long
zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
zstyle ':completion:*' use-compctl false

View File

@@ -305,7 +305,8 @@ crypt-close() {
fi
udisksctl power-off -b "$1"
rm ~/mounts/"${mount_point:t}" && rmdir --ignore-fail-on-non-empty ~/mounts/ \
rm ~/mounts/"${mount_point:t}" \
&& rmdir --ignore-fail-on-non-empty ~/mounts/ \
|| echo "~/mounts/${mount_point:t} did not exist"
}

View File

@@ -1,6 +1,7 @@
#!/usr/bin/env bash
## This runs as a crontab every 5minutes ('*/5 * * * * /usr/local/bin/wifi-mute')
# This runs as a crontab every 5minutes
# ('*/5 * * * * /usr/local/bin/wifi-mute')
if [[ "$(nmcli -t -f name con show --active)" =~ eduroam* ]]; then # iwgetid -r
# TODO: mute only speaker, not headphones

View File

@@ -3,12 +3,14 @@
## Author: druckdev
## Created: 2020-06-05
##
## A script that modifies Zoom links for the use in browsers, opens it then in a private chromium
## window and puts the password into the clipboard. If no argument is given the link is taken out
## of the clipboard.
## The reason behind the choice of Chromium is that my Firefox does weird things when used in
## scripts and that I wanted to run Zoom separately from my normal Firefox instances.
## (although this should be solvable by separate Firefox profiles.)
## A script that modifies Zoom links for the use in browsers, opens it then in a
## private chromium window and puts the password into the clipboard. If no
## argument is given the link is taken out of the clipboard.
##
## The reason behind the choice of Chromium is that my Firefox does weird things
## when used in scripts and that I wanted to run Zoom separately from my normal
## Firefox instances. (although this should be solvable by separate Firefox
## profiles.)
# Check if necessary commands exist
command -v firefox >/dev/null 2>&1 || return 1
@@ -17,7 +19,8 @@ command -v xclip >/dev/null 2>&1 || return 1
# If no argument is given, set the clipboard as argument
[ $# -gt 0 ] || set "$(xclip -selection c -o)"
# Check for right format
echo "$1" | grep -Eq "^https://tu-berlin.zoom.us/(j|wc/join)/[0-9]*\?pwd=.+" || return 1
echo "$1" | grep -Eq "^https://tu-berlin.zoom.us/(j|wc/join)/[0-9]*\?pwd=.+" \
|| return 1
# Make link work for browser joining
link="$(echo "${1%?pwd=*}" | sed 's_/j/_/wc/join/_')"

View File

@@ -25,7 +25,8 @@ subject="${subject#squash! }"
# and thus all other characters are free to use.
git_comment_char="$(git config --get --default='#' core.commentChar \
| sed 's:\^:\\&:g')"
# git's cut-line to cut off everything behind it (e.g. commit patch when verbose)
# git's cut-line to cut off everything behind it (e.g. commit patch with
# `commit.verbose`)
cut_line='------------------------ >8 ------------------------'
# Take all lines after the subject until EOF or the cut-line (here `auto` is