Add scripts

This commit is contained in:
olari
2018-07-31 21:30:28 +03:00
parent 031a4b54c1
commit da0ac3cd97
8 changed files with 78 additions and 13 deletions

View File

@@ -9,4 +9,7 @@ alias ls='ls --color=auto'
alias diff='diff --color=auto' alias diff='diff --color=auto'
alias grep='grep --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 \$ ' PS1='\u@\h:\w \$ '

View File

@@ -1,11 +1,7 @@
set $mod Mod4 set $mod Mod4
font pango:DejaVu Sans Mono 9 font pango:DejaVu Sans Mono 9
exec_always [[ ! $(pidof compton) ]] && compton exec_always ~/scripts/daemons.sh
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 xrdb ~/.xresources exec_always xrdb ~/.xresources
exec_always feh --bg-fill --no-fehbg ~/wallpapers/current 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 gaps inner 10
default_border pixel 1 default_border pixel 1
bindsym XF86MonBrightnessDown exec xbacklight -dec 5 bindsym XF86MonBrightnessUp exec ~/scripts/backlight.sh raise
bindsym XF86MonBrightnessUp exec xbacklight -inc 5 bindsym XF86MonBrightnessDown exec ~/scripts/backlight.sh lower
bindsym XF86AudioMute exec pactl set-sink-mute 0 toggle bindsym XF86AudioRaiseVolume exec ~/scripts/audio.sh raise
bindsym XF86AudioLowerVolume exec pactl set-sink-volume 0 -5% && pkill -RTMIN+1 i3blocks bindsym XF86AudioLowerVolume exec ~/scripts/audio.sh lower
bindsym XF86AudioRaiseVolume exec pactl set-sink-volume 0 +5% && pkill -RTMIN+1 i3blocks bindsym XF86AudioMute exec ~/scripts/audio.sh toggle_mute
bindsym $mod+Shift+r restart bindsym $mod+Shift+r restart
bindsym $mod+Shift+q kill 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+t exec urxvt -e tremc
bindsym $mod+c exec urxvt -e python -q bindsym $mod+c exec urxvt -e python -q
bindsym $mod+Shift+p exec mpc toggle bindsym $mod+Shift+p exec ~/scripts/music.sh toggle
bindsym $mod+Shift+n exec mpc next && pkill -RTMIN+2 i3blocks bindsym $mod+Shift+n exec ~/scripts/music.sh next
bindsym $mod+h focus left bindsym $mod+h focus left
bindsym $mod+j focus down bindsym $mod+j focus down

View File

@@ -1 +0,0 @@
auth-cookie = ~/.config/pulse/esd-auth-cookie

1
.vimrc
View File

@@ -3,3 +3,4 @@ set number
set tabstop=4 set tabstop=4
set autoindent set autoindent
set viminfo= set viminfo=
let g:netrw_dirhistmax = 0

19
scripts/audio.sh Executable file
View File

@@ -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

22
scripts/backlight.sh Executable file
View File

@@ -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

9
scripts/daemons.sh Executable file
View File

@@ -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

16
scripts/music.sh Executable file
View File

@@ -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