dotfiles

<-- duh.
Log | Files | Refs | LICENSE

commit 4d280c96cc72c446b5220ceee208b54ef24befc5
parent 9414a0043740b0e43b568398ac8eef4df6ea0ae1
Author: Hayden Hamilton <hayden@haydenvh.com>
Date:   Mon, 23 Dec 2019 12:02:26 +0000

Forgot to include i3blocks

Diffstat:
A.scripts/i3blocks/bat | 17+++++++++++++++++
A.scripts/i3blocks/cal | 15+++++++++++++++
A.scripts/i3blocks/cpu | 13+++++++++++++
A.scripts/i3blocks/disk | 13+++++++++++++
A.scripts/i3blocks/disk2 | 13+++++++++++++
A.scripts/i3blocks/host | 6++++++
A.scripts/i3blocks/mem | 12++++++++++++
A.scripts/i3blocks/mpv | 51+++++++++++++++++++++++++++++++++++++++++++++++++++
A.scripts/i3blocks/net | 13+++++++++++++
A.scripts/i3blocks/news | 8++++++++
A.scripts/i3blocks/time | 4++++
A.scripts/i3blocks/time2 | 4++++
A.scripts/i3blocks/vol | 8++++++++
A.scripts/i3blocks/weather | 6++++++
A.scripts/i3blocks/weather2 | 5+++++
15 files changed, 188 insertions(+), 0 deletions(-)

diff --git a/.scripts/i3blocks/bat b/.scripts/i3blocks/bat @@ -0,0 +1,17 @@ +#!/bin/bash +# +# i3blocks/bat +# Created by Hayden Hamilton +# +# haydenvh.com +# Copyright (c) 2019 Hayden Hamilton. LICENSE:GPLv2 ../../.licenses/gplv2.license + +p=$(acpi | awk '/Battery/ {print $4}' | sed 's/,//g') +if [ "$p" == "0%" ] +then + echo "" > /dev/null +else + echo "< B $p" + echo + echo \#C625C8 +fi diff --git a/.scripts/i3blocks/cal b/.scripts/i3blocks/cal @@ -0,0 +1,15 @@ +#!/bin/bash + +get_cal() { + calcurse -D $HOME/.config/calcurse $1 | awk "/$2/" | wc -l +} +todo=$(get_cal -t) +if [ "$todo" == "0" ] +then + todo=$todo +else + todo=$(($todo-1)) +fi +echo "< CAL A:$(get_cal -a "*")/T:$todo" +echo +echo \#236B1B diff --git a/.scripts/i3blocks/cpu b/.scripts/i3blocks/cpu @@ -0,0 +1,13 @@ +#!/bin/bash +# +# i3blocks/cpu +# Created by Hayden Hamilton +# +# haydenvh.com +# Copyright (c) 2019 Hayden Hamilton. LICENSE:GPLv2 ../../.licenses/gplv2.license +# + +cpu=$(ps -e -o %cpu | awk '{s+=$1} END {print s}') +echo "< C $cpu%" +echo +echo \#7525C8 diff --git a/.scripts/i3blocks/disk b/.scripts/i3blocks/disk @@ -0,0 +1,13 @@ +#!/bin/bash +# +# i3blocks/disk +# Created by Hayden Hamilton +# +# haydenvh.com +# Copyright (c) 2019 Hayden Hamilton. LICENSE:GPLv2 ../../.licenses/gplv2.license +# + +sda1=$(df -h | awk '/sda1/ {print $3 "/" $4}') +echo "< SDA1 $sda1" +echo +echo \#0F9BF3 diff --git a/.scripts/i3blocks/disk2 b/.scripts/i3blocks/disk2 @@ -0,0 +1,13 @@ +#!/bin/bash +# +# i3blocks/disk +# Created by Hayden Hamilton +# +# haydenvh.com +# Copyright (c) 2019 Hayden Hamilton. LICENSE:GPL v2 ../../.licenses/gplv2.license +# + +sda2=$(df -h | awk '/sda2/ {print $3 "/" $4}') +echo "< SDA2 $sda2" +echo +echo \#3157B5 diff --git a/.scripts/i3blocks/host b/.scripts/i3blocks/host @@ -0,0 +1,6 @@ +#!/bin/bash + +hostget="\u@\h" +echo "< ${hostget@P}" +echo +echo \#ff003b diff --git a/.scripts/i3blocks/mem b/.scripts/i3blocks/mem @@ -0,0 +1,12 @@ +#!/bin/bash +# +# i3blocks/mem +# Created by Hayden Hamilton +# +# haydenvh.com +# Copyright (c) 2019 Hayden Hamilton. LICENSE:GPLv2 ../../.licenses/gplv2.license +# + +echo "< M $(free -h | awk '/^Mem:/ {print $3 "/" $2}')" +echo +echo \#009dc1 diff --git a/.scripts/i3blocks/mpv b/.scripts/i3blocks/mpv @@ -0,0 +1,51 @@ +#!/bin/bash + +file=$(echo '{command:["get_property", "media-title"]}' | socat - /tmp/mpv-socket | tr "." " " | sed 's/opus//g' | sed 's/mp3//g' | sed 's/mkv//g' | sed 's/flac//g' | sed 's/webm//g' | sed 's/part//g' | tr '"\{:,}[' ' ' | sed 's/data//g' | sed 's/request_id 0//g' | sed 's/error success//g' | sed 's/ //g' | tail -c +2 | sed 's/$//g' | tr "()'" " " | sed 's/ / /g' |sed 's/ / /g' | sed 's/ / /g' | sed 's/ / /g') +vidtitle=$(echo '{command:["get_property", "media-title"]}' | socat - /tmp/mpv-socket2 | tr '"{:,}\[' ' ' | sed 's/data//g' | sed 's/request_id 0//g' | sed 's/error success//g' | sed 's/ / /g' | sed 's/ / /g' | sed 's/ / /g' | sed 's/ / /g') +state=$(echo '{ "command": ["get_property", "pause"] }' | socat - /tmp/mpv-socket | tr '{":0,}' ' ' | awk '// {print $2}') +state2=$(echo '{ "command": ["get_property", "pause"] }' | socat - /tmp/mpv-socket2 | tr '{":0,}' ' ' | awk '// {print $2}') +convertsecs() { + ((h=${1}/3600)) + ((m=(${1}%3600)/60)) + ((s=${1}%60)) + printf "%02d:%02d:%02d\n" $h $m $s +} +time=$(convertsecs $(echo '{ "command": ["get_property", "playback-time"] }' | socat - /tmp/mpv-socket | tr '{":,}' ' ' | awk '// {print $2}' | sed 's/\./ /g' | awk '// {print $1}')) +time2=$(convertsecs $(echo '{ "command": ["get_property", "playback-time"] }' | socat - /tmp/mpv-socket2 | tr '{":,}' ' ' | awk '// {print $2}' | sed 's/\./ /g' | awk '// {print $1}')) +if [ "$state" == "false" ] +then + out=" PLAY - MUSIC - $file - $time" + color="true" +elif [ "$state" == "true" ] +then + if [ "$state2" == "false" ] + then + out=" PLAY - VIDEO - $vidtitle - $time2" + else + out=" STOP - MUSIC - $file - $time" + fi + color="true" +elif [ "$state2" == "false" ] +then + out=" PLAY - VIDEO - $vidtitle - $time2" + color="true" +elif [ "$state2" == "true" ] +then + out=" STOP - VIDEO - $vidtitle - $time2" + color="true" +else + out=" NONE" + color="true" +fi +if [ "$color" == "true" ] +then + echo "< MPV$out" + echo + echo \#666b1b +elif [ "$color" == "false" ] +then + exit 0 +else + echo "Nothing set?... Exiting" + exit 1 +fi diff --git a/.scripts/i3blocks/net b/.scripts/i3blocks/net @@ -0,0 +1,13 @@ +#!/bin/bash +# +# i3blocks/net +# Created by Hayden Hamilton +# +# haydenvh.com +# Copyright (c) 2019 Hayden Hamilton. LICENSE:GPLv2 ../../.licenses/gplv2.license +# + +ip=$(curl -s http://icanhazip.com/) +echo "< $ip" +echo +echo \#4DB0C6 diff --git a/.scripts/i3blocks/news b/.scripts/i3blocks/news @@ -0,0 +1,8 @@ +#!/bin/bash + +newsboat -x reload 2>/dev/null +unread=$(newsboat -x print-unread | sed 's/unread articles//g') + +echo "< NEWS $unread" +echo +echo \#498364 diff --git a/.scripts/i3blocks/time b/.scripts/i3blocks/time @@ -0,0 +1,4 @@ +#!/bin/bash +echo "< $(date +%d/%m)" +echo +echo \#ff7777 diff --git a/.scripts/i3blocks/time2 b/.scripts/i3blocks/time2 @@ -0,0 +1,4 @@ +#!/bin/bash +echo "< $(date | awk '{print $4}')" +echo +echo \#ff303b diff --git a/.scripts/i3blocks/vol b/.scripts/i3blocks/vol @@ -0,0 +1,8 @@ +#!/bin/bash + +toggled=$(amixer sget Master | awk '/Mono/ {print $6}' | sed 's/\[//g' | sed 's/\]//g') +volume=$(amixer sget Master | awk '/Mono/ {print $4}' | sed 's/\[//g' | sed 's/\]//g') +output=$(echo $(echo ${volume}|tr "\n" " ")$(echo ${toggled}|tr "\n" " "|sed 's/ //g')) +echo "< VOL $output" +echo +echo \#21a4a3 diff --git a/.scripts/i3blocks/weather b/.scripts/i3blocks/weather @@ -0,0 +1,6 @@ +#!/bin/bash + +curl -Ss 'https://wttr.in?0TQ' | cut -c 16- > ~/.cache/weather +echo "< $(sed 2q ~/.cache/weather | sed 's/\.\./ /g' | xargs echo)" +echo +echo \#249980 diff --git a/.scripts/i3blocks/weather2 b/.scripts/i3blocks/weather2 @@ -0,0 +1,5 @@ +#!/bin/bash + +echo "< RAIN $(sed 5q ~/.cache/weather | sed 's/‘//g' | sed 's/‚’//g' | tail -n 1 | sed 's/ //g')" +echo +echo \#249980