Add synology

This commit is contained in:
2021-04-20 04:24:26 +09:00
parent ccd9f8fe57
commit 089d44c282
3 changed files with 69 additions and 2 deletions

View File

@@ -14,6 +14,14 @@ const common: DotOption = {
}, },
}; };
const synology: DotOption = {
hostname: "nas",
link: {
...common.link,
".local/bin/ufetch": "synology/bin/ufetch",
},
};
const darwin: DotOption = { const darwin: DotOption = {
hostname: "MacBook-Pro.local", hostname: "MacBook-Pro.local",
install: [ install: [
@@ -92,7 +100,7 @@ const linuxHiDPI: DotOption = {
}; };
try { try {
await dot(Deno.args, [common, linux, linuxHiDPI, darwin]); await dot(Deno.args, [common, linux, linuxHiDPI, darwin, synology]);
} catch (err) { } catch (err) {
console.log(err.message); console.log(err.message);
} }

54
synology/bin/ufetch Executable file
View File

@@ -0,0 +1,54 @@
#!/bin/sh
#
# ufetch-arch - tiny system info for arch
## INFO
# user is already defined
host="$(cat /etc/hostname)"
os='Synology'
kernel="$(uname -sr)"
uptime="$(uptime -p | sed 's/up //')"
packages="$(opkg list-installed | wc -l)"
shell="$(basename "$SHELL")"
## UI DETECTION
ui='DSM'
uitype='UI'
## DEFINE COLORS
# probably don't change these
if [ -x "$(command -v tput)" ]; then
bold="$(tput bold)"
black="$(tput setaf 0)"
red="$(tput setaf 1)"
green="$(tput setaf 2)"
yellow="$(tput setaf 3)"
blue="$(tput setaf 4)"
magenta="$(tput setaf 5)"
cyan="$(tput setaf 6)"
white="$(tput setaf 7)"
reset="$(tput sgr0)"
fi
# you can change these
lc="${reset}${bold}${blue}" # labels
nc="${reset}${bold}${blue}" # user and hostname
ic="${reset}" # info
c0="${reset}${blue}" # first color
## OUTPUT
cat <<EOF
${c0} _____ ${reset}
${c0} / ____| ${nc}${USER}${ic}@${nc}${host}${reset}
${c0}| (___ _ _ ${lc}OS: ${ic}${os}${reset}
${c0} \___ \| | | | ${lc}KERNEL: ${ic}${kernel}${reset}
${c0} ____) | |_| | ${lc}UPTIME: ${ic}${uptime}${reset}
${c0}|_____/ \__, | ${lc}PACKAGES: ${ic}${packages}${reset}
${c0} __/ | ${lc}SHELL: ${ic}${shell}${reset}
${c0} |___/ ${lc}${uitype}: ${ic}${ui}${reset}
EOF

5
zshrc
View File

@@ -111,6 +111,11 @@ export GPG_TTY=$(tty)
if [[ `uname` != "Darwin" ]]; then if [[ `uname` != "Darwin" ]]; then
alias open=xdg-open alias open=xdg-open
fi fi
if [[ -f "/etc/synoinfo.conf" ]]; then
export PATH="$PATH:/opt/bin"
else
ufetch ufetch
fi
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh