From 68f8e15b94f79d39d987f1aa7f1d5b94985c4457 Mon Sep 17 00:00:00 2001 From: Felix Steghofer Date: Mon, 16 Jul 2018 21:33:50 +0200 Subject: [PATCH] cleanup --- .config/i3/config | 2 +- .config/polybar/battery-combined-udev.sh | 84 ------------------------ .zshrc | 8 +-- bin/i3-shutdown.py | 17 ----- 4 files changed, 5 insertions(+), 106 deletions(-) delete mode 100755 .config/polybar/battery-combined-udev.sh delete mode 100755 bin/i3-shutdown.py diff --git a/.config/i3/config b/.config/i3/config index 345e305..65c8b4d 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -238,7 +238,7 @@ bindsym XF86MonBrightnessUp exec xbacklight -inc 20 # increase screen brightness bindsym XF86MonBrightnessDown exec xbacklight -dec 20 # decrease screen brightness # Touchpad controls -bindsym XF86Tools exec /home/felix/scripts/toggleTouchpad.sh # toggle touchpad +bindsym XF86Tools exec $HOME/scripts/toggleTouchpad.sh # toggle touchpad # Media player controls bindsym XF86AudioPlay exec playerctl play diff --git a/.config/polybar/battery-combined-udev.sh b/.config/polybar/battery-combined-udev.sh deleted file mode 100755 index aeed061..0000000 --- a/.config/polybar/battery-combined-udev.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/bin/sh - -battery_print() { - path_ac="/sys/class/power_supply/AC" - path_battery_0="/sys/class/power_supply/BAT0" - path_battery_1="/sys/class/power_supply/BAT1" - - ac=0 - battery_level_0=0 - battery_level_1=0 - battery_max_0=0 - battery_max_1=0 - - if [ -f "$path_ac/online" ]; then - ac=$(cat "$path_ac/online") - fi - - if [ -f "$path_battery_0/energy_now" ]; then - battery_level_0=$(cat "$path_battery_0/energy_now") - fi - - if [ -f "$path_battery_0/energy_full" ]; then - battery_max_0=$(cat "$path_battery_0/energy_full") - fi - - if [ -f "$path_battery_1/energy_now" ]; then - battery_level_1=$(cat "$path_battery_1/energy_now") - fi - - if [ -f "$path_battery_1/energy_full" ]; then - battery_max_1=$(cat "$path_battery_1/energy_full") - fi - - battery_level=$(("$battery_level_0 + $battery_level_1")) - battery_max=$(("$battery_max_0 + $battery_max_1")) - - battery_percent=$(("$battery_level * 100")) - battery_percent=$(("$battery_percent / $battery_max")) - - if [ "$ac" -eq 1 ]; then - icon="#1" - - if [ "$battery_percent" -gt 97 ]; then - echo "$icon" - else - echo "$icon $battery_percent %" - fi - else - if [ "$battery_percent" -gt 85 ]; then - icon="#21" - elif [ "$battery_percent" -gt 60 ]; then - icon="#22" - elif [ "$battery_percent" -gt 35 ]; then - icon="#23" - elif [ "$battery_percent" -gt 10 ]; then - icon="#24" - else - icon="#25" - fi - - echo "$icon $battery_percent %" - fi -} - -case "$1" in - --update) - pid=$(pgrep -xf "/bin/sh /home/felix/.config/polybar/battery-combined-udev.sh") - - if [ "$pid" != "" ]; then - kill -10 "$pid" - fi - ;; - *) - trap exit INT - trap "echo" USR1 - - while true; do - battery_print - - sleep 30 & - wait - done - ;; -esac diff --git a/.zshrc b/.zshrc index 01d587c..0b7996c 100644 --- a/.zshrc +++ b/.zshrc @@ -1,5 +1,5 @@ ##### ENVIRONMENT -export PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/home/felix/bin:/opt/android-sdk/platform-tools:/opt/android-sdk/tools:/home/felix/.gem/ruby/2.3.0/bin:/usr/bin/core_perl/:/home/felix/.mos/bin/:/home/felix/.gem/ruby/2.5.0/bin +export PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/home/felix/bin:/opt/android-sdk/platform-tools:/opt/android-sdk/tools export LANG=en_US.UTF-8 export EDITOR='code' @@ -20,7 +20,7 @@ export BROWSER='google-chrome-unstable' export LESS=XFRaeiM # the XFR is important here: don't mess with the terminal!export LESS=-cex3M export HELPDIR=/usr/local/lib/zsh/help -# jetzt ist / Wortseperator, also path/file strg w loescht nur noch bis zum /, nicht mehr den gesamten pfad. +# / is now word separator WORDCHARS=${WORDCHARS//[&=\/;!#%]_/} bindkey -e #emacs navi @@ -37,7 +37,7 @@ setopt HIST_REDUCE_BLANKS setopt HIST_IGNORE_SPACE setopt SH_WORD_SPLIT setopt nohup -setopt NO_CASE_GLOB # Globbing ist nicht mehr casesensitive +setopt NO_CASE_GLOB # globbing is not case sensitive setopt ZLE setopt kshglob @@ -58,7 +58,7 @@ setopt MARK_DIRS # adds slash to end of completed dirs setopt NUMERIC_GLOB_SORT # sort numerically first, before alpha setopt PROMPT_SUBST # sub values in prompt (though it seems to work anyway haha) #setopt SHARE_HISTORY # share history between open shells -# Don't overwrite, append! +# Don't overwrite, append setopt APPEND_HISTORY # Write after each command diff --git a/bin/i3-shutdown.py b/bin/i3-shutdown.py deleted file mode 100755 index 5717d3b..0000000 --- a/bin/i3-shutdown.py +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env python3 - -import i3ipc -import subprocess - -def on_shutdown(conn=None): - for ws in range(1, 4): - file = open('/home/felix/.config/i3/workspace_' + str(ws) + '.json', 'w') - bashCommand = 'i3-save-tree --workspace ' + str(ws) - subprocess.Popen(bashCommand.split(), stdout=file) - -on_shutdown() -conn = i3ipc.Connection() - -conn.on('ipc_shutdown', on_shutdown) - -conn.main()