diff options
| author | Jack Jamison <jackqjamison@gmail.com> | 2026-05-15 21:04:16 -0400 |
|---|---|---|
| committer | Jack Jamison <jackqjamison@gmail.com> | 2026-05-15 21:04:16 -0400 |
| commit | fbe17d51cc2d52261721a46ee54d5dc8f32db3eb (patch) | |
| tree | e239efb71787499076d2fe1e1b7459df0f4c76d4 /scripts | |
| parent | e642731374e6bdd3a6d8a15998851ba8ac6cc822 (diff) | |
lots of changes for new setup
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/graphical-startup | 6 | ||||
| -rwxr-xr-x | scripts/lock | 2 | ||||
| -rwxr-xr-x | scripts/lock_computer | 4 | ||||
| -rwxr-xr-x | scripts/sleep_computer | 5 | ||||
| -rwxr-xr-x | scripts/startup | 4 | ||||
| -rwxr-xr-x | scripts/sysinfo | 54 |
6 files changed, 39 insertions, 36 deletions
diff --git a/scripts/graphical-startup b/scripts/graphical-startup new file mode 100755 index 0000000..877ca59 --- /dev/null +++ b/scripts/graphical-startup @@ -0,0 +1,6 @@ +#!/bin/sh +# pipewire & +dunst & +swaybg -i $HOME/dotfiles/files/wallpapers/mill.png & +swayidle timeout 300 sleep_computer & +# restartemacs >/dev/null & diff --git a/scripts/lock b/scripts/lock deleted file mode 100755 index efb238e..0000000 --- a/scripts/lock +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -swaylock -fc 000000 diff --git a/scripts/lock_computer b/scripts/lock_computer new file mode 100755 index 0000000..0abb3a2 --- /dev/null +++ b/scripts/lock_computer @@ -0,0 +1,4 @@ +#!/bin/sh +if not pgrep swaylock; then + swaylock +fi diff --git a/scripts/sleep_computer b/scripts/sleep_computer index 3dca0e3..5a62465 100755 --- a/scripts/sleep_computer +++ b/scripts/sleep_computer @@ -1,4 +1,3 @@ #!/bin/sh -echo "slept" >> $HOME/.sleeplog -lock -echo "mem" > /sys/power/state +echo "mem" | doas tee /sys/power/state +lock_computer diff --git a/scripts/startup b/scripts/startup deleted file mode 100755 index f09130e..0000000 --- a/scripts/startup +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -pipewire & -dunst & -restartemacs >/dev/null & diff --git a/scripts/sysinfo b/scripts/sysinfo index 8acc18d..5cb2d07 100755 --- a/scripts/sysinfo +++ b/scripts/sysinfo @@ -1,37 +1,37 @@ #!/bin/sh -get_network_info() { - device=$(ip a | grep "state UP" | awk -F': ' '{ printf($2) }') - case "${device}" in - wlan*) - network=$(iwctl station ${device} show | grep 'Connected network' \ - | awk -F' ' '{ printf($3) }') - echo "${device}: ${network}" - ;; - eth*) - echo "${device}: ${network}" - ;; - esac -} +get_message() { + # Date + echo "Date: $(date +"%a %b %d")" + echo "Time: $(date +"%I:%M:%S")" + + # Volume + echo "$(wpctl get-volume @DEFAULT_SINK@ | awk -F' ' '{ printf "%s %s%% %s", $1, ($2 * 100), $3; }')" -batperc=$(cat /sys/class/power_supply/BAT0/capacity) -batstate=$(cat /sys/class/power_supply/BAT0/status) -brightness=$(brightnessctl -m | cut -d, -f 4) -volume=$(wpctl get-volume @DEFAULT_SINK@ | awk -F' ' '{ printf "%s %s%% %s", $1, ($2 * 100), $3; }') -network=$(get_network_info) + # Brightness + echo "Brightness: $(brightnessctl -m | cut -d, -f 4)" + + # Battery + echo "$(cat /sys/class/power_supply/BAT0/status): $(cat /sys/class/power_supply/BAT0/capacity)%" + + # Network Info + net_device=$(ip a | grep "state UP" | awk -F': ' '{ printf($2) }') + case "${net_device}" in + wlan*) + connected_network=$(iwctl station ${net_device} show | grep 'Connected network' \ + | awk -F' ' '{ printf($3) }') + ;; + eth*) + ;; + esac + echo "${net_device}: ${connected_network}" +} -header="System Info:" -message="\ -Date: $(date +"%a %b %d") -Time: $(date "+%I:%M:%S") -${volume} -Brightness: ${brightness} -${batstate}: ${batperc}% -${network}" +message=$(get_message) if [ "$TERM" = "linux" ]; then - notify-send "$header" "$message" + notify-send "System Info" "$message" else echo "$message" fi |
