configs

git clone git://git.codymlewis.com/configs.git
Log | Files | Refs | README

commit 3759d6215d94806d88c644bec4d2aa0a81068354
parent 9d4a0e14590aaec2d07326c867fa0d59cb64bb0f
Author: Cody Lewis <cody@codymlewis.com>
Date:   Fri, 26 Jun 2020 10:31:42 +1000

Updated zsh configs

Diffstat:
M.gitignore | 1+
Ddwmstatus.sh | 47-----------------------------------------------
Memoji/emoji-inserter.sh | 2+-
Dstatus.sh | 34----------------------------------
Mzsh/.zprofile | 4----
Mzsh/.zshrc | 4+---
6 files changed, 3 insertions(+), 89 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -37,3 +37,4 @@ mpd/log mpd/database Android Open Source Project/ QtProject.conf +.zcompdump diff --git a/dwmstatus.sh b/dwmstatus.sh @@ -1,47 +0,0 @@ -#!/bin/sh - -get_volume() { - vol=$(amixer get Master | awk -F'[][]' 'END{ print $2 }' | sed 's/%//g') - is_muted=$(amixer get Master | grep 'off') - if [ "$is_muted" ]; then - echo " " - else - if [ "$vol" -gt 50 ]; then - vol=" $vol" - elif [ "$vol" -gt 0 ]; then - vol=" $vol" - else - vol=" $vol" - fi - printf "%s" "$vol%" - fi -} - -get_brightness() { - xbacklight | cut -c -6 -} - -get_battery() { - cap=$(cat /sys/class/power_supply/BAT0/capacity) - if grep 'Discharging' /sys/class/power_supply/BAT0/status > /dev/null; then - if [ "$cap" -lt 20 ]; then - baticon="" - elif [ "$cap" -lt 40 ]; then - baticon="" - elif [ "$cap" -lt 60 ]; then - baticon="" - elif [ "$cap" -lt 80 ]; then - baticon="" - else - baticon="" - fi - else - baticon="" - fi - echo "$baticon $cap" -} - -while true; do - xsetroot -name "$(echo \ $(nmcli | head -n 1)\ \  $(get_brightness)%\ \ $(get_volume)\ \ $(get_battery)%\ \  $(date '+%F %T')\ \ )" - sleep 1 -done diff --git a/emoji/emoji-inserter.sh b/emoji/emoji-inserter.sh @@ -1,7 +1,7 @@ #!/bin/bash EMOJI=$(cat "$HOME/.config/emoji/emoji-list.txt" | - rofi -dmenu -i -p "Which emoji would you like" | + dmenu -i -p "Which emoji would you like" | awk '{print $1}') ! [[ $EMOJI = "" ]] && (printf "%s" "$EMOJI" | xsel) && diff --git a/status.sh b/status.sh @@ -1,34 +0,0 @@ -#!/bin/bash - -get_ip() { - ip -4 address show "$1" | grep inet | awk '{print $2}' -} - -get_mem() { - mem="$(free -h | grep Mem)" - free="$(echo "$mem" | awk '{print $3}')" - total="$(echo "$mem" | awk '{print $2}')" - printf "%s/%s" "$free" "$total" -} - -get_swap() { - mem="$(free -h | grep Swap)" - free="$(echo "$mem" | awk '{print $3}')" - total="$(echo "$mem" | awk '{print $2}')" - printf "%s/%s" "$free" "$total" -} - -music_status() { - if mpc status | grep "playing" > /dev/null; then - echo "" - else - echo "" - fi -} - -cpu_usage() { - usage=$(top -b -n 1 | grep Cpu | awk '{print $2}') - printf "%5.1f" "$usage" -} - -echo " $(music_status) $(mpc current)  $(get_ip wlo1)  $(get_mem)  $(cpu_usage)% " diff --git a/zsh/.zprofile b/zsh/.zprofile @@ -27,9 +27,5 @@ export ANDROIDAPI="26" [ -d "$HOME.rvm" ] && export PATH="$PATH:$HOME.rvm/bin" [[ -s "$HOME.rvm/scripts/rvm" ]] && source "$HOME.rvm/scripts/rvm" -pgrep 'tmux' > /dev/null || - (tmux new-session -d 'nvim ~/Desktop/dash.md' && - tmux new-window 'ncmpcpp' && - tmux next-window) pgrep 'mpd' > /dev/null || mpd ~/.config/mpd/mpd.conf & pgrep 'startx' > /dev/null || startx diff --git a/zsh/.zshrc b/zsh/.zshrc @@ -48,10 +48,8 @@ alias ...="cd ../../" alias ....="cd ../../../" alias .....="cd ../../../../" alias tmuxcon='tmux -q has-session && exec tmux attach-session -d || exec tmux new-session -n"$USER" -s"$USER"@"$HOSTNAME"' -bindkey -s '^N' 'ncmpcpp\n' bindkey -s '^P' 'f=$(fzf) && open "$f"\n' -bindkey -s "^V" 'pulsemixer\n' -bindkey -s "^Z" 'fzfmpc\n' +bindkey -s "^Z" 'setsid $TERMINAL 2>&1 > /dev/null &\n' open () { for a in $@; do