Console Theme Switcher
Forum rules
Your own work only.
Your own work only.
-
- Baconator
- Posts: 10253
- Joined: Thu Sep 16, 2010 11:03 am
- Location: Pfälzerwald
- Contact:
Re: Console Theme Switcher
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*
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..
Re: Console Theme Switcher
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.
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.
-
- Baconator
- Posts: 10253
- Joined: Thu Sep 16, 2010 11:03 am
- Location: Pfälzerwald
- Contact:
Re: Console Theme Switcher
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)
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..
Re: Console Theme Switcher
....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.
Re: Console Theme Switcher
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
Re: Console Theme Switcher
This sounds like a great tool, guys. Keep up the good work (my bash/python still sucks, so I can't help you...)
Re: Console Theme Switcher
@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!
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.
Re: Console Theme Switcher
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.
-
- Baconator
- Posts: 10253
- Joined: Thu Sep 16, 2010 11:03 am
- Location: Pfälzerwald
- Contact:
Re: Console Theme Switcher
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.)xaos52 wrote:I am working on a bash version doing everything that has been mentioned in this thread.
-
- Baconator
- Posts: 10253
- Joined: Thu Sep 16, 2010 11:03 am
- Location: Pfälzerwald
- Contact:
Re: Console Theme Switcher
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.
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.
Re: Console Theme Switcher
On killX ccolor works fine in tty, but doesn't change colors in fbterm. Maybe it's just me missing something as usual :)
- wuxmedia
- Grasshopper
- Posts: 6454
- Joined: Wed Oct 17, 2012 11:32 am
- Location: Back in Blighty
- Contact:
Re: Console Theme Switcher
^ 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.
https://code.google.com/p/fbterm/issues/detail?id=53
changing 'desktops' can work too, can't remember the keycombo.
Re: Console Theme Switcher
Right, not my fault then. Thank you.
-
- Baconator
- Posts: 10253
- Joined: Thu Sep 16, 2010 11:03 am
- Location: Pfälzerwald
- Contact:
Re: Console Theme Switcher
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:
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..