Added i3status-rust config

This commit is contained in:
GaspardCulis 2023-10-29 13:56:07 +01:00
parent e32b5eaaf1
commit 2515910d41
4 changed files with 131 additions and 0 deletions

View file

@ -0,0 +1,70 @@
icons_format = "{icon}"
[theme]
theme = "solarized-dark"
[theme.overrides]
idle_bg = "#123456"
idle_fg = "#abcdef"
[icons]
icons = "awesome4"
[[block]]
block = "cpu"
[[block]]
block = "custom"
command = "~/.config/i3status-rust/scripts/toggle-profile"
json = true
[[block.click]]
button = "left"
cmd="~/.config/i3status-rust/scripts/toggle-profile toggle"
sync = true
update = true
[[block]]
block = "custom"
command = "cat /sys/bus/pci/devices/0000:01:00.0/power/runtime_status"
interval = 2
format = " \uf26c $text "
[[block]]
block = "custom"
command = "~/.config/i3status-rust/scripts/refresh-rate"
json = true
[[block.click]]
button = "left"
cmd="~/.config/i3status-rust/scripts/refresh-rate toggle"
sync = true
update = true
[[block]]
block = "memory"
format = " $icon $mem_total_used_percents.eng(w:2) "
format_alt = " $icon_swap $swap_used_percents.eng(w:2) "
[[block]]
block = "disk_space"
path = "/"
info_type = "available"
alert_unit = "GB"
interval = 20
warning = 20.0
alert = 10.0
format = " $icon root: $available.eng(w:2) "
[[block]]
block = "battery"
interval = 5
format = "$icon $percentage $power $time"
[[block]]
block = "sound"
[[block.click]]
button = "left"
cmd = "pavucontrol"
[[block]]
block = "time"
interval = 1
format = " $timestamp.datetime(f:'%a %d/%m %X') "

View file

@ -0,0 +1,28 @@
#!/usr/bin/env bash
get-refresh-rate () {
xrandr --screen 0 | grep "*" | cut -d "*" -f 1 | awk '{print $NF}' | cut -d "." -f 1
}
get-refresh-rate-json () {
refresh_rate="$(get-refresh-rate)"
state="idle"
if [ "$refresh_rate" == "165" ]; then
state="info"
fi
echo "{\"icon\": \"\", \"state\": \"$state\", \"text\": \"${refresh_rate}Hz\", \"short_text\": \"\"}"
}
refresh_rate=$(get-refresh-rate)
if [ "$1" == "toggle" ]; then
if [ $refresh_rate == "60" ]; then
xrandr --screen 0 -r 165
get-refresh-rate-json
else
xrandr --screen 0 -r 60
get-refresh-rate-json
fi
else
get-refresh-rate-json
fi

View file

@ -0,0 +1,32 @@
#!/bin/bash
get-profile () {
asusctl profile -p | awk '{print $4}'
}
get-profile-json () {
profile="$(get-profile)"
state="idle"
if [ "$profile" == "Balanced" ]; then
state="info"
elif [ "$profile" == "Performance" ]; then
state="warning"
fi
echo "{\"icon\": \"\", \"state\": \"$state\", \"text\": \"$profile\", \"short_text\": \"\"}"
}
active_profile="$(get-profile)"
if [ "$1" == "toggle" ]; then
if [ "$active_profile" == "Quiet" ]; then
asusctl profile -P Balanced
elif [ "$active_profile" == "Balanced" ]; then
asusctl profile -P Performance
else
asusctl profile -P Quiet
fi
fi
get-profile-json

1
sync
View file

@ -22,6 +22,7 @@ synced_files = [
('term/rio/', '~/.config/rio/'),
('term/alacritty/', '~/.config/alacritty/'),
('bar/waybar/', '~/.config/waybar/'),
('bar/i3status-rust/', '~/.config/i3status-rust/'),
('home/xinitrc', '~/.xinitrc'),
('misc/picom/', '~/.config/picom/'),
('misc/runst/', '~/.config/runst/'),