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)
Compilando um Kernel customizado a partir do código-fonte do Kernel do Debian 12
Gentoo binário ao lado da sua distro atual
Documentação para a função de carregamento saudável da bateria do notebook Acer Aspire 5 no Linux
Instalando Google Chrome no Linux Mint 22
O Que Fazer Após Instalar Linux Mint 22
Instalando o Dolphin e deixando-o "pretinho" acompanhando o tema escuro do Gnome-Shell
Meu computador está travando (12)
Meu computador não aceita o Linux de nenhuma maneira (7)
Máximo que meu PC suporta de gigas no HD ou ssd. (5)
Error no such device : 3C8E-127A. error: disco 'hd1,gpt... não e... (3)