From 978482a94c723ee48e42e8ad72eca42590d4e8f1 Mon Sep 17 00:00:00 2001 From: TuDatTr Date: Wed, 29 Jan 2020 23:12:54 +0100 Subject: [PATCH] Added some vim-go funcs and added a little sound utility script --- config/.config/i3/config | 6 +++--- config/.local/share/ranger/bookmarks | 4 ++-- config/.scripts/sound.sh | 24 ++++++++++++++++++++++++ vim/.vim/ftplugin/go.vim | 17 +++++++++-------- vim/.vim/ftplugin/markdown.vim | 2 -- 5 files changed, 38 insertions(+), 15 deletions(-) create mode 100755 config/.scripts/sound.sh diff --git a/config/.config/i3/config b/config/.config/i3/config index 1f98cd9..e9815d0 100644 --- a/config/.config/i3/config +++ b/config/.config/i3/config @@ -133,9 +133,9 @@ bindsym XF86MonBrightnessUp exec "xbacklight -inc 10; a=$(xbacklight | cut -d\. bindsym XF86MonBrightnessDown exec "xbacklight -dec 10; a=$(xbacklight | cut -d\. -f1)%; dunstify -r 1 'brightness down'\ \($a\)" # Pulse Audio controls -bindsym XF86AudioLowerVolume exec --no-startup-id "pactl set-sink-volume $(pactl info | grep 'Default Sink' | cut -d' ' -f3) -5%; b=$(amixer sget Master | grep -o \[0-9\]\\+% -m 1); dunstify -r 2 'sound down'\ \($b\)" -bindsym XF86AudioRaiseVolume exec --no-startup-id "pactl set-sink-volume $(pactl info | grep 'Default Sink' | cut -d' ' -f3) +5%; b=$(amixer sget Master | grep -o \[0-9\]\\+% -m 1); dunstify -r 2 'sound up'\ \($b\)" -bindsym XF86AudioMute exec --no-startup-id "pactl set-sink-mute $(pactl info | grep 'Default Sink' | cut -d' ' -f3) toggle; dunstify -r 2 'sound muted'" +bindsym XF86AudioLowerVolume exec --no-startup-id ~/.scripts/sound.sh down +bindsym XF86AudioRaiseVolume exec --no-startup-id ~/.scripts/sound.sh up +bindsym XF86AudioMute exec --no-startup-id ~/.scripts/sound.sh toggle bindsym XF86AudioPlay exec "playerctl play-pause; cmus-remote -u" bindsym XF86AudioStop exec "playerctl stop; cmus-remote -s" bindsym XF86AudioNext exec "playerctl next; cmus-remote -n" diff --git a/config/.local/share/ranger/bookmarks b/config/.local/share/ranger/bookmarks index 7f26635..db480d4 100644 --- a/config/.local/share/ranger/bookmarks +++ b/config/.local/share/ranger/bookmarks @@ -7,6 +7,6 @@ l:/home/tuan/Local c:/home/tuan/Documents/CTF/picoCTF t:/home/tuan/Templates w:/home/tuan/workspace_l/Projects -k:/home/tuan/Documents/Fachschaft/Berufungskomission +k:/home/tuan/Documents/Protokolle/FSE q:/home/tuan/.nextcloud/Quick Drop -':/home/tuan +':/home/tuan/.scripts diff --git a/config/.scripts/sound.sh b/config/.scripts/sound.sh new file mode 100755 index 0000000..1f4e724 --- /dev/null +++ b/config/.scripts/sound.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +defaultsink=$(pactl info | grep 'Default Sink' | cut -d' ' -f3); +curVolume=$(amixer get Master | grep -o \[0-9\]\\+% -m 1); + +case $1 in + "up"*) + pactl set-sink-volume $defaultsink +5%; + dunstify -r 2 'sound up'\ \($curVolume\); + ;; + "down"*) + pactl set-sink-volume $defaultsink -5%; + dunstify -r 2 'sound up'\ \($curVolume\); + ;; + "toggle"*) + msg='muted'; + if amixer get Master | grep -q off; then + msg='unmuted'; + fi + pactl set-sink-mute $defaultsink toggle; + dunstify -r 2 'sound'\ $msg; + echo $msg + ;; +esac diff --git a/vim/.vim/ftplugin/go.vim b/vim/.vim/ftplugin/go.vim index 152825e..ccb5970 100644 --- a/vim/.vim/ftplugin/go.vim +++ b/vim/.vim/ftplugin/go.vim @@ -1,18 +1,19 @@ " Basics set autoindent noexpandtab tabstop=4 shiftwidth=4 " Shortcuts -imap ;main package mainimport ("fmt")func main() {}O " Compiling -map :GoImport -map :!clear:GoRun -map :!clear:GoBuild -map :!clear:GoTest -map :!clear:GoTestFunc -map :!clear:GoDebugStart +nnoremap :GoFmt +nnoremap :!clear:GoRun +nnoremap :!clear:GoBuild +nnoremap :!clear:GoTest +nnoremap :!clear:GoTestFunc +nnoremap :!clear:GoDebugStart nnoremap gd :GoDef nnoremap :GoDoc - map :!clear; GOOS=windows GOARCH=386 go build -o %<.exe % + +abbrev funct funcTest(t*testing.T){}kwwi +abbrev trun t.Run("", func(t *testing.T){})%la diff --git a/vim/.vim/ftplugin/markdown.vim b/vim/.vim/ftplugin/markdown.vim index 429cdd0..2a6e12f 100644 --- a/vim/.vim/ftplugin/markdown.vim +++ b/vim/.vim/ftplugin/markdown.vim @@ -1,8 +1,6 @@ " setlocal spell spelllang=de_de " set nospell - - " Begin Shortcuts " Compilation