plugfiles

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit faf77e363bef7502296bcb2b0af65e00b070d1d4
parent 4d4f6665924a0a9a15d6967521c22398fd4fd8c3
Author: NicholasFarrow <nicholas.w.farrow@gmail.com>
Date:   Thu, 19 Mar 2020 18:48:43 +1100

Include custom scripts and updates to polybar+i3

Diffstat:
M.bash_profile | 2+-
M.config/i3/config | 2+-
MREADME.md | 1+
Abin/crypto | 16++++++++++++++++
Abin/dualOBS | 30++++++++++++++++++++++++++++++
Abin/lock.sh | 7+++++++
Abin/nordstat | 7+++++++
Abin/polybar.sh | 10++++++++++
Abin/polylaunch | 20++++++++++++++++++++
Abin/steam | 2++
DdesktopScreenshot.png | 0
Minstall.sh | 9++++++++-
Dscreenshot.png | 0
13 files changed, 103 insertions(+), 3 deletions(-)

diff --git a/.bash_profile b/.bash_profile @@ -1,5 +1,5 @@ #!/bin/bash - +PLG=$HOME/plugfiles/ CFG=$HOME/.config SHD=/media/sea/ diff --git a/.config/i3/config b/.config/i3/config @@ -61,7 +61,7 @@ exec --no-startup-id pkill polybar; polybar -r example # Application Shortcuts -bindsym $mod+F1 exec brave #google-chrome-stable +bindsym $mod+F1 exec brave --disable-seccomp-filter-sandbox #google-chrome-stable bindsym $mod+F2 exec nautilus bindsym $mod+F3 exec firefox #bindsym $mod+F4 diff --git a/README.md b/README.md @@ -5,3 +5,4 @@ Customised for Lenovo X1 Carbon ![screenshot_arch](Screenshot.png) +My scripts can be found in `bin`. diff --git a/bin/crypto b/bin/crypto @@ -0,0 +1,16 @@ +#!/bin/bash +# Nicholas Farrow 2020 +crypto_rate () { + if [ "$1" == "BTC" ]; then ln=2; else ln=1; fi + echo "$(curl -s rate.sx | grep $1 | sed -n ${ln}p | grep -Eo "[0-9]*\.[0-9]*" | head -1)" +} + +BTC=$(crypto_rate "BTC") +ETH=$(crypto_rate "ETH") +RATIO=$(bc <<< "scale=4;$ETH/$BTC") + +printf "BTC:%0.0f " $BTC +printf "ETH:%0.0f " $ETH +printf "E/B:%0.3f\n" $RATIO +#echo -e "BTC:$BTC ETH:$ETH ETH/BTC:0$RATIO" + diff --git a/bin/dualOBS b/bin/dualOBS @@ -0,0 +1,30 @@ +#!/bin/bash +# Nick Farrow 2019 + +# Whenever out mouse is past XSPLIT in the X-direction, +# A hotkey is sent to OBS to change scenes +XSPLIT=1920 + +# Hotkeys for left and right scenes +LEFT='F7' +RIGHT='F8' + +PAST=$RIGHT + +obs | while : + do + XCOORD=$(xdotool getmouselocation | cut -d : -f 2 | cut -d ' ' -f 1) + + if [ "$XCOORD" -lt "$XSPLIT" ] && [ "$PAST" == "$RIGHT" ] then + WINDOWID=$(xdotool search --name OBS | tail -1) + xdotool key --window $WINDOWID $LEFT + PAST=$LEFT + echo "CHANGE LEFT" + + elif [ "$XCOORD" -gt "$XSPLIT" ] && [ "$PAST" == "$LEFT" ] then + WINDOWID=$(xdotool search --name OBS | tail -1) + xdotool key --window $WINDOWID $RIGHT + PAST=$RIGHT + echo "CHANGE RIGHT" + fi + done diff --git a/bin/lock.sh b/bin/lock.sh @@ -0,0 +1,7 @@ +#!/bin/bash +TMPBG=~/Pictures/screen.png +LOCK=~/Pictures/lock.png +RES=1920x1080 + +ffmpeg -f x11grab -video_size $RES -y -i $DISPLAY -i $LOCK -filter_complex "boxblur=5:1,overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2" -vframes 1 $TMPBG +i3lock -i $TMPBG diff --git a/bin/nordstat b/bin/nordstat @@ -0,0 +1,7 @@ +#!/bin/bash +# Nicholas Farrow 2020 +STATUS=$(nordvpn status) +CONNSTAT=$(grep "Status:" <<< "$STATUS" | cut -d ' ' -f2) +COUNTRY=$(grep "City:" <<< "$STATUS" | cut -d ' ' -f2) +IP=$(grep "IP" <<< "$STATUS" | cut -d ':' -f2) +echo "$CONNSTAT $COUNTRY$IP" diff --git a/bin/polybar.sh b/bin/polybar.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env sh + +# Terminate already running bar instances +killall -q polybar + +# Wait until the processes have been shut down +while pgrep -x polybar >/dev/null; do sleep 1; done + +# Launch polybar +polybar top & diff --git a/bin/polylaunch b/bin/polylaunch @@ -0,0 +1,20 @@ +#!/bin/bash + +# Terminate already running bar instances +killall -q polybar + +# Wait until the processes have been shut down +#while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done +pkill polybar + +# Launch Polybar, using default config location ~/.config/polybar/config +if type "xrandr"; then + for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do + MONITOR=$m polybar --reload example & + done +else + polybar --reload example & +fi + +echo "Polybar launched..." + diff --git a/bin/steam b/bin/steam @@ -0,0 +1,2 @@ +#!/bin/sh +LD_PRELOAD='/usr/$LIB/libasound.so.2' /usr/bin/steam diff --git a/desktopScreenshot.png b/desktopScreenshot.png Binary files differ. diff --git a/install.sh b/install.sh @@ -3,8 +3,13 @@ PLUGLOC=$HOME/plugfiles CFGLOC=$HOME/.config +BINLOC=$HOME/.local/bin -[ -f $CFGLOC ] || mkdir $CFGLOC +#[ -f $CFGLOC ] || mkdir $CFGLOC +#[ -f $BINLOC ] || mkdir $BINLOC + +mkdir -p $CFGLOC +mkdir -p $BINLOC for CFGFOLDER in $PLUGLOC/.config/*/ do @@ -16,6 +21,8 @@ do cp -R "$CFGFOLDER" "$OLDDIR" done +cp -r ./bin/* $BINLOC/ + [ -f "$CFGLOC/.aliasrc" ] && rm "$CFGLOC/.aliasrc" cp "$PLUGLOC/.config/.aliasrc" "$CFGLOC/.aliasrc" cp "$PLUGLOC/.config/.compton.conf" "$CFGLOC/.compton.conf" diff --git a/screenshot.png b/screenshot.png Binary files differ.