about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2021-05-19 16:10:42 +0200
committerPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2021-05-19 16:10:42 +0200
commitd40f3bebad9f761691abf08af4c4ce2b231ca945 (patch)
tree44cc009a29cec8c512225717cd316869b1418471
parent3405aa05d134d17f9bb60404bc88b8499ff21942 (diff)
downloaddots-d40f3bebad9f761691abf08af4c4ce2b231ca945.tar.gz
dots-d40f3bebad9f761691abf08af4c4ce2b231ca945.zip
Update home
-rw-r--r--home.nix3
-rw-r--r--programs/qutebrowser.nix51
-rwxr-xr-xusers/pn.nix4
3 files changed, 55 insertions, 3 deletions
diff --git a/home.nix b/home.nix
index 089f431..da44d51 100644
--- a/home.nix
+++ b/home.nix
@@ -17,7 +17,7 @@ let
     ];
 in
 {
-  dconf.enable = true;
+  dconf.enable = false;
 
   programs.obs-studio = {
     enable = true;
@@ -36,6 +36,7 @@ in
     ./programs/git.nix
     ./programs/mpv.nix
     ./programs/sent
+    ./programs/qutebrowser.nix
   ] ++ platformSetup;
 
   home.packages = with pkgs; [
diff --git a/programs/qutebrowser.nix b/programs/qutebrowser.nix
new file mode 100644
index 0000000..6c60534
--- /dev/null
+++ b/programs/qutebrowser.nix
@@ -0,0 +1,51 @@
+{ config, pkgs, ... }:
+
+{
+  config = {
+    home.packages = [ pkgs.qutebrowser ];
+
+    home.file.".config/qutebrowser/config.py".text = ''
+      c.aliases = {}
+      c.tabs.tabs_are_windows = True
+      c.tabs.show = "multiple"
+      c.statusbar.show = "in-mode"
+      c.downloads.location.directory = "~/down"
+      c.content.pdfjs = True
+      c.content.javascript.enabled = False
+      config.load_autoconfig()
+
+      import subprocess
+      import sys, os
+
+      def read_xresources(prefix):
+        props = {}
+        x = subprocess.run(['xrdb', '-query'], stdout=subprocess.PIPE)
+        lines = x.stdout.decode().split('\n')
+        for line in filter(lambda l : l.startswith(prefix), lines):
+          prop, _, value = line.partition(':\t')
+          props[prop] = value
+        return props
+
+      xresources = read_xresources('*')
+
+      black      =  xresources['*.color0']
+      red        =  xresources['*.color1']
+      green      =  xresources['*.color2']
+      yellow     =  xresources['*.color3']
+      blue       =  xresources['*.color4']
+      magenta    =  xresources['*.color5']
+      cyan       =  xresources['*.color6']
+      white      =  xresources['*.color7']
+      black_b    =  xresources['*.color8']
+      red_b      =  xresources['*.color9']
+      green_b    =  xresources['*.color10']
+      yellow_b   =  xresources['*.color11']
+      blue_b     =  xresources['*.color12']
+      magenta_b  =  xresources['*.color13']
+      cyan_b     =  xresources['*.color14']
+      white_b    =  xresources['*.color15']
+      bg         =  xresources['*.background']
+      fg         =  xresources['*.foreground']
+    '';
+  };
+}
diff --git a/users/pn.nix b/users/pn.nix
index 2fc54c5..a73716a 100755
--- a/users/pn.nix
+++ b/users/pn.nix
@@ -26,7 +26,7 @@ in
       imports = [
         ../home.nix
         ../platforms/linux/user-dirs.nix
-        # ../platforms/linux/gtk.nix
+        ../platforms/linux/gtk.nix
       ];
 
       gtk.enable = true;
@@ -42,7 +42,7 @@ in
           mpd &			# music player daemon-you might prefer it as a service though
           remaps &		# run the remaps script, switching caps/esc and more; check it for more info
           setbg &			# set the background with the `setbg` script
-      #xrdb $\{XDG_CONFIG_HOME:-$HOME/.config}/Xresources &	# Uncomment to use Xresources colors/settings on startup
+          xrdb $HOME/.config/Xresources &	# Uncomment to use Xresources colors/settings on startup
           #xcompmgr &
           picom &
           dunst &			# dunst for notifications