diff --git a/README.md b/README.md index f0bfa46..abe7cff 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Lastly, make sure you're not executing a bunch of stuff from your WM's config. F ## Configuration -On first run and when invoked with `firestarter -g`, Firestarter will generate a series of configuration files in `~/.config/firestarter`. These files consist of several lines that look somewhat like the following: +In the `contrib` directory of this repository is a series of example configuration files. These files consist of several lines that look somewhat like the following: ```bash #.fsdefaults diff --git a/contrib/example-configs/audio-daemon b/contrib/example-configs/audio-daemon new file mode 100644 index 0000000..6331ef8 --- /dev/null +++ b/contrib/example-configs/audio-daemon @@ -0,0 +1,3 @@ +#.fsdefaults +command -v pulseaudio +pulseaudio diff --git a/contrib/example-configs/bar b/contrib/example-configs/bar new file mode 100644 index 0000000..6111fb0 --- /dev/null +++ b/contrib/example-configs/bar @@ -0,0 +1,13 @@ +#.fsdefaults +command -v polybar && [ -r "~/.config/polybar/launch.sh" ] +"~/.config/polybar/launch.sh" +command -v tint2 +tint2 +command -v lxpanel +lxpanel +command -v lxqt-panel +lxqt-panel +command -v mate-panel +mate-panel +command -v xfce4-panel +xfce4-panel diff --git a/contrib/example-configs/blue-light-filter b/contrib/example-configs/blue-light-filter new file mode 100644 index 0000000..3914a89 --- /dev/null +++ b/contrib/example-configs/blue-light-filter @@ -0,0 +1,5 @@ +#.fsdefaults +command -v redshift-gtk +redshift-gtk +command -v redshift +redshift diff --git a/contrib/example-configs/compositor b/contrib/example-configs/compositor new file mode 100644 index 0000000..dcbf0de --- /dev/null +++ b/contrib/example-configs/compositor @@ -0,0 +1,9 @@ +#.fsdefaults +[ -z "$DISPLAY" ] +: +command -v unagi +unagi +command -v compton +compton +command -v xcompmgr +xcompmgr diff --git a/contrib/example-configs/hotkey-daemon b/contrib/example-configs/hotkey-daemon new file mode 100644 index 0000000..b45bd99 --- /dev/null +++ b/contrib/example-configs/hotkey-daemon @@ -0,0 +1,7 @@ +#.fsdefaults +[ -z "$DISPLAY" ] +: +command -v sxhkd +sxhkd +command -v lxqt-globalkeysd +lxqt-globalkeysd diff --git a/contrib/example-configs/network-daemon b/contrib/example-configs/network-daemon new file mode 100644 index 0000000..77933ba --- /dev/null +++ b/contrib/example-configs/network-daemon @@ -0,0 +1,3 @@ +#.fsdefaults +command -v nm-applet +nm-applet diff --git a/contrib/example-configs/notification-daemon b/contrib/example-configs/notification-daemon new file mode 100644 index 0000000..1522d9e --- /dev/null +++ b/contrib/example-configs/notification-daemon @@ -0,0 +1,7 @@ +#.fsdefaults +[ -z "$DISPLAY" ] +: +command -v dunst +dunst +command -v lxqt-notificationd +notificationd diff --git a/contrib/example-configs/polkit-agent b/contrib/example-configs/polkit-agent new file mode 100644 index 0000000..43c6425 --- /dev/null +++ b/contrib/example-configs/polkit-agent @@ -0,0 +1,42 @@ +#.fsdefaults +command -v lxqt-policykit-agent +lxqt-policykit-agent +command -v lxpolkit +lxpolkit +command -v mate-polkit +mate-polkit +command -v polkit-efl-authentication-agent-1 +polkit-efl-authentication-agent-1 +[ -x "/usr/lib/ts-polkitagent" ] +/usr/lib/ts-polkitagent +[ -x "/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1" ] +/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1 +[ -x "/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1" ] +/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 +# Debian locations +# On generation time, your architecture is filled in here +[ -x "/usr/lib/$(uname -m)-linux-gnu/polkit-mate/polkit-mate-authentication-agent-1" ] +"/usr/lib/$(uname -m)-linux-gnu/polkit-mate/polkit-mate-authentication-agent-1" +[ -x "/usr/lib/$(uname -m)-linux-gnu/libexec/polkit-kde-authentication-agent-1" ] +"/usr/lib/$(uname -m)-linux-gnu/libexec/polkit-kde-authentication-agent-1" +# OpenSuSE locations +[ -x "/usr/lib/polkit-mate/polkit-mate-authentication-agent-1" ] +"/usr/lib/polkit-mate/polkit-mate-authentication-agent-1" +[ -x "/usr/lib/polkit-kde-authentication-agent-1" ] +"/usr/lib/polkit-kde-authentication-agent-1" +# Arch locations +[ -x "/usr/lib/mate-polkit/polkit-mate-authentication-agent-1" ] +/usr/lib/mate-polkit/polkit-mate-authentication-agent-1 +[ -x "/usr/lib/polkit-kde-authentication-agent-1" ] +/usr/lib/polkit-kde-authentication-agent-1 +# Fedora locations +[ -x "/usr/libexec/xfce-polkit" ] +/usr/libexec/xfce-polkit +[ -x "/usr/libexec/lxqt-policykit-agent" ] +/usr/libexec/lxqt-policykit-agent +[ -x "/usr/libexec/polkit-mate-authentication-agent-1" ] +/usr/libexec/polkit-mate-authentication-agent-1 +[ -x "/usr/libexec/kf5/polkit-kde-authentication-agent-1" ] +/usr/libexec/kf5/polkit-kde-authentication-agent-1 +[ -x "/usr/libexec/polkit-gnome-authentication-agent-1" ] +/usr/libexec/polkit-gnome-authentication-agent-1 diff --git a/contrib/example-configs/power-daemon b/contrib/example-configs/power-daemon new file mode 100644 index 0000000..be3521e --- /dev/null +++ b/contrib/example-configs/power-daemon @@ -0,0 +1,15 @@ +#.fsdefaults +command -v batterymon +batterymon +command -v cbatticon +cbatticon +command -v lxqt-powermangement +lxqt-powermanagement +command -v xfce4-power-manager +xfce4-power-manager +command -v mate-power-manager +mate-power-manager +[ -x "/usr/lib/$(uname -m)-linux-gnu/libexec/org_kde_powerdevil" ] +/usr/lib/$(uname -m)-linux-gnu/libexec/org_kde_powerdevil +command -v gnome-power-manager +gnome-power-manager diff --git a/contrib/example-configs/runner b/contrib/example-configs/runner new file mode 100644 index 0000000..9dd18a6 --- /dev/null +++ b/contrib/example-configs/runner @@ -0,0 +1,3 @@ +#.fsdefaults +command -v krunner +krunner diff --git a/contrib/example-configs/settings-daemon b/contrib/example-configs/settings-daemon new file mode 100644 index 0000000..9c5b522 --- /dev/null +++ b/contrib/example-configs/settings-daemon @@ -0,0 +1,13 @@ +#.fsdefaults +command -v xsettingsd +xsettingsd +command -v xsettings-kde +xsettingskde +command -v lxsettings-daemon +lxsettings-daemon +command -v xfsettingsd +xfsettingsd +command -v mate-settings-daemon +mate-settings-daemon +command -v gnome-settings-daemon +gnome-settings-daemon diff --git a/contrib/example-configs/stat-glances b/contrib/example-configs/stat-glances new file mode 100644 index 0000000..e369929 --- /dev/null +++ b/contrib/example-configs/stat-glances @@ -0,0 +1,7 @@ +#.fsdefaults +[ -z "$DISPLAY" ] +: +# Note: the dumb sleep hack is because Conky crashes with window_type override if the WM hasn't loaded yet +# This gives the WM ample time to load up +command -v conky && [ -r "${XDG_CONFIG_HOME:-~/.config}/conky/conky.conf" ] +sleep 5 && conky diff --git a/contrib/example-configs/wallpaper b/contrib/example-configs/wallpaper new file mode 100644 index 0000000..4233926 --- /dev/null +++ b/contrib/example-configs/wallpaper @@ -0,0 +1,7 @@ +#.fsdefaults +[ -z "$DISPLAY" ] +: +command -v feh && [ -r "~/.fehbg" ] +~/.fehbg +command -v nitrogen +nitrogen --restore diff --git a/contrib/example-configs/wm b/contrib/example-configs/wm new file mode 100644 index 0000000..1acd572 --- /dev/null +++ b/contrib/example-configs/wm @@ -0,0 +1,63 @@ +#.fsdefaults +[ -z "$DISPLAY" ] +: +command -v 2bwm +2bwm +command -v aewm +aewm +command -v awesome +awesome +command -v bspwm +bspwm +command -v catwm +catwm +command -v cwm +cwm +command -v dwm +dwm +command -v evilwm +evilwm +command -v exwm +exwm +command -v fluxbox +fluxbox +command -v flwm +flwm +command -v fvwm +fvwm +command -v herbstluftwm +herbstluftwm +command -v i3 +i3 +command -v icewm +icewm +command -v jbwm +jbwm +command -v jwm +jwm +command -v lwm +lwm +command -v openbox +openbox +command -v pawm +pawm +command -v ratpoison +ratpoison +command -v twm +twm +command -v windowmaker +windowmaker +command -v wmii +wmii +command -v xmonad +xmonad +command -v xfwm4 +xfwm4 +command -v metacity +metacity +command -v mutter +mutter +command -v kwin +kwin +command -v tinywm +tinywm diff --git a/firestarter b/firestarter index aacdce6..1f8e634 100755 --- a/firestarter +++ b/firestarter @@ -15,7 +15,6 @@ declare -r _sessionid="$(< /proc/self/sessionid)" declare _optconfigdir="${XDG_CONFIG_HOME:-$HOME/.config}/${_name}" declare _optdryrun declare _optlogdir="$_optconfigdir/logs" -declare _optpregen declare -i _opthelp declare -i _optverbose # Working variables @@ -97,250 +96,6 @@ gettarget() { done < "$1" return 2 } -genconfigs() { - log "Creating default config setup in \"$_optconfigdir\"" - log "See firestarter -h for more information" - # Audio daemon - cat << EOF > "$_optconfigdir/audio-daemon" -#.fsdefaults -command -v pulseaudio -pulseaudio -EOF - # Information bars - cat << EOF > "$_optconfigdir/bar" -#.fsdefaults -command -v polybar && [ -r "~/.config/polybar/launch.sh" ] -"~/.config/polybar/launch.sh" -command -v tint2 -tint2 -command -v lxpanel -lxpanel -command -v lxqt-panel -lxqt-panel -command -v mate-panel -mate-panel -command -v xfce4-panel -xfce4-panel -EOF - # Blue light filter - cat << EOF > "$_optconfigdir/blue-light-filter" -#.fsdefaults -command -v redshift-gtk -redshift-gtk -command -v redshift -redshift -EOF - # Compositor - cat << EOF > "$_optconfigdir/compositor" -#.fsdefaults -[ -z "\$DISPLAY" ] -: -command -v unagi -unagi -command -v compton -compton -command -v xcompmgr -xcompmgr -EOF - # Polkit authentication agents - cat << EOF > "$_optconfigdir/polkit-agent" -#.fsdefaults -command -v lxqt-policykit-agent -lxqt-policykit-agent -command -v lxpolkit -lxpolkit -command -v mate-polkit -mate-polkit -command -v polkit-efl-authentication-agent-1 -polkit-efl-authentication-agent-1 -[ -x "/usr/lib/ts-polkitagent" ] -/usr/lib/ts-polkitagent -[ -x "/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1" ] -/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1 -[ -x "/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1" ] -/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 -# Debian locations -# On generation time, your architecture is filled in here -[ -x "/usr/lib/\$(uname -m)-linux-gnu/polkit-mate/polkit-mate-authentication-agent-1" ] -"/usr/lib/\$(uname -m)-linux-gnu/polkit-mate/polkit-mate-authentication-agent-1" -[ -x "/usr/lib/\$(uname -m)-linux-gnu/libexec/polkit-kde-authentication-agent-1" ] -"/usr/lib/\$(uname -m)-linux-gnu/libexec/polkit-kde-authentication-agent-1" -# OpenSuSE locations -[ -x "/usr/lib/polkit-mate/polkit-mate-authentication-agent-1" ] -"/usr/lib/polkit-mate/polkit-mate-authentication-agent-1" -[ -x "/usr/lib/polkit-kde-authentication-agent-1" ] -"/usr/lib/polkit-kde-authentication-agent-1" -# Arch locations -[ -x "/usr/lib/mate-polkit/polkit-mate-authentication-agent-1" ] -/usr/lib/mate-polkit/polkit-mate-authentication-agent-1 -[ -x "/usr/lib/polkit-kde-authentication-agent-1" ] -/usr/lib/polkit-kde-authentication-agent-1 -# Fedora locations -[ -x "/usr/libexec/xfce-polkit" ] -/usr/libexec/xfce-polkit -[ -x "/usr/libexec/lxqt-policykit-agent" ] -/usr/libexec/lxqt-policykit-agent -[ -x "/usr/libexec/polkit-mate-authentication-agent-1" ] -/usr/libexec/polkit-mate-authentication-agent-1 -[ -x "/usr/libexec/kf5/polkit-kde-authentication-agent-1" ] -/usr/libexec/kf5/polkit-kde-authentication-agent-1 -[ -x "/usr/libexec/polkit-gnome-authentication-agent-1" ] -/usr/libexec/polkit-gnome-authentication-agent-1 -EOF - # Hotkey daemon - cat << EOF > "$_optconfigdir/hotkey-daemon" -#.fsdefaults -[ -z "\$DISPLAY" ] -: -command -v sxhkd -sxhkd -command -v lxqt-globalkeysd -lxqt-globalkeysd -EOF - # Network daemon - cat << EOF > "$_optconfigdir/network-daemon" -#.fsdefaults -command -v nm-applet -nm-applet -EOF - # Notification daemon - cat << EOF > "$_optconfigdir/notification-daemon" -#.fsdefaults -[ -z "\$DISPLAY" ] -: -command -v dunst -dunst -command -v lxqt-notificationd -notificationd -EOF - # Power daemons - cat << EOF > "$_optconfigdir/power-daemon" -#.fsdefaults -command -v batterymon -batterymon -command -v cbatticon -cbatticon -command -v lxqt-powermangement -lxqt-powermanagement -command -v xfce4-power-manager -xfce4-power-manager -command -v mate-power-manager -mate-power-manager -[ -x "/usr/lib/\$(uname -m)-linux-gnu/libexec/org_kde_powerdevil" ] -/usr/lib/\$(uname -m)-linux-gnu/libexec/org_kde_powerdevil -command -v gnome-power-manager -gnome-power-manager -EOF - # Runners - # Note that rofi is not a daemon and is not included here - cat << EOF > "$_optconfigdir/runner" -#.fsdefaults -command -v krunner -krunner -EOF - # Settings daemons - cat << EOF > "$_optconfigdir/settings-daemon" -#.fsdefaults -command -v xsettingsd -xsettingsd -command -v xsettings-kde -xsettingskde -command -v lxsettings-daemon -lxsettings-daemon -command -v xfsettingsd -xfsettingsd -command -v mate-settings-daemon -mate-settings-daemon -command -v gnome-settings-daemon -gnome-settings-daemon -EOF - # System statistics glances - cat << EOF > "$_optconfigdir/stat-glances" -#.fsdefaults -[ -z "\$DISPLAY" ] -: -# Note: the dumb sleep hack is because Conky crashes with window_type override if the WM hasn't loaded yet -# This gives the WM ample time to load up -command -v conky && [ -r "\${XDG_CONFIG_HOME:-~/.config}/conky/conky.conf" ] -sleep 5 && conky -EOF - # Wallpaper setters - cat << EOF > "$_optconfigdir/wallpaper" -#.fsdefaults -[ -z "\$DISPLAY" ] -: -command -v feh && [ -r "~/.fehbg" ] -~/.fehbg -command -v nitrogen -nitrogen --restore -EOF - # Window managers - cat << EOF > "$_optconfigdir/wm" -#.fsdefaults -[ -z "\$DISPLAY" ] -: -command -v 2bwm -2bwm -command -v aewm -aewm -command -v awesome -awesome -command -v bspwm -bspwm -command -v catwm -catwm -command -v cwm -cwm -command -v dwm -dwm -command -v evilwm -evilwm -command -v exwm -exwm -command -v fluxbox -fluxbox -command -v flwm -flwm -command -v fvwm -fvwm -command -v herbstluftwm -herbstluftwm -command -v i3 -i3 -command -v icewm -icewm -command -v jbwm -jbwm -command -v jwm -jwm -command -v lwm -lwm -command -v openbox -openbox -command -v pawm -pawm -command -v ratpoison -ratpoison -command -v twm -twm -command -v windowmaker -windowmaker -command -v wmii -wmii -command -v xmonad -xmonad -command -v xfwm4 -xfwm4 -command -v metacity -metacity -command -v mutter -mutter -command -v kwin -kwin -command -v tinywm -tinywm -EOF -} step_preexecute() { # Special things that can't use simple configuration files [ -n "$_optdryrun" ] && return 0 @@ -428,10 +183,7 @@ step_execute() { fi for file in "$_optconfigdir"/*; do if ! [ -e "$file" ]; then - log "No configuration files found; generating defaults" - genconfigs - step_execute - return + error "No configuration files found" 70 fi # Skip our logs directory [ "$_optlogdir" == "$file" ] && continue @@ -529,7 +281,6 @@ Usage: $_name [OPTION]... -d Perform a dry run; print what programs would have been executed instead of doing so - -g Regenerate default configs. This will clobber -h Print this help text -v Print more status messages. Stacks @@ -548,14 +299,11 @@ main() { # Parse out arguments while [ -n "$1" ]; do # Parse out flags - while getopts ":dghv" opt; do + while getopts ":dhv" opt; do case $opt in d) _optdryrun=1 ;; - g) - _optpregen=1 - ;; h) _opthelp=1 ;; @@ -580,13 +328,8 @@ main() { done # Early hook for help [ -n "$_opthelp" ] && printhelp && exit 0 - # Early hook for generating configs - if [ -n "$_optpregen" ]; then - genconfigs - exit $? - fi # Ensure our running environment is sane and that we're not about to nest - if [ -z "$_optdryrun" ] && [ -z "$_optpregen" ]; then + if [ -z "$_optdryrun" ]; then for pid in $(pgrep firestarter); do # Skip invalid PIDs ! [ -d "$/proc/$pid" ] && continue