dtfscript: Move to dedicated folder

This commit is contained in:
2018-09-27 20:48:37 -05:00
parent 28817a4542
commit df9bf53a9d
20 changed files with 7 additions and 7 deletions

View File

@@ -0,0 +1,19 @@
#! /usr/bin/env bash
#
# Simple wmstartup service
# Copyright (C) 2018 salt <salt@lap-th-e560-0>
#
# Distributed under terms of the MIT license.
#
service_name="sxhkd"
service_process="sxhkd"
function prestart-extra() {
if ! pgrep bspwm > /dev/null 2>&1; then
svc_log "Not under bspwm" 2
return 1
fi
return 0
}

View File

@@ -0,0 +1,19 @@
#! /usr/bin/env bash
#
# Simple wmstartup service
# Copyright (C) 2018 salt <salt@lap-th-e560-0>
#
# Distributed under terms of the MIT license.
#
service_name="Compton"
service_process="compton"
function prestart-extra() {
if [[ "$HOST" == "vm-*" ]]; then
svc_log "Will not start: in a VM" 2
return 1
fi
return 0
}

31
.dtfscripts/services/conky.dtf Executable file
View File

@@ -0,0 +1,31 @@
#! /usr/bin/env bash
#
# Simple wmstartup service
# Copyright (C) 2018 salt <salt@lap-th-e560-0>
#
# Distributed under terms of the MIT license.
#
service_name="Conky"
service_process="conky"
function start() {
for file in $XDG_CONFIG_HOME/conky/*.conf; do
svc_log "Starting with config $file"
conky -c $file > /dev/null 2>&1 &
done
return 0
}
function start-extra() {
for i in {1..100}; do
if xprop -name "Conky" > /dev/null 2>&1; then break; fi
sleep 0.01
if (( $i > 99 )); then
svc_log "Conky may spawn behind the current desktop" 2
break
fi
done
return 0
}

View File

@@ -0,0 +1,12 @@
#! /usr/bin/env bash
#
# Simple wmstartup service
# Copyright (C) 2018 salt <salt@lap-th-e560-0>
#
# Distributed under terms of the MIT license.
#
service_name="Dropbox"
service_process="dropbox"
service_kill_on_reload="false"

11
.dtfscripts/services/dunst.dtf Executable file
View File

@@ -0,0 +1,11 @@
#! /usr/bin/env bash
#
# Simple wmstartup service
# Copyright (C) 2018 salt <salt@lap-th-e560-0>
#
# Distributed under terms of the MIT license.
#
service_name="Dunst"
service_process="dunst"

View File

@@ -0,0 +1,11 @@
#! /usr/bin/env bash
#
# Simple wmstartup service
# Copyright (C) 2018 salt <salt@lap-th-e560-0>
#
# Distributed under terms of the MIT license.
#
service_name="Plasma"
service_process="plasmashell"

View File

@@ -0,0 +1,39 @@
#! /usr/bin/env bash
#
# Simple wmstartup service
# Copyright (C) 2018 salt <salt@lap-th-e560-0>
#
# Distributed under terms of the MIT license.
#
service_name="Polybar"
service_process="polybar"
function start() {
# Set some variables, if necessary
if [[ "$PB_BAR_BORDER_SIZE" == "" ]] && pgrep bspwm > /dev/null 2>&1; then
if ! [[ "$BSPWM_WINDOW_GAP" == "" ]]; then
svc_log "Inferring bar size from BSPWM_WINDOW_GAP"
export PB_BAR_BORDER_SIZE="$BSPWM_WINDOW_GAP"
fi
fi
# Spawn bars on the primary monitor
export PB_MONITOR=$(xrandr -q | awk '/primary/{print $1}')
svc_log "Starting primary bar(s) on monitor $PB_MONITOR"
polybar -r primary >/dev/null 2>/dev/null &
polybar -r primary-2 >/dev/null 2>/dev/null &
# Spawn more for each secondary
export secondary_monitors=$(xrandr -q | grep ' connected' | grep -v 'primary' | awk '{print $1}')
if [[ "$secondary_monitors" == "" ]]; then
return 0
fi
for monitor in $secondary_monitors; do
svc_log "Starting secondary bar(s) on monitor $monitor"
PB_MONITOR=$monitor
polybar -r secondary >/dev/null 2>/dev/null &
polybar -r secondary-2 >/dev/null 2>/dev/null &
done
return 0
}

View File

@@ -0,0 +1,12 @@
#! /usr/bin/env bash
#
# Simple wmstartup service
# Copyright (C) 2018 salt <salt@lap-th-e560-0>
#
# Distributed under terms of the MIT license.
#
service_name="Redshift"
service_process="redshift"
service_kill_on_reload="false"

View File

@@ -0,0 +1,13 @@
#! /usr/bin/env bash
#
# Simple wmstartup service
# Copyright (C) 2018 salt <salt@lap-th-e560-0>
#
# Distributed under terms of the MIT license.
#
service_name="Syncthing"
service_process="syncthing"
service_kill_on_reload="false"
service_flags="--no-browser"