initial commit

This commit is contained in:
Tristan
2017-06-06 18:02:21 +02:00
commit 178bfef951
481 changed files with 43275 additions and 0 deletions

7
.i3/scripts/RAM.sh Executable file
View File

@@ -0,0 +1,7 @@
#!/bin/bash
ram=$(free -m)
arr=($ram)
max=$(awk "BEGIN {printf \"%.2f\",${arr[7]}/1024}")
cur=$(awk "BEGIN {printf \"%.2f\",${arr[8]}/1024}")
echo "${cur}GB/${max}GB"

BIN
.i3/scripts/claw Executable file

Binary file not shown.

23
.i3/scripts/key_layout Executable file
View File

@@ -0,0 +1,23 @@
#!/usr/bin/env bash
# Copyright 2016 Patrick Haun
# Edited: Denis Kadyshev
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
setxkbmap -query | awk '
BEGIN{layout="";variant=""}
/^layout/{layout=$2}
/^variant/{variant=$2}
END{printf("%s %s",layout,variant)}'

14
.i3/scripts/locker.sh Executable file
View File

@@ -0,0 +1,14 @@
#!/bin/sh
ARGS=(
"--clock" "-s"
"-i${HOME}/Pictures/backgrounds/6164e8_5775038.png"
"--insidevercolor=35d75588"
"--insidewrongcolor=d7355588"
"--insidecolor=50505000"
"--ringvercolor=64c784ff"
"--ringwrongcolor=c76484ff"
"--ringcolor=3555d7ff"
"--separatorcolor=6484c7ff"
"--keyhlcolor=35d755ff"
"--bshlcolor=d73555ff")
i3lock "${ARGS[@]}"

25
.i3/scripts/mpd_status.sh Executable file
View File

@@ -0,0 +1,25 @@
#!/bin/sh
SONG=$(mpc current)
for i in $(mpc --format ""); do
a=$i
break
done
case $BLOCK_BUTTON in
2) mpc toggle ;;
1) mpc prev ;;
3) mpc next ;;
esac
if [ -z "$SONG" ]; then
OUT="<span foreground='#CC0033'></span>"
else
if [ $a = "[playing]" ]; then
OUT="<span foreground='#00CC33'></span>"
else
OUT="<span foreground='#CC0033'></span>"
fi
OUT="$OUT <span foreground='#6484C7'>$SONG</span>"
fi
echo $OUT

40
.i3/scripts/shutdown_menu Executable file
View File

@@ -0,0 +1,40 @@
#!/bin/bash
#LOCKSCRIPT="i3lock-extra -m pixelize"
FG_COLOR="#d7d7d7"
BG_COLOR="#15325A"
SF_COLOR="#3555d7"
SB_COLOR="#6484c7"
color="-bg $BG_COLOR -fg $FG_COLOR -hlfg $SF_COLOR -hlbg $SB_COLOR -bw 0"
# menu defined as an associative array
typeset -A menu
# Menu with keys/commands
menu=(
[Shutdown]="systemctl poweroff"
[Reboot]="systemctl reboot"
[Hibernate]="systemctl hibernate"
[Suspend]="systemctl suspend"
[Halt]="systemctl halt"
[Lock]="i3lock --color=${BG_COLOR}"
[Logout]="i3-msg exit"
[Cancel]="Cancel"
)
# Menu entries that may trigger a confirmation message
menu_confirm="Shutdown Reboot Hibernate Suspend Halt Logout"
launcher="rofi -dmenu -hide-scrollbar -width 10"
launcher_opt="-i -yoffset 23 -location 3 $color"
selection=$(printf '%s\n' ${!menu[@]} | sort | eval '$launcher $launcher_opt -font "Hack-Regular 12" -lines 8')
if [ $selection == "Cancel" ] || [ -z $selection ]; then
exit 1
else
if [[ ${menu_confirm[*]} =~ $selection ]]; then
confirm=$(printf 'Yes\nNo\n' | eval '$launcher $launcher_opt -l 2 -font "Hack-Regular 12"')
if [[ $confirm == 'Yes' ]]; then
i3-msg -q "exec ${menu[${selection}]}"
fi
else
i3-msg -q "exec ${menu[${selection}]}"
fi
fi

18
.i3/scripts/volume_set.sh Executable file
View File

@@ -0,0 +1,18 @@
#!/bin/bash
if [ "$1" == "up" ]
then
pulsemixer --change-volume +5
TEXT="Volume: $(pulsemixer --get-volume | cut -d' ' -f 1 | sed 's/\(\[\|\]\)//g')"
elif [ "$1" == "down" ]
then
pulsemixer --change-volume -5
TEXT="Volume: $(pulsemixer --get-volume | cut -d' ' -f 1 | sed 's/\(\[\|\]\)//g')"
elif [ "$1" == "mute" ]
then
pulsemixer --toggle-mute
TEXT="Mute: $(pulsemixer --get-mute | cut -d' ' -f 1 | sed 's/\(\[\|\]\)//g')"
else
echo "usage volume_set.sh {up|down|mute}"
fi
dunstify -r 33223 "Volume changed" "$TEXT"

13
.i3/scripts/wan-or-not.sh Executable file
View File

@@ -0,0 +1,13 @@
#!/bin/zsh
#First arg is icon for WAN IP, Second argument is icon for local IP, third for offline
wanip=$(dig +short myip.opendns.com @resolver1.opendns.com);
if [[ $wanip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
echo "<span foreground='#00CC33'>$1</span>:$wanip"
else
wanip=$(ip addr show dev wlan0 | grep "inet " | awk '{print $2}')
if [[ $wanip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3} ]]; then
echo "<span foreground='#3300CC'>$2</span>:$wanip"
else
echo "<span foreground='#CC0033'>$3</span>"
fi
fi