Scripts by xaos52
Forum rules
Your own work only.
Your own work only.
Scripts by xaos52
New script in my repo: 'raiss' bash_scripts
For loading rss feeds into your browser from the command line.
Thanks to user 'procyan on the Arch forum
And a small contribution by yours truly (jds1307 is my moniker on arch)
For loading rss feeds into your browser from the command line.
Thanks to user 'procyan on the Arch forum
And a small contribution by yours truly (jds1307 is my moniker on arch)
Connected. Take this REPL, brother, and may it serve you well.
Re: Scripts by xaos52
Added first 'quick & dirty' version of console_colors to github.
"Database" layout and data are in a separate file: console-color-themes
The script itself loads the color themes from the data file : put it in the same dir as the script or modify the script.
Some working functionality:
- load the database
- print list of themes
- apply a theme
The rest will be added in future versions.
Remarks, suggestions, criticism are welcome :)
"Database" layout and data are in a separate file: console-color-themes
The script itself loads the color themes from the data file : put it in the same dir as the script or modify the script.
Some working functionality:
- load the database
- print list of themes
- apply a theme
The rest will be added in future versions.
Remarks, suggestions, criticism are welcome :)
Connected. Take this REPL, brother, and may it serve you well.
Re: Scripts by xaos52
Would it be within reason to break the huge plaintext themes database file into individual files? One of the primary aims of the project was to avoid having to edit a monolithic file just to add a theme.
-
- Baconator
- Posts: 10253
- Joined: Thu Sep 16, 2010 11:03 am
- Location: Pfälzerwald
- Contact:
Re: Scripts by xaos52
Thanks Doctor, it does what it says on the tin. Two questions:
1) can you make it read from more than one -color-theme file?
2) I get a list of available themes when run without options, but some have a "key:" label before the theme name. Does it mean anything?
1) can you make it read from more than one -color-theme file?
2) I get a list of available themes when run without options, but some have a "key:" label before the theme name. Does it mean anything?
Code: Select all
...
...
key: autumn
key: flower
key: vintage
afog
astro
...
...
..gnutella..
Re: Scripts by xaos52
1) you mean more than one in the same session or specify the one you want to use with an option?
2) the key: ... lines were for debugging only.
the list will be extended to include author and full_name of the theme.
3) adding themes will be easiest with palleter integrated into the script.
4) adding a theme will also be possible by providing a text file in the same format as the database file ( 3 lines per theme that you want to add ), or a format that is easily transformed to that format.
2) the key: ... lines were for debugging only.
the list will be extended to include author and full_name of the theme.
3) adding themes will be easiest with palleter integrated into the script.
4) adding a theme will also be possible by providing a text file in the same format as the database file ( 3 lines per theme that you want to add ), or a format that is easily transformed to that format.
Last edited by xaos52 on Tue Nov 05, 2013 3:13 pm, edited 1 time in total.
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: Scripts by xaos52
Originally we planned (or would be happy) to have all the themes in separated files, so that it is easier to maintain in the future - users could drop their color schemes into the themes directory, they would partly come from the paletter script, partly from contributions. Adding themes to one large file is more complicated than adding smaller files to a designated directory.
..gnutella..
Re: Scripts by xaos52
^ Can be done.
Loading the database would then consist of scanning the themes directory and loading all files into one associated array. in memory.
Do you have a list of possible formats the user would supply?
Entry via palleter will be no problem, as I know the format palleter delivers. All I need there is the key, author and full_name.
How about me always asking interactively for key, author and full_name, and the user supplying one color per line, with the prefixes P0...PF.. that would be unequivocal.
Loading the database would then consist of scanning the themes directory and loading all files into one associated array. in memory.
Do you have a list of possible formats the user would supply?
Entry via palleter will be no problem, as I know the format palleter delivers. All I need there is the key, author and full_name.
How about me always asking interactively for key, author and full_name, and the user supplying one color per line, with the prefixes P0...PF.. that would be unequivocal.
Connected. Take this REPL, brother, and may it serve you well.
Re: Scripts by xaos52
Or a fixed layout:
line 1 = key
line 2 = author
line 3 = full name
following lines are color definition lines - including the prefixes.
Then a theme can be created without user interaction.
Lines 1 to 3 must be double quoted when containing spaces.<--- scrap that
Comment lines allowed before and after the definition lines, not in the definitions themselves <-- scrap that too.
the key can be the file name, so scrap line1 as well. --> one theme per file.
line 1 = key
line 2 = author
line 3 = full name
following lines are color definition lines - including the prefixes.
Then a theme can be created without user interaction.
Lines 1 to 3 must be double quoted when containing spaces.<--- scrap that
Comment lines allowed before and after the definition lines, not in the definitions themselves <-- scrap that too.
the key can be the file name, so scrap line1 as well. --> one theme per file.
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: Scripts by xaos52
Right now there's no fixed format for the key/author/full name header, the paletter only outputs the colors, and the other scripts use 'hardcoded' key/name values; so we are flexible.
I wonder if the 'author' field is important or not. Actually it doesn't bring much, as it is repeated in the 'full name' field. And even a full name field is redundant, who really cares about the author's name? I don't.
But don't take my word for written in stone :)
-----
Note to self: paletter would ask for a key and full name and add it to the .theme file.
I wonder if the 'author' field is important or not. Actually it doesn't bring much, as it is repeated in the 'full name' field. And even a full name field is redundant, who really cares about the author's name? I don't.
But don't take my word for written in stone :)
-----
Note to self: paletter would ask for a key and full name and add it to the .theme file.
..gnutella..
Re: Scripts by xaos52
some thoughts:
- themefiles in a 'themes' directory would be the simplest way to have this implemented. wanna add a new theme? just drop a themefile in the directory, run the script and it will be available for switching.
- creation of themefiles could be done either through Paletter (if you want a theme based on a picture), through an interactive part of the script (as suggested by xaos) or by hand (just write your own theme-file)
- i think when it comes to FOSS-related shit it is somewhat important to mention the author of a theme, simply to do some attribution, ie. as a way to say 'thank you' or something
hope this is useful :)
- themefiles in a 'themes' directory would be the simplest way to have this implemented. wanna add a new theme? just drop a themefile in the directory, run the script and it will be available for switching.
- creation of themefiles could be done either through Paletter (if you want a theme based on a picture), through an interactive part of the script (as suggested by xaos) or by hand (just write your own theme-file)
- i think when it comes to FOSS-related shit it is somewhat important to mention the author of a theme, simply to do some attribution, ie. as a way to say 'thank you' or something
hope this is useful :)
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.
-
- Baconator
- Posts: 10253
- Joined: Thu Sep 16, 2010 11:03 am
- Location: Pfälzerwald
- Contact:
Re: Scripts by xaos52
^ Who made FlatStudio? Or Numix? ;) But yeah, I don't really care about "author" bullshit, exactly because it is the FOSS world. As long as it is easy to implement...
It would be super-sexy if writing the .theme file is easy as pasting the 16 color code blocks into a txt file, especially because it could easily generate an Xresources snippet, too.
It would be super-sexy if writing the .theme file is easy as pasting the 16 color code blocks into a txt file, especially because it could easily generate an Xresources snippet, too.
..gnutella..
Re: Scripts by xaos52
Pushed v002 of the script and ilight as an example of the expected layout.
This one scans the themes dir for files containing a single theme definition and uses the fileame as key.
Will simplify to just color codes as suggested by mb in the next version.
This one scans the themes dir for files containing a single theme definition and uses the fileame as key.
Will simplify to just color codes as suggested by mb in the next version.
Connected. Take this REPL, brother, and may it serve you well.
Re: Scripts by xaos52
Q: should I descend into subdirectories of the themes dir?
Connected. Take this REPL, brother, and may it serve you well.
Re: Scripts by xaos52
pushed version .003
Connected. Take this REPL, brother, and may it serve you well.
Re: Scripts by xaos52
@Jules: hmm, okay, you got a point.
@Xaos: i'd say: no descending into subdirs. what's the use? only complicates stuff more... (imo)
@Xaos: i'd say: no descending into subdirs. what's the use? only complicates stuff more... (imo)
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: Scripts by xaos52
Pushed v0.004
See commit message for details.
See commit message for details.
Connected. Take this REPL, brother, and may it serve you well.
Re: Scripts by xaos52
Pushed version 0.005
See commit message for details.
See commit message for details.
Connected. Take this REPL, brother, and may it serve you well.
Re: Scripts by xaos52
Pushed version 0.006
See commit message for details.
See commit message for details.
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: Scripts by xaos52
Sir,
I get a ./console-colors.sh: line 212: columns: command not found
bash --version
GNU bash, version 4.2.45(1)-release
bsdmainutils:
Installed: 9.0.5
Shouldn't it be "column"? Or is the problem elsewhere?
I commented the pipe out for testing - the script is superb, really. Now if it makes us an .Xresources file (or open an Xresources file from an existing theme in ./console_colors), I open a bottle of beer for us. A Belgian one.
I get a ./console-colors.sh: line 212: columns: command not found
bash --version
GNU bash, version 4.2.45(1)-release
bsdmainutils:
Installed: 9.0.5
Shouldn't it be "column"? Or is the problem elsewhere?
I commented the pipe out for testing - the script is superb, really. Now if it makes us an .Xresources file (or open an Xresources file from an existing theme in ./console_colors), I open a bottle of beer for us. A Belgian one.
..gnutella..
Re: Scripts by xaos52
^ /usr/bin/columns comes with the package 'autogen' in Debian.
Well, it is not finished yet.
Go buy that beer and put it somewhere cold.
And I dont like it when you call me "sir", my son.
Well, it is not finished yet.
Go buy that beer and put it somewhere cold.
And I dont like it when you call me "sir", my son.
Connected. Take this REPL, brother, and may it serve you well.