fix: some stuff

This commit is contained in:
rxyhn 2022-03-10 03:31:10 +07:00
parent 7197ba0f43
commit 452e1be6ab
2 changed files with 29 additions and 25 deletions

View file

@ -8,22 +8,21 @@ local uptime_script = [[
sh -c " sh -c "
cmd=$(uptime) cmd=$(uptime)
hr=$( echo $cmd | cut -d \":\" -f3 | awk '{print $NF}') hr=$( echo $cmd | cut -d \":\" -f3 | awk '{print $NF}')
mt=$( echo $cmd | cut -d \":\" -f4 | cut -c1-2 ) mt=$( echo $cmd | cut -d \":\" -f4 | cut -c1-2 )
day=$(echo $cmd | grep day) day=$(echo $cmd | grep day)
if [ -z \"$day\" ]; then if [ -z \"$day\" ]; then
hour=$(uptime -p | grep hour) hour=$(uptime -p | grep hour)
if [ -z \"$hour\" ]; then if [ -z \"$hour\" ]; then
uptime -p | awk '{print $2$3}' | cut -c1-3 uptime -p | awk '{print $2$3}' | cut -c1-3
else else
echo \"${hr}h ${mt}m\" echo \"${hr}h ${mt}m\"
fi fi
else else
day=$(echo $day | cut -d \" \" -f3) day=$(echo $day | cut -d \" \" -f3)
echo \"${day}d ${hr}h ${mt}m\" echo \"${day}d ${hr}h ${mt}m\"
fi fi
"]] "]]
local update_interval = 60 local update_interval = 60

View file

@ -82,7 +82,11 @@ local function toggle_pop()
end end
end end
local vol_first_time = true
awesome.connect_signal("signal::volume", function(value, muted) awesome.connect_signal("signal::volume", function(value, muted)
if vol_first_time then
vol_first_time = false
else
pop_icon.markup = "" pop_icon.markup = ""
pop_bar.value = value pop_bar.value = value
@ -94,6 +98,7 @@ awesome.connect_signal("signal::volume", function(value, muted)
end end
toggle_pop() toggle_pop()
end
end) end)
awesome.connect_signal("signal::brightness", function(value) awesome.connect_signal("signal::brightness", function(value)