Topic: Noob writes first shell script

I wrote my first shell script the other day. Whenever I start Firefox, it asks me how long I want to surf, starts the browser and kills it after the specified timespan. (I'm into productivity hacks.) Nothing special, but I feel very proud about it.

I guess that this could've been done on any other OS, even on Windows. But as a regular GUI guy, I would never have gotten the idea. About a year ago, I chose Crunchbang for its speed and looks, but underneath the sleekness I found it to be pretty DIYish. It forced me to edit config files and to solve things geek-style. I'm just beginning to learn what "infinitely hackable" means. Hell, I could do ANYTHING with this (if I was smart enough)!

Thanks, Crunchbang. This is fun.

Re: Noob writes first shell script

Well done, I am happy for you. smile

How did you get the idea of time limiting the usage of Firefox?

Re: Noob writes first shell script

@mxlmpr: Nice job! Maybe you could post the script? Lots of us here either use bash scripts a lot or are learning to write them - your example may be beneficial to someone and we're all about sharing here!

btw, welcome to #! smile

"Stranger, if you passing meet me and desire to speak to me, why should you not speak to me? And why should I not speak to you?" Walt Whitman, 'To You'.

Re: Noob writes first shell script

hi mxlmpr, welcome to the community! and congratulations on your own script, and a good idea at that!

i agree with safetycopy on sharing your script. you are not obliged to do so of course, but the reason i always share mine is because i want to get some feedback on the coding, and maybe there are people looking for the same thing, and you save them time. plus, anyone interested in writing bash scripts could learn from your efforts. just to give something back to the community, that's all.

if you do share, please do so in the Tips&Tricks&Scripts subforum, as it is meant for that kinda thing.

Re: Noob writes first shell script

Welcome to #! mxlmpr...  Enjoy the show!

I would also like to see the script

Re: Noob writes first shell script

Scripting's fun, health-giving and profitable!

John
------------------------
( a boring Japan blog , and idle twitterings )
“Good morning sir, which way up would you like your reality today?”  "As it comes, Jeeves, as it comes..."

Re: Noob writes first shell script

Hey share it with the world! maybe it may evolve with more people's ideas into something bigger!

Statler: Are you running Mac or PC?

Waldorf: After that... I'm running away!

Re: Noob writes first shell script

Wow, thanks for your feedback. I'll gladly post the script in the scripts subforum (tomorrow), as rhowaldt suggested. And I'll tell you about my motivation for writing it right here.

I translate for a living. I like doing it, but I am easily distracted and prone to getting lost in the web. Since I do not believe in self-discipline, I divided the work into writing and editing, with the first part to be done offline (I have the router cut off my connection the whole evening). Which works fine. But when I'm editing and looking things up, I'll wander off. That's how I got the idea of setting a time limit on browser use.

At the moment, I'm not interested in refining the script, but in finding out how it affects my behavior. The first thing I noticed was that I always underestimate the time I actually need/use to get things done.

Do you guys employ any self-restricting hacks?

Re: Noob writes first shell script

mxlmpr wrote:

Do you guys employ any self-restricting hacks?

nope. i've had a problem with any form of discipline (including self-discipline) my entire life, and feel that of all the kinds, self-discipline is the most useful one to have, so i try and get by purely on that, training myself in the process, without hacks.

Re: Noob writes first shell script

This sounds really good smile, if you made multiple scripts for multiple programs, or even a script for the user session you could bunch them together so parents could use them for their kids.

Re: Noob writes first shell script

Hey mxlmpr have you tried the LeechBlock add-on for Firefox?

https://addons.mozilla.org/en-US/firefo … eechblock/

Note: ** Please read before posting **

BTW if you wish to contact me, send me an e-mail instead of a PM.