diff options
-rw-r--r-- | .bashrc | 3 | ||||
-rw-r--r-- | .config/bat/config | 2 | ||||
-rw-r--r-- | .zshrc | 4 | ||||
-rwxr-xr-x | acpid/handler.sh | 102 | ||||
-rw-r--r-- | irssi/solarized-powerline.theme | 10 | ||||
-rw-r--r-- | makefilec | 8 | ||||
-rw-r--r-- | makefilecpp | 8 |
7 files changed, 121 insertions, 16 deletions
@@ -34,7 +34,8 @@ export LESS_TERMCAP_mb=$'\e[01;31m' # begin blinking export LESS_TERMCAP_md=$'\e[01;38;5;74m' # begin bold export LESS_TERMCAP_me=$'\e[0m' # end mode export LESS_TERMCAP_se=$'\e[0m' # end standout-mode -export LESS_TERMCAP_so=$'\e[38;5;246m' # begin standout-mode - info box +# export LESS_TERMCAP_so=$'\e[38;5;246m' # begin standout-mode - info box +export LESS_TERMCAP_so=$'\e[1;92m' # begin standout-mode - info box export LESS_TERMCAP_ue=$'\e[0m' # end underline export LESS_TERMCAP_us=$'\e[04;38;5;146m' # begin underline diff --git a/.config/bat/config b/.config/bat/config index e96057d..3334823 100644 --- a/.config/bat/config +++ b/.config/bat/config @@ -24,4 +24,4 @@ --map-syntax "*.ino:C++" --map-syntax ".ignore:Git Ignore" ---style=auto +--style="numbers,changes,header,rule,grid,snip" @@ -651,7 +651,9 @@ export LESS_TERMCAP_mb=$'\e[01;31m' # begin blinking export LESS_TERMCAP_md=$'\e[01;38;5;74m' # begin bold export LESS_TERMCAP_me=$'\e[0m' # end mode export LESS_TERMCAP_se=$'\e[0m' # end standout-mode -export LESS_TERMCAP_so=$'\e[38;5;246m' # begin standout-mode - info box +# export LESS_TERMCAP_so=$'\e[38;5;246m' # begin standout-mode - info box +# export LESS_TERMCAP_so=$'\e[1;92m' # begin standout-mode - info box +export LESS_TERMCAP_so=$'\x1b[38;5;22m' export LESS_TERMCAP_ue=$'\e[0m' # end underline export LESS_TERMCAP_us=$'\e[04;38;5;146m' # begin underline # handle the format of the zsh built-in time diff --git a/acpid/handler.sh b/acpid/handler.sh new file mode 100755 index 0000000..6a66e1d --- /dev/null +++ b/acpid/handler.sh @@ -0,0 +1,102 @@ +#!/bin/sh +# Default acpi script that takes an entry for all actions + +# NOTE: This is a 2.6-centric script. If you use 2.4.x, you'll have to +# modify it to not use /sys + +# $1 should be + or - to step up or down the brightness. +step_backlight() { + for backlight in /sys/class/backlight/*/; do + [ -d "$backlight" ] || continue + step=$(( $(cat "$backlight/max_brightness") / 20 )) + [ "$step" -gt "1" ] || step=1 #fallback if gradation is too low + printf '%s' "$(( $(cat "$backlight/brightness") $1 step ))" >"$backlight/brightness" + done +} + +minspeed=$(cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq) +maxspeed=$(cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq) +setspeed="/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed" + + +case "$1" in + button/power) + case "$2" in + PBTN|PWRF) + logger "PowerButton pressed: $2, shutting down..." + shutdown -P now + ;; + *) logger "button/power ACPI action undefined: $2" ;; + esac + ;; + button/sleep) + case "$2" in + SBTN|SLPB) + # suspend-to-ram + logger "Sleep Button pressed: $2, suspending..." + zzz + ;; + *) logger "button/sleep ACPI action undefined: $2" ;; + esac + ;; + ac_adapter) + case "$2" in + AC|ACAD|ADP0) + case "$4" in + 00000000) + printf '%s' "$minspeed" >"$setspeed" + #/etc/laptop-mode/laptop-mode start + ;; + 00000001) + printf '%s' "$maxspeed" >"$setspeed" + #/etc/laptop-mode/laptop-mode stop + ;; + esac + ;; + *) logger "ac_adapter ACPI action undefined: $2" ;; + esac + ;; + battery) + case "$2" in + BAT0) + case "$4" in + 00000000) #echo "offline" >/dev/tty5 + ;; + 00000001) #echo "online" >/dev/tty5 + ;; + esac + ;; + CPU0) + ;; + PNP0C0A*) + : + ;; + *) logger "battery ACPI action undefined: $2" ;; + esac + ;; + button/lid) + case "$3" in + close) + # suspend-to-ram + logger "LID closed, suspending..." + zzz + ;; + open) + logger "LID opened" + ;; + *) logger "button/lid ACPI action undefined (LID): $2";; + esac + ;; + video/brightnessdown) + step_backlight - + ;; + video/brightnessup) + step_backlight + + ;; + processor) + : + ;; + *) + logger "ACPI group/action undefined: $1 / $2" + ;; +esac diff --git a/irssi/solarized-powerline.theme b/irssi/solarized-powerline.theme index c079bac..eeb89da 100644 --- a/irssi/solarized-powerline.theme +++ b/irssi/solarized-powerline.theme @@ -135,7 +135,7 @@ abstracts = { # ban/ban exception/invite list mask is printed # %R = brightred (Solarized: orange) # %n = return - ban = "%zff5f00$*%n"; + ban = "%zff5f00$*%0%Zff5f00%n"; ## @@ -419,8 +419,8 @@ formats = { }; "fe-common/irc" = { away = "%k%z00d700AWAY %Z00d700%0%N"; - banlist = "%p%z00d700BANS %z00d700 $[-3]0 %8 {ichannelhilight $1} %N%8%n%k%N {ban $2}"; - banlist_long = "%p%z00d700BANS %z00d700 $[-3]0 %8 {ichannelhilight $1} {comment by {inick $3}%0%k, $4 secs ago} %N%8%n%k%N {ban $2}"; + banlist = "%k%z005f00BANS %z005f00 $[-3]0 %8 %z005f00{ichannelhilight $1} %k%N {ban $2}"; + banlist_long = "%k%z005f00BANS %z005f00 $[-3]0 %8 %z005f00{ichannelhilight $1} {comment by {inick $3}%0%k,%Z005f00 $4 secs ago} %N {ban $2}"; chanmode_change = "%k%z008700MODE %N%Z008700%N {channelhilight $0} %Zeeeeee%n {mode $1}%n by {nick $2}"; channel_created = "%k%N Channel {channelhilight $0} created $1"; channel_mode = "%k%N mode/{channelhilight $0} {mode $1}"; @@ -431,8 +431,8 @@ formats = { ctcp_requested = "%k%z005f87%8%8 CTCP {hilight $2} from {mynick $4} %n%Z005f87%N by {hilight $0} {comment $1} %y%N $3"; default_event = "%N%k %N%n$1"; default_event_server = "%k%z00d700$0 %N%k %N%n$1"; - ebanlist = "%p%z00d700BANS %k exception %8 {ichannelhilight $0} %N%8%n%k%N {ban $1}"; - ebanlist_long = "%p%z00d700BANS %k exception %8 {ichannelhilight $0} {comment by {inick $2}%0%k, $3 secs ago} %N%8%n%k%N {ban $1}"; + ebanlist = "%k%z005f00BANS %k exception %8 %z005f00{ichannelhilight $0} %N {ban $1}"; + ebanlist_long = "%k%z005f00BANS %k exception %8 {ichannelhilight $0} %z005f00{comment by {inick $2}%0%k, $3 secs ago} %N {ban $1}"; end_of_who = "%z00d700%kWHO %Z00d700%0%N END"; end_of_whois = "%z00d700%kWHOIS %Z00d700%0%N END"; end_of_whowas = "%z00d700%kWHOWAS %Z00d700%0%N END"; @@ -178,22 +178,22 @@ $(TARGET).adbg: $(OBJ_DBG_LIST) ar rcs $(TARGET).adbg $(OBJ_DBG_LIST) runcov: $(TARGET)-cov - $(TARGET)-cov + "./$(TARGET)-cov" test: $(TARGET) - $(TARGET) + "./$(TARGET)" run: $(TARGET) "./$(TARGET)" valgrind: $(TARGET) - - valgrind --track-origins=yes --leak-check=full --show-leak-kinds=all $(TARGET) + - valgrind --track-origins=yes --leak-check=full --show-leak-kinds=all "./$(TARGET)" cppcheck: cppcheck $(SRCS) rundbg: $(TARGET)-dbg - gdb --batch --command=./debug.dbg --args $(TARGET)-dbg + gdb --batch --command=./debug.dbg --args "./$(TARGET)-dbg" format: - clang-format -i $(SRCS) $(HDRS) diff --git a/makefilecpp b/makefilecpp index d5e9dc0..82f045c 100644 --- a/makefilecpp +++ b/makefilecpp @@ -183,22 +183,22 @@ $(TARGET).adbg: $(OBJ_DBG_LIST) ar rcs $(TARGET).adbg $(OBJ_DBG_LIST) runcov: $(TARGET)-cov - $(TARGET)-cov + "./$(TARGET)-cov" test: $(TARGET) - $(TARGET) + "./$(TARGET)" run: $(TARGET) "./$(TARGET)" valgrind: $(TARGET) - - valgrind --track-origins=yes --leak-check=full --show-leak-kinds=all $(TARGET) + - valgrind --track-origins=yes --leak-check=full --show-leak-kinds=all "./$(TARGET)" cppcheck: cppcheck $(SRCS) rundbg: $(TARGET)-dbg - gdb --batch --command=./debug.dbg --args $(TARGET)-dbg + gdb --batch --command=./debug.dbg --args "./$(TARGET)-dbg" format: - clang-format -i $(SRCS) $(HDRS) |