summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/.bin/lay_both2
-rwxr-xr-xbin/.bin/lay_hdmi2
-rwxr-xr-xbin/.bin/lemonconf74
-rwxr-xr-xbin/.bin/pcolor3
-rwxr-xr-xbin/.bin/statusbar45
-rwxr-xr-xbin/.bin/update-resolv-conf.sh71
6 files changed, 0 insertions, 197 deletions
diff --git a/bin/.bin/lay_both b/bin/.bin/lay_both
deleted file mode 100755
index 21eb5ec..0000000
--- a/bin/.bin/lay_both
+++ /dev/null
@@ -1,2 +0,0 @@
1#!/bin/sh
2xrandr --output eDP-1 --primary --mode 1920x1080 --pos 0x0 --rotate normal --output HDMI-1 --mode 1366x768 --pos 0x0 --rotate normal
diff --git a/bin/.bin/lay_hdmi b/bin/.bin/lay_hdmi
deleted file mode 100755
index 6ddea55..0000000
--- a/bin/.bin/lay_hdmi
+++ /dev/null
@@ -1,2 +0,0 @@
1#!/bin/sh
2xrandr --output eDP-1 --off --output HDMI-1 --mode 1366x768 --scale 1.4x1.4 --pos 0x0 --rotate normal
diff --git a/bin/.bin/lemonconf b/bin/.bin/lemonconf
deleted file mode 100755
index cb5e505..0000000
--- a/bin/.bin/lemonconf
+++ /dev/null
@@ -1,74 +0,0 @@
1#!/bin/bash
2# Outputs a configuration for lemonbar
3
4vol(){
5 vol=$(pulsemixer --get-volume | awk '{print $1}')
6 mute=$(pulsemixer --get-mute)
7 if [ "$mute" == 1 ]; then
8 echo -e "%{F#787878}vol%{F-} muted "
9 elif [ "$mute" == 0 ]; then
10 echo -e "%{F#787878}vol%{F-} $vol% "
11 fi
12}
13
14bat() {
15 power=$(cat /sys/class/power_supply/BAT0/capacity)
16 status=$(cat /sys/class/power_supply/BAT0/status)
17 if [ "$status" == "Charging" ]; then
18 echo -e "%{F#787878}bat%{F-} +$power% "
19 elif [ "$status" == "Discharging" ]; then
20 echo -e "%{F#787878}bat%{F-} $power% "
21 fi
22}
23
24dte() {
25 dte=$(date +"%a, %b %d")
26 echo -e "%{F#787878}date%{F-} $dte "
27}
28
29tie() {
30 tme=$(date +"%I:%M %P")
31 echo -e "%{F#787878}time%{F-} $tme "
32}
33
34groups() {
35 cur=`xprop -root _NET_CURRENT_DESKTOP | awk '{print $3}'`
36 tot=`xprop -root _NET_NUMBER_OF_DESKTOPS | awk '{print $3}'`
37
38 for w in `seq 0 $((cur - 1))`; do line="${line}  "; done
39 line="${line}  "
40 for w in `seq $((cur + 2)) $tot`; do line="${line}  "; done
41 echo $line
42}
43
44workspaces() {
45 all=$(bspc query -D)
46 occupied=$(bspc query -D -d .occupied)
47 current=$(bspc query -D -d .focused)
48 result=""
49 padding=" "
50 while IFS= read -r line; do
51 # Get the name of the current desktop
52 name=""
53 if [[ "$occupied" == *"$line"* ]];
54 then
55 name=""
56 fi
57
58 if [[ "$current" == *"$line"* ]];
59 then
60 name=""
61 fi
62
63 result="$result$padding"
64 result="$result$name"
65 result="$result$padding"
66 done <<< "$all"
67 echo -e "$result"
68}
69
70while true; do
71 echo " $(vol) $(bat) $(tie) $(dte) %{F#787878}%{r}$(workspaces)%{F-} "
72 xdo above -t $(xdo id -n root) $(xdo id -n lemonbar)
73 sleep 3
74done
diff --git a/bin/.bin/pcolor b/bin/.bin/pcolor
deleted file mode 100755
index 4cc28a0..0000000
--- a/bin/.bin/pcolor
+++ /dev/null
@@ -1,3 +0,0 @@
1#!/bin/bash
2pcs() { for i in {0..7}; do echo -en "\e[${1}$((30+$i))m \u2588\u2588 \e[0m"; done; }
3printf "\n%s\n%s\n\n" "$(pcs)" "$(pcs '1;')"
diff --git a/bin/.bin/statusbar b/bin/.bin/statusbar
deleted file mode 100755
index c506244..0000000
--- a/bin/.bin/statusbar
+++ /dev/null
@@ -1,45 +0,0 @@
1#!/bin/bash
2
3# Color definitions.
4export BLK="\e[30m"
5export RED="\e[31m"
6export GRN="\e[32m"
7export YLW="\e[33m"
8export BLU="\e[34m"
9export PUR="\e[35m"
10export CYN="\e[36m"
11export RST="\e[0m"
12
13# Other formatting.
14export BLD="\e[1m"
15export DIM="\e[2m"
16export ITA="\e[3m"
17export UND="\e[4m"
18export FLS="\e[5m"
19export REV="\e[7m"
20export INV="\e[8m"
21export STR="\e[9m"
22
23vol(){
24 vol=$(pulsemixer --get-volume | awk '{print $1}')
25 echo -e "vol $vol%"
26}
27
28bat() {
29 power=$(cat /sys/class/power_supply/BAT0/capacity)
30 echo -e "bat $power%"
31}
32
33dte() {
34 dte=$(date +"%A, %B %d")
35 echo -e "date $dte"
36}
37
38tie() {
39 tme=$(date +"%I:%M %p")
40 echo -e "time $tme"
41}
42while :; do
43 echo "$(vol) $(bat) $(tie) $(dte)"
44 sleep 2
45done
diff --git a/bin/.bin/update-resolv-conf.sh b/bin/.bin/update-resolv-conf.sh
deleted file mode 100755
index 16622a1..0000000
--- a/bin/.bin/update-resolv-conf.sh
+++ /dev/null
@@ -1,71 +0,0 @@
1#!/usr/bin/env bash
2#
3# Parses DHCP options from openvpn to update resolv.conf
4# To use set as 'up' and 'down' script in your openvpn *.conf:
5# up /etc/openvpn/update-resolv-conf
6# down /etc/openvpn/update-resolv-conf
7#
8# Used snippets of resolvconf script by Thomas Hood <jdthood@yahoo.co.uk>
9# and Chris Hanson
10# Licensed under the GNU GPL. See /usr/share/common-licenses/GPL.
11# 07/2013 colin@daedrum.net Fixed intet name
12# 05/2006 chlauber@bnc.ch
13#
14# Example envs set from openvpn:
15# foreign_option_1='dhcp-option DNS 193.43.27.132'
16# foreign_option_2='dhcp-option DNS 193.43.27.133'
17# foreign_option_3='dhcp-option DOMAIN be.bnc.ch'
18# foreign_option_4='dhcp-option DOMAIN-SEARCH bnc.local'
19
20## The 'type' builtins will look for file in $PATH variable, so we set the
21## PATH below. You might need to directly set the path to 'resolvconf'
22## manually if it still doesn't work, i.e.
23## RESOLVCONF=/usr/sbin/resolvconf
24export PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin
25RESOLVCONF=$(type -p resolvconf)
26
27case $script_type in
28
29up)
30 for optionname in ${!foreign_option_*} ; do
31 option="${!optionname}"
32 echo $option
33 part1=$(echo "$option" | cut -d " " -f 1)
34 if [ "$part1" == "dhcp-option" ] ; then
35 part2=$(echo "$option" | cut -d " " -f 2)
36 part3=$(echo "$option" | cut -d " " -f 3)
37 if [ "$part2" == "DNS" ] ; then
38 IF_DNS_NAMESERVERS="$IF_DNS_NAMESERVERS $part3"
39 fi
40 if [[ "$part2" == "DOMAIN" || "$part2" == "DOMAIN-SEARCH" ]] ; then
41 IF_DNS_SEARCH="$IF_DNS_SEARCH $part3"
42 fi
43 fi
44 done
45 R=""
46 if [ "$IF_DNS_SEARCH" ]; then
47 R="search "
48 for DS in $IF_DNS_SEARCH ; do
49 R="${R} $DS"
50 done
51 R="${R}
52"
53 fi
54
55 for NS in $IF_DNS_NAMESERVERS ; do
56 R="${R}nameserver $NS
57"
58 done
59 #echo -n "$R" | $RESOLVCONF -x -p -a "${dev}"
60 echo -n "$R" | $RESOLVCONF -x -a "${dev}.inet"
61 ;;
62down)
63 $RESOLVCONF -d "${dev}.inet"
64 ;;
65esac
66
67# Workaround / jm@epiclabs.io
68# force exit with no errors. Due to an apparent conflict with the Network Manager
69# $RESOLVCONF sometimes exits with error code 6 even though it has performed the
70# action correctly and OpenVPN shuts down.
71exit 0