diff options
-rw-r--r-- | .config/fontconfig/fonts.conf | 7 | ||||
-rw-r--r-- | .config/sxhkd/sxhkdrc | 2 | ||||
-rw-r--r-- | .config/zsh/.zshrc | 2 | ||||
-rwxr-xr-x | .local/bin/notify-action.sh | 68 | ||||
-rwxr-xr-x | .local/bin/notify-send.sh | 326 | ||||
-rw-r--r-- | .mozilla/firefox/whisperwood/chrome/userChrome.css (renamed from .mozilla/firefox/k6uncrlc.default-esr/chrome/userChrome.css) | 0 | ||||
-rw-r--r-- | .profile | 6 | ||||
-rw-r--r-- | .ssh/authorized_keys | 3 | ||||
-rw-r--r-- | .xinitrc | 7 |
9 files changed, 411 insertions, 10 deletions
diff --git a/.config/fontconfig/fonts.conf b/.config/fontconfig/fonts.conf index b36ded9..0b18be1 100644 --- a/.config/fontconfig/fonts.conf +++ b/.config/fontconfig/fonts.conf @@ -31,13 +31,6 @@ <family>Vulf Mono</family> <family>Cousine Nerd Font</family> <family>GoMono Nerd Font</family> - <family>Lig LinLibertineMO Nerd Font</family> - <family>Lig Linux Libertine Mono O</family> - <family>Linux Libertine Mono O</family> - <family>Brutalist Mono</family> - <family>Cartograph Mono CF</family> - <family>Maison Mono</family> - <family>Liberation Mono</family> </prefer> </alias> </fontconfig> diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc index 873cf95..dddf4b7 100644 --- a/.config/sxhkd/sxhkdrc +++ b/.config/sxhkd/sxhkdrc @@ -216,7 +216,7 @@ super + Print #-# Special Keys #-# ## Increase/decrease Volume {XF86AudioRaiseVolume, XF86AudioLowerVolume} - volumectl 5 {+,-} + volumectl 1 {+,-} ## Max-Out Volume shift + XF86AudioRaiseVolume volumectl 100 diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index d1aa444..7ec7bc0 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -81,7 +81,7 @@ RPROMPT="\$vcs_info_msg_0_ %B%F{magenta}(%B%F{cyan}%1/%B%F{magenta})" zstyle ':vcs_info:git:*' formats '%b' # Quickly navigate to a created directory -function mkcd() { +mkcd() { mkdir -p -- "$1" && cd -P -- "$1" } diff --git a/.local/bin/notify-action.sh b/.local/bin/notify-action.sh new file mode 100755 index 0000000..7b8dbb0 --- /dev/null +++ b/.local/bin/notify-action.sh @@ -0,0 +1,68 @@ +#!/usr/bin/env bash + +GDBUS_MONITOR_PID=/tmp/notify-action-dbus-monitor.$$.pid +GDBUS_MONITOR=(gdbus monitor --session --dest org.freedesktop.Notifications --object-path /org/freedesktop/Notifications) + +NOTIFICATION_ID="$1" +if [[ -z "$NOTIFICATION_ID" ]]; then + echo "no notification id passed: $@" + exit 1; +fi +shift + +ACTION_COMMANDS=("$@") +if [[ -z "$ACTION_COMMANDS" ]]; then + echo "no action commands passed: $@" + exit 1; +fi + +cleanup() { + rm -f "$GDBUS_MONITOR_PID" +} + +create_pid_file(){ + rm -f "$GDBUS_MONITOR_PID" + umask 077 + touch "$GDBUS_MONITOR_PID" +} + +invoke_action() { + invoked_action_id="$1" + local action="" cmd="" + for index in "${!ACTION_COMMANDS[@]}"; do + if [[ $((index % 2)) == 0 ]]; then + action="${ACTION_COMMANDS[$index]}" + else + cmd="${ACTION_COMMANDS[$index]}" + if [[ "$action" == "$invoked_action_id" ]]; then + bash -c "${cmd}" & + fi + fi + done +} + +monitor() { + + create_pid_file + ( "${GDBUS_MONITOR[@]}" & echo $! >&3 ) 3>"$GDBUS_MONITOR_PID" | while read -r line + do + local closed_notification_id="$(sed '/^\/org\/freedesktop\/Notifications: org.freedesktop.Notifications.NotificationClosed (uint32 \([0-9]\+\), uint32 [0-9]\+)$/!d;s//\1/' <<< "$line")" + if [[ -n "$closed_notification_id" ]]; then + if [[ "$closed_notification_id" == "$NOTIFICATION_ID" ]]; then + invoke_action close + break + fi + else + local action_invoked="$(sed '/\/org\/freedesktop\/Notifications: org.freedesktop.Notifications.ActionInvoked (uint32 \([0-9]\+\), '\''\(.*\)'\'')$/!d;s//\1:\2/' <<< "$line")" + IFS=: read invoked_id action_id <<< "$action_invoked" + if [[ "$invoked_id" == "$NOTIFICATION_ID" ]]; then + invoke_action "$action_id" + break + fi + fi + done + kill $(<"$GDBUS_MONITOR_PID") + cleanup +} + +monitor diff --git a/.local/bin/notify-send.sh b/.local/bin/notify-send.sh new file mode 100755 index 0000000..4149966 --- /dev/null +++ b/.local/bin/notify-send.sh @@ -0,0 +1,326 @@ +#!/usr/bin/env bash + +# notify-send.sh - drop-in replacement for notify-send with more features +# Copyright (C) 2015-2021 notify-send.sh authors (see AUTHORS file) + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# Desktop Notifications Specification +# https://developer.gnome.org/notification-spec/ + +VERSION=1.2 +NOTIFY_ARGS=(--session + --dest org.freedesktop.Notifications + --object-path /org/freedesktop/Notifications) +EXPIRE_TIME=-1 +APP_NAME="${0##*/}" +REPLACE_ID=0 +URGENCY=1 +HINTS=() +SUMMARY_SET=n + +help() { + cat <<EOF +Usage: + notify-send.sh [OPTION...] <SUMMARY> [BODY] - create a notification + +Help Options: + -?|--help Show help options + +Application Options: + -u, --urgency=LEVEL Specifies the urgency level (low, normal, critical). + -t, --expire-time=TIME Specifies the timeout in milliseconds at which to expire the notification. + -f, --force-expire Forcefully closes the notification when the notification has expired. + -a, --app-name=APP_NAME Specifies the app name for the icon. + -i, --icon=ICON[,ICON...] Specifies an icon filename or stock icon to display. + -c, --category=TYPE[,TYPE...] Specifies the notification category. + -h, --hint=TYPE:NAME:VALUE Specifies basic extra data to pass. Valid types are int, double, string and byte. + -o, --action=LABEL:COMMAND Specifies an action. Can be passed multiple times. LABEL is usually a button's label. COMMAND is a shell command executed when action is invoked. + -d, --default-action=COMMAND Specifies the default action which is usually invoked by clicking the notification. + -l, --close-action=COMMAND Specifies the action invoked when notification is closed. + -p, --print-id Print the notification ID to the standard output. + -r, --replace=ID Replace existing notification. + -R, --replace-file=FILE Store and load notification replace ID to/from this file. + -s, --close=ID Close notification. + -v, --version Version of the package. + +EOF +} + +convert_type() { + case "$1" in + int) echo int32 ;; + double|string|byte) echo "$1" ;; + *) echo error; return 1 ;; + esac +} + +make_action_key() { + echo "$(tr -dc _A-Z-a-z-0-9 <<< \"$1\")${RANDOM}" +} + +make_action() { + local action_key="$1" + printf -v text "%q" "$2" + echo "\"$action_key\", \"$text\"" +} + +make_hint() { + type=$(convert_type "$1") + [[ ! $? = 0 ]] && return 1 + name="$2" + [[ "$type" = string ]] && command="\"$3\"" || command="$3" + echo "\"$name\": <$type $command>" +} + +concat_actions() { + local result="$1" + shift + for s in "$@"; do + result="$result, $s" + done + echo "[$result]" +} + +concat_hints() { + local result="$1" + shift + for s in "$@"; do + result="$result, $s" + done + echo "{$result}" +} + +parse_notification_id(){ + sed 's/(uint32 \([0-9]\+\),)/\1/g' +} + +notify() { + local actions="$(concat_actions "${ACTIONS[@]}")" + local hints="$(concat_hints "${HINTS[@]}")" + + NOTIFICATION_ID=$(gdbus call "${NOTIFY_ARGS[@]}" \ + --method org.freedesktop.Notifications.Notify \ + -- \ + "$APP_NAME" "$REPLACE_ID" "$ICON" "$SUMMARY" "$BODY" \ + "${actions}" "${hints}" "int32 $EXPIRE_TIME" \ + | parse_notification_id) + + if [[ -n "$STORE_ID" ]] ; then + echo "$NOTIFICATION_ID" > "$STORE_ID" + fi + if [[ -n "$PRINT_ID" ]] ; then + echo "$NOTIFICATION_ID" + fi + + if [[ -n "$FORCE_EXPIRE" ]] ; then + SLEEP_TIME="$( LC_NUMERIC=C printf %f "${EXPIRE_TIME}e-3" )" + ( sleep "$SLEEP_TIME" ; notify_close "$NOTIFICATION_ID" ) & + fi + + maybe_run_action_handler +} + +notify_close () { + gdbus call "${NOTIFY_ARGS[@]}" --method org.freedesktop.Notifications.CloseNotification "$1" >/dev/null +} + +process_urgency() { + case "$1" in + low) URGENCY=0 ;; + normal) URGENCY=1 ;; + critical) URGENCY=2 ;; + *) echo "Unknown urgency $URGENCY specified. Known urgency levels: low, normal, critical." + exit 1 + ;; + esac +} + +process_category() { + IFS=, read -a categories <<< "$1" + for category in "${categories[@]}"; do + hint="$(make_hint string category "$category")" + HINTS=("${HINTS[@]}" "$hint") + done +} + +process_hint() { + IFS=: read type name command <<< "$1" + if [[ -z "$name" ]] || [[ -z "$command" ]] ; then + echo "Invalid hint syntax specified. Use TYPE:NAME:VALUE." + exit 1 + fi + hint="$(make_hint "$type" "$name" "$command")" + if [[ ! $? = 0 ]] ; then + echo "Invalid hint type \"$type\". Valid types are int, double, string and byte." + exit 1 + fi + HINTS=("${HINTS[@]}" "$hint") +} + +maybe_run_action_handler() { + if [[ -n "$NOTIFICATION_ID" ]] && [[ -n "$ACTION_COMMANDS" ]]; then + local notify_action="$(dirname ${BASH_SOURCE[0]})/notify-action.sh" + if [[ -x "$notify_action" ]] ; then + "$notify_action" "$NOTIFICATION_ID" "${ACTION_COMMANDS[@]}" & + exit 0 + else + echo "executable file not found: $notify_action" + exit 1 + fi + fi +} + +process_action() { + IFS=: read name command <<<"$1" + if [[ -z "$name" ]] || [[ -z "$command" ]]; then + echo "Invalid action syntax specified. Use NAME:COMMAND." + exit 1 + fi + + local action_key="$(make_action_key "$name")" + ACTION_COMMANDS=("${ACTION_COMMANDS[@]}" "$action_key" "$command") + + local action="$(make_action "$action_key" "$name")" + ACTIONS=("${ACTIONS[@]}" "$action") +} + +process_special_action() { + action_key="$1" + command="$2" + + if [[ -z "$action_key" ]] || [[ -z "$command" ]]; then + echo "Command must not be empty" + exit 1 + fi + + ACTION_COMMANDS=("${ACTION_COMMANDS[@]}" "$action_key" "$command") + + if [[ "$action_key" != close ]]; then + local action="$(make_action "$action_key" "$name")" + ACTIONS=("${ACTIONS[@]}" "$action") + fi +} + +process_posargs() { + if [[ "$1" = -* ]] && ! [[ "$positional" = yes ]] ; then + echo "Unknown option $1" + exit 1 + else + if [[ "$SUMMARY_SET" = n ]]; then + SUMMARY="$1" + SUMMARY_SET=y + else + BODY="$1" + fi + fi +} + +while (( $# > 0 )) ; do + case "$1" in + -\?|--help) + help + exit 0 + ;; + -v|--version) + echo "${0##*/} $VERSION" + exit 0 + ;; + -u|--urgency|--urgency=*) + [[ "$1" = --urgency=* ]] && urgency="${1#*=}" || { shift; urgency="$1"; } + process_urgency "$urgency" + ;; + -t|--expire-time|--expire-time=*) + [[ "$1" = --expire-time=* ]] && EXPIRE_TIME="${1#*=}" || { shift; EXPIRE_TIME="$1"; } + if ! [[ "$EXPIRE_TIME" =~ ^-?[0-9]+$ ]]; then + echo "Invalid expire time: ${EXPIRE_TIME}" + exit 1; + fi + ;; + -f|--force-expire) + FORCE_EXPIRE=yes + ;; + -a|--app-name|--app-name=*) + [[ "$1" = --app-name=* ]] && APP_NAME="${1#*=}" || { shift; APP_NAME="$1"; } + ;; + -i|--icon|--icon=*) + [[ "$1" = --icon=* ]] && ICON="${1#*=}" || { shift; ICON="$1"; } + ;; + -c|--category|--category=*) + [[ "$1" = --category=* ]] && category="${1#*=}" || { shift; category="$1"; } + process_category "$category" + ;; + -h|--hint|--hint=*) + [[ "$1" = --hint=* ]] && hint="${1#*=}" || { shift; hint="$1"; } + process_hint "$hint" + ;; + -o | --action | --action=*) + [[ "$1" == --action=* ]] && action="${1#*=}" || { shift; action="$1"; } + process_action "$action" + ;; + -d | --default-action | --default-action=*) + [[ "$1" == --default-action=* ]] && default_action="${1#*=}" || { shift; default_action="$1"; } + process_special_action default "$default_action" + ;; + -l | --close-action | --close-action=*) + [[ "$1" == --close-action=* ]] && close_action="${1#*=}" || { shift; close_action="$1"; } + process_special_action close "$close_action" + ;; + -p|--print-id) + PRINT_ID=yes + ;; + -r|--replace|--replace=*) + [[ "$1" = --replace=* ]] && REPLACE_ID="${1#*=}" || { shift; REPLACE_ID="$1"; } + ;; + -R|--replace-file|--replace-file=*) + [[ "$1" = --replace-file=* ]] && filename="${1#*=}" || { shift; filename="$1"; } + if [[ -s "$filename" ]]; then + REPLACE_ID="$(< "$filename")" + fi + STORE_ID="$filename" + ;; + -s|--close|--close=*) + [[ "$1" = --close=* ]] && close_id="${1#*=}" || { shift; close_id="$1"; } + # always check that --close provides a numeric value + if [[ -z "$close_id" || ! "$close_id" =~ ^[0-9]+$ ]]; then + echo "Invalid close id: '$close_id'" + exit 1 + fi + notify_close "$close_id" + exit $? + ;; + --) + positional=yes + ;; + *) + process_posargs "$1" + ;; + esac + shift +done + +# always force --replace and --replace-file to provide a numeric value; 0 means no id provided +if [[ -z "$REPLACE_ID" || ! "$REPLACE_ID" =~ ^[0-9]+$ ]]; then + REPLACE_ID=0 +fi + +# urgency is always set +HINTS=("$(make_hint byte urgency "$URGENCY")" "${HINTS[@]}") + +if [[ "$SUMMARY_SET" = n ]] ; then + help + exit 1 +else + notify +fi diff --git a/.mozilla/firefox/k6uncrlc.default-esr/chrome/userChrome.css b/.mozilla/firefox/whisperwood/chrome/userChrome.css index 10e0a36..10e0a36 100644 --- a/.mozilla/firefox/k6uncrlc.default-esr/chrome/userChrome.css +++ b/.mozilla/firefox/whisperwood/chrome/userChrome.css @@ -21,6 +21,7 @@ export XDG_CONFIG_HOME=$HOME/.config export XDG_DATA_HOME=$HOME/.local/share export R_PROFILE_USER=$HOME/.config/R/Rprofile export ZDOTDIR=$HOME/.config/zsh +export TEXMFHOME=$XDG_DATA_HOME/texmf # Applications export EDITOR=$(which nvim) @@ -43,6 +44,11 @@ export LESS_TERMCAP_ue=$'\e[0m' # end underline shortcutgen aliasgen +# Ensure XDG_RUNTIME_DIR is set +if test -z "$XDG_RUNTIME_DIR"; then + export XDG_RUNTIME_DIR=$(mktemp -d /tmp/$(id -u)-runtime-dir.XXX) +fi + # Start Desktop Environment if on the main TTY if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then startx diff --git a/.ssh/authorized_keys b/.ssh/authorized_keys new file mode 100644 index 0000000..3a8f331 --- /dev/null +++ b/.ssh/authorized_keys @@ -0,0 +1,3 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC6wn1w2cVGDN/rBrqrAjbXLZ3KdFe1zmlwX4jT2deUc4DNr5+FyKrOp++9i5ujv/388TiGR9FbbvwHzk92FS6XXFyCVLx2gMrYN5XUTuu/tqFYPzLagZkzAEDuTGk4Ou1zdWRyk9ogfXnixgkrrA8We6FmQH3D4565WFgsFG2fwMfIG0vk1arZoxQa+45a+pq8T7PtPPEwukQSTjoqePng6CgzkiWr5zbdBG0zDrsQUW4lgn/k4S69RInMa0jp5EhjydSNio5Cm1N/1ij8/utXv9r7UuhgRPwkl+ctChkPIDRcHGrnwMUE5gglZZ8ndjbHOoYEjQ94h6itK6I96iOpVyDy30GePqrBvfg77wBownPmhmIfb12QkeffNeM2XiEruduEvRe4HPNCR65M+NRi8c2MK1XNbawSYvSFSf6lJyyWhgthd8icJExDh+rWb3F+HYL5TMU8/a160VTX+UDGXcdioqXfiPwNtiumWkiz7NX12gax1VlFtEOYr4Tnchvv9NNI2pzDtjVGfv6WwUL4/+YaBb7xV3PmH5Th++1JoWY2Z3LzoJ0O63Q9mDR0m18vmZg369PIOFaSBNkMKLsSSHcW61lJm398MVWsZa/cIw2uCUXm92HnOFLOMYVDngwAWXGQPOMq3Ld/ehY7WpQ06zPZsyZiNBufbBVV1PpHZw== master@intern +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDVXJbHCcGfpWGZgW59zWXm2yoEnMeiuwr+u7upBx98KRg26nlzlLjAXxRiKfHj+7V/Ybfhgr8N5XAT/IKY+eUQNZk8iKCHnvRpkJKB9+ZsVFR8Pjd/WOflguUIWY03/q0hYLv8x1RaoehAKL2kR8IIhj7fjlka/w+4C3nUyKV4Kf7NQfx8yTSbcf4bl0XVcpxtZWRlyrY8Y76D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dqsFobK1jaUowNG2NKxdp6NYQiRj8gUWmmlq8Un3a1lPplTX7DQhoffu10O98byJXVaXb1HLICG/KOBJTzyj4k+U/eJOZwLCuyIa/2F2GYEltQpKOdYHo5dXZW8LRPTV89wWrCfMWYD2w==master@workstation @@ -1,5 +1,6 @@ $HOME/.dropbox-dist/dropboxd & $XDG_CONFIG_HOME/startup/$(hostname) & +gentoo-pipewire-launcher & makewall & sxhkd & dunst & @@ -8,9 +9,13 @@ picom -b & echo us > $HOME/.cache/layout xrdb -load $HOME/.Xresources flashfocus -n 30 -t 150 -l never -o 0.75 -v ERROR & +$HOME/.screenlayout/battlestation-dualmon.sh & dwmblocks & remaps & while true; do - dwm >/dev/null +# Start dwm (loop restarts it if it crashes) +# dwm >/dev/null +# Trying to launch dwm with dbus-launch + dbus-launch --exit-with-session dwm done # vim:filetype=sh |