Compare commits
2 commits
9367fef8e9
...
d1b53c92ed
Author | SHA1 | Date | |
---|---|---|---|
|
d1b53c92ed | ||
|
0b0cd477c5 |
2 changed files with 8 additions and 10 deletions
|
@ -1,4 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
grub-mkconfig \
|
|
||||||
-o /boot/grub/grub.cfg
|
|
||||||
|
|
|
@ -1,24 +1,26 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Variable
|
# Variable
|
||||||
commands_d="$HOME/.local/share/updateall/commands.d"
|
commands_d="${HOME}/.local/share/updateall/commands.d"
|
||||||
|
|
||||||
# Function
|
# Function
|
||||||
# Create a clear separator, adapts to the screen size
|
# Create a clear separator, adapts to the screen size
|
||||||
function separator {
|
function separator {
|
||||||
local char="${2:-=}"
|
local separator=""
|
||||||
local separator cols
|
|
||||||
|
local name="$1" ; shift
|
||||||
|
local char="${1:-=}"; shift
|
||||||
(( cols = $(tput cols) / 3 ))
|
(( cols = $(tput cols) / 3 ))
|
||||||
|
|
||||||
while [[ ${#separator} -le $cols ]]; do
|
while [[ ${#separator} -le "$cols" ]]; do
|
||||||
separator+="$char"
|
separator+="$char"
|
||||||
done
|
done
|
||||||
|
|
||||||
printf '\n%s\n\t%s\n%s\n' "$separator" "$1" "$separator"
|
printf '\n%s\n\t%s\n%s\n' "$separator" "$name" "$separator"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Loop
|
# Loop
|
||||||
for pm in "$commands_d/"*; do
|
for pm in "${commands_d}/"*; do
|
||||||
separator "$(basename "$pm")"
|
separator "$(basename "$pm")"
|
||||||
source "$pm"
|
source "$pm"
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in a new issue