aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2024-09-07 15:56:47 +0530
committerAkshay Nair <phenax5@gmail.com>2024-09-07 15:56:47 +0530
commit433b6ccecf41bb4ae7fadc84cd1bbb8af163b941 (patch)
tree903cba8373520fd99afee9979045701fbdb1fa17
parent86d3b43cbc880da156b81c9f5f30396d1f7de308 (diff)
downloadnixos-config-433b6ccecf41bb4ae7fadc84cd1bbb8af163b941.tar.gz
nixos-config-433b6ccecf41bb4ae7fadc84cd1bbb8af163b941.zip
Failed attempt at ddg style in qute
Diffstat (limited to '')
-rw-r--r--config/qutebrowser/config.py17
-rw-r--r--config/qutebrowser/greasemonkey/duckduckgo.js53
-rw-r--r--modules/firefox.home/chrome/globalKeybindings.uc.js2
-rw-r--r--modules/firefox.home/chrome/userContent.css4
4 files changed, 65 insertions, 11 deletions
diff --git a/config/qutebrowser/config.py b/config/qutebrowser/config.py
index d741669..7db4c10 100644
--- a/config/qutebrowser/config.py
+++ b/config/qutebrowser/config.py
@@ -17,6 +17,7 @@ config.load_autoconfig()
# Helper Functions {{{
def toggle_stylesheets(stylesheets):
+ # TODO: Remove the given stylesheets from the list
return 'config-cycle content.user_stylesheets \'' \
+ json.dumps(c.content.user_stylesheets) \
+ '\' \'' \
@@ -153,9 +154,11 @@ config.source('ui.py')
## Webpage styles
c.content.user_stylesheets = [
- "styles/scrollbar.css",
- "styles/default.css",
- "styles/adblocker.css",
+ 'styles/scrollbar.css',
+ 'styles/default.css',
+ 'styles/adblocker.css',
+ # TODO: Add user styles for lite.duckduckgo.com
+ # 'styles/duckduckgo.css'
]
# Dark mode
@@ -286,11 +289,13 @@ config.set('content.media.video_capture', True, '*://meet.google.com')
c.url.default_page = '~/.config/qutebrowser/homepage/index.html'
c.url.start_pages = [c.url.default_page]
-DEFAULT_SEARCH_ENGINE = 'go'
+DEFAULT_SEARCH_ENGINE = 'd'
c.url.searchengines = {
# Main general
- 'd': 'https://duckduckgo.com/?q={}',
- 'go': 'https://google.com/search?q={}',
+ 'd': 'https://lite.duckduckgo.com/lite?q={}',
+ 'go': 'https://lite.duckduckgo.com/lite?q={}',
+ 'gg': 'https://google.com/search?q={}',
+ 'ai': 'https://chatgpt.com/?temporary-chat=true&q={}',
'br': 'https://search.brave.com/search?q={}',
# Alt general
diff --git a/config/qutebrowser/greasemonkey/duckduckgo.js b/config/qutebrowser/greasemonkey/duckduckgo.js
index f1c9247..c950abb 100644
--- a/config/qutebrowser/greasemonkey/duckduckgo.js
+++ b/config/qutebrowser/greasemonkey/duckduckgo.js
@@ -1,16 +1,59 @@
// ==UserScript==
-// @name Github PR helper
+// @name DuckduckGo styles
// @namespace phenax.github.io
// @version 0.0.0
// @description Github PR helper
// @author Akshay Nair
-// @match *://duckduckgo.com/*
+// @match *://*.duckduckgo.com/*
// ==/UserScript==
(() => {
- const load = str =>
- str.split(' ').forEach(x => (document.cookie = x));
+ document.body.classList.add('document-duckduckgo');
- load('ae=d; 5=2; s=m; p=-2; am=osm; a=JetBrains%20Mono; t=JetBrains%20Mono; j=0f0c19; 7=15121f; 21=1f1c29;')
+ GM_addStyle(`
+.document-duckduckgo {
+ --ff-accent-color: #8161ff;
+ --ff-bg-color: #16121f;
+}
+
+.document-duckduckgo {
+ background-color: var(--ff-bg-color) !important;
+ color: white !important;
+ width: 100%;
+ margin: auto;
+ max-width: 900px !important;
+}
+
+.document-duckduckgo a {
+ color: var(--ff-accent-color) !important;
+}
+
+.document-duckduckgo .result-link {
+ font-size: 1rem !important;
+}
+
+.document-duckduckgo .did-you-mean {
+ font-size: 0.8rem !important;
+}
+.document-duckduckgo .did-you-mean br {
+ display: none !important;
+}
+
+.document-duckduckgo select.submit {
+ display: none !important;
+}
+
+.document-duckduckgo .link-text {
+ color: #888 !important;
+}
+
+.document-duckduckgo .header {
+ font-size: 1rem !important;
+}
+
+.document-duckduckgo .result-sponsored {
+ display: none !important;
+}
+`);
})();
diff --git a/modules/firefox.home/chrome/globalKeybindings.uc.js b/modules/firefox.home/chrome/globalKeybindings.uc.js
index 4ad35da..cd6a420 100644
--- a/modules/firefox.home/chrome/globalKeybindings.uc.js
+++ b/modules/firefox.home/chrome/globalKeybindings.uc.js
@@ -33,6 +33,8 @@
],
});
+ // Restart firefox: Services.startup.quit(Services.startup.eForceQuit | Services.startup.eRestart)
+
const nextTab = () => () => updateTabIndex((n, len) => (n + 1) % len);
const prevTab = () => () => updateTabIndex((n, len) => n === 0 ? len - 1 : n - 1);
const tabIndex = idx => () => updateTabIndex((_n, _len) => idx)
diff --git a/modules/firefox.home/chrome/userContent.css b/modules/firefox.home/chrome/userContent.css
index b7361e8..b20f349 100644
--- a/modules/firefox.home/chrome/userContent.css
+++ b/modules/firefox.home/chrome/userContent.css
@@ -45,5 +45,9 @@
.header {
font-size: 1rem !important;
}
+
+ .result-sponsored {
+ display: none !important;
+ }
}