config

OpenBSD system configuration
git clone git://jacobedwards.org/config
Log | Files | Refs | README

commit ae545a71caa318d52b4494d8f82e2ce4f23c860b
parent 58d4c0f1793b5e173f6ca3261433c0ac1bf2d1e4
Author: jacobsGit <JacobDoesLinux@protonmail.com>
Date:   Mon,  9 Dec 2019 00:45:20 -0800

cleaned it up

Diffstat:
Dxmobar/.xmobar/scripts/XMBconnections | 35-----------------------------------
Dxmobar/.xmobar/scripts/XMBlastBackup | 24------------------------
Dxmobar/.xmobar/scripts/XMBlow-battery | 4----
Dxmobar/.xmobar/scripts/XMBmusic | 12------------
Dxmobar/.xmobar/scripts/XMBpackages | 2--
Dxmobar/.xmobar/scripts/XMBpacman-update | 23-----------------------
Dxmobar/.xmobar/scripts/XMBspotify | 33---------------------------------
Dxmobar/.xmobar/scripts/XMBsshalive | 23-----------------------
Dxmobar/.xmobar/scripts/XMBsshalive2 | 37-------------------------------------
Dxmobar/.xmobar/scripts/unconverted/partition-usage.sh | 37-------------------------------------
Dxmobar/.xmobar/scripts/unconverted/total-partition.sh | 8--------
Dxmobar/.xmobar/scripts/unconverted/uptime.sh | 26--------------------------
Dxmobar/.xmobar/scripts/unconverted/volume.sh | 10----------
13 files changed, 0 insertions(+), 274 deletions(-)

diff --git a/xmobar/.xmobar/scripts/XMBconnections b/xmobar/.xmobar/scripts/XMBconnections @@ -1,35 +0,0 @@ -#!/bin/sh -reading='true' -line='0' - -connections=$(ss | grep uucp-rlogin | grep 'ESTAB.0 0' | awk '{print $6}' | cut -d ':' -f 1) -#ss | grep semantix | # connection from -lines=$(cat /etc/ssh/ssh_config | wc -l) - -while [[ "$line" -le "$lines" ]]; do - line=$(calc $line + 1) - contents=$(cat /etc/ssh/ssh_config | head -n $line | tail -n 1) - - if [[ "$contents" == host\ * ]]; then - hosts="$hosts $(printf "$contents" | awk '{print $2}' | sed 's/\"//g' | awk '{print $1}')\n" - hostnames="$hostnames$(cat /etc/ssh/ssh_config | head -n $(calc $line + 1) | tail -n 1 | awk '{print $2}' | awk '{print $1}')\n" - - fi - done - - - - -itor=0 -printf "$connections" - -while [[ $(printf "$hostnames" | wc -l) -ge "$itor" ]]; do - itor=$(calc "$itor" + 1) - - host=$(printf "$hosts" | head -n "$itor" | tail -n 1) - hostname=$(printf "$hostnames" | head -n "$itor" | tail -n 1) - - parsed="$(printf "$connections" | sed "s/$hostname/$host/g")" -done - -printf "$parsed" diff --git a/xmobar/.xmobar/scripts/XMBlastBackup b/xmobar/.xmobar/scripts/XMBlastBackup @@ -1,24 +0,0 @@ -#!/bin/sh -MB=$(calc $(date +'%s') - $(cat ~/.dates/ssh-backup) / 60 | cut -d '.' -f 1) - - -if [[ "$MB" -ge "60" ]]; then - HB=$(expr "$MB" / 60) - MB=$(expr "$MB" % 60) - -if [[ "$MB" -lt "10" ]]; then - MB=0$MB - fi - - printf "$HB":"$MB" - -else -if [[ "$MB" -lt "10" ]]; then - MB=0$MB - fi - -printf 0:$MB -fi - - - diff --git a/xmobar/.xmobar/scripts/XMBlow-battery b/xmobar/.xmobar/scripts/XMBlow-battery @@ -1,4 +0,0 @@ -#!/bin/sh -notify-send -u critical 'hibernation imminent' -sleep 30 -systemctl hibernate diff --git a/xmobar/.xmobar/scripts/XMBmusic b/xmobar/.xmobar/scripts/XMBmusic @@ -1,12 +0,0 @@ -#!/bin/sh -string="$(playerctl metadata | grep title | tail -c +35)" - -if [[ "$string" == "" ]]; then - string="$(mpc current | cut -d '-' -f 2 | cut -d '(' -f 1)" - fi - -if [[ "$string" == "" ]]; then - string=OFF -fi - -printf "$string" diff --git a/xmobar/.xmobar/scripts/XMBpackages b/xmobar/.xmobar/scripts/XMBpackages @@ -1,2 +0,0 @@ -#!/bin/sh -printf "$(pacman -Q | wc -l)" diff --git a/xmobar/.xmobar/scripts/XMBpacman-update b/xmobar/.xmobar/scripts/XMBpacman-update @@ -1,23 +0,0 @@ -#!/bin/sh -MB=$(calc $(date +'%s') - $(cat ~/.dates/system-update) / 60 | cut -d '.' -f 1) - -if [[ "$MB" -gt "59" ]]; then - HB=$(expr "$MB" / 60) - MB=$(expr "$MB" % 60) - -if [[ "$MB" -lt "10" ]]; then - MB=0$MB - fi - - printf "$HB":"$MB" - -else -if [[ "$MB" -lt "10" ]]; then - MB=0$MB - fi - -printf 0:$MB -fi - - - diff --git a/xmobar/.xmobar/scripts/XMBspotify b/xmobar/.xmobar/scripts/XMBspotify @@ -1,33 +0,0 @@ -#!/bin/sh -string="$(playerctl metadata | grep title | tail -c +35)" - -if [[ "$string" == "" ]]; then - string=OFF - fi - -printf "$string" -exit # comment these lines to limit length of title - - -i=0 -bytes=$(printf "$string" | wc -c) - -while [[ $bytes -gt "26" ]]; do -bytes=$(printf "$string" | wc -c) -i=$(calc $i + 1) - -if [[ $i -eq "1" ]]; then -string=$(printf "$string" | awk '{print $1,$2,$3}') -fi - if [[ $i -eq "2" ]]; then - string=$(printf "$string" | awk '{print $1,$2}') - fi - if [[ $i -eq "3" ]]; then - string=$(printf "$string" | awk '{print $1}') - - else - string=$(printf "$string" | head -c 26) - fi -done - -printf "$string" diff --git a/xmobar/.xmobar/scripts/XMBsshalive b/xmobar/.xmobar/scripts/XMBsshalive @@ -1,23 +0,0 @@ -#!/bin/sh -offline='<fc=#6A241C>' -online='<fc=#1DB954>' -reset='</fc>' - - -nc -z -w 1 "$1" "$2" -if [[ "$?" == '0' ]]; then - - if [[ -z $3 ]]; then - printf "$online$1$reset" - else - printf "$online$3$reset" - fi -else - if [[ -z $3 ]]; then - printf "$offline$1$reset" - - else - printf "$offline$3$reset" - fi -fi - diff --git a/xmobar/.xmobar/scripts/XMBsshalive2 b/xmobar/.xmobar/scripts/XMBsshalive2 @@ -1,37 +0,0 @@ -#!/bin/sh -name1=$(cat /etc/ssh/ssh_config | grep ost | grep -v \# | grep -v ostname | tail -n +1 | head -n +1 | awk '{print $2}') -name2=$(cat /etc/ssh/ssh_config | grep ost | grep -v \# | grep -v ostname | tail -n +2 | head -n +1 | awk '{print $2}') - -port1=$(cat /etc/ssh/ssh_config | grep ort | grep -v \# | tail -n +1 | head -n +1 | awk '{print $2}') -port2=$(cat /etc/ssh/ssh_config | grep ort | grep -v \# | tail -n +2 | head -n +1 | awk '{print $2}') - -host1=$(cat /etc/ssh/ssh_config | grep ostname | tail -n +1 | head -n +1 | awk '{print $2}') -host2=$(cat /etc/ssh/ssh_config | grep ostname | tail -n +2 | head -n +1 | awk '{print $2}') - -green="#1DB954" -red="#6A241C" - - -name1=$(printf $name1 | sed 's/"//g') -name2=$(printf $name2 | sed 's/"//g') - -# same computer diffrent user so for eases sake -name1="$name1 cloud" - -nc -z -w 1 "$host1" "$port1" -if [[ "$?" -eq "0" ]]; then - output="$output <fc=#1DB954>$name1</fc>" - - else - output="$output <fc=#6A241C>$name1</fc>" - fi - -nc -z -w 1 "$host2" "$port2" -if [[ "$?" -eq "0" ]]; then - output="$output <fc=#1DB954>$name2</fc>" - - else - output="$output <fc=#6A241C>$name2</fc>" - fi - - printf "$output" diff --git a/xmobar/.xmobar/scripts/unconverted/partition-usage.sh b/xmobar/.xmobar/scripts/unconverted/partition-usage.sh @@ -1,37 +0,0 @@ -#!/bin/sh - -float=$2 -if [[ "$1" == "--help" ]] || [[ "$1" == "-h" ]]; then - printf "\nusage: partition-size [-d | -f] [detail int] [directory if -d is specified]\n\n" - printf " -h, --help prints help message\n" - printf " -d, prints usage of partiton\n" - printf " mounted to that directory\n\n" - - printf " -t, total (mounted) disk usage\n" - - - exit - fi - -if [[ "$1" == "-t" ]]; then - size=$(df -BK --total | grep total | awk '{print $2 $3}' | head -c -2 | sed 's/K/ /g') - total=$(calc $(printf "$size" | awk '{print $1}') / 1000000 | cut -d '.' -f 1) - totalFloat=.$(calc $(printf "$size" | awk '{print $1}') / 1000000 | cut -d '.' -f 2 | head -c $float) - used=$(calc $(printf "$size" | awk '{print $2}') / 1000000 | cut -d '.' -f 1) - usedFloat=.$(calc $(printf "$size" | awk '{print $2}') / 1000000 | cut -d '.' -f 2 | head -c $float) - - - printf "$used$usedFloat/$total$totalFloat" - exit - fi - -if [[ "$1" == "-d" ]]; then - size=$(df -BK "$3" | grep /dev/ | awk '{print $2 $3}' | head -c -2 | sed 's/K/ /g') - total=$(calc $(printf "$size" | awk '{print $1}') / 1000000 | cut -d '.' -f 1) - totalFloat=.$(calc $(printf "$size" | awk '{print $1}') / 1000000 | cut -d '.' -f 2 | head -c $float) - used=$(calc $(printf "$size" | awk '{print $2}') / 1000000 | cut -d '.' -f 1) - usedFloat=.$(calc $(printf "$size" | awk '{print $2}') / 1000000 | cut -d '.' -f 2 | head -c $float) - - printf "$used$usedFloat/$total$totalFloat" - exit - fi diff --git a/xmobar/.xmobar/scripts/unconverted/total-partition.sh b/xmobar/.xmobar/scripts/unconverted/total-partition.sh @@ -1,8 +0,0 @@ -#!/bin/sh - - -bytesTotal=$(df -B1024 --total | grep total | awk '{print $2}') -bytesUsed=$(df -B1024 --total | grep total | awk '{print $3}') -bytesPercent=$(df -B1024 --total | grep total | awk '{print $5}' | head -c -2) - -printf "$bytesUsed - $bytesPex rcent" diff --git a/xmobar/.xmobar/scripts/unconverted/uptime.sh b/xmobar/.xmobar/scripts/unconverted/uptime.sh @@ -1,26 +0,0 @@ -#!/bin/sh -epoStart="$(date --date="$(last --time-format iso | head -n 15 | grep still\ logged\ in | awk '{print $3}')" +"%s")" - -#taken from ssh-backup -MB=$(calc $(date +'%s') - $epoStart / 60 | cut -d '.' -f 1) - - -if [[ "$MB" -ge "60" ]]; then - HB=$(expr "$MB" / 60) - MB=$(expr "$MB" % 60) - -if [[ "$MB" -lt "10" ]]; then - MB=0$MB - fi - - printf "$HB":"$MB" - -else -if [[ "$MB" -lt "10" ]]; then - MB=0$MB - fi - -printf 0:$MB -fi - - diff --git a/xmobar/.xmobar/scripts/unconverted/volume.sh b/xmobar/.xmobar/scripts/unconverted/volume.sh @@ -1,10 +0,0 @@ -#!/bin/sh - -volume=$(ponymix get-volume) -if [[ $(ponymix | grep Avg.* | grep $volume | awk '{print $4}') == "" ]]; then - echo "$volume%" - - else - printf "muted" -fi -