Rename to system-helpers
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Alexander Schäferdiek 2022-09-17 20:28:53 +02:00
parent 9466f83acc
commit 25659467cc
33 changed files with 15 additions and 3170 deletions

View file

@ -1,6 +1,6 @@
# README # README
dotfiles-system is a collection of helper systemd services, systemd timers and system-helpers is a collection of helper systemd services, systemd timers and
shell scripts for common configuration and tasks like shell scripts for common configuration and tasks like
* checking if systemd services and timers are running * checking if systemd services and timers are running
@ -16,7 +16,7 @@ shell scripts for common configuration and tasks like
Provided systemd services mostly support mail notifications if they have failed Provided systemd services mostly support mail notifications if they have failed
via systemd_failure_notify. via systemd_failure_notify.
See `/usr/share/doc/dotfiles-system` for example configurations which should See `/usr/share/doc/system-helpers` for example configurations which should
be copied inside $HOME or /etc depending on the helper script. be copied inside $HOME or /etc depending on the helper script.
## Installation ## Installation
@ -37,7 +37,7 @@ Services and scripts don't depend on each other but have hints that they can be
combined (out-commented line in service files for `systemd_failure_notify@.service` combined (out-commented line in service files for `systemd_failure_notify@.service`
for example). for example).
Examples are given inside `usr/share/doc/dotfiles-system`. Examples are given inside `usr/share/doc/system-helpers`.
## FAQ ## FAQ

View file

@ -1,6 +1,6 @@
# dotfiles-system # system-helpers
dotfiles-system is a collection of helper systemd services, systemd timers and system-helpers is a collection of helper systemd services, systemd timers and
shell scripts for common configuration and tasks like shell scripts for common configuration and tasks like
* checking if systemd services and timers are running * checking if systemd services and timers are running
@ -16,5 +16,5 @@ shell scripts for common configuration and tasks like
Provided systemd services mostly support mail notifications if they have failed Provided systemd services mostly support mail notifications if they have failed
via systemd_failure_notify. via systemd_failure_notify.
See `/usr/share/doc/dotfiles-system` for example configurations which should See `/usr/share/doc/system-helpers` for example configurations which should
be copied inside $HOME or /etc depending on the helper script. be copied inside $HOME or /etc depending on the helper script.

3
_pkg/.gitignore vendored
View file

@ -1,3 +0,0 @@
*
!PKGBUILD
!.gitignore

View file

@ -1,13 +1,13 @@
pkgname=dotfiles-system-git pkgname=system-helpers-git
_pkgname="dotfiles-system" _pkgname="system-helpers"
pkgver=r83.7338248 pkgver=r83.7338248
pkgrel=1 pkgrel=1
pkgdesc="Common system helper scripts" pkgdesc="Common system helper scripts"
arch=('any') arch=('any')
url="https://git.myservermanager.com/alexander.schaeferdiek/dotfiles-system" url="https://git.myservermanager.com/alexander.schaeferdiek/system-helpers"
makedepends=('git') makedepends=('git')
license=('GPL') license=('GPL')
source=("${pkgname}::git+https://git.myservermanager.com/alexander.schaeferdiek/dotfiles-system.git") source=("${pkgname}::git+https://git.myservermanager.com/alexander.schaeferdiek/system-helpers.git")
sha256sums=('SKIP') sha256sums=('SKIP')
pkgver() { pkgver() {

View file

@ -1,5 +0,0 @@
set nowrap
set tabsize 4
set tabstospaces
include "/usr/share/nano/*.nanorc"

File diff suppressed because it is too large Load diff

View file

@ -1,41 +0,0 @@
" to use themes, comment out the example themes (Plug and below)
" enter vim and type :PlugInstall or :PlugUpdate
filetype plugin indent on
syntax on
set ai
set bs=2
set cc=80,120
set fdm=syntax
set formatoptions+=j
"set lcs=tab:\│\ ,trail:·,eol:¬
set ls=2
set nu
set rnu
set ru
set si
set sta
set sw=4
set ts=4
set ttyfast
set udf
set wmnu
" disable folding
set nofoldenable
" Specify a directory for plugins
" - Avoid using standard Vim directory names like 'plugin'
call plug#begin('~/.vim/plugged')
"Plug 'chriskempson/base16-vim'
"Plug 'dracula/vim', { 'as': 'dracula' }
"Plug 'junegunn/vim-easy-align'
" Initialize plugin system
call plug#end()
"colorscheme base16-atelier-forest
"colorscheme dracula
if has('gui_running')
set go=m
endif

View file

@ -1,2 +0,0 @@
#!/bin/zsh
loadkeys de

View file

@ -1,33 +0,0 @@
#!/usr/bin/env zsh
alias pkgfile-update="sudo pkgfile --update"
alias pac="yay"
# recommended hooks: pacman-cleanup-hook
alias pkg-upgrade="yay && pacman-orphans && sync"
alias pkg-upgrade-full="yay -Syyu --devel && pacman-orphans && sync"
alias pacdiff-merge='sudo DIFFPROG=vimdiff DIFFSEARCHPATH="/boot /etc /usr" pacdiff'
alias font-cache-update='sudo fc-cache -vf'
alias mkinitcpio-linux='sudo mkinitcpio -p linux'
pacman-orphans() {
if [[ ! -n $(pacman -Qdt) ]]; then
echo "No orphans to remove."
else
sudo pacman -Rns $(pacman -Qdtq)
fi
}
pacman-unneeded() {
ignoregrp="base base-devel"
ignorepkg=""
comm -23 <(pacman -Qqt | sort) <(echo $ignorepkg | tr ' ' '\n' | cat <(pacman -Sqg $ignoregrp) - | sort -u)
}
pacman-modified() {
pacman -Qii | awk '/^MODIFIED/ {print $2}'
}
pacman-disowned() {
sudo lostfiles
}

View file

@ -1,37 +0,0 @@
#!/usr/bin/env zsh
alias systemctl-list-running-services="sudo systemctl --type=service"
alias systemctl-list-units='sudo systemctl list-units'
alias systemctl-list-unit-files='sudo systemctl list-unit-files'
alias systemctl-failed='sudo systemctl --failed'
alias systemctl-daemon-reload='sudo systemctl daemon-reload'
alias journalctl-error='sudo journalctl -b --priority 0..3'
alias journalctl-user='journalctl -b'
shutdown-timer() {
bash -c 'echo "System is going to shutdown in $1 minute(s)..."
sleep $1m
systemctl poweroff' -- $1
}
hibernate-timer() {
bash -c 'echo "System is going to hibernate in $1 minute(s)..."
sleep $1m
systemctl hibernate' -- $1
}
shutdown() {
systemctl poweroff
}
hibernate() {
systemctl hibernate
}
standby() {
systemctl suspend
}
restart() {
systemctl reboot
}

View file

@ -1,2 +0,0 @@
# misc
export EDITOR="vim"

View file

@ -1,118 +0,0 @@
# This configuration makes use of zsh-syntax-highlighting.
# Some alias will call pre-defined applications.
# Ensure to install them if a command is not working.
#
# SETTINGS
autoload -U compinit promptinit
autoload -U colors && colors
compinit
promptinit
prompt walters
zstyle ':completion:*' menu select
setopt completealiases
setopt HIST_IGNORE_DUPS
PROMPT="%{$fg[red]%}%n%{$reset_color%}@%{$fg[blue]%}%m %{$fg_no_bold[yellow]%}%1~%{$reset_color%} #"
RPROMPT="[%{$fg_no_bold[yellow]%}%?%{$reset_color%}]"
LS_COLORS='rs=0:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:tw=30;42:ow=34;42:st=37;44:ex=01;32:';
# HISTORY
HISTFILE=~/.zsh_history
HISTSIZE=10000
SAVEHIST=10000
# EXPORTS
export LS_COLORS
# ALIAS & FUNCTIONS
alias ls="ls --color -F"
alias ll="ls --color -lh -a"
alias ll-octal-dir='stat -c "%a %n" *'
alias ip='ip -c'
alias n="$EDITOR"
alias v="$EDITOR"
alias ..='cd ..'
alias grep='grep --color=auto'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias fd='fd -H'
alias e='$EDITOR'
alias edit='$EDITOR'
alias free-cached-memory='sync && sudo echo 3 > /proc/sys/vm/drop_caches'
function chpwd() {
ll
}
process-name() {
ps -p $1 -o comm=
}
man() {
env \
LESS_TERMCAP_mb=$(printf "\e[1;31m") \
LESS_TERMCAP_md=$(printf "\e[1;31m") \
LESS_TERMCAP_me=$(printf "\e[0m") \
LESS_TERMCAP_se=$(printf "\e[0m") \
LESS_TERMCAP_so=$(printf "\e[1;44;33m") \
LESS_TERMCAP_ue=$(printf "\e[0m") \
LESS_TERMCAP_us=$(printf "\e[1;32m") \
man "$@"
}
# SOURCE CUSTOM USER-SPECIFIC
if [ -f ~/.zsh_custom ]; then
source ~/.zsh_custom
fi
if [ -f ~/.zsh_systemd ]; then
source ~/.zsh_systemd
fi
if [ -f ~/.zsh_archlinux ]; then
source ~/.zsh_archlinux
fi
# KEYBINDINGS
typeset -A key
key[Home]=${terminfo[khome]}
key[End]=${terminfo[kend]}
key[Insert]=${terminfo[kich1]}
key[Delete]=${terminfo[kdch1]}
key[Up]=${terminfo[kcuu1]}
key[Down]=${terminfo[kcud1]}
key[Left]=${terminfo[kcub1]}
key[Right]=${terminfo[kcuf1]}
key[PageUp]=${terminfo[kpp]}
key[PageDown]=${terminfo[knp]}
[[ -n "${key[Home]}" ]] && bindkey "${key[Home]}" beginning-of-line
[[ -n "${key[End]}" ]] && bindkey "${key[End]}" end-of-line
[[ -n "${key[Insert]}" ]] && bindkey "${key[Insert]}" overwrite-mode
[[ -n "${key[Delete]}" ]] && bindkey "${key[Delete]}" delete-char
[[ -n "${key[Up]}" ]] && bindkey "${key[Up]}" up-line-or-history
[[ -n "${key[Down]}" ]] && bindkey "${key[Down]}" down-line-or-history
[[ -n "${key[Left]}" ]] && bindkey "${key[Left]}" backward-char
[[ -n "${key[Right]}" ]] && bindkey "${key[Right]}" forward-char
[[ -n "${key[PageUp]}" ]] && bindkey "${key[PageUp]}" beginning-of-buffer-or-history
[[ -n "${key[PageDown]}" ]] && bindkey "${key[PageDown]}" end-of-buffer-or-history
bindkey '^R' history-incremental-search-backward
if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then
function zle-line-init () {
printf '%s' "${terminfo[smkx]}"
}
function zle-line-finish () {
printf '%s' "${terminfo[rmkx]}"
}
zle -N zle-line-init
zle -N zle-line-finish
fi
# HIGHLIGHTING
if [ -f "/usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" ]; then
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern)
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
fi

View file

@ -5,7 +5,7 @@
set -e; set -e;
usage() { usage() {
echo "Script to synchronize dotfiles-system with your system"; echo "Script to synchronize system-helpers with your system";
echo ""; echo "";
echo "(1) to sync the git folder's '/etc' --> system's '/etc'"; echo "(1) to sync the git folder's '/etc' --> system's '/etc'";
echo ""; echo "";
@ -41,7 +41,7 @@ menu() {
users=$(cat /etc/passwd|grep $shellInput| awk -F':' '{ print $1 }'); users=$(cat /etc/passwd|grep $shellInput| awk -F':' '{ print $1 }');
# stage # stage
tmpDir=/tmp/dotfiles-system-sync/; tmpDir=/tmp/system-helpers-sync/;
mkdir -p $tmpDir; mkdir -p $tmpDir;
srcDir=$(pwd)/etc/skel/. srcDir=$(pwd)/etc/skel/.
cp -R $srcDir $tmpDir; cp -R $srcDir $tmpDir;
@ -65,7 +65,7 @@ menu() {
echo ""; echo "";
# stage # stage
tmpDir=/tmp/dotfiles-system-sync/; tmpDir=/tmp/system-helpers-sync/;
mkdir -p $tmpDir; mkdir -p $tmpDir;
srcDir=$(pwd)/etc/skel/. srcDir=$(pwd)/etc/skel/.
cp -R $srcDir $tmpDir; cp -R $srcDir $tmpDir;

View file

@ -1,102 +0,0 @@
#!/usr/bin/env bash
#
# Be careful what you are doing with this script. You may overwrite files.
# cd into the repository before executing the script!
set -e;
usage() {
echo "Script to synchronize dotfiles-system skel files";
echo "";
echo "(1) /etc/skel --> ~/... ALL users (with given shell)";
echo "";
echo "(2) /etc/skel --> ~/specific user";
echo "";
echo "(3) list line all users with given shell, e.g. zsh";
echo "";
echo "(0) or [CTRL+C] to exit";
}
menu() {
usage;
read -n 1 -e -p ">" menuInput
echo "";
if [ "$menuInput" = "1" ]; then
# require root
[[ $UID -eq 0 ]] || (>&2 echo "ERROR: need to be root!" && exit 1)
# determine shell
echo "Which shell (shortname, e.g. zsh)?";
read -e -p ">" shellInput
echo "";
# shell users
users=$(cat /etc/passwd|grep $shellInput| awk -F':' '{ print $1 }');
# stage
tmpDir=/tmp/dotfiles-system-sync/;
mkdir -p $tmpDir;
srcDir=/etc/skel/.
cp -R $srcDir $tmpDir;
# copy
for user in $users; do
exists=$(id -u $user);
primaryGroup=$(id -gn $user);
chown -R $user:$primaryGroup $tmpDir;
trgDir=$(eval echo ~$user/);
echo "Copy from $tmpDir to $trgDir";
cp -Rp $tmpDir/. $trgDir/;
done
# remove stage
rm -rf $tmpDir;
elif [ "$menuInput" = "2" ]; then
# determine shell
echo "Which user?";
read -e -p ">" user
echo "";
# stage
tmpDir=/tmp/dotfiles-system-sync/;
mkdir -p $tmpDir;
srcDir=/etc/skel/.
cp -R $srcDir $tmpDir;
# copy
exists=$(id -u $user);
if [ $UID -ne $exists ] && [ $UID -ne 0 ]; then
echo "ERROR: need to be $user or root!";
exit 1;
fi
primaryGroup=$(id -gn $user);
chown -R $user:$primaryGroup $tmpDir;
trgDir=$(eval echo ~$user/);
echo "Copy from $tmpDir to $trgDir";
cp -Rp $tmpDir/. $trgDir/;
# remove stage
rm -rf $tmpDir;
elif [ "$menuInput" = "3" ]; then
echo "Which shell (shortname, e.g. zsh)?";
read -e -p ">" shellInput
echo "";
# shell users
users=$(cat /etc/passwd|grep $shellInput| awk -F':' '{ print $1 }');
echo "Users with shell $shellInput"
for u in $users; do
echo $u;
done
elif [ "$menuInput" = "0" ]; then
exit 0;
fi
menu;
}
menu;

View file

@ -1,6 +1,6 @@
.\" generated with Ronn/v0.7.3 .\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3
dotfiles\-system is a collection of helper systemd services, systemd timers and shell scripts for common configuration and tasks like system\-helpers is a collection of helper systemd services, systemd timers and shell scripts for common configuration and tasks like
. .
.IP "" 4 .IP "" 4
. .
@ -24,4 +24,4 @@ dotfiles\-system is a collection of helper systemd services, systemd timers and
Provided systemd services mostly support mail notifications if they have failed via systemd_failure_notify\. Provided systemd services mostly support mail notifications if they have failed via systemd_failure_notify\.
. .
.P .P
See \fB/usr/share/doc/dotfiles\-system\fR for example configurations which should be copied inside $HOME or /etc depending on the helper script\. See \fB/usr/share/doc/system\-helpers\fR for example configurations which should be copied inside $HOME or /etc depending on the helper script\.