feat: maybe fixed copy, and addet for loop for cpu identification with hyprpanel

This commit is contained in:
pika 2025-03-22 11:01:26 +01:00
parent c653009ae3
commit 0e699d4fda

17
.zshrc
View file

@ -160,6 +160,7 @@ __alias__() {
# ─< easier dir up >────────────────────────────────────────────────────────────────────────
alias ..="cd .."
# ─< weather >──────────────────────────────────────────────────────────────────────────────
alias www="curl wttr.in/Ulm"
@ -178,11 +179,19 @@ __alias__() {
# ─< define copy command >────────────────────────────────────────────────────────────────
if command_exists wl-copy; then
copy() {
command cat "$1" | wl-copy
if cat "$1"; then
command cat "$1" | wl-copy
else
"$1" | wl-copy
fi
}
elif command_exists xclip; then
copy() {
command cat "$1" | xclip -selection clipboard
if cat "$1"; then
command cat "$1" | wl-copy
else
"$1" | xclip -selection clipboard
fi
}
else
echo_warning "No clipboard utility found. Please install wl-copy or xclip."
@ -197,6 +206,10 @@ __alias__() {
alias starwars="telnet -a telehack.com"
fi
if command_exists hyprpanel; then
alias get_cpu="for i in /sys/class/hwmon/hwmon*/temp*_input; do echo "$(<$(dirname $i)/name): $(cat ${i%_*}_label 2>/dev/null || echo $(basename ${i%_*})) $(readlink -f $i)"; done"
fi
# ─< rsync >────────────────────────────────────────────────────────────────────────────────
if command_exists rsync; then
alias scp="rsync -avP"