diff options
| author | Christian Krinitsin <christian@krinitsin.xyz> | 2024-03-18 16:20:20 +0100 |
|---|---|---|
| committer | Christian Krinitsin <christian@krinitsin.xyz> | 2024-03-18 16:20:20 +0100 |
| commit | c6775b8032e2423f5e484505b277a7e0fdc9788a (patch) | |
| tree | 5cdb7b8bfe13a1fc971a7ca414753a968e8c9f70 | |
| parent | e992c3c164e9bf8869fb8b20eaa17ca595d92aac (diff) | |
| download | dotfiles-c6775b8032e2423f5e484505b277a7e0fdc9788a.tar.gz dotfiles-c6775b8032e2423f5e484505b277a7e0fdc9788a.zip | |
changes
37 files changed, 38 insertions, 684 deletions
diff --git a/.bashrc b/.bashrc index ab1bf09..c1e078e 100644 --- a/.bashrc +++ b/.bashrc @@ -26,6 +26,3 @@ eval "$(zoxide init --cmd='cd' bash)" # Navtag #source /home/chris/.scripts/navtag/commands.sh - -# Own shell functions -source $HOME/.scripts/shell_functions.sh diff --git a/.config/qutebrowser/dracula/__pycache__/__init__.cpython-311.pyc b/.config/qutebrowser/dracula/__pycache__/__init__.cpython-311.pyc index 958a220..ddd341c 100644 --- a/.config/qutebrowser/dracula/__pycache__/__init__.cpython-311.pyc +++ b/.config/qutebrowser/dracula/__pycache__/__init__.cpython-311.pyc Binary files differdiff --git a/.config/qutebrowser/dracula/__pycache__/draw.cpython-311.pyc b/.config/qutebrowser/dracula/__pycache__/draw.cpython-311.pyc index 8857702..086fcbc 100644 --- a/.config/qutebrowser/dracula/__pycache__/draw.cpython-311.pyc +++ b/.config/qutebrowser/dracula/__pycache__/draw.cpython-311.pyc Binary files differdiff --git a/.config/sway/config b/.config/sway/config index 59b6307..6a78723 100644 --- a/.config/sway/config +++ b/.config/sway/config @@ -14,7 +14,9 @@ set $ws10 "10" workspace_layout default default_border pixel 2 -client.focused "#ffffff" "#d699b6" "#ffffff" + +client.focused "#ffffff" "#d699b6" "#ffffff" "#e69875" +client.focused_inactive "#ffffff" "#83c092" "#ffffff" "#e69875" gaps inner 6 gaps outer 3 @@ -134,7 +136,6 @@ bindsym XF86AudioPrev exec playerctl previous bindsym $mod+Ctrl+s exec screenshot # custom scripts -bindsym $mod+Shift+i exec dmonitors bindsym $mod+Shift+o exec zathura-fzf /home/chris/uni/ bindsym $mod+Shift+b exec bluetooth-devices bindsym $mod+w exec qtb-load-session @@ -144,7 +145,7 @@ bindsym $mod+Ctrl+w exec random-wallpaper # autostart exec --no-startup-id /usr/bin/dunst -exec --no-startup-id random-wallpaper +exec_always --no-startup-id random-wallpaper input * { xkb_layout "eu" diff --git a/.config/systemd/user/mbsync.service b/.config/systemd/user/mbsync.service deleted file mode 100755 index 03beacf..0000000 --- a/.config/systemd/user/mbsync.service +++ /dev/null @@ -1,9 +0,0 @@ -[Unit] -Description=Mailbox synchronization service - -[Service] -Type=oneshot -ExecStart=/usr/bin/mbsync -Va - -[Install] -WantedBy=default.target diff --git a/.config/systemd/user/mbsync.timer b/.config/systemd/user/mbsync.timer deleted file mode 100755 index 8625e78..0000000 --- a/.config/systemd/user/mbsync.timer +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description=Mailbox synchronization timer - -[Timer] -OnBootSec=20s -OnUnitActiveSec=15s -Unit=mbsync.service - -[Install] -WantedBy=timers.target diff --git a/.config/systemd/user/timers.target.wants/mbsync.timer b/.config/systemd/user/timers.target.wants/mbsync.timer deleted file mode 120000 index 2364b5c..0000000 --- a/.config/systemd/user/timers.target.wants/mbsync.timer +++ /dev/null @@ -1 +0,0 @@ -/home/chris/.config/systemd/user/mbsync.timer \ No newline at end of file diff --git a/.config/waybar/config b/.config/waybar/config index 66d74ff..d4be05a 100644 --- a/.config/waybar/config +++ b/.config/waybar/config @@ -4,8 +4,7 @@ "height": 20, // Waybar height (to be removed for auto height) "spacing": 2, // Gaps between modules (4px) "modules-left": ["sway/workspaces", "sway/mode", "sway/scratchpad", "custom/media"], - "modules-right": ["custom/mail", "custom/pacman", "mpd", "backlight", "pulseaudio", "network", "cpu", "memory", "disk", "temperature", "battery", "clock", "tray"], - + "modules-right": ["custom/pacman", "mpd", "backlight", "pulseaudio", "network", "cpu", "memory", "disk", "temperature", "battery", "clock", "tray"], "keyboard-state": { "numlock": true, @@ -67,6 +66,7 @@ "timezone": "Europe/Berlin", "tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>", "format": "{:%d %h %Y - %R}", + "on-click": "alacritty -e calcurse", }, "cpu": { "format": " {usage}%", diff --git a/.config/waybar/i3blocks.conf b/.config/waybar/i3blocks.conf deleted file mode 100755 index d6ed217..0000000 --- a/.config/waybar/i3blocks.conf +++ /dev/null @@ -1,69 +0,0 @@ -# icons from: -# https://fontawesome.com/v4.7/cheatsheet/ - -separator=false -markup=pango -color=#d3c6aa - -[e-mail] -label= -command=~/.config/i3/scripts/mail.sh -interval=5 - -[disk] -label= -instance=/ -command=~/.config/i3/scripts/disk -interval=30 - -[memory] -label= -command=~/.config/i3/scripts/memory -interval=2 - -[cpu_usage] -label= -command=~/.config/i3/scripts/cpu_usage -interval=2 - -[CPU-temperature] -label= -command=~/.config/i3/scripts/temperature -interval=30 - -[battery] -command=~/.config/i3/scripts/battery2 -label= -interval=3 - -[simple-2] -full_text=: : - -[pavucontrol] -full_text= -command=pavucontrol - -[volume-pulseaudio] -command=~/.config/i3/scripts/volume -instance=Master -interval=1 - -[ppd_menu] -full_text= -command=~/.config/i3/scripts/power-profiles -color=#83c092 - -[ppd-status] -command=~/.config/i3/scripts/ppd-status -interval=5 - -[time] -command=date '+%a %d %b %H:%M:%S' -interval=1 - -[shutdown_menu] -full_text= -command=~/.config/i3/scripts/powermenu - -[simple-2] -full_text=" " diff --git a/.config/waybar/scripts/cpu_usage b/.config/waybar/scripts/cpu_usage deleted file mode 100755 index 8d8a267..0000000 --- a/.config/waybar/scripts/cpu_usage +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/perl -# -# Copyright 2014 Pierre Mavro <deimos@deimos.fr> -# Copyright 2014 Vivien Didelot <vivien@didelot.org> -# Copyright 2014 Andreas Guldstrand <andreas.guldstrand@gmail.com> -# -# Licensed under the terms of the GNU GPL v3, or any later version. - -use strict; -use warnings; -use utf8; -use Getopt::Long; - -# default values -my $t_warn = $ENV{T_WARN} // 50; -my $t_crit = $ENV{T_CRIT} // 80; -my $cpu_usage = -1; -my $decimals = $ENV{DECIMALS} // 0; -my $label = $ENV{LABEL} // ""; - -sub help { - print "Usage: cpu_usage [-w <warning>] [-c <critical>] [-d <decimals>]\n"; - print "-w <percent>: warning threshold to become yellow\n"; - print "-c <percent>: critical threshold to become red\n"; - print "-d <decimals>: Use <decimals> decimals for percentage (default is $decimals) \n"; - exit 0; -} - -GetOptions("help|h" => \&help, - "w=i" => \$t_warn, - "c=i" => \$t_crit, - "d=i" => \$decimals, -); - -# Get CPU usage -$ENV{LC_ALL}="en_US"; # if mpstat is not run under en_US locale, things may break, so make sure it is -open (MPSTAT, 'mpstat 1 1 |') or die; -while (<MPSTAT>) { - if (/^.*\s+(\d+\.\d+)[\s\x00]?$/) { - $cpu_usage = 100 - $1; # 100% - %idle - last; - } -} -close(MPSTAT); - -$cpu_usage eq -1 and die 'Can\'t find CPU information'; - -# Print short_text, full_text -print "${label}"; -printf "%02.${decimals}f%%\n", $cpu_usage; -print "${label}"; -printf "%02.${decimals}f%%\n", $cpu_usage; - -# Print color, if needed -if ($cpu_usage >= $t_crit) { - print "#FF0000\n"; - exit 33; -} elsif ($cpu_usage >= $t_warn) { - print "#FFFC00\n"; -} - -exit 0; diff --git a/.config/waybar/scripts/disk b/.config/waybar/scripts/disk deleted file mode 100755 index e18c7aa..0000000 --- a/.config/waybar/scripts/disk +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env bash -# Copyright (C) 2014 Julien Bonjean <julien@bonjean.info> - -# 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/>. - -DIR="${DIR:-$BLOCK_INSTANCE}" -DIR="${DIR:-$HOME}" -ALERT_LOW="${ALERT_LOW:-$1}" -ALERT_LOW="${ALERT_LOW:-10}" # color will turn red under this value (default: 10%) - -LOCAL_FLAG="-l" -if [ "$1" = "-n" ] || [ "$2" = "-n" ]; then - LOCAL_FLAG="" -fi - -df -h -P $LOCAL_FLAG "$DIR" | awk -v label="$LABEL" -v alert_low=$ALERT_LOW ' -/\/.*/ { - # full text - print label $4 - - # short text - print label $4 - - use=$5 - - # no need to continue parsing - exit 0 -} - -END { - gsub(/%$/,"",use) - if (100 - use < alert_low) { - # color - print "#FF0000" - } -} -' diff --git a/.config/waybar/scripts/get_weather.sh b/.config/waybar/scripts/get_weather.sh deleted file mode 100755 index 5b89549..0000000 --- a/.config/waybar/scripts/get_weather.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash - -for i in {1..5} -do - text=$(curl -s "https://wttr.in/$1?format=1") - if [[ $? == 0 ]] - then - text=$(echo "$text" | sed -E "s/\s+/ /g") - tooltip=$(curl -s "https://wttr.in/$1?format=4") - if [[ $? == 0 ]] - then - tooltip=$(echo "$tooltip" | sed -E "s/\s+/ /g") - echo "{\"text\":\"$text\", \"tooltip\":\"$tooltip\"}" - exit - fi - fi - sleep 2 -done -echo "{\"text\":\"error\", \"tooltip\":\"error\"}" diff --git a/.config/waybar/scripts/mail.sh b/.config/waybar/scripts/mail.sh deleted file mode 100755 index 8272af2..0000000 --- a/.config/waybar/scripts/mail.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -echo $(find $HOME/.cache/mail/*/INBOX/new/ -type f | wc -l) diff --git a/.config/waybar/scripts/memory b/.config/waybar/scripts/memory deleted file mode 100755 index 6a69a6f..0000000 --- a/.config/waybar/scripts/memory +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/env bash -# Copyright (C) 2014 Julien Bonjean <julien@bonjean.info> - -# 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/>. - -TYPE="${BLOCK_INSTANCE:-mem}" - -awk -v type=$TYPE ' -/^MemTotal:/ { - mem_total=$2 -} -/^MemFree:/ { - mem_free=$2 -} -/^Buffers:/ { - mem_free+=$2 -} -/^Cached:/ { - mem_free+=$2 -} -/^SwapTotal:/ { - swap_total=$2 -} -/^SwapFree:/ { - swap_free=$2 -} -END { - if (type == "swap") { - free=swap_free/1024/1024 - used=(swap_total-swap_free)/1024/1024 - total=swap_total/1024/1024 - } else { - free=mem_free/1024/1024 - used=(mem_total-mem_free)/1024/1024 - total=mem_total/1024/1024 - } - - pct=0 - if (total > 0) { - pct=used/total*100 - } - - # full text - # printf("%.1fG/%.1fG (%.f%%)\n", used, total, pct) - - # short text - printf("%.f%%\n", pct) - - # color - if (pct > 90) { - print("#FF0000") - } else if (pct > 80) { - print("#FFAE00") - } else if (pct > 70) { - print("#FFF600") - } -} -' /proc/meminfo diff --git a/.config/waybar/scripts/power-profiles b/.config/waybar/scripts/power-profiles deleted file mode 100755 index feb63dc..0000000 --- a/.config/waybar/scripts/power-profiles +++ /dev/null @@ -1,190 +0,0 @@ -#!/usr/bin/env bash -# -# Use rofi/zenity to change system runstate thanks to systemd. -# -# Note: this currently relies on associative array support in the shell. -# -# Inspired from i3pystatus wiki: -# https://github.com/enkore/i3pystatus/wiki/Shutdown-Menu -# -# Copyright 2015 Benjamin Chrétien <chretien at lirmm dot fr> -# -# 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/>. - -# power-profiles-daemon implementation: -# needs package power-profiles-daemon installed and the service running see here: -# https://wiki.archlinux.org/title/CPU_frequency_scaling#power-profiles-daemon -# used in i3-blocks: ~/.config/i3/i3blocks.conf together with: ~/.config/i3/scripts/ppd-status - - -####################################################################### -# BEGIN CONFIG # -####################################################################### - -# Use a custom lock script -#LOCKSCRIPT="i3lock-extra -m pixelize" - -# Colors: FG (foreground), BG (background), HL (highlighted) -FG_COLOR="#bbbbbb" -BG_COLOR="#111111" -HLFG_COLOR="#111111" -HLBG_COLOR="#bbbbbb" -BORDER_COLOR="#222222" - -# Options not related to colors -#ROFI_TEXT=":" -#ROFI_OPTIONS=(-width -11 -location 0 -hide-scrollbar -bw 30 -color-window "#dd310027,#dd0310027,#dd310027" -padding 5) -#ROFI_OPTIONS=(-width -18 -location 4 -hide-scrollbar -color-window "#cc310027,#00a0009a,#cc310027" -padding 5 -font "Sourcecode Pro Regular 10, FontAwesome 9") -ROFI_OPTIONS=(-theme ~/.config/rofi/power-profiles.rasi) -# Zenity options -ZENITY_TITLE="Power Profiles" -ZENITY_TEXT="Set Profiles:" -ZENITY_OPTIONS=(--column= --hide-header) - -####################################################################### -# END CONFIG # -####################################################################### - -# Whether to ask for user's confirmation -enable_confirmation=false - -# Preferred launcher if both are available -preferred_launcher="rofi" - -usage="$(basename "$0") [-h] [-c] [-p name] -- display a menu for shutdown, reboot, lock etc. - -where: - -h show this help text - -c ask for user confirmation - -p preferred launcher (rofi or zenity) - -This script depends on: - - systemd, - - i3, - - rofi or zenity." - -# Check whether the user-defined launcher is valid -launcher_list=(rofi zenity) -function check_launcher() { - if [[ ! "${launcher_list[@]}" =~ (^|[[:space:]])"$1"($|[[:space:]]) ]]; then - echo "Supported launchers: ${launcher_list[*]}" - exit 1 - else - # Get array with unique elements and preferred launcher first - # Note: uniq expects a sorted list, so we cannot use it - i=1 - launcher_list=($(for l in "$1" "${launcher_list[@]}"; do printf "%i %s\n" "$i" "$l"; let i+=1; done \ - | sort -uk2 | sort -nk1 | cut -d' ' -f2- | tr '\n' ' ')) - fi -} - -# Parse CLI arguments -while getopts "hcp:" option; do - case "${option}" in - h) echo "${usage}" - exit 0 - ;; - c) enable_confirmation=true - ;; - p) preferred_launcher="${OPTARG}" - check_launcher "${preferred_launcher}" - ;; - *) exit 1 - ;; - esac -done - -# Check whether a command exists -function command_exists() { - command -v "$1" &> /dev/null 2>&1 -} - -# systemctl required -if ! command_exists systemctl ; then - exit 1 -fi - -# menu defined as an associative array -typeset -A menu - -# Menu with keys/commands - -menu=( - [ Performance]="powerprofilesctl set performance" - [ Balanced]="powerprofilesctl set balanced" - [ Power Saver]="powerprofilesctl set power-saver" - [ Cancel]="" -) - -menu_nrows=${#menu[@]} - -# Menu entries that may trigger a confirmation message -menu_confirm="Shutdown Reboot Hibernate Suspend Halt Logout" - -launcher_exe="" -launcher_options="" -rofi_colors="" - -function prepare_launcher() { - if [[ "$1" == "rofi" ]]; then - rofi_colors=(-bc "${BORDER_COLOR}" -bg "${BG_COLOR}" -fg "${FG_COLOR}" \ - -hlfg "${HLFG_COLOR}" -hlbg "${HLBG_COLOR}") - launcher_exe="rofi" - launcher_options=(-dmenu -i -lines "${menu_nrows}" -p "${ROFI_TEXT}" \ - "${rofi_colors}" "${ROFI_OPTIONS[@]}") - elif [[ "$1" == "zenity" ]]; then - launcher_exe="zenity" - launcher_options=(--list --title="${ZENITY_TITLE}" --text="${ZENITY_TEXT}" \ - "${ZENITY_OPTIONS[@]}") - fi -} - -for l in "${launcher_list[@]}"; do - if command_exists "${l}" ; then - prepare_launcher "${l}" - break - fi -done - -# No launcher available -if [[ -z "${launcher_exe}" ]]; then - exit 1 -fi - -launcher=(${launcher_exe} "${launcher_options[@]}") -selection="$(printf '%s\n' "${!menu[@]}" | sort | "${launcher[@]}")" - -function ask_confirmation() { - if [ "${launcher_exe}" == "rofi" ]; then - confirmed=$(echo -e "Yes\nNo" | rofi -dmenu -i -lines 2 -p "${selection}?" \ - "${rofi_colors}" "${ROFI_OPTIONS[@]}") - [ "${confirmed}" == "Yes" ] && confirmed=0 - elif [ "${launcher_exe}" == "zenity" ]; then - zenity --question --text "Are you sure you want to ${selection,,}?" - confirmed=$? - fi - - if [ "${confirmed}" == 0 ]; then - i3-msg -q "exec --no-startup-id ${menu[${selection}]}" - fi -} - -if [[ $? -eq 0 && ! -z ${selection} ]]; then - if [[ "${enable_confirmation}" = true && \ - ${menu_confirm} =~ (^|[[:space:]])"${selection}"($|[[:space:]]) ]]; then - ask_confirmation - else - i3-msg -q "exec --no-startup-id ${menu[${selection}]}" - fi -fi diff --git a/.config/waybar/scripts/ppd-status b/.config/waybar/scripts/ppd-status deleted file mode 100755 index 8e6eb7b..0000000 --- a/.config/waybar/scripts/ppd-status +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash -# -# power-profiles-daemon implementation: -# needs package power-profiles-daemon installed and the service running see here: -# https://wiki.archlinux.org/title/CPU_frequency_scaling#power-profiles-daemon -# used in i3-blocks: ~/.config/i3/i3blocks.conf together with: ~/.config/i3/scripts/power-profiles - -# script to show current power profile - -current_profile=$(/usr/bin/powerprofilesctl get) -echo "$current_profile" diff --git a/.config/waybar/scripts/temperature b/.config/waybar/scripts/temperature deleted file mode 100755 index 4e31610..0000000 --- a/.config/waybar/scripts/temperature +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/env perl -# Copyright 2014 Pierre Mavro <deimos@deimos.fr> -# Copyright 2014 Vivien Didelot <vivien@didelot.org> -# Copyright 2014 Andreas Guldstrand <andreas.guldstrand@gmail.com> -# Copyright 2014 Benjamin Chretien <chretien at lirmm dot fr> - -# 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/>. -# -# Edited by Andreas Lindlbauer <endeavouros.mousily@aleeas.com> - -use strict; -use warnings; -use utf8; -use Getopt::Long; - -binmode(STDOUT, ":utf8"); - -# default values -my $t_warn = $ENV{T_WARN} || 70; -my $t_crit = $ENV{T_CRIT} || 90; -my $chip = $ENV{SENSOR_CHIP} || ""; -my $temperature = -9999; -my $label = "😀 "; - -sub help { - print "Usage: temperature [-w <warning>] [-c <critical>] [--chip <chip>]\n"; - print "-w <percent>: warning threshold to become yellow\n"; - print "-c <percent>: critical threshold to become red\n"; - print "--chip <chip>: sensor chip\n"; - exit 0; -} - -GetOptions("help|h" => \&help, - "w=i" => \$t_warn, - "c=i" => \$t_crit, - "chip=s" => \$chip); - -# Get chip temperature -open (SENSORS, "sensors -u $chip |") or die; -while (<SENSORS>) { - if (/^\s+temp1_input:\s+[\+]*([\-]*\d+\.\d)/) { - $temperature = $1; - last; - } -} -close(SENSORS); - -$temperature eq -9999 and die 'Cannot find temperature'; - -if ($temperature < 45) { - $label = ''; -} elsif ($temperature < 55) { - $label = ''; -} elsif ($temperature < 65) { - $label = ''; -} elsif ($temperature < 75) { - $label = ''; -} else { - $label = ''; -} -# Print short_text, full_text -print "${label}"; -print " $temperature°C\n"; -print "${label}"; -print " $temperature°C\n"; - -# Print color, if needed -if ($temperature >= $t_crit) { - print "#FF0000\n"; - exit 33; -} elsif ($temperature >= $t_warn) { - print "#FFFC00\n"; -} - -exit 0; diff --git a/.config/waybar/scripts/volume b/.config/waybar/scripts/volume deleted file mode 100755 index 39618e1..0000000 --- a/.config/waybar/scripts/volume +++ /dev/null @@ -1,93 +0,0 @@ -#!/usr/bin/env bash -# Copyright (C) 2014 Julien Bonjean <julien@bonjean.info> -# Copyright (C) 2014 Alexander Keller <github@nycroth.com> - -# 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/>. - -# original source: https://github.com/vivien/i3blocks-contrib/tree/master/volume -# check the readme: https://github.com/vivien/i3blocks-contrib/blob/master/volume/README.md -#------------------------------------------------------------------------ - -# The second parameter overrides the mixer selection -# For PulseAudio users, eventually use "pulse" -# For Jack/Jack2 users, use "jackplug" -# For ALSA users, you may use "default" for your primary card -# or you may use hw:# where # is the number of the card desired -if [[ -z "$MIXER" ]] ; then - MIXER="default" - if command -v pulseaudio >/dev/null 2>&1 && pulseaudio --check ; then - # pulseaudio is running, but not all installations use "pulse" - if amixer -D pulse info >/dev/null 2>&1 ; then - MIXER="pulse" - fi - fi - [ -n "$(lsmod | grep jack)" ] && MIXER="jackplug" - MIXER="${2:-$MIXER}" -fi - -# The instance option sets the control to report and configure -# This defaults to the first control of your selected mixer -# For a list of the available, use `amixer -D $Your_Mixer scontrols` -if [[ -z "$SCONTROL" ]] ; then - SCONTROL="${BLOCK_INSTANCE:-$(amixer -D $MIXER scontrols | - sed -n "s/Simple mixer control '\([^']*\)',0/\1/p" | - head -n1 - )}" -fi - -# The first parameter sets the step to change the volume by (and units to display) -# This may be in in % or dB (eg. 5% or 3dB) -if [[ -z "$STEP" ]] ; then - STEP="${1:-5%}" -fi - -# AMIXER(1): -# "Use the mapped volume for evaluating the percentage representation like alsamixer, to be -# more natural for human ear." -NATURAL_MAPPING=${NATURAL_MAPPING:-0} -if [[ "$NATURAL_MAPPING" != "0" ]] ; then - AMIXER_PARAMS="-M" -fi - -#------------------------------------------------------------------------ - -capability() { # Return "Capture" if the device is a capture device - amixer $AMIXER_PARAMS -D $MIXER get $SCONTROL | - sed -n "s/ Capabilities:.*cvolume.*/Capture/p" -} - -volume() { - amixer $AMIXER_PARAMS -D $MIXER get $SCONTROL $(capability) -} - -format() { - - perl_filter='if (/.*\[(\d+%)\] (\[(-?\d+.\d+dB)\] )?\[(on|off)\]/)' - perl_filter+='{CORE::say $4 eq "off" ? "MUTE" : "' - # If dB was selected, print that instead - perl_filter+=$([[ $STEP = *dB ]] && echo '$3' || echo '$1') - perl_filter+='"; exit}' - output=$(perl -ne "$perl_filter") - echo "$LABEL$output" -} - -#------------------------------------------------------------------------ - -case $BLOCK_BUTTON in - 3) amixer $AMIXER_PARAMS -q -D $MIXER sset $SCONTROL $(capability) toggle ;; # right click, mute/unmute - 4) amixer $AMIXER_PARAMS -q -D $MIXER sset $SCONTROL $(capability) ${STEP}+ unmute ;; # scroll up, increase - 5) amixer $AMIXER_PARAMS -q -D $MIXER sset $SCONTROL $(capability) ${STEP}- unmute ;; # scroll down, decrease -esac - -volume | format diff --git a/.config/waybar/scripts/volume_brightness.sh b/.config/waybar/scripts/volume_brightness.sh index 8527b62..d98dc69 100755 --- a/.config/waybar/scripts/volume_brightness.sh +++ b/.config/waybar/scripts/volume_brightness.sh @@ -28,7 +28,9 @@ function get_brightness { function get_volume_icon { volume=$(get_volume) mute=$(get_mute) - if [ "$volume" -eq 0 ] || [ "$mute" == "yes" ] ; then + if [ "$mute" == "yes" ] ; then + volume_icon=" " + elif [ "$volume" -eq 0 ]; then volume_icon=" " elif [ "$volume" -lt 50 ]; then volume_icon=" " @@ -46,7 +48,11 @@ function get_brightness_icon { function show_volume_notif { volume=$(get_mute) get_volume_icon - dunstify -t 1000 -r 2593 -u normal "$volume_icon $volume%" -h int:value:$volume -h string:hlcolor:$bar_color + if [ "$mute" == "yes" ]; then + dunstify -t 1000 -r 2593 -u normal "$volume_icon" -h int:value:0 -h string:hlcolor:$bar_color + else + dunstify -t 1000 -r 2593 -u normal "$volume_icon $volume%" -h int:value:$volume -h string:hlcolor:$bar_color + fi } # Displays a brightness notification using dunstify diff --git a/.gnupg/gpg-agent.conf b/.gnupg/gpg-agent.conf new file mode 100755 index 0000000..07ba416 --- /dev/null +++ b/.gnupg/gpg-agent.conf @@ -0,0 +1,3 @@ +pinentry-program /home/chris/.gnupg/pinentry-dmenu +default-cache-ttl 7200 +max-cache-ttl 7200 diff --git a/.gnupg/pinentry-dmenu b/.gnupg/pinentry-dmenu new file mode 100755 index 0000000..e66c127 --- /dev/null +++ b/.gnupg/pinentry-dmenu @@ -0,0 +1,13 @@ +#!/bin/sh + +echo 'OK this mf ready' + +while read stdin; do + case $stdin in + *GETPIN*) echo "D `dmenu-wl -P -po "$KEYNAME ($KEYID)" -nb '#2b3339' -nf '#d3c6aa' -sb '#d3c6aa' -sf '#212736' -h 22 -fn 'DroidSansM Nerd Font'`"; echo "OK" ;; + *SETDESC*) KEYNAME=${stdin#*:%0A%22}; KEYNAME=${KEYNAME%\%22\%0A*}; KEYID=${stdin#*ID }; KEYID=${KEYID%,*}; echo OK ;; + *SETERROR*) notify-send "${stdin#SETERROR }"; echo "OK" ;; + *BYE*) exit 0 ;; + *) echo OK ;; + esac +done diff --git a/.mbsyncrc b/.mbsyncrc index 41b7413..ba4ab85 100755 --- a/.mbsyncrc +++ b/.mbsyncrc @@ -2,7 +2,7 @@ IMAPStore christian.krinitsin_tum.de-remote Host xmail.mwn.de Port 993 User ge87liq -PassCmd "pass tum.de/ge87liq" +PassCmd "pass ionos.de/christian.krinitsin@tum.de" AuthMechs LOGIN SSLType IMAPS CertificateFile /etc/ssl/certs/ca-certificates.crt diff --git a/.stow-local-ignore b/.stow-local-ignore new file mode 100644 index 0000000..c45ea57 --- /dev/null +++ b/.stow-local-ignore @@ -0,0 +1,3 @@ +.git +bin +wallpaper diff --git a/bin/random-wallpaper b/bin/random-wallpaper index 796d44c..cb4aa1a 100755 --- a/bin/random-wallpaper +++ b/bin/random-wallpaper @@ -6,8 +6,8 @@ # I'm "limiting" myself to one colorgrading -cd ~/.everforest-walls/nature/ +cd ~/.dotfiles/wallpaper -IMAGE=$(find *'1.png' | sort -R | tail -n 1) +IMAGE=$(find *'.png' | sort -R | tail -n 1) -swaymsg output "*" bg ~/.everforest-walls/nature/$IMAGE fill +swaymsg output "*" bg ~/.dotfiles/wallpaper/$IMAGE fill diff --git a/wallpaper/fog_forest_1.png b/wallpaper/fog_forest_1.png new file mode 100755 index 0000000..7704dbc --- /dev/null +++ b/wallpaper/fog_forest_1.png Binary files differdiff --git a/wallpaper/fog_forest_alt_1.png b/wallpaper/fog_forest_alt_1.png new file mode 100755 index 0000000..4910dee --- /dev/null +++ b/wallpaper/fog_forest_alt_1.png Binary files differdiff --git a/wallpaper/fog_forest_portrait_1.png b/wallpaper/fog_forest_portrait_1.png new file mode 100755 index 0000000..48b2b8c --- /dev/null +++ b/wallpaper/fog_forest_portrait_1.png Binary files differdiff --git a/wallpaper/foggy_valley_1.png b/wallpaper/foggy_valley_1.png new file mode 100755 index 0000000..a484bc1 --- /dev/null +++ b/wallpaper/foggy_valley_1.png Binary files differdiff --git a/wallpaper/green_forest_1.png b/wallpaper/green_forest_1.png new file mode 100755 index 0000000..962b7f1 --- /dev/null +++ b/wallpaper/green_forest_1.png Binary files differdiff --git a/wallpaper/mist_forest_1.png b/wallpaper/mist_forest_1.png new file mode 100755 index 0000000..eb0c104 --- /dev/null +++ b/wallpaper/mist_forest_1.png Binary files differdiff --git a/wallpaper/ocean_front_1.png b/wallpaper/ocean_front_1.png new file mode 100755 index 0000000..251d772 --- /dev/null +++ b/wallpaper/ocean_front_1.png Binary files differdiff --git a/wallpaper/polyscape_1.png b/wallpaper/polyscape_1.png new file mode 100755 index 0000000..06a02e7 --- /dev/null +++ b/wallpaper/polyscape_1.png Binary files differdiff --git a/wallpaper/polyscape_pillars_1.png b/wallpaper/polyscape_pillars_1.png new file mode 100755 index 0000000..0daef21 --- /dev/null +++ b/wallpaper/polyscape_pillars_1.png Binary files differdiff --git a/wallpaper/readme.md b/wallpaper/readme.md new file mode 100644 index 0000000..0d08514 --- /dev/null +++ b/wallpaper/readme.md @@ -0,0 +1 @@ +taken from 'Apeiros-46B/everforest-walls' diff --git a/wallpaper/rock_1.png b/wallpaper/rock_1.png new file mode 100755 index 0000000..8c02861 --- /dev/null +++ b/wallpaper/rock_1.png Binary files differdiff --git a/wallpaper/rocky_beach_1.png b/wallpaper/rocky_beach_1.png new file mode 100755 index 0000000..bb72f2a --- /dev/null +++ b/wallpaper/rocky_beach_1.png Binary files differdiff --git a/wallpaper/waterfall_1.png b/wallpaper/waterfall_1.png new file mode 100755 index 0000000..d681b69 --- /dev/null +++ b/wallpaper/waterfall_1.png Binary files differ |