From 5d56266be4a16de6991f3f7c70dd9bad53983b53 Mon Sep 17 00:00:00 2001 From: Enrico Fasoli Date: Wed, 26 Aug 2015 10:42:05 +0000 Subject: [PATCH] fixed media keys, added mpd to lemonbar.. --- config.nix | 3 +++ configuration.nix | 2 +- install | 1 + lemonbar.sh | 18 +++++++++++------- sxhkdrc | 35 +++++++++++++++++++---------------- 5 files changed, 35 insertions(+), 24 deletions(-) create mode 100644 config.nix diff --git a/config.nix b/config.nix new file mode 100644 index 0000000..1dd1750 --- /dev/null +++ b/config.nix @@ -0,0 +1,3 @@ +{ + allowUnfree = true; +} diff --git a/configuration.nix b/configuration.nix index aaa710e..4e26bb3 100644 --- a/configuration.nix +++ b/configuration.nix @@ -36,7 +36,7 @@ # Development atom git # Desktop and appliations - sxhkd tmux htop ranger w3m rxvt_unicode chromium dmenu gnupg irssi bar + sxhkd tmux htop ranger w3m rxvt_unicode chromium dmenu gnupg irssi bar bc # Games minecraft # Media diff --git a/install b/install index 577f77a..d4cf81f 100755 --- a/install +++ b/install @@ -6,6 +6,7 @@ echo "Installing dotfiles" sudo cp configuration.nix /etc/nixos/ echo "Activating NixOS configuration" sudo nixos-rebuild switch +cp config.nix ~/.nixpkgs/ # Custom Binaries diff --git a/lemonbar.sh b/lemonbar.sh index 625b3ca..7073c74 100755 --- a/lemonbar.sh +++ b/lemonbar.sh @@ -1,25 +1,29 @@ buildClock() { - echo -n $(date "+%A, %e %B, %k:%M:%S") + echo -n $(date "+%A, %e %B, %k:%M:%S") } getVolume() { - echo -n "|Vol| $(amixer get Master | sed -n 's/^.*\[\([0-9]\+\)%.*$/\1/p' | uniq)%%" + echo -n "$(amixer get Master | sed -n 's/^.*\[\([0-9]\+\)%.*$/\1/p' | uniq)%%" } -getRAM(){ - echo -n "free -m | awk 'NR == 2 {gsub(/%/,''); print }'" +getMPD(){ + echo -n "♫ " + if [ "$(mpc | wc -l)" -gt 1 ]; then + echo -n "$(mpc | cut -d$'\n' -f1) | $(mpc | cut -d$'\n' -f2)" + fi } -getCPU(){ - echo -n "grep 'cpu ' /proc/stat | awk '{usage=(+)*100/(++)} END {print usage}'" +getNET(){ + echo -n "$(curl -s http://canihazip.com/s)" } buildBar () { while true do - echo "$(getVolume)%{c}$(buildClock)%{r}|IP| $(curl -s http://canihazip.com/s)" + echo "$(getVolume) $(getMPD) %{c}$(buildClock)%{r}$(getNET)" sleep 1 done } buildBar | lemonbar -p -g "1872x20+24+8" -B "#181b20" -F "#9b9081" -f -gohu-gohufont-medium-r-normal--14-100-100-100-c-80-iso10646-1 + diff --git a/sxhkdrc b/sxhkdrc index 5da8cbd..9875559 100755 --- a/sxhkdrc +++ b/sxhkdrc @@ -4,7 +4,7 @@ super + alt + Escape for id in $(bspc query -W); do bspc window $id -c; done; \ - bspc quit && shutdown + bspc quit super + w bspc window -c @@ -88,23 +88,26 @@ super + space #super + Escape # pkill -USR1 -x sxhkd -# -# my stuff -# - -# volume controls -F9 - amixer set Master 3- unmute -F10 +# media +XF86AudioRaiseVolume amixer set Master 3+ unmute -F11 - amixer set Master 0 +XF86AudioLowerVolume + amixer set Master 3- unmute +XF86AudioMute + amixer set Master mute +XF86AudioPlay + amixer set Master unmute +XF86HomePage + chromium +XF86Calculator + urxvt -e bc +XF86Mail + chromium --app=https://inbox.google.com -# turn screen off -F12 - lock; sleep 2; xset dpms force off -alt + F12 - lock +# lock + +XF86Sleep + lock # screenshots Print