From da0ac3cd975320179abd7cea1ebad77024170ea3 Mon Sep 17 00:00:00 2001 From: olari Date: Tue, 31 Jul 2018 21:30:28 +0300 Subject: [PATCH] Add scripts --- .bashrc | 3 +++ .config/i3/config | 20 ++++++++------------ .config/pulse/client.conf | 1 - .vimrc | 1 + scripts/audio.sh | 19 +++++++++++++++++++ scripts/backlight.sh | 22 ++++++++++++++++++++++ scripts/daemons.sh | 9 +++++++++ scripts/music.sh | 16 ++++++++++++++++ 8 files changed, 78 insertions(+), 13 deletions(-) delete mode 100644 .config/pulse/client.conf create mode 100755 scripts/audio.sh create mode 100755 scripts/backlight.sh create mode 100755 scripts/daemons.sh create mode 100755 scripts/music.sh diff --git a/.bashrc b/.bashrc index c7bdfe9..3acaae1 100644 --- a/.bashrc +++ b/.bashrc @@ -9,4 +9,7 @@ alias ls='ls --color=auto' alias diff='diff --color=auto' alias grep='grep --color=auto' +alias installed_packages='comm -23 <(pacman -Qeq | sort) <(pacman -Qgq base base-devel | sort)' +alias unused_packages='pacman -Qtdq' + PS1='\u@\h:\w \$ ' diff --git a/.config/i3/config b/.config/i3/config index b97ea28..4034781 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -1,11 +1,7 @@ set $mod Mod4 font pango:DejaVu Sans Mono 9 -exec_always [[ ! $(pidof compton) ]] && compton -exec_always [[ ! $(pidof unclutter) ]] && unclutter -exec_always [[ ! $(pidof mpd) ]] && mpd -exec_always [[ ! $(pidof transmission-daemon) ]] && transmission_daemon -exec_always [[ ! $(pidof nm-applet) ]] && nm-applet +exec_always ~/scripts/daemons.sh exec_always xrdb ~/.xresources exec_always feh --bg-fill --no-fehbg ~/wallpapers/current @@ -13,11 +9,11 @@ exec_always feh --bg-fill --no-fehbg ~/wallpapers/current gaps inner 10 default_border pixel 1 -bindsym XF86MonBrightnessDown exec xbacklight -dec 5 -bindsym XF86MonBrightnessUp exec xbacklight -inc 5 -bindsym XF86AudioMute exec pactl set-sink-mute 0 toggle -bindsym XF86AudioLowerVolume exec pactl set-sink-volume 0 -5% && pkill -RTMIN+1 i3blocks -bindsym XF86AudioRaiseVolume exec pactl set-sink-volume 0 +5% && pkill -RTMIN+1 i3blocks +bindsym XF86MonBrightnessUp exec ~/scripts/backlight.sh raise +bindsym XF86MonBrightnessDown exec ~/scripts/backlight.sh lower +bindsym XF86AudioRaiseVolume exec ~/scripts/audio.sh raise +bindsym XF86AudioLowerVolume exec ~/scripts/audio.sh lower +bindsym XF86AudioMute exec ~/scripts/audio.sh toggle_mute bindsym $mod+Shift+r restart bindsym $mod+Shift+q kill @@ -32,8 +28,8 @@ bindsym $mod+m exec urxvt -e ncmpcpp bindsym $mod+t exec urxvt -e tremc bindsym $mod+c exec urxvt -e python -q -bindsym $mod+Shift+p exec mpc toggle -bindsym $mod+Shift+n exec mpc next && pkill -RTMIN+2 i3blocks +bindsym $mod+Shift+p exec ~/scripts/music.sh toggle +bindsym $mod+Shift+n exec ~/scripts/music.sh next bindsym $mod+h focus left bindsym $mod+j focus down diff --git a/.config/pulse/client.conf b/.config/pulse/client.conf deleted file mode 100644 index 722396d..0000000 --- a/.config/pulse/client.conf +++ /dev/null @@ -1 +0,0 @@ -auth-cookie = ~/.config/pulse/esd-auth-cookie diff --git a/.vimrc b/.vimrc index 375d749..e1f8465 100644 --- a/.vimrc +++ b/.vimrc @@ -3,3 +3,4 @@ set number set tabstop=4 set autoindent set viminfo= +let g:netrw_dirhistmax = 0 diff --git a/scripts/audio.sh b/scripts/audio.sh new file mode 100755 index 0000000..4d73e55 --- /dev/null +++ b/scripts/audio.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +case $1 in +"raise") + pactl set-sink-volume 0 +5% + notify-send $(pamixer --get-volume) + pkill -RTMIN+1 i3blocks +;; +"lower") + pactl set-sink-volume 0 -5% + notify-send $(pamixer --get-volume) + pkill -RTMIN+1 i3blocks +;; +"toggle_mute") + pactl set-sink-mute 0 toggle + notify-send $(pamixer --get-mute) +;; +esac + diff --git a/scripts/backlight.sh b/scripts/backlight.sh new file mode 100755 index 0000000..24106d0 --- /dev/null +++ b/scripts/backlight.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +backlight_float=$(xbacklight -get) +current_backlight=${backlight_float%%.*} + +case $1 in +"raise") + (( current_backlight += 5 )) + [[ $current_backlight -gt 100 ]] && current_backlight=100 + + xbacklight -set $current_backlight + notify-send $current_backlight +;; +"lower") + (( current_backlight -= 5 )) + [[ $current_backlight -lt 5 ]] && current_backlight=1 + + xbacklight -set $current_backlight + notify-send $current_backlight +;; +esac + diff --git a/scripts/daemons.sh b/scripts/daemons.sh new file mode 100755 index 0000000..bddbddb --- /dev/null +++ b/scripts/daemons.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +[[ ! $(pidof compton) ]] && compton +[[ ! $(pidof unclutter) ]] && unclutter +[[ ! $(pidof mpd) ]] && mpd +[[ ! $(pidof transmission-daemon) ]] && transmission-daemon +[[ ! $(pidof dunst) ]] && dunst +[[ ! $(pidof nm-applet) ]] && nm-applet + diff --git a/scripts/music.sh b/scripts/music.sh new file mode 100755 index 0000000..9af85c1 --- /dev/null +++ b/scripts/music.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +case $1 in +"toggle") + mpc toggle +;; +"next") + mpc next + pkill -RTMIN+2 i3blocks +;; +"prev") + mpc prev + pkill -RTMIN+2 i3blocks +;; +esac +