From 480c3b5e6da3b4a98304cefdf31ffa480715d637 Mon Sep 17 00:00:00 2001 From: Salt Date: Thu, 27 Sep 2018 21:02:24 -0500 Subject: [PATCH] dtfscripts: Rename to concession Ha ha --- .../common_service.sh | 2 +- {.dtfscripts => .concession}/common_task.sh | 2 +- .dtfscripts/dtfscript => .concession/concede | 90 +++++++++---------- .../devices/dsk-cstm-0.rc | 0 .../devices/lap-th-e560-0.rc | 0 .../services/bspwm_sxhkd.dtf | 0 .../services/compton.dtf | 0 .../services/conky.dtf | 0 .../services/dropbox.dtf | 0 .../services/dunst.dtf | 0 .../services/plasmashell.dtf | 0 .../services/polybar.dtf | 0 .../services/redshift.dtf | 0 .../services/syncthing.dtf | 0 {.dtfscripts => .concession}/tasks/bspwm.sh | 0 .../tasks/bspwm_monitorset.sh | 0 .../tasks/kill_krunner.sh | 0 .../tasks/xrdbupdate.sh | 0 {.dtfscripts => .concession}/tasks/xset.sh | 0 .config/bspwm/bspwmrc | 2 +- 20 files changed, 48 insertions(+), 48 deletions(-) rename {.dtfscripts => .concession}/common_service.sh (96%) rename {.dtfscripts => .concession}/common_task.sh (89%) rename .dtfscripts/dtfscript => .concession/concede (64%) rename {.dtfscripts => .concession}/devices/dsk-cstm-0.rc (100%) rename {.dtfscripts => .concession}/devices/lap-th-e560-0.rc (100%) rename {.dtfscripts => .concession}/services/bspwm_sxhkd.dtf (100%) rename {.dtfscripts => .concession}/services/compton.dtf (100%) rename {.dtfscripts => .concession}/services/conky.dtf (100%) rename {.dtfscripts => .concession}/services/dropbox.dtf (100%) rename {.dtfscripts => .concession}/services/dunst.dtf (100%) rename {.dtfscripts => .concession}/services/plasmashell.dtf (100%) rename {.dtfscripts => .concession}/services/polybar.dtf (100%) rename {.dtfscripts => .concession}/services/redshift.dtf (100%) rename {.dtfscripts => .concession}/services/syncthing.dtf (100%) rename {.dtfscripts => .concession}/tasks/bspwm.sh (100%) rename {.dtfscripts => .concession}/tasks/bspwm_monitorset.sh (100%) rename {.dtfscripts => .concession}/tasks/kill_krunner.sh (100%) rename {.dtfscripts => .concession}/tasks/xrdbupdate.sh (100%) rename {.dtfscripts => .concession}/tasks/xset.sh (100%) diff --git a/.dtfscripts/common_service.sh b/.concession/common_service.sh similarity index 96% rename from .dtfscripts/common_service.sh rename to .concession/common_service.sh index c867a74a..0ec74eb7 100755 --- a/.dtfscripts/common_service.sh +++ b/.concession/common_service.sh @@ -24,7 +24,7 @@ function svc_log() { out=1 col_message="\e[37m" fi - dtf_log "${col_svcname}${service_name}${col_reset}: ${col_message}${1}${col_reset}" >&${out} + cnc_log "${col_svcname}${service_name}${col_reset}: ${col_message}${1}${col_reset}" >&${out} } # Basic pre-start checks. Stick extra checks in prestart-extra diff --git a/.dtfscripts/common_task.sh b/.concession/common_task.sh similarity index 89% rename from .dtfscripts/common_task.sh rename to .concession/common_task.sh index 693cd545..7c75ef83 100755 --- a/.dtfscripts/common_task.sh +++ b/.concession/common_task.sh @@ -19,6 +19,6 @@ function tsk_log() { out=1 col_message="\e[37m" fi - dtf_log "${col_tskname}${task}${col_reset}: ${col_message}${1}${col_reset}" >&${out} + cnc_log "${col_tskname}${task}${col_reset}: ${col_message}${1}${col_reset}" >&${out} } diff --git a/.dtfscripts/dtfscript b/.concession/concede similarity index 64% rename from .dtfscripts/dtfscript rename to .concession/concede index 8442179e..fa5b85e1 100755 --- a/.dtfscripts/dtfscript +++ b/.concession/concede @@ -24,8 +24,8 @@ # General unset TERMINAL # Specific to these dtfscripts -unset DTF_SERVICES -unset DTF_TASKS +unset CNC_SERVICES +unset CNC_TASKS # Polybar unset PB_MONITOR unset PB_WM_RESTACK @@ -42,7 +42,7 @@ unset BSPWM_DESKTOPS_TOTAL unset BSPWM_DESKTOPS_PRIMARY unset BSPWM_WINDOW_GAP -function dtf_log() { +function cnc_log() { name="$(basename $0 .sh)" if [ -z ${1+x} ]; then return 1; fi printf "$name: $1\n" @@ -50,97 +50,97 @@ function dtf_log() { ## Patch some directories if [[ "$PATH" != *"$HOME/.local/bin"* ]]; then - dtf_log "Patching path for $HOME/.local/bin" + cnc_log "Patching path for $HOME/.local/bin" export PATH="$HOME/.local/bin:$PATH" fi if [[ "$XDG_CONFIG_HOME" == "" ]]; then - dtf_log "Correcting configuration directory" + cnc_log "Correcting configuration directory" export XDG_CONFIG_HOME="$HOME/.config" fi if [[ "$XDG_RUNTIME_DIR" == "" ]]; then - dtf_log "Correcting runtime directory" + cnc_log "Correcting runtime directory" export XDG_RUNTIME_DIR="/run/user/$UID" fi ## Set some more variables -export DTF_HOME="$HOME/.dtfscripts" -export DTF_DEVICES_DIR="$DTF_HOME/devices" -export DTF_SERVICES_DIR="$DTF_HOME/services" -export DTF_TASKS_DIR="$DTF_HOME/tasks" +export CNC_HOME="$HOME/.concession" +export CNC_DEVICES_DIR="$CNC_HOME/devices" +export CNC_SERVICES_DIR="$CNC_HOME/services" +export CNC_TASKS_DIR="$CNC_HOME/tasks" ## Load device-specific scripts -if [[ -x "$DTF_HOME/devices/$(hostname).rc" ]]; then - dtf_log "Sourcing devices/$(hostname).rc" - source "$DTF_DEVICES_DIR/$(hostname).rc" +if [[ -x "$CNC_DEVICES_DIR/$(hostname).rc" ]]; then + cnc_log "Found device-specific config for $(hostname)" + source "$CNC_DEVICES_DIR/$(hostname).rc" fi ## Determine which tasks to run -# If DTF_TASKS is set, use that +# If CNC_TASKS is set, use that # Otherwise, run everything -if [[ "$DTF_TASKS" == "" ]]; then - dtf_log "Performing all tasks" - for task in $DTF_TASKS_DIR/*; do - export DTF_TASKS="$DTF_TASKS $(basename "$task")" +if [[ "$CNC_TASKS" == "" ]]; then + cnc_log "Performing all tasks" + for task in $CNC_TASKS_DIR/*; do + export CNC_TASKS="$CNC_TASKS $(basename "$task")" done else - dtf_log "Performing a subset of all tasks" + cnc_log "Performing a subset of all tasks" fi ## Define (and export) a task run function -function dtf_task_run() { +function cnc_task_run() { [ -z ${1+x} ] && return 1 - task_full="$DTF_TASKS_DIR/$1" + task_full="$CNC_TASKS_DIR/$1" ( if ! [ -r "$task_full" ]; then - dtf_log "Task is unreadable or missing: $task" + cnc_log "Task is unreadable or missing: $task" exit 1 fi if ! [ -x "$task_full" ]; then - dtf_log "Task is unexecutable: $task" + cnc_log "Task is unexecutable: $task" exit 1 fi - source "$DTF_HOME/common_task.sh" + source "$CNC_HOME/common_task.sh" source "$task_full" ) } -export -f dtf_task_run +export -f cnc_task_run ## Run tasks -for task in $DTF_TASKS; do - dtf_task_run $task +for task in $CNC_TASKS; do + cnc_task_run $task done ## Determine which services to run # Same as above -if [[ "$DTF_SERVICES" == "" ]]; then - dtf_log "Starting all available services" - for service in $DTF_SERVICES_DIR/*.dtf; do - export DTF_SERVICES="$DTF_SERVICES $(basename "$service")" +if [[ "$CNC_SERVICES" == "" ]]; then + cnc_log "Starting all available services" + for service in $CNC_SERVICES_DIR/*.dtf; do + export CNC_SERVICES="$CNC_SERVICES $(basename "$service")" done else - dtf_log "Starting a subset of available services" + cnc_log "Starting a subset of available services" fi ## Define (and export) service functions -function dtf_service_validate() { - service_full="$DTF_SERVICES_DIR/$1" +function cnc_service_validate() { + service_full="$CNC_SERVICES_DIR/$1" if ! [ -r "$service_full" ]; then - dtf_log "Service is unreadable or missing: $1" + cnc_log "Service is unreadable or missing: $1" return 1 fi if ! [ -x "$service_full" ]; then - dtf_log "Service is unexecutable: $1" + cnc_log "Service is unexecutable: $1" return 1 fi return 0 } -export -f dtf_service_validate +export -f cnc_service_validate -function dtf_service_start() { - service_full="$DTF_SERVICES_DIR/$1" - dtf_service_validate $1 || return 1 +function cnc_service_start() { + service_full="$CNC_SERVICES_DIR/$1" + cnc_service_validate $1 || return 1 ( - source "$DTF_HOME/common_service.sh" + source "$CNC_HOME/common_service.sh" source "$service_full" isup && [[ "$service_kill_on_reload" == "true" ]] && stop prestart || exit 1 @@ -149,12 +149,12 @@ function dtf_service_start() { start-extra ) } -export -f dtf_service_start +export -f cnc_service_start ## Run startup scripts -for service in $DTF_SERVICES; do - dtf_service_start $service +for service in $CNC_SERVICES; do + cnc_service_start $service done -dtf_log "Finished initialization" +cnc_log "Finished initialization" diff --git a/.dtfscripts/devices/dsk-cstm-0.rc b/.concession/devices/dsk-cstm-0.rc similarity index 100% rename from .dtfscripts/devices/dsk-cstm-0.rc rename to .concession/devices/dsk-cstm-0.rc diff --git a/.dtfscripts/devices/lap-th-e560-0.rc b/.concession/devices/lap-th-e560-0.rc similarity index 100% rename from .dtfscripts/devices/lap-th-e560-0.rc rename to .concession/devices/lap-th-e560-0.rc diff --git a/.dtfscripts/services/bspwm_sxhkd.dtf b/.concession/services/bspwm_sxhkd.dtf similarity index 100% rename from .dtfscripts/services/bspwm_sxhkd.dtf rename to .concession/services/bspwm_sxhkd.dtf diff --git a/.dtfscripts/services/compton.dtf b/.concession/services/compton.dtf similarity index 100% rename from .dtfscripts/services/compton.dtf rename to .concession/services/compton.dtf diff --git a/.dtfscripts/services/conky.dtf b/.concession/services/conky.dtf similarity index 100% rename from .dtfscripts/services/conky.dtf rename to .concession/services/conky.dtf diff --git a/.dtfscripts/services/dropbox.dtf b/.concession/services/dropbox.dtf similarity index 100% rename from .dtfscripts/services/dropbox.dtf rename to .concession/services/dropbox.dtf diff --git a/.dtfscripts/services/dunst.dtf b/.concession/services/dunst.dtf similarity index 100% rename from .dtfscripts/services/dunst.dtf rename to .concession/services/dunst.dtf diff --git a/.dtfscripts/services/plasmashell.dtf b/.concession/services/plasmashell.dtf similarity index 100% rename from .dtfscripts/services/plasmashell.dtf rename to .concession/services/plasmashell.dtf diff --git a/.dtfscripts/services/polybar.dtf b/.concession/services/polybar.dtf similarity index 100% rename from .dtfscripts/services/polybar.dtf rename to .concession/services/polybar.dtf diff --git a/.dtfscripts/services/redshift.dtf b/.concession/services/redshift.dtf similarity index 100% rename from .dtfscripts/services/redshift.dtf rename to .concession/services/redshift.dtf diff --git a/.dtfscripts/services/syncthing.dtf b/.concession/services/syncthing.dtf similarity index 100% rename from .dtfscripts/services/syncthing.dtf rename to .concession/services/syncthing.dtf diff --git a/.dtfscripts/tasks/bspwm.sh b/.concession/tasks/bspwm.sh similarity index 100% rename from .dtfscripts/tasks/bspwm.sh rename to .concession/tasks/bspwm.sh diff --git a/.dtfscripts/tasks/bspwm_monitorset.sh b/.concession/tasks/bspwm_monitorset.sh similarity index 100% rename from .dtfscripts/tasks/bspwm_monitorset.sh rename to .concession/tasks/bspwm_monitorset.sh diff --git a/.dtfscripts/tasks/kill_krunner.sh b/.concession/tasks/kill_krunner.sh similarity index 100% rename from .dtfscripts/tasks/kill_krunner.sh rename to .concession/tasks/kill_krunner.sh diff --git a/.dtfscripts/tasks/xrdbupdate.sh b/.concession/tasks/xrdbupdate.sh similarity index 100% rename from .dtfscripts/tasks/xrdbupdate.sh rename to .concession/tasks/xrdbupdate.sh diff --git a/.dtfscripts/tasks/xset.sh b/.concession/tasks/xset.sh similarity index 100% rename from .dtfscripts/tasks/xset.sh rename to .concession/tasks/xset.sh diff --git a/.config/bspwm/bspwmrc b/.config/bspwm/bspwmrc index 732ad6d0..69443ce0 100755 --- a/.config/bspwm/bspwmrc +++ b/.config/bspwm/bspwmrc @@ -21,7 +21,7 @@ # SOFTWARE. # Load session startup script -dtfscript="$HOME/.dtfscripts/dtfscript" +dtfscript="$HOME/.concession/concede" if [[ -x "$dtfscript" ]]; then source "$dtfscript" exit 0