Compare commits
2 commits
28c79360b2
...
0feb20c906
Author | SHA1 | Date | |
---|---|---|---|
0feb20c906 | |||
38f0cd97a9 |
5 changed files with 37 additions and 4 deletions
4
Makefile
4
Makefile
|
@ -36,3 +36,7 @@ amfora_configs: check_xdg_settings
|
|||
.PHONY: dunst_configs
|
||||
dunst_configs: check_xdg_settings
|
||||
@./helpers/dunst/generate-dunst-config
|
||||
|
||||
.PHONY: logrotate_configs
|
||||
logrotate_configs: check_xdg_settings
|
||||
@./helpers/logrotate/generate-logrotate-config
|
||||
|
|
|
@ -2,12 +2,19 @@
|
|||
|
||||
[[ -f "${HOME}/.bashrc" ]] && source "${HOME}/.bashrc"
|
||||
|
||||
if [ -x "$( command -v polybar )" ]; then
|
||||
"${XDG_CONFIG_HOME}/polybar/launch.sh" &
|
||||
fi
|
||||
|
||||
# Start dunst
|
||||
if [ -x "$( command -v dunst )" ]; then
|
||||
dunst &
|
||||
fi
|
||||
|
||||
# Load the wallpaper
|
||||
xwallpaper --stretch ~/.local/config/wallpaper/wallpaper.png &
|
||||
|
||||
# Rotate the home logs with logrotate
|
||||
logrotate \
|
||||
--state=${XDG_STATE_HOME}/logrotate/status \
|
||||
--log=${LOG_HOME}/logrotate.log \
|
||||
${XDG_CONFIG_HOME}/logrotate/logrotate.conf \
|
||||
&
|
||||
|
||||
exec dwm
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
## vim: ft=sh :
|
||||
|
||||
export GPG_TTY=$(tty)
|
||||
export GNUPGHOME=${XDG_DATA_HOME}/gnupg
|
||||
|
|
7
config/logrotate/logrotate.conf
Normal file
7
config/logrotate/logrotate.conf
Normal file
|
@ -0,0 +1,7 @@
|
|||
${LOG_HOME}/*.log ${LOG_HOME}/nvim/*.log {
|
||||
rotate 3
|
||||
size 10M
|
||||
nocompress
|
||||
notifempty
|
||||
copytruncate
|
||||
}
|
14
helpers/logrotate/generate-logrotate-config
Executable file
14
helpers/logrotate/generate-logrotate-config
Executable file
|
@ -0,0 +1,14 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
GIT_ROOT_DIR="$( cd "$( dirname $0 )/../.." && pwd )"
|
||||
LF_DOTFILES_SOURCE_DIR="${GIT_ROOT_DIR}/config/logrotate"
|
||||
LF_DOTFILES_DESTINATION_DIR="${XDG_CONFIG_HOME}/logrotate"
|
||||
|
||||
if ! [ -d ${LF_DOTFILES_DESTINATION_DIR} ]; then
|
||||
echo "INFO: Creating directory ${LF_DOTFILES_DESTINATION_DIR}"
|
||||
mkdir ${LF_DOTFILES_DESTINATION_DIR}
|
||||
fi
|
||||
|
||||
rsync -avh ${LF_DOTFILES_SOURCE_DIR}/logrotate.conf ${LF_DOTFILES_DESTINATION_DIR}/logrotate.conf && chmod a-rwx,u+rw $_
|
Loading…
Reference in a new issue