So ... today i learned how to use my power bank thingy . . . which i bought for my trip in China . . . and left it home, because i didn't know how to use it then. . .
yeah, it's hard to RTFM without TFM . . . although I should have googled . . . I also should have guessed that the powerbank doesn't have any initial charge
depends on the language TFM is written in. If it's too technical , then yeah, it won't make sense. Also lack of examples . . . .I hate man pages without examples
They're aware. Some just don't like doing documentation. Writing print_usage() function in my scripts is a bother , because i know what the script does. I just know that other users will need it
@Serg It is for a question, but not directly asked that way. I want to use the power button to run a custom script when pressed once (and do not shut down) and to shut down the normal way when it is pressed twice within 5 seconds.
It works if I do not check the timestamp and touch the file but echo the current time into the file and check its content.
@ByteCommander so i played around with the old version. Aside from doing "if [ -e "$mytempfile" ]" I didn't change anything else (except commenting out killing firefox). File gets touched ok within 5 seconds
ifconfig -a | grep 10.16
inet 10.16.x.xx netmask 0xffffff00 broadcast 10.16.x.xxx
inet 10.16.x.xx netmask 0xffffff80 broadcast 10.16.x.xxx
I have replaced the numbers with x
My aim is to remove everything apart from the inet IP's. so it just shows as:
10.16.x.xx
10.16.x.xx
Is thi...
@Serg That one's trickier. The output format of ifconfig is different on the mac (matched what I get on my Arch, apparently, which is why I didn't even realize they were using a mac). That made the first version of my solution break on Ubuntu.
To make a command that finds the id of the last window, created by Firefox (and to close it), you will need wmctrl to be installed:
sudo apt-get install wmctrl
The command
Then use the command:
wmctrl -ic "$(wmctrl -l | grep 'Mozilla Firefox' | tail -1 | awk '{ print $1 }')"
Explanation:...
@ByteCommander you should have started the repo long time ago :p This script still can be as a gist, unless you plan to have multiple scriptos interacting
@grooveplex thanks! In practice, AU is my script- database. Launchpad for the more advanced stuff.. In the beginning, I kept them locally, but my book-keeping is worse than AU :)
@StefanoPalazzo Thanks for the hint, I'll read your link...
@StefanoPalazzo I added "Please note this is NO OFFICIAL repository of Ask Ubuntu or Stack Exchange!" to the org's description. That should be enough, I think?
The logo is made by myself and Ask Ubuntu is spelled correctly. I see no issues here.
I want to monitor the output of a command which keeps running infinitely and prints a line every now and then. It displays events of a hardware button and each line indicates a push.
My script is supposed to run other commands when it receives lines, but the problem is that not the content of th...