xscripts

Scripts for .xsession or .xinit
git clone git://git.swab.dev/xscripts.git
Log | Files | Refs

commit ab2759ad3acb8107d9e82f8910ac33db1e048269
Author: Jaron Swab <jaron@swab.dev>
Date:   Thu, 21 Oct 2021 15:51:56 -0400

Initial commit

Diffstat:
Amonitors.sh | 18++++++++++++++++++
Astatus.sh | 22++++++++++++++++++++++
2 files changed, 40 insertions(+), 0 deletions(-)

diff --git a/monitors.sh b/monitors.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +VGA1=$(xrandr | awk '/VGA-1/ { print $2 }') +if [ "$VGA1" = "connected" ]; then + # run xrander script for docked screen; configured with arandr + xrandr \ + --output LVDS-1 --off \ + --output VGA-1 --mode 1920x1080 --pos 0x420 --rotate normal \ + --output DP-2 --primary --mode 1920x1080 --pos 1920x0 --rotate left; +else + # Run xrander for built in screen only + xrandr --output LVDS-1 --mode 1366x768 --pos 0x0 --rotate normal; +fi + +# Set desktop background image: +feh --bg-fill "$HOME"/pictures/backgrounds/StarryPointers.png + +exit 0; diff --git a/status.sh b/status.sh @@ -0,0 +1,22 @@ +#!/bin/sh +# sStatus is a simple status display for the terminal. + +# Kill status bar if it's currently running: +statusPID=$(pgrep "$HOME/repos/sstatus/main.sh" | cut -f 1 -d " " | tr -d '\n') +if [ "$statusPID" != "" ]; then + kill "$statusPID"; +fi + +while true +do +battery=$(apm | grep 'Battery state:' | cut -f 4 -d " ") + time=$(date "+%H:%M") + audioLevel=$(sndioctl output.level | cut -f 2 -d "=" | cut -f 2 -d "." | cut -c 1,2) + + # Set the desired order of information: + status="Vol: $audioLevel% | Bat: $battery | $time " + + # Default for DWM. Change the line below for other displays. + xsetroot -name "$status" + sleep 1 +done