You are not logged in.
something I just noticed, if you want to use printf instead of echo, I think the safer way is considered to be to explicitly format all the arguments as strings with '%s'.
IE perhaps:debugging() { [[ "$debug" == 1 ]] && printf '%s' "$@" }
So every word in "$@" will be treated as a string.
thanks, i fixed this now.
Offline
^Note that will glob every word of "$@" together with no intervening spaces. It won't affect bl-fortune because you've already formatted the strings as one argument before passing it to debugging().
As I'm sure you already know, printf can do amazing things.
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Online
oh, i see.
guess i'm better off using echo then...
changed & pushed.
Last edited by ohnonot (2018-07-10 10:48:06)
Offline
I think for outputting debug messages either echo or printf are OK.
Printf can be useful if you want more control.
john@helium-dev:~$ t(){ printf '%s' "$@";}
john@helium-dev:~$ t one two
onetwojohn@helium-dev:~$
john@helium-dev:~$ t(){ printf '%s ' "$@";}
john@helium-dev:~$ t one two
one two john@helium-dev:~$
john@helium-dev:~$ t(){ printf '%s\n' "$@";}
john@helium-dev:~$ t one two
one
two
john@helium-dev:~$ Format(){ printf '%-30s %-12s %-12s\n\n' 'Package' 'apt version' 'git version';printf '%-30s %-12s %-12s\n\n' "$1" "$2" "$3"; }
john@helium-dev:~$ Format 'some-package' '1.1' '1.2'
Package apt version git version
some-package 1.1 1.2
And see http://wiki.bash-hackers.org/commands/builtin/printf
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Online
Updated bunsen-fortune 9.1.1-1 now in helium-dev repo and here: https://www.dropbox.com/s/nmah93d440g2h … l.deb?dl=1
@ohnonot if you could quickly check that out, if it's OK we can get it in the regular repos.
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Online
Excellent!
I've been using fortunes with conky for a while now. Everything is good using cbbl there.
$alignr${execi 600 fortune -s cbbl | fold -s -w25}
Offline
cool!
a quick test, everything seems to be working as advertised.
Last edited by ohnonot (2021-07-08 09:40:54)
Offline
@sloth, as an American... Well played, sir, well played.
@ohnonot, cheers! Great choice to use Bunsen-flame Beaker.
No, he can't sleep on the floor. What do you think I'm yelling for?!!!
Offline
@johnraff, by "available in the helium-dev repo", you mean our github repo? When this hits our helium repo as a deb package, let's update the OP with a link.
No, he can't sleep on the floor. What do you think I'm yelling for?!!!
Offline
@ohnonot, what line or lines should I edit if I want the notification duration to match my other ones (30 seconds)?
No, he can't sleep on the floor. What do you think I'm yelling for?!!!
Offline
@johnraff, by "available in the helium-dev repo", you mean our github repo? When this hits our helium repo as a deb package, let's update the OP with a link.
It's in GitHub, but the "helium-dev" repo is what we were using before the official release. It still exists, but there's nothing there now except a couple of experimental packages, like this.
deb https://kelaino.bunsenlabs.org/~johnraff/debian helium main
Agreed, when it's in helium proper we can update the OP and announce somewhere.
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Online
@ohnonot, what line or lines should I edit if I want the notification duration to match my other ones (30 seconds)?
My mistake, I was trying to edit the script in /usr/bin, but that's not necessary. man bl-fortune FTW, I've made my adjustments in ~/.config/openbox/autostart...
## bl-fortune - have the system come up with a little adage (not yet enabled)
(sleep 3; bl-fortune -t 30000) &
Alles gut.
No, he can't sleep on the floor. What do you think I'm yelling for?!!!
Offline
bunsen-fortune is now available in the "helium" repository.
Install, uncomment the line in openbox/autostart, and enjoy!
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Online
added:
Because "perfect for hot summer afternoon" could mean different things to different people. Some folk like stuff with field recordings of a rainforest full of drunk frogs and horny cicadas, in order to drown in their own sweat. Others like cooler wintery sounds with the drone of an a/c compressor unit in the background to help offset the heat, or bask in denial at the very least.
-- and pushed.
Offline
An instant classic, thanks!
No, he can't sleep on the floor. What do you think I'm yelling for?!!!
Offline
@ohnonot and everyone, @johnraff has made the push, it will be in Lithium...
No, he can't sleep on the floor. What do you think I'm yelling for?!!!
Offline
^Should we enable fortune popups in autostart by default, or leave it for users to uncomment?
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Online
@johnraff and @ohnonot, the timeout for the notification is inconsistent, and too short in general ATM. It would be great if it could inherit the timeout set in xfce4-notifyd-settings, or just set it to something long enough so you can read the longer quotes, maybe 20 seconds?
-edit- Is the inconsistency that the time-out is determined by the length of the quote? Sometimes it's the short ones that disappear too fast. Maybe it just needs a longer delay in my openbox autostart for when I reboot.
Last edited by hhh (2019-06-04 17:58:42)
No, he can't sleep on the floor. What do you think I'm yelling for?!!!
Offline
There are two separate delays here.
## bl-fortune - have the system come up with a little adage (not yet enabled)
#(sleep 120; bl-fortune) &
1) The delay before firing off bl-fortune. This is a quite arbitary 120s in BL's file atm, but could be anything. I use a random 'sleep $((RANDOM%3600+120))' but that needs bash.
2) The time that bl-fortune decides to set for the message display. This was the subject of much discussion a while ago. Now it's simply the # of words x 500ms, but I think it needs a fixed time adding on (as well as possibly increasing the 500) because humans need a certain time just to recognize that the message has appeared, before starting to read it.
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Online
The time that bl-fortune decides to set for the message display. This was the subject of much discussion a while ago. Now it's simply the # of words x 500ms, but I think it needs a fixed time adding on (as well as possibly increasing the 500) because humans need a certain time just to recognize that the message has appeared, before starting to read it.
but then I overturned my own statement (to simply stick with notify-send timeouts), and we had a second, much longer discussion (where?) about an additional script.
the help text:
#~ It is said that average reading speed is ~250 words per minute for adults.
#~ That means 4.166667 words per second.
#~ I think it's fair to assume that the text should linger quite a bit longer,
#~ about twice as long. make that 2 words per second, that's a delay of 500ms
#~ per word:
delay=500
HELP=" bl-fortune is a script to display custom fortunes.
Usage: bl-fortune [OPTIONS]
Options:
-i <icon>, --icon=<icon> use different icon
(default is $msg_icon)
-d <time>, --word-delay=<time> set delay per word, calculates
message expiry time based on text length
(default is ${delay}ms)
(overrides -t)
-t <time>, --expiry-time=<time> set message expiry time
(default is ${msg_time}ms)
(overrides -d)
-c <name>, --cookie='<name>[ name]' set fortune cookie list(s)
(default is $cookie)
(this can contain multiple fortunes and
options to fortune. Example:
\"-ae cbbl fortunes\")
-D debug - enable some terminal messages
-h, --help show this message
Description:
This is a wrapper round notify-send
- the icon and time options are the same.
Normally run without options,
the default behaviour is to choose a fortune
from the 'cbbl' collection, which is gathered
from CrunchBang and BunsenLabs forum posts.
"
so particularly the mutually exclusive -d and -t options.
Is that not sufficient?
BTW, the topic of this thread still stands! If you really want sth added to the quotes, please make a request here, or here! thanks!
Last edited by ohnonot (2021-07-08 09:27:26)
Offline