From 97fef158db8ae3e67f8765978fad7b2b216c672f Mon Sep 17 00:00:00 2001 From: Shubham Saini <shubham6405@gmail.com> Date: Tue, 24 Mar 2020 19:03:38 +0530 Subject: mihn --- arch.png | Bin 947311 -> 881349 bytes bspwm/.config/bspwm/bspwmrc | 1 - polybar/.config/polybar/cmus.sh | 20 ++++++++++++++++++++ polybar/.config/polybar/config | 31 +++++++++++++++---------------- sxhkd/.config/sxhkd/sxhkdrc | 8 ++++---- zsh/.zshrc | 2 +- 6 files changed, 40 insertions(+), 22 deletions(-) create mode 100755 polybar/.config/polybar/cmus.sh diff --git a/arch.png b/arch.png index 076e1ab..8d4e805 100644 Binary files a/arch.png and b/arch.png differ diff --git a/bspwm/.config/bspwm/bspwmrc b/bspwm/.config/bspwm/bspwmrc index 3ee2105..1d30e20 100755 --- a/bspwm/.config/bspwm/bspwmrc +++ b/bspwm/.config/bspwm/bspwmrc @@ -3,7 +3,6 @@ sxhkd & dunst & unclutter & -xss-lock -- /home/fd0e/.local/bin/lock & compton & ~/scrypts/bat_check.sh & redshift -l 13.082680:80.270718 & diff --git a/polybar/.config/polybar/cmus.sh b/polybar/.config/polybar/cmus.sh new file mode 100755 index 0000000..7917d4c --- /dev/null +++ b/polybar/.config/polybar/cmus.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +prepend_zero () { + seq -f "%02g" $1 $1 +} + +artist=$(echo -n $(cmus-remote -C status | grep "tag artist" | cut -c 12-)) + +if [[ $artist = *[!\ ]* ]]; then + song=$(echo -n $(cmus-remote -C status | grep title | cut -c 11-)) + position=$(cmus-remote -C status | grep position | cut -c 10-) + minutes1=$(prepend_zero $(($position / 60))) + seconds1=$(prepend_zero $(($position % 60))) + duration=$(cmus-remote -C status | grep duration | cut -c 10-) + minutes2=$(prepend_zero $(($duration / 60))) + seconds2=$(prepend_zero $(($duration % 60))) + echo -n "$artist - $song [$minutes1:$seconds1/$minutes2:$seconds2]" +else + echo +fi diff --git a/polybar/.config/polybar/config b/polybar/.config/polybar/config index fa869f3..1e91738 100644 --- a/polybar/.config/polybar/config +++ b/polybar/.config/polybar/config @@ -34,7 +34,7 @@ module-margin-right = 1.5 font-0 = Hermit:style=medium:size=9;1 modules-left = alsa battery date time bspwm modules-center = -;modules-right = spotify mpd +modules-right = cmus tray-position = right cursor-click = pointer cursor-scroll = ns-resize @@ -143,21 +143,20 @@ format = <label> format-foreground = #7b8c58 exec = python ~/.config/polybar/spotify.py -f '{artist}: {song}' -;[module/cmus] -;type = custom/script -;exec = ~/.config/polybar/cmus.sh -;exec-if = pgrep -x cmus -;interval = 1 -;click-left = cmus-remote --next -;click-right = cmus-remote --prev -;click-middle = cmus-remote --pause -;scroll-up = cmus-remote --volume +5% -;scroll-down = cmus-remote --volume -5% -;format = <label> -;format-prefix = " " -;format-foreground = #7b8c58 -;label = %output% -;label-maxlen = 50 +[module/cmus] +type = custom/script +exec = ~/.config/polybar/cmus.sh +exec-if = pgrep -x cmus +interval = 1 +click-left = cmus-remote --next +click-right = cmus-remote --prev +click-middle = cmus-remote --pause +scroll-up = cmus-remote --volume +5% +scroll-down = cmus-remote --volume -5% +format = mus: <label> +format-foreground = #7b8c58 +label = %output% +label-maxlen = 50 [module/mpd] type = internal/mpd diff --git a/sxhkd/.config/sxhkd/sxhkdrc b/sxhkd/.config/sxhkd/sxhkdrc index 22fe28e..fb3fc0e 100644 --- a/sxhkd/.config/sxhkd/sxhkdrc +++ b/sxhkd/.config/sxhkd/sxhkdrc @@ -14,10 +14,10 @@ super + i ~/.config/rofi/rofi-wifi.sh # cmus (I don't know why mpDris is not supported. Got it musl problem lol) -#super + {u,n} -# cmus-remote {-p,-n} -#super + shift + {u,n} -# cmus-remote {-u,-r} +super + {u,n} + cmus-remote {-p,-n} +super + shift + {u,n} + cmus-remote {-u,-r} # make sxhkd reload its configuration files: diff --git a/zsh/.zshrc b/zsh/.zshrc index 2dd7790..d80aa6f 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -112,7 +112,7 @@ alias py2="/bin/python2" alias pg="ping google.com" alias pubip="curl ipinfo.io/ip" alias k="pkill " -alias m="ncmpcpp" +alias m="cmus" alias vimrc="vim $HOME/.config/nvim/init.vim" alias poly="vim $HOME/.config/polybar/config" alias v="/usr/bin/nvim" -- cgit v1.2.3