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