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

15
.zshrc
View file

@ -160,6 +160,7 @@ __alias__() {
# ─< easier dir up >──────────────────────────────────────────────────────────────────────── # ─< easier dir up >────────────────────────────────────────────────────────────────────────
alias ..="cd .." alias ..="cd .."
# ─< weather >────────────────────────────────────────────────────────────────────────────── # ─< weather >──────────────────────────────────────────────────────────────────────────────
alias www="curl wttr.in/Ulm" alias www="curl wttr.in/Ulm"
@ -178,11 +179,19 @@ __alias__() {
# ─< define copy command >──────────────────────────────────────────────────────────────── # ─< define copy command >────────────────────────────────────────────────────────────────
if command_exists wl-copy; then if command_exists wl-copy; then
copy() { copy() {
if cat "$1"; then
command cat "$1" | wl-copy command cat "$1" | wl-copy
else
"$1" | wl-copy
fi
} }
elif command_exists xclip; then elif command_exists xclip; then
copy() { copy() {
command cat "$1" | xclip -selection clipboard if cat "$1"; then
command cat "$1" | wl-copy
else
"$1" | xclip -selection clipboard
fi
} }
else else
echo_warning "No clipboard utility found. Please install wl-copy or xclip." echo_warning "No clipboard utility found. Please install wl-copy or xclip."
@ -197,6 +206,10 @@ __alias__() {
alias starwars="telnet -a telehack.com" alias starwars="telnet -a telehack.com"
fi 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 >──────────────────────────────────────────────────────────────────────────────── # ─< rsync >────────────────────────────────────────────────────────────────────────────────
if command_exists rsync; then if command_exists rsync; then
alias scp="rsync -avP" alias scp="rsync -avP"