dots

Dotfiles for Linux
Log | Files | Refs | README

commit 815536811fd046ab45c230bcc59cb398daf1ab17
parent b7d537b1aebbd25e96928133a530a403d2580e28
Author: Chris Kiriakou <chris@kiriakou.net>
Date:   Wed, 19 Aug 2026 17:14:09 +0200

add new scripts

Diffstat:
Ascripts/dot-local/bin/status.sh | 11+++++++++++
Ascripts/dot-local/bin/switch-scheme.sh | 43+++++++++++++++++++++++++++++++++++++++++++
Ascripts/dot-local/bin/webcam.sh | 9+++++++++
3 files changed, 63 insertions(+), 0 deletions(-)

diff --git a/scripts/dot-local/bin/status.sh b/scripts/dot-local/bin/status.sh @@ -0,0 +1,11 @@ +#!/bin/sh +# +# Fetch status information + +main() { + date=$(date +'%a, %d.%m.%Y %H:%M') + test -d /sys/class/power_supply/BAT0 && bat=$(~/.local/bin/batterystate.sh) + printf "${bat} ${date}\n" +} + +main diff --git a/scripts/dot-local/bin/switch-scheme.sh b/scripts/dot-local/bin/switch-scheme.sh @@ -0,0 +1,43 @@ +#!/bin/sh +# +# Switch between light and dark ui + +dawn_hour=7 +dusk_hour=19 + +set_light() { + dconf write /org/gnome/desktop/interface/color-scheme '"prefer-light"' + kill -12 $(pgrep -x foot) + exit 0 +} + +set_dark() { + dconf write /org/gnome/desktop/interface/color-scheme '"prefer-dark"' + kill -10 $(pgrep -x foot) + exit 0 +} + +toggle() { + current_scheme=$(dconf read /org/gnome/desktop/interface/color-scheme) + test "$current_scheme" = "'prefer-dark'" && set_light + set_dark + exit 1 +} + +auto() { + current_hour=$(date +%H) + test $current_hour -ge $dawn_hour && \ + test $current_hour -le $dusk_hour && set_light + set_dark + exit 1 +} + +main() { + test "$1" = "--light" && set_light + test "$1" = "--dark" && set_dark + test "$1" = "--toggle" && toggle + test "$1" = "--auto" && auto + exit 1 +} + +main $1 diff --git a/scripts/dot-local/bin/webcam.sh b/scripts/dot-local/bin/webcam.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +ffplay \ + -f v4l2 \ + -video_size 1920x1080 \ + -input_format mjpeg \ + -i /dev/video0 \ + -fflags nobuffer \ + -flags low_delay