Topic: mmm...crunchbox

Hi. I am new to the forums and cunchbang in general. Installed it a month ago and i love it so far. You might have seen me on the irc channel as lyrae (no, not the theme maker)

I would like to share a program I made. I made it for my needs, but, if you use the default programs that come with crunchbang, then this should work for you too.

What is it?
It's for lazy people.
You set your desktop the way you want - your conkyrc, your tintrc, your wallpaper, your openbox theme, and gtk theme and icons. Now your desktop is perfect just how you like it.
start crunchbox and click 'save'. Now all these settings are saved in a profile with a name you specify(even takes a screenshot).

Go ahead and change your desktop as much as you like, and save it. Then, you can switch between them with the click of a button!

The screenshots will give you a better idea.

Supported programs: the following settings will be saved/loaded
- conky
- gtk theme and icon theme
-  tint2
- openbox theme
- wallpaper (nitrogen)

in the future i plan on adding support for lxpanel (since i use it for notification area), terminator, whatever else.

I hope you enjoy it.
and yes, the name is crunchbox because of crunchbang linux, since it is my fav distro right now

How to start:
extract the 'crunchbox' folder to anywhere you want. Assume it's in ~/downloads/crunchbox, just do:

$ cd downloads/crunchbox/src
$ python crunchbox

(ignore the setup file for now)
(if you have python3 installed, you may need to do '$ python2 crunchbox' instead)

do not run with sudo!!

Dependencies
nothing that doesn't come with your standard #! install. should work out of the box.


Download
https://github.com/lyrae/crunchbox

Saving a profile - click 'save' and a box asking for profile name will appear. type whatever you want and click ok. the program will then take a screenshot of the screen and you will see it in the list immediately
http://i39.tinypic.com/zbib4.png

changing the whole look of your desktop - just click on a thumbnail of a saved profile
http://i39.tinypic.com/fnwav4.png
http://i43.tinypic.com/1zgcokx.png
http://i43.tinypic.com/3mzn.png





If people actually use this and find it as useful as I do, I will probably put it on github

Last edited by none (2012-01-23 08:14:53)

Re: mmm...crunchbox

Amazingly simple and useful. Also something I was thinking of making but never got around to. Thanks a lot!

Meh. Interested for a Dropbox alternative? Go to https://launchpad.net/tart

Re: mmm...crunchbox

damn that is cool. real great idea and looks really nice. not that i'd ever use it because i never change a thing (i'm happy with how it is now), but i can appreciate a good thing when i see it.

Re: mmm...crunchbox

That is a really smart `n` nice thing to have, I am also one of the change as little as possible lazy ones, but with this installed it would be much easier to try different setups.

#!, all else is but a shadow!

Re: mmm...crunchbox

wow none, fantastic.  Great contribution.  Great for tinkerers like myself where your changing look 'n feel all the time. 

nice job

the rocky path may just be the best path.

Re: mmm...crunchbox

...this...is the seksiest...configurations manager...in the history of configurations managers.  And it's all ours!

I bet Philip could be talked into packaging that and putting it in the CrunchBang repo. wink

while ( ! ( succeed = try() ) );

Re: mmm...crunchbox

I really like the idea, and wanted to try it. However, unless I am really missing something, I can't seem to get this to work:

phillc@phillc-laptop:~/downloads/crunchbox$ sudo ./crunchbox.py
Traceback (most recent call last):
  File "./crunchbox.py", line 146, in <module>
    cb = CrunchBox()
  File "./crunchbox.py", line 36, in __init__
    self.layout = Layout(self)   
  File "/home/phillc/downloads/crunchbox/layout.py", line 41, in __init__
    self.load_screenshots()
  File "/home/phillc/downloads/crunchbox/layout.py", line 93, in load_screenshots
    screenshots = os.listdir(path)
OSError: [Errno 2] No such file or directory: '/home/lyrae/.config/crunchbox/screenshots/'

I'm guessing that's linking to your machine, rather than dynamically to mine!

Re: mmm...crunchbox

Screenshots look great, nice work! smile

Re: mmm...crunchbox

^^ got the same error as phillc. i've been learning a bit of python so tried fixing it, but even when changing the relevant code (in layout.py) to /home/rhowaldt instead of /home/lyrae, it is still failing. must be another issue... maybe because the directory 'screenshots' is empty?

Re: mmm...crunchbox

thanks all smile

Sorry if there are bugs here and there..i wrote this in my free time this past week.

...this...is the seksiest...configurations manager...in the history of configurations managers.  And it's all ours!
I bet Philip could be talked into packaging that and putting it in the CrunchBang repo.

that would be very honorable! but I need to squash some bugs first!

I really like the idea, and wanted to try it. However, unless I am really missing something, I can't seem to get this to work:
phillc@phillc-laptop:~/downloads/crunchbox$ sudo ./crunchbox.py
Traceback (most recent call last):
  File "./crunchbox.py", line 146, in <module>
    cb = CrunchBox()
  File "./crunchbox.py", line 36, in __init__
    self.layout = Layout(self)   
  File "/home/phillc/downloads/crunchbox/layout.py", line 41, in __init__
    self.load_screenshots()
  File "/home/phillc/downloads/crunchbox/layout.py", line 93, in load_screenshots
    screenshots = os.listdir(path)
OSError: [Errno 2] No such file or directory: '/home/lyrae/.config/crunchbox/screenshots/'
I'm guessing that's linking to your machine, rather than dynamically to mine!

haha. oops. yes, i just fixed that.
please delete everything and try again (also delete ~/,config/crunchbox)


damn that is cool. real great idea and looks really nice. not that i'd ever use it because i never change a thing (i'm happy with how it is now), but i can appreciate a good thing when i see it.

I like to change a lot smile sometimes when i really wanna concentrate, i make my desktop monochrome-ish so colors dont distract me and go easy on the eyes...sometimes i change according to the weather...so this came quite handy


thanks again everyone.

Last edited by none (2012-01-12 17:50:44)

Re: mmm...crunchbox

roll

rhowaldt wrote:

^^ got the same error as phillc. i've been learning a bit of python so tried fixing it, but even when changing the relevant code (in layout.py) to /home/rhowaldt instead of /home/lyrae, it is still failing. must be another issue... maybe because the directory 'screenshots' is empty?


try deleting the ~/.config/crunchbox directory

if it still doesn't work, paste the error here


sorry about this sad

but thank you guys for helping me debug <3


--edit---
i see where i hard coded a path in my machine again on line 54. fixing that right now, hold on

--edit 2--
should be fixed.

Last edited by none (2012-01-12 17:47:45)

Re: mmm...crunchbox

Making progress, but not quite...... (My system is a pretty standard install with not a lot of extras installed yet. I've only changed the theme and not touched conky or tint2 yet)

phillc@phillc-laptop:~/downloads/crunchbox$ sudo ./crunchbox.py
[sudo] password for phillc:
Traceback (most recent call last):
  File "/home/phillc/downloads/crunchbox/dialog_save.py", line 44, in ok_clicked
    brunch.save_profile(self.profile_name)
  File "./crunchbox.py", line 55, in save_profile
    tint2.save(name)
  File "/home/phillc/downloads/crunchbox/crunchbox/tint2.py", line 9, in save
    self.base.save(profile_name, 'tint2')
  File "/home/phillc/downloads/crunchbox/base.py", line 30, in save
    copyfile(src, dst_uri)
  File "/usr/lib/python2.6/shutil.py", line 50, in copyfile
    with open(src, 'rb') as fsrc:
IOError: [Errno 2] No such file or directory: '/root/.config/tint2/tint2rc'
Traceback (most recent call last):
  File "/home/phillc/downloads/crunchbox/dialog_save.py", line 44, in ok_clicked
    brunch.save_profile(self.profile_name)
  File "./crunchbox.py", line 55, in save_profile
    tint2.save(name)
  File "/home/phillc/downloads/crunchbox/crunchbox/tint2.py", line 9, in save
    self.base.save(profile_name, 'tint2')
  File "/home/phillc/downloads/crunchbox/base.py", line 30, in save
    copyfile(src, dst_uri)
  File "/usr/lib/python2.6/shutil.py", line 50, in copyfile
    with open(src, 'rb') as fsrc:
IOError: [Errno 2] No such file or directory: '/root/.config/tint2/tint2rc'

Re: mmm...crunchbox

^ sorry none, the error was my own fault. i put 'home/rhowaldt' instead of '/home/rhowaldt/' ... typo smile

Re: mmm...crunchbox

phillc, did you delete the old crunchbox and its config dirs in ~/,config/crunchbox?

also, don't run it as sudo. i see it's checking your root directory

' '/root/.config/tint2/tint2rc''

while the script is in your ~ dir..so it's checking the root's .config/crunchbox for files while it creates those files in ~/.config/crunchbox

delete crunchbox in your downloads folder, and in your ~/.config folder and try again, but without 'sudo'
just do

$ python crunchbox.py

i just created a new user and ran it, it worked fine. copied and pasted my old profiles too.

Last edited by none (2012-01-12 18:19:09)

Re: mmm...crunchbox

Hi, Great little tool.

On my laptop it takes the screenshot for the page in the full resolution making the box bigger than my screen and maximizing it does not seem to help.

Re: mmm...crunchbox

patrickstein wrote:

Hi, Great little tool.

On my laptop it takes the screenshot for the page in the full resolution making the box bigger than my screen and maximizing it does not seem to help.


do you have imagick installed?

try

convert --version

in console and see if you get the version for imagick.

crunchbox uses imagick to resize the screenshot

Re: mmm...crunchbox

Wow, that's great!
Changing between dark and light setups has never been this easy....

No errors here (on #! testing), except when the script is run with sudo.

Re: mmm...crunchbox

Tunafish wrote:

Wow, that's great!
Changing between dark and light setups has never been this easy....

No errors here (on #! testing), except when the script is run with sudo.


glad to hear smile

looks like im not the only one who enjoys this. I think i'll move it to githib and improve/maintain it

Re: mmm...crunchbox

none wrote:
patrickstein wrote:

Hi, Great little tool.

On my laptop it takes the screenshot for the page in the full resolution making the box bigger than my screen and maximizing it does not seem to help.


do you have imagick installed?

try

convert --version

in console and see if you get the version for imagick.

crunchbox uses imagick to resize the screenshot

It is not installed, how do I install it? Thanks in advance

Re: mmm...crunchbox

^

sudo apt-get install imagemagick

Re: mmm...crunchbox

Haven't tried it yet, just want to thank you for providing something I had been wanting for a long time. Great job and thank you none!

Statler Openbox on overheating Asus U5F  = 8000 Tflops!       ...(or slighlty less).

Re: mmm...crunchbox

you're welcome.
im as thankful for you using it as you are for me building it smile

Re: mmm...crunchbox

none wrote:
Tunafish wrote:

Wow, that's great!
Changing between dark and light setups has never been this easy....

No errors here (on #! testing), except when the script is run with sudo.


glad to hear smile

looks like im not the only one who enjoys this. I think i'll move it to githib and improve/maintain it

Great.... I'l do a request immediately  smile   
Can you include the gtk3 configuration as well?    ~/.config/gtk-3.0/settings.ini

Re: mmm...crunchbox

Tunafish wrote:
none wrote:
Tunafish wrote:

Wow, that's great!
Changing between dark and light setups has never been this easy....

No errors here (on #! testing), except when the script is run with sudo.


glad to hear smile

looks like im not the only one who enjoys this. I think i'll move it to githib and improve/maintain it

Great.... I'l do a request immediately  smile   
Can you include the gtk3 configuration as well?    ~/.config/gtk-3.0/settings.ini

haha yes. good request.
i'll do it later today/tomorrow.

Re: mmm...crunchbox

ok i lied. gtk3 delayed because i don't have it installed yet and just read it that 'send_clientmessage_toall()' is removed in gtk3, and i need that to refresh the gtk windows neutral

git created though. and minor updates