csser (Chromium/Chrome)

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:

csser (Chromium/Chrome)

Unread post by machinebacon » Sat Feb 22, 2014 6:38 pm

Just like the dkeger script, this one pipes Xresources colors (that are saved in ~/console-colors/) into a Custom.css

This version is for the Chromium browser.

And that's how our forums (for example) look like, using the bbq Xcolor theme:
csser.jpg
Of course you *should* hack away with this script:
- check the path to your console-colors
- adjust the CSS elements, as they will look strange on some sites

Code: Select all

#!/bin/bash
# from Xresources to CSS
# machinebacon 2014-02-22 for linuxbbq

# path to console colors, please adjust
ls ~/console_colors/
echo "Which theme to use (without extension)?"
read THEME
TMPCSS=~/$THEME.css
# path to console colors, please adjust
FULLPATH=~/console_colors/$THEME
BG=$(grep background $FULLPATH | cut -d":" -f2)
FG=$(grep foreground $FULLPATH | cut -d":" -f2)
COL0=$(grep color0 $FULLPATH | cut -d":" -f2)
COL1=$(grep color1 $FULLPATH | cut -d":" -f2)
COL2=$(grep color2 $FULLPATH | cut -d":" -f2)
COL3=$(grep color3 $FULLPATH | cut -d":" -f2)
COL4=$(grep color4 $FULLPATH | cut -d":" -f2)
COL5=$(grep color5 $FULLPATH | cut -d":" -f2)
COL6=$(grep color6 $FULLPATH | cut -d":" -f2)
COL7=$(grep color7 $FULLPATH | cut -d":" -f2)
COL8=$(grep color8 $FULLPATH | cut -d":" -f2)
COL9=$(grep color9 $FULLPATH | cut -d":" -f2)
COL10=$(grep color10 $FULLPATH | cut -d":" -f2)
COL11=$(grep color11 $FULLPATH | cut -d":" -f2)
COL12=$(grep color12 $FULLPATH | cut -d":" -f2)
COL13=$(grep color13 $FULLPATH | cut -d":" -f2)
COL14=$(grep color14 $FULLPATH | cut -d":" -f2)
COL15=$(grep color15 $FULLPATH | cut -d":" -f2)

#create a custom CSS anyway 
#works quite well for our forums, adjust for other websites

cat << EOF > $TMPCSS

code
{
background-color: $COL0 !important;
color: $COL15 !important;
}

tr
{
background-color:$BG !important;
color:$COL15 !important;
}

td
{
background-color:$BG !important;
color:$COL15 !important;
}

head
{
background-color:$BG !important;
color:$COL15 !important;
}

div, span
{
background-color:$BG !important;
color:$COL15 !important;
}

table
{
border: 1px solid $BG !important;
background-color:$BG !important;
color:$COL15 !important;
}


ol
{
background-color:$BG !important;
color:$COL15 !important;
}


ul
{
background-color:$BG !important;
color:$COL15 !important;
}

a
{
background-color:$BG !important;
color:$COL16 !important;
}
a:link
{
background-color:$BG !important;
color:$COL14 !important;
}
a:visited
{
background-color:$BG !important;
color:$COL11 !important;
}
a:active
{
background-color:$BG !important;
color:$COL12 !important;
}
a:hover
{
background-color:$BG !important;
color:$COL13 !important;
}

h1
{
background-color:$BG !important;
color:$COL8 !important;
}
h2
{
background-color:$BG !important;
color:$COL8 !important;
}
h3
{
background-color:$BG !important;
color:$COL8 !important;
}

form
{
background-color:$FG !important;
color:$BG !important;
}

span
{
background-color:$BG !important;
color:$COL15 !important;
}

body
{
background-color:$BG !important;
color:$FG !important;
}

p
{
background-color:$BG !important;
color:$COL15 !important;
}

EOF

read -n1 -p "Use it now? (y/N)"
if [ $REPLY = 'y' ]; then
cp $TMPCSS ~/.config/chromium/Default/User\ StyleSheets/Custom.css
fi
echo
echo Saved as $TMPCSS
..gnutella..

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

Re: csser (Chromium/Chrome)

Unread post by wuxmedia » Sat Feb 22, 2014 6:44 pm

cool, well cool.
Did I say this was cool?

Thanks MB 8)
"Seek, and Ye shall find"
"Github | Chooons | Site"

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

Re: csser (Chromium/Chrome)

Unread post by machinebacon » Sat Feb 22, 2014 6:48 pm

For Iceweasel, by the way, it should go to the Profile folder, which has some strange name, like p3n15unc13 :D The haxxors will find it out ;)
..gnutella..

User avatar
ivanovnegro
Minister of Truth
Posts: 5449
Joined: Wed Oct 17, 2012 11:12 pm

Re: csser (Chromium/Chrome)

Unread post by ivanovnegro » Sat Feb 22, 2014 6:56 pm

Fantástico Jamón!

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

Re: csser (Chromium/Chrome)

Unread post by rhowaldt » Sun Feb 23, 2014 3:08 pm

fuck me this is awesome! thanks so much :)
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
DebianJoe
Frame Buffer
Posts: 1915
Joined: Mon Jul 01, 2013 5:41 am
Location: emacs.d

Re: csser (Chromium/Chrome)

Unread post by DebianJoe » Mon Feb 24, 2014 1:16 pm

Well, that's pretty freaking cool Jules! (scrot or it didn't happen)
2014-02-24-121443_1366x768_scrot.png
#suchbloat #muchwow #soamaze
...now to remove all of chromiums again... :)
|>>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: csser (Chromium/Chrome)

Unread post by machinebacon » Mon Feb 24, 2014 4:08 pm

Hold on, we can somehow make roaster read stylesheets, can't we? *digs into python-webkit* ;)
..gnutella..

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

Re: csser (Chromium/Chrome)

Unread post by DebianJoe » Mon Feb 24, 2014 4:25 pm

|>>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: csser (Chromium/Chrome)

Unread post by machinebacon » Mon Feb 24, 2014 4:32 pm

But fucking dillo can! :D

move generated foo.css file to .dillo/style.css
Attachments
dillocss.png
..gnutella..

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

Re: csser (Chromium/Chrome)

Unread post by DebianJoe » Mon Feb 24, 2014 5:32 pm

(at this point, roaster does not support CSS stylesheets...but give me a little while to figure out how/if we can get the C-styled WebKitGtk imports into the python bindings.)
|>>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: csser (Chromium/Chrome)

Unread post by machinebacon » Mon Feb 24, 2014 5:40 pm

roaster is full featured and dillo isn't. ;) tbh i dont miss the custom css function.
..gnutella..

Post Reply