Console Theme Switcher

Submitted scripts and programs
Forum rules
Your own work only.
machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: Console Theme Switcher

Unread post by machinebacon » Mon Nov 04, 2013 9:23 am

I thought of python too, and in fact python+CURSES is something that makes sense.
What it can/should do:
- list available themes
- use w3mimageviewer to display a preview
- make them selectable for console or X or both (-c/-x switch)
- accepts options (direct choice of a certain colour theme, with -c/-x switch)
- can take an image and pipe it to paletter, create both themes, give it a name/label and store the resulting themes in the .colors directory
- creates a gtk2rc from any input (existing .ccolor file or image ;)

*BLOAT*
..gnutella..

User avatar
DebianJoe
Frame Buffer
Posts: 1915
Joined: Mon Jul 01, 2013 5:41 am
Location: emacs.d

Re: Console Theme Switcher

Unread post by DebianJoe » Mon Nov 04, 2013 10:01 am

Okay, so let's see if I'm understanding you correctly on how you think it "can/should" work. For the sake of discussion, let's call our program "cadet".

cadet -l = Opens a listing of all themes that exist in ~/.colors (or a specified directory, this is flexible).
cadet -c <theme> = provides correct escapes (probably ugly os.system call here) to console to implement theme outside of X.
cadet -x <theme> = generates Xresources file based on the theme passed.
cadet -g <theme> = creates a gtk2rc based on a theme.
cadet -p <theme_name> /path/to/image = pipes image from path into Rho's palleter, gives output as theme_name.ccolor and stores it in our ~/.colors, which can be used for whatever else.

Am I understanding your idea correctly?

The complicated part is actually regarding the different formats that Xresouces has to be written in to work with different terminal emulators. Xterm uses the "*", while URxvt uses "." as delimiters...and we want to offer a way to make them work in aterm, right? I may need to study how you're doing the dkeger script in better detail, because that would cover most X options.
|>>BBQ Roaster, Alpha Branch<< | >> clinky << | >> X11 must die << |
Thanks BASIC

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: Console Theme Switcher

Unread post by machinebacon » Mon Nov 04, 2013 10:37 am

Yes, you understand it correctly (the TUI part a la 'dialog' is optional of course). The output of -p could create whatever is wished, yes.

What if first "*colorX:" entries are generated and piped into the xresources' ccolor file (instead of Urxvt.color), and then a dirty 'sed' is run over it, '/s/*color/xterm/', generating the xterm entries? That must be the only difference there. (same for aterm)
..gnutella..

User avatar
DebianJoe
Frame Buffer
Posts: 1915
Joined: Mon Jul 01, 2013 5:41 am
Location: emacs.d

Re: Console Theme Switcher

Unread post by DebianJoe » Mon Nov 04, 2013 10:51 am

....if we don't use a "fancy curses switcher", we can implement this entire project in either simple python or pure bash (I may need a bit of help on it in that case, but I've got a good idea of where to start.) Let me see what all I can make happen.
|>>BBQ Roaster, Alpha Branch<< | >> clinky << | >> X11 must die << |
Thanks BASIC

User avatar
dkeg
Configurator
Posts: 3782
Joined: Sun Nov 18, 2012 9:23 pm
Location: Mid-Atlantic Grill

Re: Console Theme Switcher

Unread post by dkeg » Mon Nov 04, 2013 1:37 pm

wow, great stuff you guys! I like how this is churning. FYI, I already have an adjusted rho's paletter script to output '*colorX: #000000'. Its in scripts section of my github or actually duh, its in the paletter thread

Work hard; Complain less

User avatar
GekkoP
Emacs Sancho Panza
Posts: 5878
Joined: Tue Sep 03, 2013 7:05 am

Re: Console Theme Switcher

Unread post by GekkoP » Mon Nov 04, 2013 1:43 pm

This sounds like a great tool, guys. Keep up the good work (my bash/python still sucks, so I can't help you...)

User avatar
rhowaldt
Dog
Posts: 4565
Joined: Wed Oct 17, 2012 9:01 am
Contact:

Re: Console Theme Switcher

Unread post by rhowaldt » Mon Nov 04, 2013 3:48 pm

@DJ: if done in pure bash, i'd advice you to have a stab at it, then run it by xaos :)
the ideas sound good!
All statements are true in some sense, false in some sense, meaningless in some sense, true and false in some sense, true and meaningless in some sense, false and meaningless in some sense, and true and false and meaningless in some sense.

User avatar
xaos52
The Good Doctor
Posts: 190
Joined: Thu Aug 15, 2013 11:59 am
Location: Eernegem, Belgium

Re: Console Theme Switcher

Unread post by xaos52 » Mon Nov 04, 2013 5:35 pm

I am working on a bash version doing everything that has been mentioned in this thread.
Connected. Take this REPL, brother, and may it serve you well.

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: Console Theme Switcher

Unread post by machinebacon » Tue Nov 05, 2013 1:42 am

The doctor is working on his dissertation.
..gnutella..

User avatar
DebianJoe
Frame Buffer
Posts: 1915
Joined: Mon Jul 01, 2013 5:41 am
Location: emacs.d

Re: Console Theme Switcher

Unread post by DebianJoe » Tue Nov 05, 2013 4:12 am

xaos52 wrote:I am working on a bash version doing everything that has been mentioned in this thread.
Well, then I'll rest on my laurels and let you do that. The only reason I was thinking about using something beyond bash was for an easier way to select from the list, and I still struggle with writing good bash. A bash version would be fantastic, and should the need arise, we can worry about the pager as a sub-option for the script. (Unless you have some kind of bash magic where you can draw scrolling menus in bash...and I really don't think I'd be surprised if you did.)
|>>BBQ Roaster, Alpha Branch<< | >> clinky << | >> X11 must die << |
Thanks BASIC

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: Console Theme Switcher

Unread post by machinebacon » Tue Nov 05, 2013 4:39 am

^scrolling menus with whiptail :D
..gnutella..

User avatar
DebianJoe
Frame Buffer
Posts: 1915
Joined: Mon Jul 01, 2013 5:41 am
Location: emacs.d

Re: Console Theme Switcher

Unread post by DebianJoe » Tue Nov 05, 2013 7:19 am

Honestly, I'm looking forward to what the Doctor comes up with. Depending upon how he populates the list (perhaps an array... :D) of themes from files, passing information to a curses front-end might be very simple, and after a selection is made, the pointer could be set to reinsert the selection into the script.

This is only assuming that it's necessary for the sake of saving screen real-estate for the "foobar -l" option. If it is manageable without such a diversion, then that would be excellent. (I've never used whiptail myself, but it looks neat.)

@Xaos, I'm offering to help with creating the separate files, a binary pager for the list, or whatever else you need to help this come together. Let me know how I can help.
|>>BBQ Roaster, Alpha Branch<< | >> clinky << | >> X11 must die << |
Thanks BASIC

User avatar
GekkoP
Emacs Sancho Panza
Posts: 5878
Joined: Tue Sep 03, 2013 7:05 am

Re: Console Theme Switcher

Unread post by GekkoP » Sun Nov 17, 2013 11:11 am

On killX ccolor works fine in tty, but doesn't change colors in fbterm. Maybe it's just me missing something as usual :)

User avatar
wuxmedia
Grasshopper
Posts: 6454
Joined: Wed Oct 17, 2012 11:32 am
Location: Back in Blighty
Contact:

Re: Console Theme Switcher

Unread post by wuxmedia » Sun Nov 17, 2013 11:18 am

^ it's a bug with fbterm.
https://code.google.com/p/fbterm/issues/detail?id=53
changing 'desktops' can work too, can't remember the keycombo.
"Seek, and Ye shall find"
"Github | Chooons | Site"

User avatar
GekkoP
Emacs Sancho Panza
Posts: 5878
Joined: Tue Sep 03, 2013 7:05 am

Re: Console Theme Switcher

Unread post by GekkoP » Sun Nov 17, 2013 11:21 am

Right, not my fault then. Thank you.

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: Console Theme Switcher

Unread post by machinebacon » Sun Nov 17, 2013 11:30 am

I think the combo is simply Alt + F1/2/3/4 etc.
man fbterm shows the list, there are indeed some shortcuts. In case you don't have the documentation:

Code: Select all

SHORTCUT SUMMARY
       keyboard:
         CTRL_ALT_E:    exit from FbTerm
         CTRL_ALT_C:    create a new window
         CTRL_ALT_D:    destroy current window
         CTRL_ALT_1:    switch to window 1
         CTRL_ALT_2:    switch to window 2
         CTRL_ALT_3:    switch to window 3
         CTRL_ALT_4:    switch to window 4
         CTRL_ALT_5:    switch to window 5
         CTRL_ALT_6:    switch to window 6
         CTRL_ALT_7:    switch to window 7
         CTRL_ALT_8:    switch to window 8
         CTRL_ALT_9:    switch to window 9
         CTRL_ALT_0:    switch to window 10
         SHIFT_LEFT:    switch to previous window
         SHIFT_RIGHT:   switch to next window
         SHIFT_PAGEUP:    history scroll up
         SHIFT_PAGEDOWN:  history scroll down
         CTRL_ALT_F1:                 switch to encoding of current
       locale
         CTRL_ALT_F2 to CTRL_ALT_F6:  switch to  additional  encod‐
       ings
         CTRL_SPACE:    toggle input method
         CTRL_ALT_K:    kill input method server

       mouse:
         move when left button down:      select text
         double click with left button:   auto select text
         click with right button:         paste selected text

       Sometimes  above  actions  will not work, please try to redo
       them with shift key holding down.
..gnutella..

Post Reply