From 393dd4e0423b8113fad8486416a7da2d2bf2cda2 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sun, 23 Feb 2020 22:35:11 +0100 Subject: [PATCH] [sh] Remove dimswitch,clean homedir,improve exist Removed dimswitch script. I liked it but it has been utterly superseded by styler; if wanting to switch light and dark I can just switch to light or dark base16 theme and do not have to rely on alacritty config file hacking through dimswitch (well, now just through styler, yay.) exist script will print message to stdout even if it prints to notify, this makes more sense since now passing a loudness factor just adds it to the message, instead of replacing printed message with libnotify. Added stow ignores to top-level files. Not entirely sure if it is needed, but they were linked on my system and the change shouldn't hurt. --- .stowrc | 3 + scripts/.local/bin/dimswitch | 197 ----------------------------------- sh/.local/bin/exist | 3 +- 3 files changed, 4 insertions(+), 199 deletions(-) delete mode 100755 scripts/.local/bin/dimswitch diff --git a/.stowrc b/.stowrc index ee23bfa..b8129aa 100644 --- a/.stowrc +++ b/.stowrc @@ -1 +1,4 @@ --target=~ +--ignore='^.gitlab-ci.yml$' +--ignore='^.stowrc$' +--ignore='^.githooks$' diff --git a/scripts/.local/bin/dimswitch b/scripts/.local/bin/dimswitch deleted file mode 100755 index 59f6902..0000000 --- a/scripts/.local/bin/dimswitch +++ /dev/null @@ -1,197 +0,0 @@ -#!/usr/bin/env bash -# -#============================================================================== -# FILE: dimswitch -# USAGE: dimswitch [-v] [-h] [-i [application]] [-t theme name] dark/light -# -# DESCRIPTION: -# Toggle alacritty terminal, and between dark -# or light mode (if correctly set up in the alacritty.yml file), see REQUIREMENTS -# The default action is to toggle between light and dark mode. -# -# OPTIONS: see function ’usage’ below -# -# REQUIREMENTS: -# The alacritty.yml file needs to have the various color-schemes set up as yaml -# anchors. The script itself will then switch the referenced anchor in the actual -# `color` key of the file. For an example alacritty.yml refer to its wiki, or -# this file: https://gitlab.com/marty-oehme/dotfiles/blob/master/.config/alacritty/alacritty.yml -# -# NOTES: This script is in active development and its functionality and options -# are very much undergoing changes. For now, do not rely on its options -# staying stable. -# -# AUTHOR: -# Marty Oehme -# -# VERSION: -ld_version="0.1.1" -#============================================================================== - -#=== environment variables ==================================================== -# DESCRIPTION: Environment variables to configure the script -#============================================================================== - -# Sets the programs to be dimmed -if [ -z "$DIM_PROGRAMS" ]; then DIM_PROGRAMS=(alacritty); fi - -# Sets the path(s) to the alacritty configuration file -if [ -z "$DIM_ALACRITTY_CONF" ]; then DIM_ALACRITTY_CONF="$HOME/.config/alacritty/alacritty.yml:$HOME/.alacritty.yml"; fi - -#=== main function ============================================================ -# NAME: main -# DESCRIPTION: Display usage information for this script. -# PARAMETERS: see usage function -#============================================================================== -main() { - local cmd="" - local ret=0 - - case "$1" in - -v | --version) - cmd="version" - ;; - -h | --help) - cmd="usage" - ;; - -i | --info) - cmd="printinfo" - ;; - "") - cmd="toggle" - ;; - esac - shift - - $cmd "$@" - ret=$((ret + $?)) - exit $ret -} - -#=== usage function =========================================================== -# NAME: usage -# DESCRIPTION: Display usage information for this script. -#============================================================================== -usage() { - local name - name=$(basename "$0") - cat </dev/null; then notify-send "📦 $1" --urgency="$2" "must be installed for this function." - else - printf "%s: 📦 %s must be installed for this function.\n" "$2" "$1" fi + printf "%s: 📦 %s must be installed for this function.\n" "$2" "$1" fi exit 1 fi