Enviado em 19/11/2023 - 19:27h
Fala galera, tudo beleza? To tentando adicionar duas novas informações ao meu i3status modificando o seguinte script: https://github.com/i3/i3status/blob/main/contrib/any_position_wrapper.sh#!/usr/bin/env bash
function update_holder {
local instance="$1"
local replacement="$2"
echo "$json_array" | jq --argjson arg_j "$replacement" "(.[] | (select(.instance==\"$instance\"))) |= \$arg_j"
}
function remove_holder {
local instance="$1"
echo "$json_array" | jq "del(.[] | (select(.instance==\"$instance\")))"
}
function cmus {
artist=$(printf $(cmus-remote -C status | grep "tag artist" | cut -c 12-))
if [[ $artist = *[!\ ]* ]]; then
song=$(printf $(cmus-remote -C status | grep title | cut -c 11-))
printf "$artist ﱘ $song"
else
json_array=$(remove_holder holder__i3_layout)
fi
}
function split {
local layout=$(i3-msg -t get_tree | jq --raw-output 'recurse(.nodes[]; .nodes !=null) | select(.nodes[].focused).layout')
if [ "$layout" == splith ] ; then
local json='{ "full_text": "[horizontal]", "color": "#92BFEB" }'
json_array=$(update_holder holder__split "$json")
elif [ "$layout" == splitv ] ; then
local json='{ "full_text": "[vertical]", "color": "#92BFEB" }'
json_array=$(update_holder holder__split "$json")
elif [ "$layout" == tabbed ] ; then
local json='{ "full_text": "[tabbed]", "color": "#92BFEB" }'
json_array=$(update_holder holder__split "$json")
elif [ "$layout" == stacked ] ; then
local json='{ "full_text": "[stacked]", "color": "#92BFEB" }'
json_array=$(update_holder holder__split "$json")
else
json_array=$(remove_holder holder__split)
fi
}
i3status | (read line; echo "$line"; read line ; echo "$line" ; read line ; echo "$line" ; while true
do
read line
json_array="$(echo $line | sed -e 's/^,//')"
split
cmus
echo ",$json_array"
done)
Antivírus ClamAV com proteção em tempo real
Instalação do Comodo Antivirus para Linux (CAVL) resolvendo o problema de dependências
VirtualBox: a forma mais fácil de conhecer o Linux sem precisar instalá-lo
Hot Dog Linux - interface gráfica que imita o Windows 3.1, Mac OS clássico e Amiga
Instalar Conky no Slackware 15
Brasfoot 22-23 rodando nativamente no Linux
Instalar Google Chrome no Slackware 15
Como checar a temperatura do processador via linha de comando
conflito de valores, erro do indice de software danificado e erro no s... (3)