btw i use nix
1{
2 pkgs,
3 config,
4 lib,
5 ...
6}@inputs:
7
8let
9 cfg = config.custom.gui;
10in
11{
12 imports = [
13 ./i3.nix
14 ./sway.nix
15 inputs.timewall.homeManagerModules.default
16 ];
17
18 options.custom.gui.enable = lib.mkEnableOption "gui";
19
20 config = lib.mkIf cfg.enable {
21 gtk = {
22 enable = true;
23 font = {
24 name = "Noto Sans 11";
25 package = pkgs.noto-fonts;
26 };
27 iconTheme = {
28 package = pkgs.gruvbox-gtk-theme;
29 name = "Gruvbox-Dark";
30 };
31 theme = {
32 package = pkgs.gruvbox-gtk-theme;
33 name = "Gruvbox-Dark";
34 };
35 };
36
37 home = {
38 packages =
39 let
40 status = pkgs.stdenv.mkDerivation {
41 name = "status";
42
43 src = ../status;
44
45 installPhase = ''
46 mkdir -p $out
47 cp -r * $out
48 '';
49 };
50 in
51 [ status ];
52
53 sessionVariables = {
54 # evince workaround
55 GTK_THEME = "Gruvbox-Dark";
56 WALLPAPER =
57 let
58 wallpaper = ./wallpaper.jpg;
59 in
60 pkgs.runCommand (builtins.baseNameOf wallpaper) { } "cp ${wallpaper} $out";
61 TERMINAL = "alacritty";
62 };
63 pointerCursor = {
64 name = "Adwaita";
65 package = pkgs.adwaita-icon-theme;
66 size = 32;
67 };
68 file = {
69 ".profile".text = ''
70 source "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
71 '';
72 ".config/gtk-3.0/bookmarks" = {
73 force = true;
74 text = ''
75 file:///${config.home.homeDirectory}/archive
76 file:///${config.home.homeDirectory}/documents
77 file:///${config.home.homeDirectory}/downloads
78 file:///${config.home.homeDirectory}/pictures
79 file:///${config.home.homeDirectory}/videos
80 file:///${config.home.homeDirectory}/projects
81 '';
82 };
83 ".config/mimeapps.list" = {
84 force = true;
85 source = ./mimeapps.list;
86 };
87 };
88 };
89
90 programs.firefox =
91 let
92 settings = {
93 "browser.ctrlTab.recentlyUsedOrder" = false;
94 "browser.tabs.warnOnClose" = false;
95 "browser.toolbars.bookmarks.visibility" = "never";
96
97 # Only hide UI elements on F11 (i.e. don't go fullscreen, leave that to WM)
98 "full-screen-api.ignore-widgets" = true;
99 # Right click issue fix
100 "ui.context_menus.after_mouseup" = true;
101
102 # Use userChrome.css
103 "toolkit.legacyUserProfileCustomizations.stylesheets" = true;
104
105 "browser.shell.checkDefaultBrowser" = false;
106
107 # sync toolbar
108 "services.sync.prefs.sync.browser.uiCustomization.state" = true;
109
110 "extensions.pocket.enabled" = false;
111
112 "extensions.autoDisableScopes" = 0;
113 };
114 userChrome = ''
115 #webrtcIndicator {
116 display: none;
117 }
118
119 /* Move find bar to top */
120 .browserContainer > findbar {
121 -moz-box-ordinal-group: 0;
122 }
123
124 #TabsToolbar
125 {
126 visibility: collapse;
127 }
128 '';
129 extensions = with pkgs.nur.repos.rycee.firefox-addons; [
130 auto-tab-discard
131 bitwarden
132 multi-account-containers
133 news-feed-eradicator
134 istilldontcareaboutcookies
135 leechblock-ng
136 # search-by-image
137 simple-translate
138 tree-style-tab
139 tridactyl
140 ublock-origin
141 zotero-connector
142 ];
143 in
144 {
145 enable = true;
146 profiles.default = {
147 inherit settings userChrome extensions;
148 };
149 profiles.secondary = {
150 inherit settings userChrome extensions;
151 id = 1;
152 isDefault = false;
153 };
154 package = (
155 pkgs.firefox.override {
156 nativeMessagingHosts = with pkgs; [ tridactyl-native ];
157 }
158 );
159 };
160
161 xdg = {
162 configFile = {
163 "Thunar/uca.xml".source = ./thunar.xml;
164 "fontconfig/fonts.conf".source = ./fonts.conf;
165 "alacritty.toml".source = ./alacritty.toml;
166 "Element/config.json".source = ./element.json;
167 "swappy/config".text = ''
168 [Default]
169 save_dir=~/capture/capture/
170 save_filename_format=screenshot_%Y-%m-%dT%H:%M:%S%z.png
171 '';
172 "tridactyl/tridactylrc".source = ./tridactylrc;
173 };
174 userDirs = {
175 enable = true;
176 createDirectories = true;
177 download = "$HOME/downloads";
178 pictures = "$HOME/pictures";
179 videos = "$HOME/videos";
180 documents = "$HOME/documents/";
181 music = "$HOME/";
182 # https://bugzilla.mozilla.org/show_bug.cgi?id=1082717
183 desktop = "$HOME/";
184 templates = "$HOME/";
185 publicShare = "$HOME/";
186 };
187 };
188
189 services.timewall = {
190 enable = true;
191 config = {
192 geoclue.timeout = 300000;
193 setter = {
194 command = [
195 "${pkgs.bash}/bin/sh"
196 "-c"
197 "${pkgs.coreutils}/bin/ln -fs %f ~/.cache/timewall/last_image && ${pkgs.swaybg}/bin/swaybg -i %f -c 282828 -m fill"
198 ];
199 overlap = 1000;
200 };
201 };
202 };
203 };
204}