simple wbar refresh code

Requests go here. If you fill a request, give it a new thread in the appropriate category and then link to it in the request thread.
Post Reply
Message
Author
User avatar
nilsonmorales
Posts: 972
Joined: Fri 15 Apr 2011, 14:39
Location: El Salvador

simple wbar refresh code

#1 Post by nilsonmorales »

i have no experience in bash or any programing lang just looking for a simple script to refresh the wbar when change the wallpaper
i saw this code

Code: Select all

#!/bin/bash

shopt -s nullglob
 
cd $HOME/Wallpapers

while true; do
	files=()
	for i in *.jpg *.png; do
		[[ -f $i ]] && files+=("$i")
	done
	range=${#files[@]}

	((range)) && feh --bg-scale "${files[RANDOM % range]}"

	# Restart wbar,if already running
	[`pidof wbar`] && killall wbar && wbar &

	sleep 10m
done
how can i use the [`pidof wbar`] && killall wbar && wbar & to refresh the wbar when change the wallpaper
thx in advance .
[b][url=http://nilsonmorales.blogspot.com/]My blog |[/url][/b][b][url=https://github.com/woofshahenzup]| Github[/url][/b]
[img]https://i.postimg.cc/5tz5vrrX/imag018la6.gif[/img]
[img]http://s5.postimg.org/7h2fid8pz/botones_logos3.png[/img]

User avatar
rhadon
Posts: 1292
Joined: Thu 27 Mar 2008, 11:05
Location: Germany

#2 Post by rhadon »

Hi nilsonmorales,

maybe this helps?

Rolf
Ich verwende "frugal", und das ist gut so. :wink:
Raspberry Pi without Puppy? No, thanks.

User avatar
nilsonmorales
Posts: 972
Joined: Fri 15 Apr 2011, 14:39
Location: El Salvador

#3 Post by nilsonmorales »

I appreciate your help, unfortunately did not work
I think I need to add some code in the nathan wallpaper
anyway thank you.
[b][url=http://nilsonmorales.blogspot.com/]My blog |[/url][/b][b][url=https://github.com/woofshahenzup]| Github[/url][/b]
[img]https://i.postimg.cc/5tz5vrrX/imag018la6.gif[/img]
[img]http://s5.postimg.org/7h2fid8pz/botones_logos3.png[/img]

Post Reply