You are not logged in.
Pages: 1
Hey everyone! Apologies if this is the wrong place, please move it if I messed up.
I'll get right into it though, I've been making my own monitors with GenMon lately. Trying to get a little bit more of a personal touch. But where I'm stuck right now is wanting one with scrolling text. So my question for the hive mind is. 1. How do I set a static width for what the monitor shows on the task bar, and 2. How do I get text to scroll in that monitor like a news feed or a stock ticker does.
Ultimately, I'm hoping to build my own little ticker to keep track of just the crypto and stock I own; and keep an eye on them. I already have the stock info pulled through awk etc so I'm just stuck on the scrolling part.
Offline
Hello and welcome.
I'll get right into it though, I've been making my own monitors with GenMon lately.
Cool plugin.
How do I set a static width for what the monitor shows on the task bar
Not currently possible, unless you use a fixed width font like monospace
2. How do I get text to scroll in that monitor like a news feed or a stock ticker does.
Use a script like this:
#!/bin/bash
# str is the string to tick
str="Lorem ipsum dolor sit amet. Qui beatae nulla vel incidunt excepturi et fugiat alias a dolorem dolor ut delectus vero ut molestiae nobis a consequatur eligendi. Non esse ipsam et adipisci molestiae cum dolorem praesentium ut officia iure ut magnam accusantium 33 culpa necessitatibus."
# length is the length of the substring to display
length=30
# processing code
counter=$(cat ~/.cache/counter 2>/dev/null || echo 0)
[[ $counter -gt $((${#str}-$length)) ]] && counter=0
echo "${str:$counter:$length}"
echo "$((counter+1))" > ~/.cache/counter
exit 0
...and change the str and length variables. In the genmon plugin, set the command to point to this script and the period to indicate how fast to scroll. Don't forget to make the script executable.
In your case, $str would hold the output of the awk command to get the stock price.
Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
in general, scrolling can be done by just re-displaying the text shifted over by some amount. the picture you included has a shift of a whole character. a faster shift of a single pixel at a time could also be done but would need more involved programming.
Offline
Pages: 1
[ Generated in 0.012 seconds, 7 queries executed - Memory usage: 525.55 KiB (Peak: 531.5 KiB) ]