Compare commits
4 Commits
7af798a7c0
...
477797e045
| Author | SHA1 | Date | |
|---|---|---|---|
| 477797e045 | |||
| 88b602f8f4 | |||
| 5274d6d94d | |||
| 692df74d41 |
@@ -2,64 +2,8 @@
|
|||||||
# 2025-11-10 Hyperling
|
# 2025-11-10 Hyperling
|
||||||
# Icons: https://fontawesome.com/v4/cheatsheet/
|
# Icons: https://fontawesome.com/v4/cheatsheet/
|
||||||
|
|
||||||
source "`which volume.function`"
|
source "`which status.function`"
|
||||||
source "`which battery.function`"
|
|
||||||
source "`which storage.function`"
|
|
||||||
|
|
||||||
function datetime {
|
|
||||||
date +"%Y-%m-%d %H:%M:%S"
|
|
||||||
}
|
|
||||||
function dwm-status {
|
function dwm-status {
|
||||||
cmd="xsetroot -name "
|
status-display --dwm
|
||||||
if [[ $1 == "-t" || $1 == "--test" || $1 == "test" ]]; then
|
|
||||||
cmd="echo"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "`storage-root`" == "`storage-home`" ]]; then
|
|
||||||
function dwm-status-storage {
|
|
||||||
echo "`storage-root-dwm`)"
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
function dwm-status-storage {
|
|
||||||
echo "(Root `storage-root-dwm`, Home `storage-home-dwm`)"
|
|
||||||
}
|
|
||||||
fi
|
|
||||||
battery=""; storage=""; volume=""; datetime="";
|
|
||||||
userhost="`whoami`@`hostname`"
|
|
||||||
while true; do
|
|
||||||
# Reset Variables
|
|
||||||
if [[ $datetime == *"00" ]]; then
|
|
||||||
unset battery
|
|
||||||
unset storage
|
|
||||||
fi
|
|
||||||
if [[ $datetime != "`datetime`" ]]; then
|
|
||||||
unset volume
|
|
||||||
unset datetime
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Set Variables
|
|
||||||
if [[ -z $battery ]]; then
|
|
||||||
battery="`battery-display`"
|
|
||||||
fi
|
|
||||||
if [[ -z $storage ]]; then
|
|
||||||
storage="`dwm-status-storage`"
|
|
||||||
fi
|
|
||||||
if [[ -z $volume ]]; then
|
|
||||||
volume="`volume-display`"
|
|
||||||
fi
|
|
||||||
if [[ -z $datetime ]]; then
|
|
||||||
datetime="`datetime`"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Display Variables
|
|
||||||
readout="$readout $battery"
|
|
||||||
readout="$readout | $storage"
|
|
||||||
readout="$readout | $volume"
|
|
||||||
readout="$readout | $userhost"
|
|
||||||
readout="$readout | $datetime"
|
|
||||||
$cmd "$readout"
|
|
||||||
readout=""
|
|
||||||
sleep 0.2
|
|
||||||
done
|
|
||||||
}
|
|
||||||
alias status="dwm-status --test"
|
|
||||||
|
|||||||
82
files/functions/status.function
Executable file
82
files/functions/status.function
Executable file
@@ -0,0 +1,82 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# 2025-11-10 Hyperling
|
||||||
|
# Icons: https://fontawesome.com/v4/cheatsheet/
|
||||||
|
|
||||||
|
source "`which volume.function`"
|
||||||
|
source "`which battery.function`"
|
||||||
|
source "`which storage.function`"
|
||||||
|
|
||||||
|
function datetime {
|
||||||
|
date +"%Y-%m-%d %H:%M:%S"
|
||||||
|
}
|
||||||
|
function status-display {
|
||||||
|
# Defaults
|
||||||
|
cmd="echo"
|
||||||
|
sleep=0.2
|
||||||
|
if [[ "`storage-root`" == "`storage-home`" ]]; then
|
||||||
|
function status-display-storage {
|
||||||
|
echo "`storage-root`"
|
||||||
|
}
|
||||||
|
else
|
||||||
|
function status-display-storage {
|
||||||
|
echo "Root (`storage-root`), Home (`storage-home`)"
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Test Config
|
||||||
|
if [[ $1 == "-t" || $1 == "--test" || $1 == "test" ]]; then
|
||||||
|
sleep=5
|
||||||
|
fi
|
||||||
|
|
||||||
|
# DWM Config
|
||||||
|
if [[ $1 == "-d" || $1 == "--dwm" || $1 == "dwm" ]]; then
|
||||||
|
cmd="xsetroot -name"
|
||||||
|
if [[ "`storage-root`" == "`storage-home`" ]]; then
|
||||||
|
function status-display-storage {
|
||||||
|
echo "`storage-root-dwm`)"
|
||||||
|
}
|
||||||
|
else
|
||||||
|
function status-display-storage {
|
||||||
|
echo "(Root `storage-root-dwm`, Home `storage-home-dwm`)"
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
battery=""; storage=""; volume=""; datetime="";
|
||||||
|
userhost="`whoami`@`hostname`"
|
||||||
|
while true; do
|
||||||
|
# Reset Variables
|
||||||
|
if [[ $datetime == *"00" ]]; then
|
||||||
|
unset battery
|
||||||
|
unset storage
|
||||||
|
fi
|
||||||
|
if [[ $datetime != "`datetime`" ]]; then
|
||||||
|
unset volume
|
||||||
|
unset datetime
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Set Variables
|
||||||
|
if [[ -z $battery ]]; then
|
||||||
|
battery="`battery-display`"
|
||||||
|
fi
|
||||||
|
if [[ -z $storage ]]; then
|
||||||
|
storage="`status-display-storage`"
|
||||||
|
fi
|
||||||
|
if [[ -z $volume ]]; then
|
||||||
|
volume="`volume-display`"
|
||||||
|
fi
|
||||||
|
if [[ -z $datetime ]]; then
|
||||||
|
datetime="`datetime`"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Display Variables
|
||||||
|
readout="$readout $battery"
|
||||||
|
readout="$readout | $storage"
|
||||||
|
readout="$readout | $volume"
|
||||||
|
readout="$readout | $userhost"
|
||||||
|
readout="$readout | $datetime"
|
||||||
|
$cmd "$readout"
|
||||||
|
readout=""
|
||||||
|
sleep $sleep
|
||||||
|
done
|
||||||
|
}
|
||||||
|
alias status="status-display --test"
|
||||||
@@ -16,7 +16,7 @@ function storage-display {
|
|||||||
elif [[ "$style" == "G" || "$style" == "S" || "$style" == "F" ]]; then
|
elif [[ "$style" == "G" || "$style" == "S" || "$style" == "F" ]]; then
|
||||||
df -h "$location" | tail -n 1 | awk '{print $4" Free"}'
|
df -h "$location" | tail -n 1 | awk '{print $4" Free"}'
|
||||||
else
|
else
|
||||||
df -h "$location" | tail -n 1 | awk '{print $5" Used, "$4"/"$2" Free"}'
|
df -h "$location" | tail -n 1 | awk '{print $5" Used - "$4"/"$2" Free"}'
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
alias storage='echo -n "Root: " && storage-display "/" "F" && echo -n "Home: " && storage-display "/home" "F"'
|
alias storage='echo -n "Root: " && storage-display "/" "F" && echo -n "Home: " && storage-display "/home" "F"'
|
||||||
|
|||||||
@@ -1174,6 +1174,10 @@
|
|||||||
- .zshrc
|
- .zshrc
|
||||||
- .vimrc
|
- .vimrc
|
||||||
|
|
||||||
|
|
||||||
|
- name: General | Account Management | Users | Files | Helper Functions (Reset)
|
||||||
|
shell: "rm -v {{ global_bin }}/*.function"
|
||||||
|
|
||||||
- name: General | Account Management | Users | Files | Helper Functions
|
- name: General | Account Management | Users | Files | Helper Functions
|
||||||
copy:
|
copy:
|
||||||
src: "{{ item }}"
|
src: "{{ item }}"
|
||||||
|
|||||||
Reference in New Issue
Block a user