You are not logged in.
was browsing the web and come across this script
pretty cool you can add images to your terminal
Offline
Nice find (it needs w3m-img for images btw).
Offline
Great one! Thanks for the link.
The custom image code part is interesting on its own. Darn cool.
Offline
Thanks John, never seen one with an image display before
Offline
yeah never seen one with image support so had to share guys not just another fetch script its a great one to sexy up screenshots and well just look cool
Offline
Is this your script John?
I have a diff here for OpenBSD packages support:
https://github.com/Head-on-a-Stick/fetc … e60b9c6da2
I'll add some more when I can (I'm not good with scripting so don't expect too much )
EDIT: Added `uptime` support but it generates a trailing comma that I will have to remove somehow.
https://github.com/Head-on-a-Stick/fetc … af3a77290d
I'm not very good at this but it's fun
Last edited by Head_on_a_Stick (2016-01-02 15:44:50)
Offline
@Head_on_a_Stick not my script just found it while browsing around
Offline
@ Hoas:
This is one possible way of removing the time-stamp prefix and the trailing "," for the OPENBSD case:
uptime=( $(uptime|awk -F, '{ print $1 }') )
unset uptime[0]
uptime="${uptime[@]}"
Edit: this is a bash solution.
Last edited by xaos52 (2016-01-02 17:59:47)
Offline
^ Thank you very much xaos52!
Unfortunately, uptime(1) is a bit more limited than the GNU/Linux equivalent
The standard output format is:
$ uptime
6:08PM up 1:23, 1 user, load averages: 1.14, 1.13, 1.22
At the risk of embarrassing myself [1], this is the best I can do with your example:
$ uptime|awk -F, '{ print $1 }'|awk '{print $3}'
1:24
I think there may be a more elegant way of doing that -- give me a bit...
[1] Too late! :8
Offline
Simpler solution:
uptime=$(uptime|awk -F, '{ print $1 }')
uptime="${uptime# * }"
or, if you don't want the 'up' prefix neither:
uptime=$(uptime|awk -F, '{ print $1 }')
uptime="${uptime# * up }"
These might not work if the leading space is not there when the minutes are double digits.
In that case you might have to delete the leading space first in a separate command:
uptime=$(uptime|awk -F, '{ print $1 }')
uptime=${uptime# }
uptime="${uptime#* up }"
Last edited by xaos52 (2016-01-02 19:21:40)
Offline
Offline
uptime=$(uptime|awk -F, '{ print $1 }') uptime="${uptime# * up }"
That's the one!
Uptime: 2:13
Thank you so much
Offline
This might not work if the leading space is not there when the minutes are double digits.
In that case you might have to delete the leading space first in a separate command:
uptime=$(uptime|awk -F, '{ print $1 }')
uptime=${uptime# }
uptime="${uptime#* up }"
Should work in all cases.
Last edited by xaos52 (2016-01-02 19:20:17)
Offline
Hi there, author of the script here!
I finished rewriting the script from scratch today, see:
https://github.com/dylanaraps/fetch.sh/releases
I'm going to bed now but open an issue on github and I'll work on openbsd support tomorrow morning.
Thanks for using my script!
Edit: I've quickly added the base for OpenBSD support. Thanks the uptime lines xaos52! I've also created an issue on github where you can report issues with the script on OpenBSD to help me get it working.
Now I'm going to bed.
Edit2: The script also works with mksh and sh, all you have to do is change the shebang at the top!
Last edited by dylan (2016-01-03 21:55:24)
Offline
welcome dylan really like your script had to share here
Offline
welcome dylan really like your script had to share here
Thanks!
Offline
@dylan,
Debian-based distro's need packages 'w3m' and 'w3m-img' installed to display images
xaos52
Offline
@dylan,
Debian-based distro's need packages 'w3m' and 'w3m-img' installed to display images
xaos52
I only needed to install w3m so I thought they were bundled together. I've added a note to the readme about it.
Thanks.
Offline