fixed media keys, added mpd to lemonbar..

This commit is contained in:
Enrico Fasoli 2015-08-26 10:42:05 +00:00
parent 1bb873a7bd
commit 5d56266be4
5 changed files with 35 additions and 24 deletions

3
config.nix Normal file
View File

@ -0,0 +1,3 @@
{
allowUnfree = true;
}

View File

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

View File

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

View File

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

35
sxhkdrc
View File

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