phon31x / Tiny_polybar

45 stars 6 forks source link

Place for ideas #1

Open k1ake opened 2 years ago

k1ake commented 2 years ago

You can merge scripts and allow tray to close itself after some time.

#!/bin/bash
u=$(xprop -name "Polybar tray window" _NET_WM_PID | grep -o '[[:digit:]]*')
if [ $u -Z ]
    then polybar hiddentray &
        sleep 10
        u=$(xprop -name "Polybar tray window" _NET_WM_PID | grep -o '[[:digit:]]*')
    else kill $u
fi
k1ake commented 2 years ago

forget to add kill$u after i defined it in then

641i130 commented 2 years ago

Fixed:

#!/bin/bash
u=$(xprop -name "Polybar tray window" _NET_WM_PID | awk -F "= " '{print $2}')
if [ $u -Z ] 
then polybar tray &
sleep 10
u=$(xprop -name "Polybar tray window" _NET_WM_PID | awk -F "= " '{print $2}')
else kill $u
fi

MAKE SURE TO CHANGE tray on the then polybar tray line to the name of your bar that is showing up.

pietryszak commented 2 years ago

"Allow tray to close itself after some time". Not good idea @k1ake, I open tiiny bar and this bar stays opened till I manualy close it. Because I need that, for see a weather, and networks statistics.