From 59de189dda71d45ab2db5da23fbf7077798161aa Mon Sep 17 00:00:00 2001 From: TuDatTr Date: Thu, 30 Jan 2020 15:50:41 +0100 Subject: [PATCH] Added small screen brightness script instead of having code inside .config/i3/config Also added small func to generate a rndpassword --- config/.config/i3/config | 4 ++-- config/.local/share/ranger/bookmarks | 2 +- config/.scripts/screen.sh | 15 +++++++++++++++ zsh/.zshrc | 2 ++ 4 files changed, 20 insertions(+), 3 deletions(-) create mode 100755 config/.scripts/screen.sh diff --git a/config/.config/i3/config b/config/.config/i3/config index e9815d0..f55a43c 100644 --- a/config/.config/i3/config +++ b/config/.config/i3/config @@ -129,8 +129,8 @@ bindsym $mod+Shift+q kill bindsym $mod+d exec --no-startup-id rofi -X -show run # Screen brightness controls -bindsym XF86MonBrightnessUp exec "xbacklight -inc 10; a=$(xbacklight | cut -d\. -f1)%; dunstify -r 1 'brightness up'\ \($a\)" -bindsym XF86MonBrightnessDown exec "xbacklight -dec 10; a=$(xbacklight | cut -d\. -f1)%; dunstify -r 1 'brightness down'\ \($a\)" +bindsym XF86MonBrightnessUp exec --no-startup-id ~/.scripts/screen.sh up +bindsym XF86MonBrightnessDown exec --no-startup-id ~/.scripts/screen.sh down # Pulse Audio controls bindsym XF86AudioLowerVolume exec --no-startup-id ~/.scripts/sound.sh down diff --git a/config/.local/share/ranger/bookmarks b/config/.local/share/ranger/bookmarks index db480d4..9f6e7c4 100644 --- a/config/.local/share/ranger/bookmarks +++ b/config/.local/share/ranger/bookmarks @@ -9,4 +9,4 @@ t:/home/tuan/Templates w:/home/tuan/workspace_l/Projects k:/home/tuan/Documents/Protokolle/FSE q:/home/tuan/.nextcloud/Quick Drop -':/home/tuan/.scripts +':/home/tuan diff --git a/config/.scripts/screen.sh b/config/.scripts/screen.sh new file mode 100755 index 0000000..4cf4974 --- /dev/null +++ b/config/.scripts/screen.sh @@ -0,0 +1,15 @@ +#!/bin/sh + + +case $1 in + "up"*) + xbacklight -inc 10 & + currentBrightness=$(xbacklight | cut -d\. -f1); + dunstify -r 1 'brightness up'\ \($currentBrightness%\); + ;; + "down"*) + xbacklight -dec 10 & + currentBrightness=$(xbacklight | cut -d\. -f1); + dunstify -r 1 'brightness down'\ \($currentBrightness%\); + ;; +esac diff --git a/zsh/.zshrc b/zsh/.zshrc index 86fc05d..152c076 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -18,6 +18,8 @@ plugins=( history ) +randpw() { < /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-$1};echo;}; + # History HISTORY_IGNORE='sudo veracrypt *|veracrypt *'