diff --git a/.assets/polybar/clock.png b/.assets/polybar/clock.png
deleted file mode 100644
index 974ed2f..0000000
Binary files a/.assets/polybar/clock.png and /dev/null differ
diff --git a/.assets/polybar/clock_alt.png b/.assets/polybar/clock_alt.png
deleted file mode 100644
index 2027089..0000000
Binary files a/.assets/polybar/clock_alt.png and /dev/null differ
diff --git a/.assets/polybar/full.png b/.assets/polybar/full.png
deleted file mode 100644
index e45d85c..0000000
Binary files a/.assets/polybar/full.png and /dev/null differ
diff --git a/.assets/polybar/i3-highlight.png b/.assets/polybar/i3-highlight.png
deleted file mode 100644
index 46402bd..0000000
Binary files a/.assets/polybar/i3-highlight.png and /dev/null differ
diff --git a/.assets/polybar/i3-mode.png b/.assets/polybar/i3-mode.png
deleted file mode 100644
index d4b2e45..0000000
Binary files a/.assets/polybar/i3-mode.png and /dev/null differ
diff --git a/.assets/polybar/i3-normal.png b/.assets/polybar/i3-normal.png
deleted file mode 100644
index d6ead86..0000000
Binary files a/.assets/polybar/i3-normal.png and /dev/null differ
diff --git a/.assets/polybar/minimal.png b/.assets/polybar/minimal.png
deleted file mode 100644
index b612555..0000000
Binary files a/.assets/polybar/minimal.png and /dev/null differ
diff --git a/.assets/polybar/mpris.png b/.assets/polybar/mpris.png
deleted file mode 100644
index a3363f3..0000000
Binary files a/.assets/polybar/mpris.png and /dev/null differ
diff --git a/.assets/polybar/network.png b/.assets/polybar/network.png
deleted file mode 100644
index e5928e1..0000000
Binary files a/.assets/polybar/network.png and /dev/null differ
diff --git a/.assets/polybar/sxhkd_mode.png b/.assets/polybar/sxhkd_mode.png
deleted file mode 100644
index 2581668..0000000
Binary files a/.assets/polybar/sxhkd_mode.png and /dev/null differ
diff --git a/.assets/polybar/system.png b/.assets/polybar/system.png
deleted file mode 100644
index 7be3734..0000000
Binary files a/.assets/polybar/system.png and /dev/null differ
diff --git a/.assets/waybar/simple.png b/.assets/waybar/simple.png
new file mode 100644
index 0000000..85135dd
Binary files /dev/null and b/.assets/waybar/simple.png differ
diff --git a/X/.config/fontconfig/fonts.conf b/X/.config/fontconfig/fonts.conf
deleted file mode 100644
index 22c0096..0000000
--- a/X/.config/fontconfig/fonts.conf
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
- serif
- Heuristica
-
-
- sans-serif
- Noto Sans
-
-
- monospace
- Iosevka
-
-
- fantasy
- Signika
-
-
- cursive
- Comic Neue
-
-
-
-
- true
-
-
-
-
- rgb
-
-
-
-
- lcddefault
-
-
-
-
- true
-
-
-
-
- hintfull
-
-
-
-
- false
-
-
-
-
- 92
-
-
-
diff --git a/X/.config/xresources/Xresources b/X/.config/xresources/Xresources
deleted file mode 100644
index 122fa17..0000000
--- a/X/.config/xresources/Xresources
+++ /dev/null
@@ -1,12 +0,0 @@
-! ~/.Xresources
-
-! Setting up commonly changed vars
-#define myfontsize 11
-#define myfont Iosevka Mono
-#define myOpacity 90
-
-! Font settings
-#include "Xresources.d/fonts"
-
-! Colorscheme
-#include "Xresources.d/colorscheme"
diff --git a/X/.config/xresources/Xresources.d/fonts b/X/.config/xresources/Xresources.d/fonts
deleted file mode 100644
index 58faa41..0000000
--- a/X/.config/xresources/Xresources.d/fonts
+++ /dev/null
@@ -1,7 +0,0 @@
-Xft.antialias: 1
-Xft.autohint: 0
-Xft.dpi: 92
-Xft.hinting: true
-Xft.hintstyle: hintslight
-Xft.lcdfilter: lcddefault
-Xft.rgba: rgb
diff --git a/X/.config/xresources/xinitrc b/X/.config/xresources/xinitrc
deleted file mode 100644
index 6539d02..0000000
--- a/X/.config/xresources/xinitrc
+++ /dev/null
@@ -1,77 +0,0 @@
-#!/bin/sh
-
-userresources=$XDG_CONFIG_HOME/xresources/Xresources
-usermodmap=$XDG_CONFIG_HOME/xresources/Xmodmap
-sysresources=/etc/X11/xinit/.Xresources
-sysmodmap=/etc/X11/xinit/.Xmodmap
-
-# merge in defaults and keymaps
-
-if [ -f $sysresources ]; then
- xrdb -merge $sysresources
-fi
-
-if [ -f $sysmodmap ]; then
- xmodmap $sysmodmap
-fi
-
-if [ -f "$userresources" ]; then
- xrdb -merge "$userresources"
-fi
-
-if [ -f "$usermodmap" ]; then
- xmodmap "$usermodmap"
-fi
-
-if [ -d /etc/X11/xinit/xinitrc.d ]; then
- for f in /etc/X11/xinit/xinitrc.d/?*.sh; do
- # shellcheck disable=1090
- [ -x "$f" ] && . "$f"
- done
- unset f
-fi
-
-# unclutter is a program to hide your mouse cursor when it is not moved
-type unclutter >/dev/null 2>&1 && unclutter &
-# picom is the maintained version of desktop compositor compton
-type picom >/dev/null 2>&1 && picom &
-
-# if sxhkd - the key-binding daemon is installed, start it up
-# set it to start up a custom fifo-creating version
-# and set the chain-mode exiting key to a non existing one (default would be escape)
-type sxhkd >/dev/null 2>&1 && sxhkd-piped -a "copyright" &
-
-# if nextcloud-client exists, start it up
-type nextcloud >/dev/null 2>&1 && nextcloud --background &
-
-# load nm-applet, to allow easy vpn setting/switching from x interface
-# TODO this should over time be replaced with a custom polybar interface
-type nm-applet >/dev/null 2>&1 && nm-applet &
-
-# additional config options for Touchpad devices ONLY
-if [ "$(journalctl --dmesg -o short-monotonic --no-hostname --no-pager | grep -c "Touchpad")" -gt 0 ]; then
- # enable touch tapping for XPS13 touchpad - for different devices get the touchpad name with xinput list-prop
- xinput set-prop "DLL075B:01 06CB:76AF Touchpad" "libinput Tapping Enabled" 1
-
- # sets default to EURkey layout, with possibility to switch to german
- # sets german layout to be default for the only pc I have with a german keyboard
- # allows switching layouts with alt+space
- setxkbmap -layout eu,de
-else
- setxkbmap -layout de,eu
-fi
-# Remaps Capslock key to control.
-# (only works for x environment - I haven't needed it for non-x yet)
-setxkbmap -option ctrl:nocaps
-setxkbmap -option grp:alt_shift_toggle
-
-# Makes Capslock behave as escape - when ONLY capslock is pressed and released
-# this only works when we already substitute a ctrl for caps with the lines above,
-# otherwise control itself will act as escape.
-# Needs xcape package installed. https://github.com/alols/xcape
-# set a timeout of 500ms, if pressed longer it will ignore esc
-type xcape >/dev/null 2>&1 && xcape -e 'Control_L=Escape' -t 500
-
-type feh >/dev/null 2>&1 && exec feh --bg-scale ~/pictures/wall.jpg &
-type xss-lock >/dev/null 2>&1 && exec xss-lock &
-type i3 >/dev/null 2>&1 && exec i3
diff --git a/X/.local/bin/clip b/X/.local/bin/clip
deleted file mode 100755
index b27880a..0000000
--- a/X/.local/bin/clip
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env sh
-
-# clip -- easy copying to x clipboard manager with xclip
-#
-# clips the first argument to the clipboard
-# or stdin if stdin is passed
-# will copy png/jpg as image files
-#
-# idea ~~stolen~~ creatively borrowed from
-# https://github.com/kyazdani42/dotfiles/blob/master/bin/copy
-
-if ! exist xclip normal; then exit 1; fi
-
-# if we are in a pipe, read from stdin
-if [ ! -t 0 ]; then
- xclip -i -selection clipboard /dev/stdin
- exit 0
-fi
-
-if [ $# != 1 ] || [ ! -f "$1" ]; then
- printf "No file argument passed to xclip to clip: %s" "$1"
- exit 1
-fi
-
-options=""
-if grep -qE '.png$' "$1"; then
- options="-target image/png"
-elif grep -qE '.jpe\?g$' "$1"; then
- options="-target image/jpeg"
-fi
-
-if [ -n "$options" ]; then
- xclip -selection clipboard "$options" "$1"
-else
- xclip -selection clipboard "$1"
-fi
diff --git a/alacritty/.config/alacritty/alacritty.yml b/alacritty/.config/alacritty/alacritty.yml
index 29451bb..c8c4fe5 100644
--- a/alacritty/.config/alacritty/alacritty.yml
+++ b/alacritty/.config/alacritty/alacritty.yml
@@ -8,10 +8,11 @@ scrolling:
multiplier: 3
font:
- size: 12.5
+ size: 12
# Allow terminal applications to change Alacritty's window title.
window.dynamic_title: true
+background_opacity: 1.0
import:
- .config/alacritty/colorscheme.yml
diff --git a/bootstrap/.stow-local-ignore b/bootstrap/.stow-local-ignore
index a512395..c2591e7 100644
--- a/bootstrap/.stow-local-ignore
+++ b/bootstrap/.stow-local-ignore
@@ -3,3 +3,4 @@
^/install_packages.sh
^/packages.*.txt
^/README.md
+^/system-packages
diff --git a/bootstrap/packages.txt b/bootstrap/packages.txt
index bd1474d..a0f0eb5 100644
--- a/bootstrap/packages.txt
+++ b/bootstrap/packages.txt
@@ -160,9 +160,6 @@ reflector
restic
ripgrep-all
rng-tools
-rofi-calc
-rofi-dmenu
-rofi-greenclip
rofimoji
rtv
sc-im
@@ -210,13 +207,6 @@ vifm
vim-language-server
vimiv
visidata
-xcape
-xclip
-xsel
-xorg-xev
-xorg-xinit
-xorg-xinput
-xss-lock
youtube-dl
zathura-pdf-mupdf
zsh-autosuggestions
@@ -257,3 +247,16 @@ zathura-djvu
yt-dlp-git
yaml-language-server-bin
+river
+rivercarro
+keyd
+waybar-git
+swaybg
+waylock
+wl-clipboard
+clipman
+libqalculate
+ydotool
+brightnessctl
+grim
+slurp
diff --git a/bootstrap/system-packages/etc/keyd/AT Translated Set 2 keyboard.cfg b/bootstrap/system-packages/etc/keyd/AT Translated Set 2 keyboard.cfg
new file mode 100644
index 0000000..d6287a8
--- /dev/null
+++ b/bootstrap/system-packages/etc/keyd/AT Translated Set 2 keyboard.cfg
@@ -0,0 +1,33 @@
+# Makes capslock to control/escape
+# insert to paste
+# right alt to enable German Umlaute (äÄöÖüÜ),
+# sharp s (ß), and the Euro sign (€).
+# Needs compose key to be set in xkb to work correctly:
+# $ setxkbmap -option "compose:menu"
+
+capslock = overload(C, esc)
+insert = S-insert
+rightalt = layer(dia)
+shift = layer(shift)
+rightshift = layer(shift)
+
+[shift:S]
+
+rightalt = layer(shiftedDia)
+
+[dia]
+
+shift = layer(shiftedDia)
+rightshift = layer(shiftedDia)
+
+a = macro(compose a ")
+o = macro(compose o ")
+u = macro(compose u ")
+s = macro(compose s s)
+e = macro(compose = e)
+
+[shiftedDia]
+
+a = macro(compose A ")
+o = macro(compose O ")
+u = macro(compose U ")
diff --git a/bootstrap/system-packages/etc/keyd/default.cfg b/bootstrap/system-packages/etc/keyd/default.cfg
new file mode 100644
index 0000000..373ebab
--- /dev/null
+++ b/bootstrap/system-packages/etc/keyd/default.cfg
@@ -0,0 +1,9 @@
+# leftshift = oneshot(S)
+# leftalt = oneshot(A)
+# rightalt = oneshot(G)
+# rightshift = oneshot(A)
+# leftmeta = oneshot(M)
+# rightmeta = oneshot(M)
+
+capslock = overload(C, esc)
+insert = S-insert
diff --git a/i3/.config/i3/config b/i3/.config/i3/config
deleted file mode 100644
index b33d749..0000000
--- a/i3/.config/i3/config
+++ /dev/null
@@ -1,205 +0,0 @@
-# This file has been auto-generated by i3-config-wizard(1).
-# It will not be overwritten, so edit it as you like.
-#
-# Should you change your keyboard layout some time, delete
-# this file and re-run i3-config-wizard(1).
-#
-
-# i3 config file (v4)
-#
-# Please see https://i3wm.org/docs/userguide.html for a complete reference!
-
-set $mod Mod4
-set $modemod Mod1
-set $font "pango:Iosevka 8"
-
-# Font for window titles. Will also be used by the bar unless a different font
-# is used in the bar {} block below.
-#font pango:monospace 8
-font $font
-
-workspace_auto_back_and_forth yes
-
-# This font is widely installed, provides lots of unicode glyphs, right-to-left
-# text rendering and scalability on retina/hidpi displays (thanks to pango).
-#font pango:DejaVu Sans Mono 8
-
-# Before i3 v4.8, we used to recommend this one as the default:
-# font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
-# The font above is very space-efficient, that is, it looks good, sharp and
-# clear in small sizes. However, its unicode glyph coverage is limited, the old
-# X core fonts rendering does not support right-to-left and this being a bitmap
-# font, it doesn’t scale on retina/hidpi displays.
-
-# Use Mouse+$mod to drag floating windows to their wanted position
-floating_modifier $mod
-
-# kill focused window
-bindsym $mod+Shift+c kill
-
-# change focus
-bindsym $mod+h focus left
-bindsym $mod+j focus down
-bindsym $mod+k focus up
-bindsym $mod+l focus right
-
-# alternatively, you can use the cursor keys:
-bindsym $mod+Left focus left
-bindsym $mod+Down focus down
-bindsym $mod+Up focus up
-bindsym $mod+Right focus right
-
-# move focused window
-bindsym $mod+Shift+h move left
-bindsym $mod+Shift+j move down
-bindsym $mod+Shift+k move up
-bindsym $mod+Shift+l move right
-
-# alternatively, you can use the cursor keys:
-bindsym $mod+Shift+Left move left
-bindsym $mod+Shift+Down move down
-bindsym $mod+Shift+Up move up
-bindsym $mod+Shift+Right move right
-
-# split in horizontal orientation
-bindsym $mod+Shift+s split v
-
-# split in vertical orientation
-bindsym $mod+s split h
-
-# enter fullscreen mode for the focused container
-bindsym $mod+f fullscreen toggle
-
-# change container layout (stacked, tabbed, toggle split)
-bindsym $mod+Shift+w layout stacking
-bindsym $mod+w layout tabbed
-bindsym $mod+e layout toggle split
-
-# toggle tiling / floating
-bindsym $mod+Shift+v floating toggle
-
-# change focus between tiling / floating windows
-bindsym $mod+v focus mode_toggle
-
-# focus the parent/child container
-bindsym $mod+Shift+a focus parent
-bindsym $mod+a focus child
-
-# make a (floating) window stick to all workspaces
-bindsym $mod+ctrl+v sticky toggle
-
-# set up scratch pad for todo and 'drop-down' terminal
-# call scratchpads to current workspace -- scratchpads started on i3 starting (see end of file)
-bindsym $mod+t [class="scratchpad" title="dropdown-todo"] scratchpad show
-bindsym $mod+Shift+Return [class="scratchpad" title="dropdown-terminal"] scratchpad show
-
-# GAP MANAGEMENT
-# disable titles and borders, necessary for i3gaps to work apparently
-for_window [class="^.*"] border pixel 0
-# by default set no gaps when multiple windows are on the workspace
-gaps inner 0
-gaps outer 0
-# increase/decrease inner gapping
-bindsym $mod+shift+g gaps inner current plus 10
-bindsym $mod+g gaps inner current minus 10
-# increase/decrease border sizes
-bindsym $mod+b border toggle 2
-
-# Define names for default workspaces for which we configure key bindings later on.
-# We use variables to avoid repeating the names in multiple places.
-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"
-
-# switch to workspace
-bindsym $mod+1 workspace $ws1
-bindsym $mod+2 workspace $ws2
-bindsym $mod+3 workspace $ws3
-bindsym $mod+4 workspace $ws4
-bindsym $mod+5 workspace $ws5
-bindsym $mod+6 workspace $ws6
-bindsym $mod+7 workspace $ws7
-bindsym $mod+8 workspace $ws8
-bindsym $mod+9 workspace $ws9
-bindsym $mod+0 workspace $ws10
-
-# move focused container to workspace
-bindsym $mod+Shift+1 move container to workspace $ws1
-bindsym $mod+Shift+2 move container to workspace $ws2
-bindsym $mod+Shift+3 move container to workspace $ws3
-bindsym $mod+Shift+4 move container to workspace $ws4
-bindsym $mod+Shift+5 move container to workspace $ws5
-bindsym $mod+Shift+6 move container to workspace $ws6
-bindsym $mod+Shift+7 move container to workspace $ws7
-bindsym $mod+Shift+8 move container to workspace $ws8
-bindsym $mod+Shift+9 move container to workspace $ws9
-bindsym $mod+Shift+0 move container to workspace $ws10
-
-
-# resize window (you can also use the mouse for that)
-mode "resize" {
- # These bindings trigger as soon as you enter the resize mode
-
- # Pressing left will shrink the window’s width.
- # Pressing right will grow the window’s width.
- # Pressing up will shrink the window’s height.
- # Pressing down will grow the window’s height.
- bindsym h resize shrink width 10 px or 10 ppt
- bindsym Shift+h resize shrink width 30 px or 30 ppt
- bindsym j resize grow height 10 px or 10 ppt
- bindsym Shift+j resize grow height 30 px or 30 ppt
- bindsym k resize shrink height 10 px or 10 ppt
- bindsym Shift+k resize shrink height 30 px or 30 ppt
- bindsym l resize grow width 10 px or 10 ppt
- bindsym Shift+l resize grow width 30 px or 30 ppt
-
- # same bindings, but for the arrow keys
- bindsym Left resize shrink width 10 px or 10 ppt
- bindsym Down resize grow height 10 px or 10 ppt
- bindsym Up resize shrink height 10 px or 10 ppt
- bindsym Right resize grow width 10 px or 10 ppt
-
- # back to normal: Enter or Escape or $mod+r
- bindsym Return mode "default"
- bindsym Escape mode "default"
- bindsym $modemod+r mode "default"
-
-}
-
-bindsym $modemod+r mode "resize"
-
-# reload the configuration file
-bindsym $mod+F12 reload
-# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
-bindsym $mod+Shift+F12 restart
-
-# default workspaces for most used apps
-# assign [class="^qutebrowser$"] → number 1
-# spotify needs for_window, see https://i3wm.org/docs/userguide.html#assign_workspace
-assign [class="^spotify$"] → 10
-assign [class="^Spotify$"] → 10
-#fix for spotify not moving to workspace 10
-for_window [class="^spotify$"] move to workspace 10
-
-# windows with class floating will automatically float
-# windows with class scratchpad will automatically float and be sent to the scratchpad
-for_window [class="floating"] floating enable
-for_window [class="scratchpad"] floating enable
-for_window [class="scratchpad"] move scratchpad
-
-# Vim-like mark system - set with mod+m, go there with mod+'
-# read 1 character and mark the current window with this character
-bindsym $mod+m exec i3-input -F 'mark %s' -l 1 -P 'Mark: '
-# read 1 character and go to the window with the character
-bindsym $mod+apostrophe exec i3-input -F '[con_mark="%s"] focus' -l 1 -P 'Goto: '
-
-# launch polybar (script ensures only 1 instance existing at a time)
-exec_always --no-startup-id polybar-launch top
-
diff --git a/install.sh b/install.sh
index 9b18904..39c8692 100755
--- a/install.sh
+++ b/install.sh
@@ -17,7 +17,7 @@ main() {
case "$1" in
-v | --version)
- printf "Personal system bootstrap script.\n\n©Marty Oehme\n\nVersion: 0.1.1\n"
+ printf "Personal system bootstrap script.\n\nby Marty Oehme\n\nv0.2\n"
;;
-h | --help)
printf "Usage: install [-f|--force][-v|--version][-h|--help]\n\n-f Do not ask for any confirmations but force update and installation.\n"
@@ -36,44 +36,41 @@ main() {
exit $ret
}
+# takes default value (y/n), question, abort message as arguments
+# automatically answers yes if unattended install
check_consent() {
- echo "This will take a while, install many packages and link dotfiles all over the place. Proceed [y/N]?"
- read -r yes
- if [[ "$yes" != y* ]]; then
- echo "Exiting."
- exit
+ if [ "$UNATTENDED" == "true" ]; then
+ true
+ else
+ [[ "$1" == "y" ]] && default_consent="[Y/n]" || default_consent="[y/N]"
+ printf "%s %s " "$2" "$default_consent"
+ read -r answer
+ if [[ "$1" == "n" ]] && [[ "$answer" != y* ]]; then
+ echo first
+ printf "%s\n" "$3"
+ false
+ elif [[ "$1" == "y" ]] && [[ "$answer" == n* ]]; then
+ echo second
+ printf "%s\n" "$3"
+ false
+ else
+ true
+ fi
fi
}
+entry_question() {
+ check_consent n "This will take a while, install many packages and link dotfiles all over the place. Proceed?" "Aborting." || exit
+}
+
enable_git_hooks() {
- if [ "$1" == "false" ]; then
- echo "Should we enable git hooks for this repository, so that installed packages are automatically compared when committing? [Y/n]"
- read -r no
- if [[ "$no" == n* ]]; then
- echo "Not changing repository settings."
- return
- fi
- fi
+ check_consent y "Should we enable git hooks for this repository, so that installed packages are automatically compared when committing?" "Not changing repository settings." || return
git config --local core.hooksPath .githooks/
echo "Changed repository settings."
}
-install() {
- unattended=$1
- if ! "$unattended"; then
- check_consent
- fi
- echo "====================== BEGINNING INSTALLATION ============================="
- if ! "$unattended"; then
- export BOOTSTRAP_PACKAGES="bootstrap/packages.txt"
- "$bootstrap_dir"/install_packages.sh
- else
- export BOOTSTRAP_PACKAGES="bootstrap/packages.txt"
- "$bootstrap_dir"/install_packages.sh -f
- fi
- unset BOOTSTRAP_PACKAGES
-
- echo "=================== BEGINNING DOTFILE MANAGEMENT =========================="
+stow_dotfiles() {
+ check_consent y "Link home directory dot files?" "Not linking dotfiles." || return
# get all top level directories, remove their slashes and dots
# finally get rid of .dot-directories, since they are for the repo not for my homedir
targets="$(find . -maxdepth 1 -type d | sed -e 's/^\.\/\(.*\)$/\1/' | sed -e '/^\./d')"
@@ -81,9 +78,42 @@ install() {
# shellcheck disable=2086
# -- for some reason stow only works with unqoted var expansion
stow -R ${targets} 2> >(grep -v 'Absolute/relative mismatch between Stow dir' 1>&2)
+ echo "Linked dotfiles."
+}
+
+stow_system_packages() {
+ check_consent n "Link system settings as well? This will require sudo access." "Not touching system files." || return
+ sudo stow --dir="$bootstrap_dir" --target="/" -R system-packages/
+ echo "Linked system files."
+}
+
+install_packages() {
+ check_consent n "Install pre-designated packages? This will take a while." "Not installing packages." || return
+ export BOOTSTRAP_PACKAGES="bootstrap/packages.txt"
+ if ! "$UNATTENDED"; then
+ "$bootstrap_dir"/install_packages.sh
+ else
+ "$bootstrap_dir"/install_packages.sh -f
+ fi
+ unset BOOTSTRAP_PACKAGES
+ echo "Installed packages."
+}
+
+install() {
+ UNATTENDED=$1
+ if ! "$UNATTENDED"; then
+ entry_question
+ fi
+
+ echo "====================== BEGINNING INSTALLATION ============================="
+ install_packages
+
+ echo "=================== BEGINNING DOTFILE MANAGEMENT =========================="
+ stow_dotfiles
+ stow_system_packages
echo "================== ENABLING GIT REPOSITORY HOOKS =========================="
- enable_git_hooks "$unattended"
+ enable_git_hooks
echo "====================== INSTALLATION FINISHED =============================="
exit 0
diff --git a/mpv/.local/bin/umpv b/mpv/.local/bin/umpv
index 5d08e22..9e766c1 100755
--- a/mpv/.local/bin/umpv
+++ b/mpv/.local/bin/umpv
@@ -31,8 +31,6 @@ import os
import socket
import errno
import subprocess
-import fcntl
-import stat
import string
files = sys.argv[1:]
@@ -43,18 +41,21 @@ def is_url(filename):
if len(parts) < 2:
return False
# protocol prefix has no special characters => it's an URL
- allowed_symbols = string.ascii_letters + string.digits + '_'
+ allowed_symbols = string.ascii_letters + string.digits + "_"
prefix = parts[0]
return all(map(lambda c: c in allowed_symbols, prefix))
+
# make them absolute; also makes them safe against interpretation as options
def make_abs(filename):
if not is_url(filename):
return os.path.abspath(filename)
return filename
+
+
files = [make_abs(f) for f in files]
-SOCK = os.path.join(os.getenv("HOME"), ".umpv_socket")
+SOCK = os.path.join(str(os.getenv("HOME")), ".umpv_socket")
sock = None
try:
@@ -66,7 +67,7 @@ except socket.error as e:
pass # abandoned socket
elif e.errno == errno.ENOENT:
sock = None
- pass # doesn't exist
+ pass # doesn't exist
else:
raise e
@@ -74,23 +75,29 @@ if sock:
# Unhandled race condition: what if mpv is terminating right now?
for f in files:
# escape: \ \n "
- f = f.replace("\\", "\\\\").replace("\"", "\\\"").replace("\n", "\\n")
- f = "\"" + f + "\""
+ f = f.replace("\\", "\\\\").replace('"', '\\"').replace("\n", "\\n")
+ f = '"' + f + '"'
sock.send(("raw loadfile " + f + " append\n").encode("utf-8"))
else:
# Let mpv recreate socket if it doesn't already exist.
opts = (os.getenv("MPV") or "mpv").split()
- opts.extend(["--no-terminal",
- "--force-window",
- "--input-ipc-server=" + SOCK,
- # position on lower left screen corner
- # contains funky fix for slight resizings depending on video
- # move it 10px more left than it wants; 5px more up
- "--geometry=15%+-10-+5",
- "--on-all-workspaces",
- "--force-window=immediate",
- "--"])
+ opts.extend(
+ [
+ "--no-terminal",
+ "--force-window",
+ "--input-ipc-server=" + SOCK,
+ # position on lower left screen corner
+ # contains funky fix for slight resizings depending on video
+ # move it 10px more left than it wants; 5px more up
+ "--geometry=15%+-10-+5",
+ "--on-all-workspaces",
+ "--force-window=immediate",
+ "--x11-name=float",
+ "--wayland-app-id=float",
+ "--",
+ ]
+ )
opts.extend(files)
subprocess.check_call(opts)
diff --git a/pass/.local/bin/pass-pick b/pass/.local/bin/pass-pick
new file mode 100755
index 0000000..02ccfe2
--- /dev/null
+++ b/pass/.local/bin/pass-pick
@@ -0,0 +1,361 @@
+#!/usr/bin/env bash
+#
+# Pass picker
+#
+# Use a dmenu-like list selector to display and autofill your pass passwords.
+# Can work with rofi, bemenu and dmenu, or a custom picker given as an option.
+# Invoke it with `pass-pick`. You can set options through environment variables
+# or through a configuration file.
+#
+# Keys:
+# By default shows the available keys on rofi, but not on bemenu/dmenu.
+# ROFI mapped keys (main password list):
+# return autofill username/password combination
+# alt+return enter entry submenu
+# alt+u autofill username
+# alt+p autofill password
+# alt+ctrl+u send username to clipboard
+# alt+ctrl+p send password to clipboard
+# ROFI mapped keys (individual entry):
+# return autofill selected field
+# alt+return send selected field to clipboard
+# alt+s reveal hidden password field
+# alt+backspace back to main password menu
+# Those options also work on bemenu, but have different (and fixed) mappings.
+# BEMENU mapped keys (main password list):
+# return autofill username/password combination
+# alt+2 send username to clipboard
+# alt+3 send password to clipboard
+# alt+4 autofill username
+# alt+5 autofill password
+# alt+6 enter entry submenu
+# BEMENU mapped keys (individual entry):
+# return autofill selected field
+# alt+2 send selected field to clipboard
+# alt+3 back to main password menu
+# alt+4 reveal hidden password field
+
+# Selector wrapper
+# Prefers rofi if found, otherwise bemenu or dmenu if found, complains if no selector available.
+# Passes along any options given to main script.
+rofi_opts=("$@")
+_picker() {
+ if [ -n "$PICKER" ]; then
+ "${PICKER[@]}"
+ elif command -v rofi 1>/dev/null 2>/dev/null; then
+ rofi -dmenu -no-auto-select -i "${rofi_opts[@]}" "$@" -p "entry"
+ elif command -v bemenu 1>/dev/null 2>/dev/null; then
+ bemenu -l 20 -i -p "entry >"
+ elif command -v dmenu 1>/dev/null 2>/dev/null; then
+ dmenu -i -p "entry >"
+ else
+ printf "%s: 📦 %s must be installed for %s function.\n" "critical" "rofi/dmenu" "this" >&2
+ notify-send "📦 rofi/dmenu" --urgency="critical" "must be installed for this function."
+ exit 1
+ fi
+}
+
+# parse, see https://unix.stackexchange.com/a/331965/8541
+_parse_config() {
+ (grep -e "^$2=" -m 1 "$1" 2>/dev/null || printf "var=__UNDEFINED__\n") | head -n1 | cut -d '=' -f 2-
+}
+
+# read config file
+get_config() {
+ local locations=(
+ "$PP_CONFIGURATION_FILE"
+ "${xdg_config_home:-$HOME/.config}/pass-picker/pass-picker.conf"
+ "$HOME/.pass-picker.conf"
+ "/etc/pass-picker.conf"
+ )
+
+ # return the first config file with a valid path
+ for config in "${locations[@]}"; do
+ if [[ -n "$config" && -f "$config" ]]; then
+ # see if the config has been given a value
+ local val
+ val="$(_parse_config "$config" "$1")"
+ break
+ fi
+ done
+
+ # if there was a config file but no value
+ # or there was no config file at all
+ if [ "$val" = "__UNDEFINED__" ] || [ -z "$val" ]; then
+ val="$2"
+ fi
+ printf -- "%s" "$val"
+}
+
+set_defaults() {
+ # The location of the pass-picker config file
+ # PP_CONFIGURATION_FILE="~/.config/pass-picker/pass-picker.conf"
+ # set options, leaving already set environment variables intact
+ # try to read any settings from config files
+ PICKER="${PP_PICKER:-$(get_config PICKER)}"
+
+ KEY_AUTOFILL="${PP_KEY_AUTOFILL:-$(get_config KEY_AUTOFILL Return)}"
+ KEY_ENTRY_OPEN="${PP_KEY_ENTRY_OPEN:-$(get_config KEY_ENTRY_OPEN Alt+Return)}"
+ KEY_FILL_USER="${PP_KEY_FILL_USER:-$(get_config KEY_FILL_USER Alt+u)}"
+ KEY_CLIP_USER="${PP_KEY_CLIP_USER:-$(get_config KEY_CLIP_USER Ctrl+Alt+u)}"
+ KEY_FILL_PASS="${PP_KEY_FILL_PASS:-$(get_config KEY_FILL_PASS Alt+p)}"
+ KEY_CLIP_PASS="${PP_KEY_CLIP_PASS:-$(get_config KEY_CLIP_PASS Ctrl+Alt+p)}"
+ KEY_ENTRYMENU_FILL="${PP_KEY_ENTRYMENU_FILL:-$(get_config KEY_ENTRYMENU_FILL Return)}"
+ KEY_ENTRYMENU_CLIP="${PP_KEY_ENTRYMENU_CLIP:-$(get_config KEY_ENTRYMENU_CLIP Alt+Return)}"
+ KEY_ENTRYMENU_SHOWFIELD="${KEY_ENTRYMENU_SHOWFIELD:-$(get_config KEY_ENTRYMENU_SHOWFIELD Alt+s)}"
+ KEY_ENTRYMENU_QUIT="${PP_KEY_ENTRYMENU_QUIT:-$(get_config KEY_ENTRYMENU_QUIT Alt+BackSpace)}"
+
+ AUTOFILL_BACKEND="${PP_AUTOFILL_BACKEND:-$(get_config AUTOFILL_BACKEND ydotool)}"
+ AUTOFILL_CHAIN="${PP_AUTOENTRY_CHAIN:-$(get_config AUTOFILL_CHAIN 'username :tab password')}"
+ AUTOFILL_DELAY="${PP_AUTOENTRY_DELAY:-$(get_config AUTOFILL_DELAY 30)}"
+ PASS_USERNAME_FIELD="${PP_PASS_USERNAME_FIELD:-$(get_config PASS_USERNAME_FIELD 'username user login')}"
+}
+
+# exit on escape pressed
+exit_check() {
+ [ "$1" -eq 1 ] && exit
+}
+
+# simply return a list of all passwords in pass store
+# TODO only show website names (+ folder names), and account names for multiple accounts on one site
+list_passwords() {
+ shopt -s nullglob globstar
+ prefix=${PASSWORD_STORE_DIR:-~/.password-store}
+ password_files=("$prefix"/**/*.gpg)
+ password_files=("${password_files[@]#"$prefix"/}")
+ password_files=("${password_files[@]%.gpg}")
+
+ printf '%s\n' "${password_files[@]}"
+}
+
+# return password for argument passed
+show_password() {
+ pass show "$1" | head -n1
+}
+
+# send password to clipboard
+clip_password() {
+ pass show -c "$1"
+}
+
+# attempt to return the field specified
+# attempts all (space separated) fields until the
+# first one successfully returned
+_p_get_field() {
+ local gp_entry="$1"
+ local gp_field="$2"
+ local clip="$3"
+
+ # return on first successfully returned key
+ for key in $gp_field; do
+ local value
+ value=$(_p_get_key_value "$gp_entry" "$key")
+
+ # found entry
+ if [ -n "$value" ]; then
+
+ if [ -n "$clip" ]; then
+ # copies to clipboard, removes any trailing newlines,
+ # and only keeps it in for 1 paste (1 loop to read in script, 1 to output)
+ if command -v wl-copy; then
+ echo "$value" | wl-copy -o && break
+ elif command -v xclip; then
+ echo "$value" | xclip -i -selection 'clipboard' -loops 2 -rmlastnl && break
+ elif command -v xsel; then
+ echo "$value" | xsel -b && break
+ else
+ notify-send "No clipboard utility" "Install wl-copy, xclip or xsel."
+ fi
+ else
+ echo "$value" && break
+ fi
+
+ fi
+ done
+}
+
+# returns the corresponding value for the key passed in
+# arguments:
+# $1: pass (file) entry to search through
+# $2: string name of the containting key
+_p_get_key_value() {
+ local value
+ value=$(list_fields "$1" | grep "$2")
+
+ # get everything after first colon, remove whitespace
+ echo "$value" | cut -d':' -f2- | tr -d '[:blank:]'
+}
+
+# return username for argument passed
+show_username() {
+ _p_get_field "$1" "${PASS_USERNAME_FIELD}"
+}
+
+clip_username() {
+ _p_get_field "$1" "${PASS_USERNAME_FIELD}" "-c"
+}
+
+show_field() {
+ _p_get_field "$1" "$2"
+}
+
+clip_field() {
+ _p_get_field "$1" "$2" "-c"
+}
+
+list_fields() {
+ pass show "$1" | tail -n+2
+}
+
+# invoke the dotool to type inputs
+_type() {
+ local tool="${AUTOFILL_BACKEND}"
+ local toolmode="$1"
+ local key="$2"
+
+ if [ "$tool" = "xdotool" ]; then
+ "$tool" "$toolmode" --delay "${AUTOFILL_DELAY}" "$key"
+ elif [ "$tool" = "ydotool" ]; then
+ "$tool" "$toolmode" --key-delay "${AUTOFILL_DELAY}" "$key"
+ else
+ "$tool" "$toolmode" "$key"
+ fi
+}
+
+# automatically fill out fields
+# transform special chain entries into valid dotool commands
+autofill() {
+ local selected="${1}"
+ local autoentry_chain="${2}"
+
+ for part in $autoentry_chain; do
+ case "$part" in
+ ":tab") _type key Tab ;;
+ ":return") _type key Return ;;
+ ":space") _type key space ;;
+ "username") _type type "$(show_username "$selected")" ;;
+ "password") _type type "$(show_password "$selected")" ;;
+ ":direct") _type type "$selected" ;;
+ *) printf '%s' "$selected" ;;
+ esac
+ done
+}
+
+# opens a menu for the specified pass entry, containing its individual fields
+entrymenu() {
+ local entry="$1"
+ local deobfuscate="$2"
+ local k_entrymenu_fill="${KEY_ENTRYMENU_FILL}"
+ local k_entrymenu_clip="${KEY_ENTRYMENU_CLIP}"
+ local k_entrymenu_showfield="${KEY_ENTRYMENU_SHOWFIELD}"
+ local k_entrymenu_quit="${KEY_ENTRYMENU_QUIT}"
+
+ local pass
+ if [ "$deobfuscate" = "true" ]; then
+ pass="$(show_password "$entry")"
+ else
+ pass="(hidden)"
+ fi
+
+ local field
+ field=$(
+ printf "password: %s\n%s" "$pass" "$(list_fields "$entry")" |
+ _picker \
+ -kb-accept-entry "" \
+ -kb-custom-1 "$k_entrymenu_fill" \
+ -kb-custom-2 "$k_entrymenu_clip" \
+ -kb-custom-3 "$k_entrymenu_quit" \
+ -kb-custom-4 "$k_entrymenu_showfield" \
+ -mesg " ᐊ $k_entrymenu_quit ᐊ | $k_entrymenu_fill: fill selection | $k_entrymenu_clip: clip selection | $k_entrymenu_showfield: reveal password"
+ )
+ exit_value=$?
+ exit_check "$exit_value"
+
+ # get field name
+ field=${field%%:*}
+ case "$exit_value" in
+ "0" | "10")
+ if [ "$field" = "password" ]; then
+ autofill "$entry" "password"
+ else
+ autofill "$(show_field "$entry" "$field")" ":direct"
+ fi
+ exit 0
+ ;;
+ "11")
+ if [ "$field" = "password" ]; then
+ clip_password "$entry"
+ else
+ clip_field "$entry" "$field"
+ fi
+ exit 0
+ ;;
+ "12")
+ main
+ ;;
+ "13")
+ local toggle
+ if [ "$deobfuscate" = "true" ]; then
+ toggle=false
+ else
+ toggle=true
+ fi
+ entrymenu "$entry" "$toggle"
+ ;;
+ esac
+}
+
+main() {
+ local autoentry_chain="${AUTOFILL_CHAIN}"
+ local k_autofill="${KEY_AUTOFILL}"
+ local k_fill_user="${KEY_FILL_USER}"
+ local k_clip_user="${KEY_CLIP_USER}"
+ local k_fill_pass="${KEY_FILL_PASS}"
+ local k_clip_pass="${KEY_CLIP_PASS}"
+ local k_submenu="${KEY_ENTRY_OPEN}"
+
+ entry="$(
+ list_passwords |
+ _picker -kb-accept-entry "" \
+ -kb-custom-1 "$k_autofill" \
+ -kb-custom-2 "$k_clip_user" \
+ -kb-custom-3 "$k_clip_pass" \
+ -kb-custom-4 "$k_fill_user" \
+ -kb-custom-5 "$k_fill_pass" \
+ -kb-custom-6 "$k_submenu" \
+ -mesg "| $k_autofill: fill credentials | $k_submenu: open entry | $k_fill_user: fill username | $k_fill_pass: fill password | $k_clip_user: clip username | $k_clip_pass: clip password |"
+ )"
+ exit_value=$?
+
+ echo "$entry"
+ exit_check "$exit_value"
+ case "$exit_value" in
+ "0" | "10")
+ autofill "$entry" "$autoentry_chain"
+ exit 0
+ ;;
+ "11")
+ clip_username "$entry"
+ exit 0
+ ;;
+ "12")
+ clip_password "$entry"
+ exit
+ ;;
+ "13")
+ autofill "$entry" "username"
+ exit
+ ;;
+ "14")
+ autofill "$entry" "password"
+ exit
+ ;;
+ "15")
+ entrymenu "$entry"
+ exit
+ ;;
+ esac
+}
+
+set_defaults
+main
diff --git a/pass/.local/bin/rofi-pass b/pass/.local/bin/rofi-pass
deleted file mode 100755
index c16a187..0000000
--- a/pass/.local/bin/rofi-pass
+++ /dev/null
@@ -1,307 +0,0 @@
-#!/usr/bin/env bash
-#
-
-# selector wrapper
-# uses rofi if found, or dmenu if found, complains if no selector available
-# passes along any options given to main script
-rofi_opts=("$@")
-_rofi() {
- if type rofi 1>/dev/null 2>/dev/null; then
- rofi -dmenu -no-auto-select -i "${rofi_opts[@]}" "$@" -p "Entry"
- elif type dmenu 1>/dev/null 2>/dev/null; then
- dmenu -i "${rofi_opts[@]}" "$@" -p "Entry"
- else
- printf "%s: 📦 %s must be installed for %s function.\n" "critical" "rofi/dmenu" "this" >&2
- notify-send "📦 rofi/dmenu" --urgency="critical" "must be installed for this function."
- exit 1
- fi
-}
-
-# parse, see https://unix.stackexchange.com/a/331965/8541
-_parse_config() {
- (grep -E "^$2=" -m 1 "$1" 2>/dev/null || printf "VAR=__UNDEFINED__\n") | head -n1 | cut -d '=' -f 2-
-}
-
-# read config file
-get_config() {
- local locations=(
- "$RP_CONFIGURATION_FILE"
- "${XDG_CONFIG_HOME:-$HOME/.config}/rofi-pass/rofi-pass.conf"
- "$HOME/.rofi-pass.conf"
- "/etc/rofi-pass.conf"
- )
-
- # return the first config file with a valid path
- for config in "${locations[@]}"; do
- if [[ -n "$config" && -f "$config" ]]; then
- # see if the config has been given a value
- local val
- val="$(_parse_config "$config" "$1")"
- break
- fi
- done
-
- # if there was a config file but no value
- # or there was no config file at all
- if [ "$val" = "__UNDEFINED__" ] || [ -z "$val" ]; then
- val="$2"
- fi
- printf -- "%s" "$val"
-}
-
-set_defaults() {
- # The location of the rofi-pass config file
- # RP_CONFIGURATION_FILE="~/.config/rofi-pass/rofi-pass.conf"
- # set options, leaving already set environment variables intact
- # try to read any settings from config files
- KEY_AUTOFILL="${RP_KEY_AUTOFILL:-$(get_config KEY_AUTOFILL Return)}"
- KEY_ENTRY_OPEN="${RP_KEY_ENTRY_OPEN:-$(get_config KEY_ENTRY_OPEN Alt+Return)}"
- KEY_FILL_USER="${RP_KEY_FILL_USER:-$(get_config KEY_FILL_USER Alt+u)}"
- KEY_CLIP_USER="${RP_KEY_CLIP_USER:-$(get_config KEY_CLIP_USER Ctrl+Alt+u)}"
- KEY_FILL_PASS="${RP_KEY_FILL_PASS:-$(get_config KEY_FILL_PASS Alt+p)}"
- KEY_CLIP_PASS="${RP_KEY_CLIP_PASS:-$(get_config KEY_CLIP_PASS Ctrl+Alt+p)}"
- KEY_ENTRYMENU_FILL="${RP_KEY_ENTRYMENU_FILL:-$(get_config KEY_ENTRYMENU_FILL Return)}"
- KEY_ENTRYMENU_CLIP="${RP_KEY_ENTRYMENU_CLIP:-$(get_config KEY_ENTRYMENU_CLIP Alt+Return)}"
- KEY_ENTRYMENU_SHOWFIELD="${KEY_ENTRYMENU_SHOWFIELD:-$(get_config KEY_ENTRYMENU_SHOWFIELD Alt+s)}"
- KEY_ENTRYMENU_QUIT="${RP_KEY_ENTRYMENU_QUIT:-$(get_config KEY_ENTRYMENU_QUIT Alt+BackSpace)}"
-
- AUTOFILL_BACKEND="${RP_AUTOFILL_BACKEND:-$(get_config AUTOFILL_BACKEND xdotool)}"
- AUTOFILL_CHAIN="${RP_AUTOENTRY_CHAIN:-$(get_config AUTOFILL_CHAIN 'username :tab password')}"
- AUTOFILL_DELAY="${RP_AUTOENTRY_DELAY:-$(get_config AUTOFILL_DELAY 30)}"
- PASS_USERNAME_FIELD="${RP_PASS_USERNAME_FIELD:-$(get_config PASS_USERNAME_FIELD 'username user login')}"
-}
-
-# exit on escape pressed
-# rofi returns exit code 1 on esc
-exit_check() {
- [ "$1" -eq 1 ] && exit
-}
-
-# simply return a list of all passwords in pass store
-# TODO only show website names (+ folder names), and account names for multiple accounts on one site
-list_passwords() {
- shopt -s nullglob globstar
- prefix=${PASSWORD_STORE_DIR:-~/.password-store}
- password_files=("$prefix"/**/*.gpg)
- password_files=("${password_files[@]#"$prefix"/}")
- password_files=("${password_files[@]%.gpg}")
-
- printf '%s\n' "${password_files[@]}"
-}
-
-# return password for argument passed
-show_password() {
- pass show "$1" | head -n1
-}
-
-# send password to clipboard
-clip_password() {
- pass show -c "$1"
-}
-
-# attempt to return the field specified
-# attempts all (space separated) fields until the
-# first one successfully returned
-_p_get_field() {
- local gp_entry="$1"
- local gp_field="$2"
- local clip="$3"
-
- # return on first successfully returned key
- for key in $gp_field; do
- local value
- value=$(_p_get_key_value "$gp_entry" "$key")
-
- # found entry
- if [ -n "$value" ]; then
-
- if [ -n "$clip" ]; then
- # copies to clipboard, removes any trailing newlines,
- # and only keeps it in for 1 paste (1 loop to read in script, 1 to output)
- echo "$value" | xclip -i -selection 'clipboard' -loops 2 -rmlastnl && break
- else
- echo "$value" && break
- fi
-
- fi
- done
-}
-
-# returns the corresponding value for the key passed in
-# arguments:
-# $1: pass (file) entry to search through
-# $2: string name of the containting key
-_p_get_key_value() {
- local value
- value=$(list_fields "$1" | grep "$2")
-
- # get everything after first colon, remove whitespace
- echo "$value" | cut -d':' -f2- | tr -d '[:blank:]'
-}
-
-# return username for argument passed
-show_username() {
- _p_get_field "$1" "${PASS_USERNAME_FIELD}"
-}
-
-clip_username() {
- _p_get_field "$1" "${PASS_USERNAME_FIELD}" "-c"
-}
-
-show_field() {
- _p_get_field "$1" "$2"
-}
-
-clip_field() {
- _p_get_field "$1" "$2" "-c"
-}
-
-list_fields() {
- pass show "$1" | tail -n+2
-}
-
-# invoke the dotool to type inputs
-_type() {
- local tool="${AUTOFILL_BACKEND}"
- local toolmode="$1"
- local key="$2"
-
- "$tool" "$toolmode" --delay "${AUTOFILL_DELAY}" "$key"
-}
-
-# automatically fill out fields
-# transform special chain entries into valid dotool commands
-autofill() {
- local selected="${1}"
- local autoentry_chain="${2}"
-
- for part in $autoentry_chain; do
- case "$part" in
- ":tab") _type key Tab ;;
- ":return") _type key Return ;;
- ":space") _type key space ;;
- "username") _type type "$(show_username "$selected")" ;;
- "password") _type type "$(show_password "$selected")" ;;
- ":direct") _type type "$selected" ;;
- *) printf '%s' "$selected" ;;
- esac
- done
-}
-
-# opens a menu for the specified pass entry, containing its individual fields
-entrymenu() {
- local entry="$1"
- local deobfuscate="$2"
- local k_entrymenu_fill="${KEY_ENTRYMENU_FILL}"
- local k_entrymenu_clip="${KEY_ENTRYMENU_CLIP}"
- local k_entrymenu_showfield="${KEY_ENTRYMENU_SHOWFIELD}"
- local k_entrymenu_quit="${KEY_ENTRYMENU_QUIT}"
-
- local pass
- if [ "$deobfuscate" = "true" ]; then
- pass="$(show_password "$entry")"
- else
- pass="(hidden)"
- fi
-
- local field
- field=$(
- printf "password: %s\n%s" "$pass" "$(list_fields "$entry")" |
- _rofi \
- -kb-accept-entry "" \
- -kb-custom-1 "$k_entrymenu_fill" \
- -kb-custom-2 "$k_entrymenu_clip" \
- -kb-custom-3 "$k_entrymenu_quit" \
- -kb-custom-4 "$k_entrymenu_showfield" \
- -mesg " ᐊ $k_entrymenu_quit ᐊ | $k_entrymenu_fill: fill selection | $k_entrymenu_clip: clip selection | $k_entrymenu_showfield: reveal password"
- )
- exit_value=$?
- exit_check "$exit_value"
-
- # get field name
- field=${field%%:*}
- case "$exit_value" in
- "10")
- if [ "$field" = "password" ]; then
- autofill "$entry" "password"
- else
- autofill "$(show_field "$entry" "$field")" ":direct"
- fi
- exit 0
- ;;
- "11")
- if [ "$field" = "password" ]; then
- clip_password "$entry"
- else
- clip_field "$entry" "$field"
- fi
- exit 0
- ;;
- "12")
- main
- ;;
- "13")
- local toggle
- if [ "$deobfuscate" = "true" ]; then
- toggle=false
- else
- toggle=true
- fi
- entrymenu "$entry" "$toggle"
- ;;
- esac
-}
-
-main() {
- local autoentry_chain="${AUTOFILL_CHAIN}"
- local k_autofill="${KEY_AUTOFILL}"
- local k_fill_user="${KEY_FILL_USER}"
- local k_clip_user="${KEY_CLIP_USER}"
- local k_fill_pass="${KEY_FILL_PASS}"
- local k_clip_pass="${KEY_CLIP_PASS}"
- local k_submenu="${KEY_ENTRY_OPEN}"
-
- entry="$(
- list_passwords |
- _rofi -kb-accept-entry "" \
- -kb-custom-1 "$k_autofill" \
- -kb-custom-2 "$k_clip_user" \
- -kb-custom-3 "$k_clip_pass" \
- -kb-custom-4 "$k_fill_user" \
- -kb-custom-5 "$k_fill_pass" \
- -kb-custom-6 "$k_submenu" \
- -mesg "| $k_autofill: fill credentials | $k_submenu: open entry | $k_fill_user: fill username | $k_fill_pass: fill password | $k_clip_user: clip username | $k_clip_pass: clip password |"
- )"
- exit_value=$?
-
- exit_check "$exit_value"
- case "$exit_value" in
- "10")
- autofill "$entry" "$autoentry_chain"
- exit 0
- ;;
- "11")
- clip_username "$entry"
- exit 0
- ;;
- "12")
- clip_password "$entry"
- exit
- ;;
- "13")
- autofill "$entry" "username"
- exit
- ;;
- "14")
- autofill "$entry" "password"
- exit
- ;;
- "15")
- entrymenu "$entry"
- exit
- ;;
- esac
-}
-
-set_defaults
-main
diff --git a/polybar/.config/polybar/config b/polybar/.config/polybar/config
deleted file mode 100644
index 76232eb..0000000
--- a/polybar/.config/polybar/config
+++ /dev/null
@@ -1,364 +0,0 @@
-;==========================================================
-;
-;
-; ██████╗ ██████╗ ██╗ ██╗ ██╗██████╗ █████╗ ██████╗
-; ██╔══██╗██╔═══██╗██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗
-; ██████╔╝██║ ██║██║ ╚████╔╝ ██████╔╝███████║██████╔╝
-; ██╔═══╝ ██║ ██║██║ ╚██╔╝ ██╔══██╗██╔══██║██╔══██╗
-; ██║ ╚██████╔╝███████╗██║ ██████╔╝██║ ██║██║ ██║
-; ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝
-;
-;
-; To learn more about how to configure Polybar
-; go to https://github.com/polybar/polybar
-;
-; The README contains a lot of information
-;
-;==========================================================
-
-[colors]
-background = ${xrdb:background}
-background-alt = ${xrdb:color8}
-foreground = ${xrdb:foreground}
-foreground-alt = ${xrdb:color3}
-primary = ${xrdb:color1}
-secondary = ${xrdb:color4}
-alert = ${xrdb:color2}
-
-[settings]
-; The throttle settings lets the eventloop swallow up til X events
-; if they happen within Y millisecond after first event was received.
-; This is done to prevent flood of update event.
-;
-; For example if 5 modules emit an update event at the same time, we really
-; just care about the last one. But if we wait too long for events to swallow
-; the bar would appear sluggish so we continue if timeout
-; expires or limit is reached.
-throttle-output = 5
-throttle-output-for = 10
-; Time in milliseconds that the input handler will wait between processing events
-throttle-input-for = 30
-
-[global/wm]
-margin-top = 0
-margin-bottom = 0
-
-[bar/top]
-; enable inter process communication, so that we can send messages
-; to polybar via polybar-msg command
-enable-ipc = true
-
-; Put the bar at the bottom of the screen
-bottom=false
-
-width = 100%
-height = 20
-padding-left = 0
-padding-right = 0
-module-margin-left = 2
-module-margin-right = 2
-
-modules-left = sxhkdmode workspaces pomo papersdue
-modules-center = music datecal
-modules-right = dunstpaused networkspeed mail weather archupdates cpu temp volume battery
-; do not use offsets for the bar, would only work with override-redirect
-; and will mess up tray https://github.com/polybar/polybar/issues/1355
-tray-position = right
-
-; Basic Colors, defined further up
-background = ${colors.background}
-foreground = ${colors.foreground}
-line-size = 1
-line-color = ${colors.primary}
-
-; Prefer fixed center position for the `modules-center` block.
-; The center block will stay in the middle of the bar whenever
-; possible. It can still be pushed around if other blocks need
-; more space.
-; When false, the center block is centered in the space between
-; the left and right block.
-fixed-center = true
-
-; Fonts are defined using ;
-; Font names are specified using a fontconfig pattern.
-; font-0 = NotoSans-Regular:size=8;2
-; font-1 = MaterialIcons:size=10
-; font-2 = Termsynu:size=8;-1
-; font-3 = FontAwesome:size=10
-; See the Fonts wiki page for more details
-font-0 = Comic Neue:size=10
-font-1 = NotoSans:size=23
-font-2 = Iosevka:size=14;1
-
-cursor-click = pointer
-
-[module/sxhkdmode]
-type = custom/script
-exec = sxhkd-chain-labels
-exec-if = type sxhkd-chain-labels
-tail = true
-format =