From 6aa9e4a0fbe0b741b8daf0b92732428a918ee52b Mon Sep 17 00:00:00 2001 From: Robert Morrison Date: Mon, 19 Feb 2024 20:57:28 +0000 Subject: [PATCH] INIT --- BarRunner | 59 ++++++++++++++ License.txt | 9 +++ Readme.html | 215 ++++++++++++++++++++++++++++++++++++++++++++++++++++ Readme.md | 48 ++++++++++++ WallChooser | 35 +++++++++ 5 files changed, 366 insertions(+) create mode 100755 BarRunner create mode 100644 License.txt create mode 100644 Readme.html create mode 100644 Readme.md create mode 100755 WallChooser diff --git a/BarRunner b/BarRunner new file mode 100755 index 0000000..c63202b --- /dev/null +++ b/BarRunner @@ -0,0 +1,59 @@ +#!/bin/bash +# +SPDX:MIT +## Based on https://github.com/Alexays/Waybar/issues/961#issuecomment-753533975 + +## WE NEED SOME DEPENDENCIES +depcheck() { + if ! command -v "$1" &> /dev/null ; then + echo "Missing dependency $1" + exit 1 + fi +} +depcheck waybar +depcheck inotifywait + +COMPOSITOR="$1" +PYWAL="$2" + +WATCHEDFILES="" + +CONFIG_FILE="$XDG_CONFIG_HOME/waybar/config" +CONFIG_FILE_HYPRLAND="$XDG_CONFIG_HOME/waybar/config.hyprland.conf" +COLOR_FILE="$XDG_CONFIG_HOME/waybar/colours.css" +COLOR_FILE_PYWAL="$XDG_CACHE_HOME/wal/colors-waybar.css" +STYLE_FILE="$XDG_CONFIG_HOME/waybar/style.css" +STYLE_FILE_PYWAL="$XDG_CONFIG_HOME/waybar/style.pywal.css" + +case "$COMPOSITOR" in + "hyprland") + WATCHEDFILES+=$CONFIG_FILE_HYPRLAND + RUNCONFIG=$CONFIG_FILE_HYPRLAND + ;; + *) + WATCHEDFILES+=$CONFIG_FILE + RUNCONFIG=$CONFIG_FILE + ;; +esac +WATCHEDFILES+=" " +case "$PYWAL" in + "y"|"Y"|"yes") + WATCHEDFILES+=$COLOR_FILE_PYWAL + WATCHEDFILES+=" " + WATCHEDFILES+=$STYLE_FILE_PYWAL + RUNSTYLE=$STYLE_FILE_PYWAL + ;; + *) + WATCHEDFILES+=$COLOR_FILE + WATCHEDFILES+=" " + WATCHEDFILES+=$STYLE_FILE + RUNSTYLE=$STYLE_FILE + ;; +esac + +trap "killall waybar" EXIT + +while true; do + waybar -c $RUNCONFIG -s $RUNSTYLE & + inotifywait -e create,modify $WATCHEDFILES + killall waybar +done diff --git a/License.txt b/License.txt new file mode 100644 index 0000000..bcf50fe --- /dev/null +++ b/License.txt @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) 2024 Robert Morrison + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Readme.html b/Readme.html new file mode 100644 index 0000000..c3891ee --- /dev/null +++ b/Readme.html @@ -0,0 +1,215 @@ + + + + + + + Readme + + + +

GScripts

+

A set of scripts which I use in my current Gentoo system, all are +installed through portage and of course are tested to work on my system +and my system alone. Where possible I only use dependencies available in +the main Gentoo repo and each script has the dependencies listed.

+

All scripts are licensed under the MIT (Expat) License (for more +information on why I give two names for one license please see what the +GNU project has to say on the matter) I intentionally use the term +MIT license as that is the accepted SPDX license identifier.

+

Coming Eventually: A portage repo that contains my ebuilds +(where I am certain of the accuracy of the license data).

+

Where scripts have configuration all environment variables are +pseudo-namespaced by $GScripts_<OPTION>

+

The Scripts

+

WallChooser

+

A simple script that lets you pick a new wallpaper, it automatically +runs all the required steps to generate a new pywal theme +and set the wallpaper using swww

+

Requirements

+ +

BarRunner

+

A tool to run waybar, Automatically restarting the bar +if any of the required config files are changed. NOTE: This tool is very +much designed around my system and will likely fail to operate properly +for you. It is designed with special handling for different compositors. +And compatibility with pywal

+

Arguments

+ +

Requirements

+ + + diff --git a/Readme.md b/Readme.md new file mode 100644 index 0000000..65eaa4c --- /dev/null +++ b/Readme.md @@ -0,0 +1,48 @@ +# GScripts + +A set of scripts which I use in my current Gentoo system, +all are installed through portage and of course are tested to work on my +system and my system alone. +Where possible I only use dependencies available in the main Gentoo repo +and each script has the dependencies listed. + +All scripts are licensed under the MIT (Expat) License (for more +information on why I give two names for one license please see +[what the GNU project has to say on the matter](https://www.gnu.org/licenses/license-list.en.html#Expat)) +I intentionally use the term MIT license as that is the accepted SPDX +license identifier. + +_Coming Eventually:_ +A portage repo that contains my ebuilds (where I am certain of the accuracy +of the license data). + +Where scripts have configuration all environment variables are +pseudo-namespaced by `$GScripts_