]> git.rmz.io Git - dotfiles.git/commitdiff
dwb: use perdomainsettings to set user-stylsheet
authorSamir Benmendil <samir.benmendil@gmail.com>
Sun, 12 Jan 2014 18:09:50 +0000 (19:09 +0100)
committerSamir Benmendil <samir.benmendil@gmail.com>
Sun, 12 Jan 2014 18:13:05 +0000 (19:13 +0100)
this seems like a cleaner way
custom css can be placed in dwb/userstyles and loaded on specific
domains via perdomainsettings.

dwb/greasemonkey/darken.user.js [deleted file]
dwb/settings
dwb/userscripts/extension_loader.js
dwb/userstyles/chakra-project.org.css [new file with mode: 0644]
dwb/userstyles/default.css [new file with mode: 0644]

diff --git a/dwb/greasemonkey/darken.user.js b/dwb/greasemonkey/darken.user.js
deleted file mode 100644 (file)
index 280cb98..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-// Darken
-// version 0.1
-// Gina Trapani
-// 2007-05-10
-// Released to the public domain.
-//
-// ==UserScript==
-// @name          Darken
-// @description   Turns a web pages' background Grey and text White for readability.
-// @include       *
-// @exclude       https?://plus.google.com/hangouts/*
-// @exclude       https?://www.humblebundle.com/*
-// @exclude       https?://steamcommunity.com/*
-// @exclude       https?://*steampowered.com/*
-// @exclude       https?://imgur.com/*
-// @exclude       https?://*playstarbound.com/*
-// ==/UserScript==
-//
-// ==RevisionHistory==
-// Version 0.1:
-// Released: 2007-05-10.
-// Initial release.
-// ==/RevisionHistory==
-
-(function(){
-    var newSS;
-    var styles=':not(img) { background-color: #201F1F ! important; color: #D4D2CF ! important; } :link, :link * { color: #719696 !important; } :visited, :visited * { color: #666665 !important; } .tagContainer { display: none }';
-    if(document.createStyleSheet) {
-        document.createStyleSheet("javascript:'"+styles+"'");
-    } else {
-        newSS=document.createElement('link');
-        newSS.rel='stylesheet';
-        newSS.href='data:text/css,'+escape(styles);
-        document.getElementsByTagName("head")[0].appendChild(newSS);
-    }
-})();
-//.user.js
index 693c69a855163df5c8c802081b0bac0bfeefc899..3bb199e84ed9be7cc689209e01a5b26f8b12ed07 100644 (file)
@@ -131,7 +131,7 @@ enable-spatial-navigation=false
 download-directory=~/downloads
 adblocker=true
 download-external-command=xterm -e wget dwb_uri -O dwb_output --load-cookies dwb_cookies
-user-stylesheet-uri=
+user-stylesheet-uri=file:///home/ramsi/.config/dwb/userstyles/default.css
 auto-load-images=true
 tab-active-fg-color=#ffffff
 history-length=500
index 74fa41fcebb64920277ac6228697a154e633b4ef..bd8e413d40e820b5469fe93ba18a98e57d6452fe 100644 (file)
@@ -1,4 +1,9 @@
 //!javascript
+
+//extensions.load("userstyles", {
+//  scripts : []
+//});
+
 //<formfiller___SCRIPT
 extensions.load("formfiller", {
 //<formfiller___CONFIG
@@ -74,3 +79,46 @@ filterListDir : data.configDir + "/adblock_lists"
 //>adblock_subscriptions___CONFIG
 });
 //>adblock_subscriptions___SCRIPT
+//<perdomainsettings___SCRIPT
+extensions.load("perdomainsettings", {
+//<perdomainsettings___CONFIG
+// Only webkit builtin settings can be set, for a list of settings see 
+// http://webkitgtk.org/reference/webkitgtk/unstable/WebKitWebSettings.html
+// All settings can also be used in camelcase, otherwise they must be quoted.
+// 
+// The special domain suffix .tld matches all top level domains, e.g. 
+// example.tld matches example.com, example.co.uk, example.it ... 
+//
+// Settings based on uri will override host based settings and host based
+// settings will override domain based settings. Settings for domains/hosts/uris
+// with without tld suffix will override settings for
+// domains/hosts/uris with tld suffix respectively, e.g. 
+//      "example.com" : { enableScripts : true }, 
+//      "example.tld" : { enableScripts : false } 
+// will enable scripts on example.com but not on example.co.uk, example.it, ... 
+
+
+// Settings applied based on the second level domain
+domains : {
+//      "example.com" : { "auto-load-images" : false }, 
+//      "google.tld" : { enableScripts : false, autoLoadImages : false }, 
+        "chakra-project.org" : { "user-stylesheet-uri" : "file:///home/ramsi/.config/dwb/userstyles/chakra-project.org.css" }
+},
+
+defaults: {
+    "user-stylesheet-uri" : "file:///home/ramsi/.config/dwb/userstyles/default.css"
+},
+
+//Settings applied based on the hostname
+hosts : {
+//    "www.example.com" : { autoLoadImages : true } 
+},
+
+// Settings applied based on the uri
+uris : {
+//  "http://www.example.com/foo/" : { autoLoadImages : true } }, 
+},
+
+//>perdomainsettings___CONFIG
+});
+//>perdomainsettings___SCRIPT
diff --git a/dwb/userstyles/chakra-project.org.css b/dwb/userstyles/chakra-project.org.css
new file mode 100644 (file)
index 0000000..5171651
--- /dev/null
@@ -0,0 +1,74 @@
+body {
+    background-color: #201F1F !important;
+    background-image: none !important;
+}
+
+div.box, .pun blockquote, div.codebox, #adminconsole fieldset th, .rowodd, .roweven {
+    color: #FFF !important;
+    background-color: #343434 !important;
+}
+
+#punwrap {
+    background-image: url(http://chakra-project.org/img/theme/header-gradient2.png) !important;
+    height: 00px !important;
+    padding: 150px 0 0 0 !important;
+    background-color: #1A1A1A !important;
+}
+
+#punviewforum {
+    background-color: #1A1A1A !important;
+}
+
+.pun {
+    color: white !important;
+}
+
+.pun h2 {
+    background-image: none !important;
+    background-color: #606060 !important;
+}
+
+.pun th {
+    background-color: #505050 !important;
+}
+
+.pun legend {
+    color: white !important;
+}
+
+textarea {
+    background-color: #202020 !important;
+    color: white !important;
+}
+
+select {
+    color: white !important;
+}
+
+#main_nav a {
+    color: #F2F2F2 !important;
+}
+
+.pun a:link, .pun a:visited {
+    color: #5DC3D7 !important;
+}
+
+td.tc2, td.tc3, td.tcmod, #postpreview, #viewprofile dd, div.forminfo, #adminconsole fieldset td, div.blockmenu div.box, #adstats dd {
+    background-color: #404040 !important;
+}
+
+#brdmenu a {
+    color: #FFF !important;
+}
+
+.index {
+    color: #555555 !important;
+}
+
+div.postleft, div.postfootleft, div.blockpost label {
+    background-color: #4E4E4E !important;
+}
+
+div.postright, div.postfootright {
+    border-left-color: #4E4E4E !important;
+}
diff --git a/dwb/userstyles/default.css b/dwb/userstyles/default.css
new file mode 100644 (file)
index 0000000..45aa136
--- /dev/null
@@ -0,0 +1,15 @@
+:not(img) {
+    background-color: #201F1F ! important;
+    color: #D4D2CF ! important;
+ }
+
+ :link, :link * {
+     color: #719696 !important;
+ }
+
+ :visited, :visited * {
+     color: #666665 !important;
+ }
+ .tagContainer {
+     display: none;
+ }