From 9d34ebb94ee32e060e3ed7531c2babecce198025 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Sep 2024 07:33:19 +0000 Subject: [PATCH 001/319] Bump DeterminateSystems/nix-installer-action from 13 to 14 Bumps [DeterminateSystems/nix-installer-action](https://github.com/determinatesystems/nix-installer-action) from 13 to 14. - [Release notes](https://github.com/determinatesystems/nix-installer-action/releases) - [Commits](https://github.com/determinatesystems/nix-installer-action/compare/v13...v14) --- updated-dependencies: - dependency-name: DeterminateSystems/nix-installer-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/flake-update.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/flake-update.yml b/.github/workflows/flake-update.yml index 5903b13d..8ccaa8d1 100644 --- a/.github/workflows/flake-update.yml +++ b/.github/workflows/flake-update.yml @@ -14,7 +14,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: DeterminateSystems/nix-installer-action@v13 + - uses: DeterminateSystems/nix-installer-action@v14 - uses: DeterminateSystems/magic-nix-cache-action@v7 - uses: DeterminateSystems/update-flake-lock@v23 with: From 8342ac638aa49f6bca2c6f68a98226a7e38fd395 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Sep 2024 07:33:23 +0000 Subject: [PATCH 002/319] Bump DeterminateSystems/update-flake-lock from 23 to 24 Bumps [DeterminateSystems/update-flake-lock](https://github.com/determinatesystems/update-flake-lock) from 23 to 24. - [Release notes](https://github.com/determinatesystems/update-flake-lock/releases) - [Commits](https://github.com/determinatesystems/update-flake-lock/compare/v23...v24) --- updated-dependencies: - dependency-name: DeterminateSystems/update-flake-lock dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/flake-update.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/flake-update.yml b/.github/workflows/flake-update.yml index 5903b13d..991a219f 100644 --- a/.github/workflows/flake-update.yml +++ b/.github/workflows/flake-update.yml @@ -16,7 +16,7 @@ jobs: fetch-depth: 0 - uses: DeterminateSystems/nix-installer-action@v13 - uses: DeterminateSystems/magic-nix-cache-action@v7 - - uses: DeterminateSystems/update-flake-lock@v23 + - uses: DeterminateSystems/update-flake-lock@v24 with: pr-title: "chore: update flake.lock" # Labels to be set on the PR From f0ec4dd5e02e2ac34819b852168f35b8e0c728d1 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Mon, 16 Sep 2024 21:19:43 +0400 Subject: [PATCH 003/319] virt-manager tryout on sakopc --- hosts/sakopc/configuration.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hosts/sakopc/configuration.nix b/hosts/sakopc/configuration.nix index 6f207d07..96e8dc26 100644 --- a/hosts/sakopc/configuration.nix +++ b/hosts/sakopc/configuration.nix @@ -110,6 +110,9 @@ sops.enable = true; certs.enable = true; }; + virtualization = { + virt-manager.enable = true; + }; }; # fuck you AOC From 7e678f5a78b49214a5e53b4eef36417cc0209b6a Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Mon, 16 Sep 2024 21:20:48 +0400 Subject: [PATCH 004/319] i called it libvirtd lmao --- hosts/sakopc/configuration.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosts/sakopc/configuration.nix b/hosts/sakopc/configuration.nix index 96e8dc26..4e12bdaa 100644 --- a/hosts/sakopc/configuration.nix +++ b/hosts/sakopc/configuration.nix @@ -111,7 +111,7 @@ certs.enable = true; }; virtualization = { - virt-manager.enable = true; + libvirtd.enable = true; }; }; From a1d87d16dd4461a254bd333d99f9d908fa503c87 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Mon, 16 Sep 2024 21:21:13 +0400 Subject: [PATCH 005/319] lmao --- modules/virtualization/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/virtualization/default.nix b/modules/virtualization/default.nix index 4dbde113..5f00db20 100644 --- a/modules/virtualization/default.nix +++ b/modules/virtualization/default.nix @@ -1,5 +1,6 @@ { imports = [ ./waydroid.nix + ./virt-manager.nix ]; } From 25b11d8cd28eff61cc3ede50d005d303e6b16dec Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Mon, 16 Sep 2024 21:21:25 +0400 Subject: [PATCH 006/319] typo --- modules/virtualization/virt-manager.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/virtualization/virt-manager.nix b/modules/virtualization/virt-manager.nix index ed1ea5b4..d1736892 100644 --- a/modules/virtualization/virt-manager.nix +++ b/modules/virtualization/virt-manager.nix @@ -10,7 +10,7 @@ in config = lib.mkIf cfg.enable { virtualization.libvirtd.enable = true; programs.dconf.enable = true; - environtment.systemPackages = with pkgs; [ + environment.systemPackages = with pkgs; [ virt-manager ]; From 0e41a8522ea71d79a29d5a8da47391c472f8d545 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Mon, 16 Sep 2024 21:22:10 +0400 Subject: [PATCH 007/319] wait a second im on unstable lmao --- modules/virtualization/virt-manager.nix | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/modules/virtualization/virt-manager.nix b/modules/virtualization/virt-manager.nix index d1736892..67bcc5cc 100644 --- a/modules/virtualization/virt-manager.nix +++ b/modules/virtualization/virt-manager.nix @@ -8,12 +8,8 @@ in }; config = lib.mkIf cfg.enable { - virtualization.libvirtd.enable = true; - programs.dconf.enable = true; - environment.systemPackages = with pkgs; [ - virt-manager - ]; - - users.users.sako.extraGroups = [ "libvirtd" ]; + virtualisation.libvirtd.enable = true; + programs.virt-manager.enable = true; + users.users.sako.extraGroups = [ "libvirtd" ]; }; } From 550925dd2ca5843bb7a3ff39391b4e51cf7ea5bf Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Mon, 16 Sep 2024 21:34:19 +0400 Subject: [PATCH 008/319] ok it works --- hosts/sakopc/configuration.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosts/sakopc/configuration.nix b/hosts/sakopc/configuration.nix index 4e12bdaa..8d21c8ed 100644 --- a/hosts/sakopc/configuration.nix +++ b/hosts/sakopc/configuration.nix @@ -111,7 +111,7 @@ certs.enable = true; }; virtualization = { - libvirtd.enable = true; + libvirtd.enable = false; }; }; From 276d2e018d55b23861eaa7024a02f8eb90fbde51 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 17 Sep 2024 17:52:53 +0400 Subject: [PATCH 009/319] try ags home-manager module --- modules/desktop/hyprland/default.nix | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/modules/desktop/hyprland/default.nix b/modules/desktop/hyprland/default.nix index c85e0c8e..fefb49fc 100644 --- a/modules/desktop/hyprland/default.nix +++ b/modules/desktop/hyprland/default.nix @@ -99,7 +99,7 @@ in waybar # lock # swaylock - inputs.ags.packages.${pkgs.system}.default + # inputs.ags.packages.${pkgs.system}.default brightnessctl inotify-tools greetd.tuigreet @@ -127,6 +127,14 @@ in services.emacs.startWithGraphical = false; home-manager.users.sako = { pkgs , ...}: { + programs.ags = { + enable = true; + configDir = ../../../config/ags; + extraPackages = with pkgs; [ + bun + ]; + }; + home.pointerCursor = { # name = "Catppuccin-Mocha-Dark"; name = "catppuccin-mocha-dark-cursors"; @@ -164,10 +172,10 @@ in # source = ../../../config/swaylock; # recursive = true; # }; - ags = { - source = ../../../config/ags; - recursive = true; - }; + # ags = { + # source = ../../../config/ags; + # recursive = true; + # }; }; }; From c058f181fb28778356f645c4f7021c3bad46961a Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 17 Sep 2024 17:55:22 +0400 Subject: [PATCH 010/319] add ags to homemanager sharedmodules --- modules/desktop/hyprland/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/desktop/hyprland/default.nix b/modules/desktop/hyprland/default.nix index fefb49fc..e8270324 100644 --- a/modules/desktop/hyprland/default.nix +++ b/modules/desktop/hyprland/default.nix @@ -13,6 +13,8 @@ in config = lib.mkIf cfg.enable { + inputs.home-manager.sharedModules = [{ imports = inputs.ags.homeManagerModules.default; }]; + modules.desktop.dunst.enable = lib.mkForce false; services.gnome.gnome-keyring.enable = true; From 962d7940b496e22eae81b314b6170311bfb28dc1 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 17 Sep 2024 17:56:22 +0400 Subject: [PATCH 011/319] epic fail --- modules/desktop/hyprland/default.nix | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/modules/desktop/hyprland/default.nix b/modules/desktop/hyprland/default.nix index e8270324..c85e0c8e 100644 --- a/modules/desktop/hyprland/default.nix +++ b/modules/desktop/hyprland/default.nix @@ -13,8 +13,6 @@ in config = lib.mkIf cfg.enable { - inputs.home-manager.sharedModules = [{ imports = inputs.ags.homeManagerModules.default; }]; - modules.desktop.dunst.enable = lib.mkForce false; services.gnome.gnome-keyring.enable = true; @@ -101,7 +99,7 @@ in waybar # lock # swaylock - # inputs.ags.packages.${pkgs.system}.default + inputs.ags.packages.${pkgs.system}.default brightnessctl inotify-tools greetd.tuigreet @@ -129,14 +127,6 @@ in services.emacs.startWithGraphical = false; home-manager.users.sako = { pkgs , ...}: { - programs.ags = { - enable = true; - configDir = ../../../config/ags; - extraPackages = with pkgs; [ - bun - ]; - }; - home.pointerCursor = { # name = "Catppuccin-Mocha-Dark"; name = "catppuccin-mocha-dark-cursors"; @@ -174,10 +164,10 @@ in # source = ../../../config/swaylock; # recursive = true; # }; - # ags = { - # source = ../../../config/ags; - # recursive = true; - # }; + ags = { + source = ../../../config/ags; + recursive = true; + }; }; }; From 1d147e9ed0fcc3a504058cc9fa71bdaccc265d27 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 17 Sep 2024 21:52:07 +0400 Subject: [PATCH 012/319] whatever this is --- hosts/sakopc/configuration.nix | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/hosts/sakopc/configuration.nix b/hosts/sakopc/configuration.nix index 8d21c8ed..725d47fe 100644 --- a/hosts/sakopc/configuration.nix +++ b/hosts/sakopc/configuration.nix @@ -25,8 +25,8 @@ hyprland.enable = true; foot.enable = true; kitty.enable = true; - picom.enable = true; - dunst.enable = true; + picom.enable = false; + dunst.enable = false; apps = { nextcloud.enable = true; rssguard.enable = true; @@ -39,7 +39,7 @@ browsers = { firefox.enable = true; qutebrowser.enable = false; - chromium.enable = true; + chromium.enable = false; }; chat = { zoom.enable = true; @@ -110,9 +110,6 @@ sops.enable = true; certs.enable = true; }; - virtualization = { - libvirtd.enable = false; - }; }; # fuck you AOC From 7c0c2232b0447c5a3198fac52aa170b887c8f6c7 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 17 Sep 2024 21:54:17 +0400 Subject: [PATCH 013/319] enable flatpak for sakopc --- hosts/sakopc/configuration.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/hosts/sakopc/configuration.nix b/hosts/sakopc/configuration.nix index 725d47fe..ddbab93a 100644 --- a/hosts/sakopc/configuration.nix +++ b/hosts/sakopc/configuration.nix @@ -16,6 +16,7 @@ modules = { desktop = { + flatpak.enable = true; wireguard.enable = true; printing.enable = true; bspwm = { From 469bdcfc1eb3db66a0071fe46008e63027605fc8 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 18 Sep 2024 09:58:30 +0400 Subject: [PATCH 014/319] remove margins --- config/ags/config.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/ags/config.js b/config/ags/config.js index 6b8e848b..2b983594 100644 --- a/config/ags/config.js +++ b/config/ags/config.js @@ -202,7 +202,8 @@ function Bar(monitor = 0) { class_name: "bar", monitor, anchor: ["top", "left", "right"], - margins: [5, 10, 0, 10], + // margins: [5, 10, 0, 10], + margins: [0, 0, 0, 0], exclusivity: "exclusive", child: Widget.CenterBox({ start_widget: Left(), From 6742e354ec2daa3ef2503ea66ab14a82b8fac3f4 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 18 Sep 2024 10:53:37 +0400 Subject: [PATCH 015/319] css --- config/ags/style.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/ags/style.css b/config/ags/style.css index c099733a..a69bc98e 100644 --- a/config/ags/style.css +++ b/config/ags/style.css @@ -3,8 +3,8 @@ } window.bar { - background-color: @theme_bg_color; - color: @theme_fg_color; + background-color: ##531A76; + color: #FFFFFF; } button { From 0b665473d78ee88ca2df6b38d8035bbd0877fe64 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 18 Sep 2024 10:56:15 +0400 Subject: [PATCH 016/319] Revert "css" This reverts commit 6742e354ec2daa3ef2503ea66ab14a82b8fac3f4. --- config/ags/style.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/ags/style.css b/config/ags/style.css index a69bc98e..c099733a 100644 --- a/config/ags/style.css +++ b/config/ags/style.css @@ -3,8 +3,8 @@ } window.bar { - background-color: ##531A76; - color: #FFFFFF; + background-color: @theme_bg_color; + color: @theme_fg_color; } button { From fb42dc0e49dd65851c2ab600ac19158c8db65e1f Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 18 Sep 2024 13:29:07 +0400 Subject: [PATCH 017/319] add webkit-color-picker --- config/emacs/emacs.org | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index bef286dc..4732d448 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -888,6 +888,11 @@ this should be useful later :config (direnv-mode))) #+end_src +** Color Picker +#+begin_src emacs-lisp +(use-package webkit-color-picker + :bind (("C-c C-p" . webkit-color-picker-show))) +#+end_src * Languages #+begin_src emacs-lisp (message "Reached languages") From bf8dcf2ac740a536ce8f357d957bb405223669a0 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 18 Sep 2024 13:34:55 +0400 Subject: [PATCH 018/319] make it stop pulling another emacs --- modules/dev/editors/emacs/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/dev/editors/emacs/default.nix b/modules/dev/editors/emacs/default.nix index 498607e3..cf194db5 100644 --- a/modules/dev/editors/emacs/default.nix +++ b/modules/dev/editors/emacs/default.nix @@ -144,7 +144,7 @@ in { home.file = { ".emacs.d/init.el".source = pkgs.runCommand "init.el" {} '' cp ${../../../../config/emacs/emacs.org} emacs.org - ${pkgs.emacs}/bin/emacs -Q --batch ./emacs.org -f org-babel-tangle + ${myEmacs}/bin/emacs -Q --batch ./emacs.org -f org-babel-tangle mv init.el $out ''; ".emacs.d/icon.png".source = ../../../../config/emacs/icon.png; From 9f39c58a6ce286a0317724178bfa6cd84864008b Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 18 Sep 2024 13:41:15 +0400 Subject: [PATCH 019/319] switch to edit-color-stamp --- config/emacs/emacs.org | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 4732d448..e934cbef 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -890,8 +890,7 @@ this should be useful later #+end_src ** Color Picker #+begin_src emacs-lisp -(use-package webkit-color-picker - :bind (("C-c C-p" . webkit-color-picker-show))) + (use-package edit-color-stamp) #+end_src * Languages #+begin_src emacs-lisp From d2e4292bb2039bf15e48f530a310d6d74793125e Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 18 Sep 2024 13:45:34 +0400 Subject: [PATCH 020/319] use zenity-color-picker instead again --- config/emacs/emacs.org | 2 +- modules/dev/editors/emacs/default.nix | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index e934cbef..d900f897 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -890,7 +890,7 @@ this should be useful later #+end_src ** Color Picker #+begin_src emacs-lisp - (use-package edit-color-stamp) + (use-package zenity-color-picker) #+end_src * Languages #+begin_src emacs-lisp diff --git a/modules/dev/editors/emacs/default.nix b/modules/dev/editors/emacs/default.nix index cf194db5..e89b298c 100644 --- a/modules/dev/editors/emacs/default.nix +++ b/modules/dev/editors/emacs/default.nix @@ -119,6 +119,8 @@ in { texliveMinimal # lsp emacs-lsp-booster + # zenity-color-picker + zenity ]; systemd.services.hydroxide = { From c1b4fe83d2031fc68946962f26b9ac0308a033ea Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Thu, 19 Sep 2024 09:30:55 +0400 Subject: [PATCH 021/319] rust-analyzer thing --- config/emacs/emacs.org | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index d900f897..6d3f0867 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1023,21 +1023,16 @@ this should be useful later #+end_src ** Rust #+begin_src emacs-lisp - ;; (use-package rust-mode - ;; :hook (rust-mode . eglot-ensure) - ;; :mode "\\.rs\\'") - - ;; (use-package cargo-mode - ;; :hook - ;; (rust-mode . cargo-minor-mode) - ;; :config - ;; (setq compilation-scroll-output t)) - (use-package rustic :ensure t :config (setq rustic-format-on-save nil) (setq rustic-lsp-client 'eglot) + + (add-to-list 'eglot-server-programs + '((rust-ts-mode rust-mode) . + ("rust-analyzer" :initializationOptions (:diagnostics (:disabled "inactive-code"))))) + :custom (rustic-cargo-use-last-stored-arguments t)) #+end_src From 71ba1fdeb427035fb27633ae35237604bfcdf335 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Thu, 19 Sep 2024 09:46:12 +0400 Subject: [PATCH 022/319] forgot to add rustic-mode --- config/emacs/emacs.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 6d3f0867..1f06ba90 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1030,7 +1030,7 @@ this should be useful later (setq rustic-lsp-client 'eglot) (add-to-list 'eglot-server-programs - '((rust-ts-mode rust-mode) . + '((rust-ts-mode rust-mode rustic-mode) . ("rust-analyzer" :initializationOptions (:diagnostics (:disabled "inactive-code"))))) :custom From 29e4e7b09038d69d63151eeffaf3b1dddfa73823 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Thu, 19 Sep 2024 09:53:11 +0400 Subject: [PATCH 023/319] nvm --- config/emacs/emacs.org | 5 ----- 1 file changed, 5 deletions(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 1f06ba90..76543ea4 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1028,11 +1028,6 @@ this should be useful later :config (setq rustic-format-on-save nil) (setq rustic-lsp-client 'eglot) - - (add-to-list 'eglot-server-programs - '((rust-ts-mode rust-mode rustic-mode) . - ("rust-analyzer" :initializationOptions (:diagnostics (:disabled "inactive-code"))))) - :custom (rustic-cargo-use-last-stored-arguments t)) #+end_src From 978b5506f21a7807e9696c1a20c2c71b05435288 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Thu, 19 Sep 2024 10:29:58 +0400 Subject: [PATCH 024/319] emacs rust shennanigans --- config/emacs/emacs.org | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 76543ea4..09993a30 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1028,6 +1028,21 @@ this should be useful later :config (setq rustic-format-on-save nil) (setq rustic-lsp-client 'eglot) + + (defun setup-rust () + "Setup for ‘rust-mode’." + ;; Configuration taken from rust-analyzer’s manual: + ;; https://rust-analyzer.github.io/manual.html#configuration + (setq-local eglot-workspace-configuration + ;; Setting the workspace configuration for every + ;; rust-mode buffer, you can also set it with dir-local + ;; variables, should you want different configuration + ;; per project/directory. + '(:rust-analyzer + :cargo (:features ["all"])))) + + (add-hook 'rustic-mode-hook #'setup-rust) + :custom (rustic-cargo-use-last-stored-arguments t)) #+end_src From 66980715aa735a15dd94b543d23ce22df3359490 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Thu, 19 Sep 2024 10:36:52 +0400 Subject: [PATCH 025/319] ok --- config/emacs/emacs.org | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 09993a30..cfb47a05 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1034,14 +1034,31 @@ this should be useful later ;; Configuration taken from rust-analyzer’s manual: ;; https://rust-analyzer.github.io/manual.html#configuration (setq-local eglot-workspace-configuration - ;; Setting the workspace configuration for every - ;; rust-mode buffer, you can also set it with dir-local - ;; variables, should you want different configuration - ;; per project/directory. - '(:rust-analyzer - :cargo (:features ["all"])))) + ;; Setting the workspace configuration for every + ;; rust-mode buffer, you can also set it with dir-local + ;; variables, should you want different configuration + ;; per project/directory. + '(:rust-analyzer + :cargo (:features ["all"])))) (add-hook 'rustic-mode-hook #'setup-rust) + (add-hook 'rust-mode-hook #'setup-rust) + + + ;; expects initializationOptions done a bit differently (see below). + (defclass eglot-rust-analyzer (eglot-lsp-server) () + :documentation "A custom class for rust-analyzer.") + + ;; Rust-analyzer requires the workspaceConfiguration sent as + ;; initializationOptions at startup time. See + ;; https://github.com/joaotavora/eglot/discussions/845 and + ;; rust-analyzer’s manual page. + (cl-defmethod eglot-initialization-options ((server eglot-rust-analyzer)) + eglot-workspace-configuration) + + ;; Use our custom ‘eglot-rust-analyzer’ for ‘rust-mode’. + (add-to-list 'eglot-server-programs + '(rustic-mode . (eglot-rust-analyzer "rust-analyzer"))) :custom (rustic-cargo-use-last-stored-arguments t)) From 004b28391092e17311a4ba6da378abf0c8e1b050 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Thu, 19 Sep 2024 10:40:54 +0400 Subject: [PATCH 026/319] okay --- config/emacs/emacs.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index cfb47a05..1b6b2b7c 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1039,7 +1039,7 @@ this should be useful later ;; variables, should you want different configuration ;; per project/directory. '(:rust-analyzer - :cargo (:features ["all"])))) + :cargo (:features "all")))) (add-hook 'rustic-mode-hook #'setup-rust) (add-hook 'rust-mode-hook #'setup-rust) From a5296e48a6130aadcdd3302c09cb7495980fa6d6 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Thu, 19 Sep 2024 10:57:23 +0400 Subject: [PATCH 027/319] paralysis --- config/emacs/emacs.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 1b6b2b7c..1197eaba 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1039,7 +1039,7 @@ this should be useful later ;; variables, should you want different configuration ;; per project/directory. '(:rust-analyzer - :cargo (:features "all")))) + (:cargo (:features "all"))))) (add-hook 'rustic-mode-hook #'setup-rust) (add-hook 'rust-mode-hook #'setup-rust) From 9f01f11afdf3e885293b43ae81cc19e40df37504 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Thu, 19 Sep 2024 11:01:20 +0400 Subject: [PATCH 028/319] skibidi toilet --- config/emacs/emacs.org | 34 +++------------------------------- 1 file changed, 3 insertions(+), 31 deletions(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 1197eaba..6fe159ab 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1028,38 +1028,10 @@ this should be useful later :config (setq rustic-format-on-save nil) (setq rustic-lsp-client 'eglot) - - (defun setup-rust () - "Setup for ‘rust-mode’." - ;; Configuration taken from rust-analyzer’s manual: - ;; https://rust-analyzer.github.io/manual.html#configuration - (setq-local eglot-workspace-configuration - ;; Setting the workspace configuration for every - ;; rust-mode buffer, you can also set it with dir-local - ;; variables, should you want different configuration - ;; per project/directory. - '(:rust-analyzer - (:cargo (:features "all"))))) - - (add-hook 'rustic-mode-hook #'setup-rust) - (add-hook 'rust-mode-hook #'setup-rust) - - - ;; expects initializationOptions done a bit differently (see below). - (defclass eglot-rust-analyzer (eglot-lsp-server) () - :documentation "A custom class for rust-analyzer.") - - ;; Rust-analyzer requires the workspaceConfiguration sent as - ;; initializationOptions at startup time. See - ;; https://github.com/joaotavora/eglot/discussions/845 and - ;; rust-analyzer’s manual page. - (cl-defmethod eglot-initialization-options ((server eglot-rust-analyzer)) - eglot-workspace-configuration) - - ;; Use our custom ‘eglot-rust-analyzer’ for ‘rust-mode’. - (add-to-list 'eglot-server-programs - '(rustic-mode . (eglot-rust-analyzer "rust-analyzer"))) + (add-to-list 'eglot-server-programs + `(rustic-mode . ("rust-analyzer" :initializationOptions + ( :cargo ( :features "all"))))) :custom (rustic-cargo-use-last-stored-arguments t)) #+end_src From 75c0e5ae9d86ee67ba04cb64a0425deda966ea78 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Thu, 19 Sep 2024 12:14:11 +0400 Subject: [PATCH 029/319] ok it broke --- config/emacs/emacs.org | 4 ---- 1 file changed, 4 deletions(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 6fe159ab..76543ea4 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1028,10 +1028,6 @@ this should be useful later :config (setq rustic-format-on-save nil) (setq rustic-lsp-client 'eglot) - - (add-to-list 'eglot-server-programs - `(rustic-mode . ("rust-analyzer" :initializationOptions - ( :cargo ( :features "all"))))) :custom (rustic-cargo-use-last-stored-arguments t)) #+end_src From 6284431c91e56986dfaa5aeb8e64676a9d6fef2f Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Fri, 20 Sep 2024 22:19:07 +0400 Subject: [PATCH 030/319] renable hyprland animations ig --- config/hyprland/hyprland.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/hyprland/hyprland.conf b/config/hyprland/hyprland.conf index 092e9773..bce191fd 100644 --- a/config/hyprland/hyprland.conf +++ b/config/hyprland/hyprland.conf @@ -105,7 +105,7 @@ decoration { } animations { - enabled = false + enabled = true # Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more From 239c068593baa80c9aeadd957cf4c000dcf11a02 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Fri, 20 Sep 2024 22:29:30 +0400 Subject: [PATCH 031/319] config/ags: workspace shennanigans 1 --- config/ags/config.js | 59 ++++++++++++++++++++++++++++++++++---------- config/ags/style.css | 30 +++++++++++++++++++--- 2 files changed, 73 insertions(+), 16 deletions(-) diff --git a/config/ags/config.js b/config/ags/config.js index 2b983594..1f87cf1e 100644 --- a/config/ags/config.js +++ b/config/ags/config.js @@ -15,20 +15,53 @@ const date = Variable("", { // so to make a reuseable widget, make it a function // then you can simply instantiate one by calling it -function Workspaces() { - const activeId = hyprland.active.workspace.bind("id") - const workspaces = hyprland.bind("workspaces") - .as(ws => ws.map(({ id }) => Widget.Button({ - on_clicked: () => hyprland.messageAsync(`dispatch workspace ${id}`), - child: Widget.Label(`${id}`), - class_name: activeId.as(i => `${i === id ? "focused" : ""}`), - }))) +// function Workspaces() { +// const activeId = hyprland.active.workspace.bind("id") +// const workspaces = hyprland.bind("workspaces") +// .as(ws => ws.map(({ id }) => Widget.Button({ +// on_clicked: () => hyprland.messageAsync(`dispatch workspace ${id}`), +// child: Widget.Label(`${id}`), +// class_name: activeId.as(i => `${i === id ? "focused" : ""}`), +// }))) - return Widget.Box({ - class_name: "workspaces", - children: workspaces, - }) -} +// return Widget.Box({ +// class_name: "workspaces", +// children: workspaces, +// }) +// } + +const dispatch = ws => hyprland.sendMessage(`dispatch workspace ${ws}`); + +export const Workspaces = () => Widget.EventBox({ + child: Widget.Box({ + children: Array.from({ length: 10 }, (_, i) => i + 1).map(i => Widget.Button({ + class_name: "workspace-buttons", + attribute: i, + // Keeps button from expanding to fit its container + onClicked: () => dispatch(i), + child: Widget.Box({ + class_name: "workspace-indicator", + // vpack: "start", + vpack: "center", + hpack: "center", + children: [ + Widget.Label({ + label: `${i}`, + justification: "center", + }) + ], + setup: self => self.hook(hyprland, () => { + // The "?" is used here to return "undefined" if the workspace doesn't exist + self.toggleClassName('workspace-inactive', (hyprland.getWorkspace(i)?.windows || 0) === 0); + self.toggleClassName('workspace-occupied', (hyprland.getWorkspace(i)?.windows || 0) > 0); + self.toggleClassName('workspace-active', hyprland.active.workspace.id === i); + // self.toggleClassName('workspace-large', (hyprland.getWorkspace(i)?.windows || 0) > 1); + }), + }), + + })), + }), +}); function ClientTitle() { diff --git a/config/ags/style.css b/config/ags/style.css index c099733a..8e6d1cc5 100644 --- a/config/ags/style.css +++ b/config/ags/style.css @@ -13,7 +13,6 @@ button { padding-bottom: 0; border: none; background-color: transparent; - border-bottom: 3px solid transparent; } button:active { @@ -21,7 +20,7 @@ button:active { } button:hover { - border-bottom: 3px solid @theme_fg_color; + border-bottom: 1px solid @theme_fg_color; } label { @@ -29,7 +28,7 @@ label { } .workspaces button.focused { - border-bottom: 3px solid @theme_selected_bg_color; + border-bottom: 1px solid @theme_selected_bg_color; } .client-title { @@ -40,6 +39,31 @@ label { color: yellow; } + +.workspace-buttons { + min-width: 0; + padding-top: 0; + padding-bottom: 0; + outline-width: 0; + border: none; + background-color: transparent; +} + +.workspace-inactive { + opacity: 0.5; + border-bottom: 3px transparent; +} + +.workspace-occupied { + opacity: 1; + border-bottom: 3px transparent; +} + +.workspace-active { + outline-width: 0; + border-bottom: 3px solid @theme_selected_bg_color; +} + levelbar block, highlight { min-height: 10px; From 98ec4dd31e952977959e171fa3f1e6870629eda5 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 22 Sep 2024 01:23:34 +0400 Subject: [PATCH 032/319] you must gangnam like i have --- config/ags/style.css | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/ags/style.css b/config/ags/style.css index 8e6d1cc5..5d5a4315 100644 --- a/config/ags/style.css +++ b/config/ags/style.css @@ -20,7 +20,7 @@ button:active { } button:hover { - border-bottom: 1px solid @theme_fg_color; + /* border-bottom: 1px solid @theme_fg_color; */ } label { @@ -51,12 +51,12 @@ label { .workspace-inactive { opacity: 0.5; - border-bottom: 3px transparent; + /* border-bottom: 3px transparent; */ } .workspace-occupied { opacity: 1; - border-bottom: 3px transparent; + /* border-bottom: 3px transparent; */ } .workspace-active { From 6f011279e504520e80a1c4302a1d2b54dd899d8e Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 22 Sep 2024 01:25:40 +0400 Subject: [PATCH 033/319] uhhh --- config/ags/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/ags/style.css b/config/ags/style.css index 5d5a4315..84b185d4 100644 --- a/config/ags/style.css +++ b/config/ags/style.css @@ -44,7 +44,7 @@ label { min-width: 0; padding-top: 0; padding-bottom: 0; - outline-width: 0; + /* outline-width: 0; */ border: none; background-color: transparent; } From 1c43e528e1ee45ff3886f482001cbfa4ab74a586 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 22 Sep 2024 01:29:32 +0400 Subject: [PATCH 034/319] please --- config/ags/style.css | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/config/ags/style.css b/config/ags/style.css index 84b185d4..563d9196 100644 --- a/config/ags/style.css +++ b/config/ags/style.css @@ -40,12 +40,10 @@ label { } -.workspace-buttons { +.workspace-indicator { min-width: 0; padding-top: 0; padding-bottom: 0; - /* outline-width: 0; */ - border: none; background-color: transparent; } @@ -60,7 +58,6 @@ label { } .workspace-active { - outline-width: 0; border-bottom: 3px solid @theme_selected_bg_color; } From 2ef079ab05142ef08990fa4b69d5ab68450753f2 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 22 Sep 2024 08:47:08 +0400 Subject: [PATCH 035/319] i hate myself i hate this --- config/ags/style.css | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/config/ags/style.css b/config/ags/style.css index 563d9196..b7b98274 100644 --- a/config/ags/style.css +++ b/config/ags/style.css @@ -5,6 +5,7 @@ window.bar { background-color: @theme_bg_color; color: @theme_fg_color; + min-height: 4rem; } button { @@ -44,21 +45,27 @@ label { min-width: 0; padding-top: 0; padding-bottom: 0; + margin: 0; background-color: transparent; } +/* .workspace-indicator button.focused { + border-bottom: 3px solid @theme_selected_bg_color; + } + */ + .workspace-inactive { opacity: 0.5; - /* border-bottom: 3px transparent; */ + border-bottom: 5px transparent; } .workspace-occupied { opacity: 1; - /* border-bottom: 3px transparent; */ + border-bottom: 5px transparent; } .workspace-active { - border-bottom: 3px solid @theme_selected_bg_color; + border-bottom: 3px solid @theme_selected_bg_color; } levelbar block, From cf17ebcb408d6b8d00b71e340cf7ea3121f36149 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 22 Sep 2024 12:28:07 +0400 Subject: [PATCH 036/319] change themes again --- config/emacs/emacs.org | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 76543ea4..fe852661 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -201,9 +201,13 @@ kept-old-versions 5) #+end_src ** Appearance #+begin_src emacs-lisp - (use-package doom-themes + ;; (use-package doom-themes + ;; :config + ;; (load-theme 'doom-sourcerer t)) + + (use-package grandshell-theme :config - (load-theme 'doom-sourcerer t)) + (load-theme 'grandshell t)) ;; emacsclient things (setq frame-resize-pixelwise t) From e8a73a9e76f32be3e4af8a84189ddbd10e64b40b Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 22 Sep 2024 12:42:45 +0400 Subject: [PATCH 037/319] comment out doom-modeline --- config/emacs/emacs.org | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index fe852661..5cc83151 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -243,14 +243,14 @@ kept-old-versions 5) #+end_src ** Modeline #+begin_src emacs-lisp - (use-package nerd-icons - :custom - (nerd-icons-font-family "JetBrainsMono NF")) - (use-package doom-modeline - :custom - (doom-modeline-height 35) - (doom-modeline-modal-modern-icon nil) - :init (doom-modeline-mode 1)) + ;; (use-package nerd-icons + ;; :custom + ;; (nerd-icons-font-family "JetBrainsMono NF")) + ;; (use-package doom-modeline + ;; :custom + ;; (doom-modeline-height 35) + ;; (doom-modeline-modal-modern-icon nil) + ;; :init (doom-modeline-mode 1)) #+end_src ** Editor Configuration #+begin_src emacs-lisp From d3a346477a1f86dedbe851663550a37f0fa9aec3 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 22 Sep 2024 12:45:05 +0400 Subject: [PATCH 038/319] another new theme lmao --- config/emacs/emacs.org | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 5cc83151..ef8a7b0a 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -205,9 +205,13 @@ kept-old-versions 5) ;; :config ;; (load-theme 'doom-sourcerer t)) - (use-package grandshell-theme + ;; (use-package grandshell-theme + ;; :config + ;; (load-theme 'grandshell t)) + + (use-package ef-themes :config - (load-theme 'grandshell t)) + (load-theme 'ef-duo-dark)) ;; emacsclient things (setq frame-resize-pixelwise t) From 964e4f02ef18f31782d608babb732bab7302693a Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 22 Sep 2024 12:48:01 +0400 Subject: [PATCH 039/319] i forgot the t lmao --- config/emacs/emacs.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index ef8a7b0a..af036279 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -211,7 +211,7 @@ kept-old-versions 5) (use-package ef-themes :config - (load-theme 'ef-duo-dark)) + (load-theme 'ef-duo-dark t)) ;; emacsclient things (setq frame-resize-pixelwise t) From e167b50879323823bfee0757ccb9d8de05f7b30f Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 22 Sep 2024 12:49:01 +0400 Subject: [PATCH 040/319] ok i have decided on this one lmao --- config/emacs/emacs.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index af036279..83799b18 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -211,7 +211,7 @@ kept-old-versions 5) (use-package ef-themes :config - (load-theme 'ef-duo-dark t)) + (load-theme 'ef-dark t)) ;; emacsclient things (setq frame-resize-pixelwise t) From fdb699d9bc4a572475f39abba68732781ba80bc6 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 22 Sep 2024 12:55:44 +0400 Subject: [PATCH 041/319] add offlineimap because isync is probably dead now --- modules/dev/editors/emacs/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/dev/editors/emacs/default.nix b/modules/dev/editors/emacs/default.nix index e89b298c..c1318c4e 100644 --- a/modules/dev/editors/emacs/default.nix +++ b/modules/dev/editors/emacs/default.nix @@ -107,9 +107,10 @@ in { direnv # mu for email mu - # sync + # email sync isync cyrus-sasl-xoauth2 + offlineimap # protonmail hydroxide # doc-view From 96424bafca3986b0ab23d79bec3013d9dca7775b Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 22 Sep 2024 12:58:42 +0400 Subject: [PATCH 042/319] make this thing less long --- config/ags/style.css | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/config/ags/style.css b/config/ags/style.css index b7b98274..c7699e2d 100644 --- a/config/ags/style.css +++ b/config/ags/style.css @@ -68,6 +68,20 @@ label { border-bottom: 3px solid @theme_selected_bg_color; } +.client-title { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + max-width: 50px; +} + +.media { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + max-width: 100px; +} + levelbar block, highlight { min-height: 10px; From a870d62f1f631688424940cb9279d0c279221bb3 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 22 Sep 2024 13:01:23 +0400 Subject: [PATCH 043/319] nvm this broke it This reverts commit 96424bafca3986b0ab23d79bec3013d9dca7775b. --- config/ags/style.css | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/config/ags/style.css b/config/ags/style.css index c7699e2d..b7b98274 100644 --- a/config/ags/style.css +++ b/config/ags/style.css @@ -68,20 +68,6 @@ label { border-bottom: 3px solid @theme_selected_bg_color; } -.client-title { - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - max-width: 50px; -} - -.media { - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - max-width: 100px; -} - levelbar block, highlight { min-height: 10px; From f391fe191cd10f8497d92676275f0d5f0c59bb02 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Mon, 23 Sep 2024 06:34:52 +0400 Subject: [PATCH 044/319] this is terrible --- config/ags/style.css | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/config/ags/style.css b/config/ags/style.css index b7b98274..c9eebf05 100644 --- a/config/ags/style.css +++ b/config/ags/style.css @@ -14,6 +14,7 @@ button { padding-bottom: 0; border: none; background-color: transparent; + border-bottom: 3px solid transparent; } button:active { @@ -56,15 +57,15 @@ label { .workspace-inactive { opacity: 0.5; - border-bottom: 5px transparent; + border-bottom: 3px transparent; } .workspace-occupied { opacity: 1; - border-bottom: 5px transparent; + border-bottom: 3px transparent; } -.workspace-active { +.workspace-active button.focused { border-bottom: 3px solid @theme_selected_bg_color; } From aedaee97453a0c48541b183544ed9af4829e5986 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Mon, 23 Sep 2024 06:39:21 +0400 Subject: [PATCH 045/319] sigma sigma on the wall --- config/ags/style.css | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/config/ags/style.css b/config/ags/style.css index c9eebf05..148e96e8 100644 --- a/config/ags/style.css +++ b/config/ags/style.css @@ -50,10 +50,10 @@ label { background-color: transparent; } -/* .workspace-indicator button.focused { - border-bottom: 3px solid @theme_selected_bg_color; - } - */ +.workspace-indicator button.focused { + border-bottom: 3px solid @theme_selected_bg_color; +} + .workspace-inactive { opacity: 0.5; @@ -65,7 +65,7 @@ label { border-bottom: 3px transparent; } -.workspace-active button.focused { +.workspace-active { border-bottom: 3px solid @theme_selected_bg_color; } From 682bdb1fb89ef670f617423023ab637e2247b847 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Mon, 23 Sep 2024 11:50:35 +0400 Subject: [PATCH 046/319] config/emacs: offlineimap config init --- config/emacs/.offlineimap.py | 162 +++++++++++++++++++++++++++++++++++ config/emacs/.offlineimaprc | 19 ++++ 2 files changed, 181 insertions(+) create mode 100644 config/emacs/.offlineimap.py create mode 100644 config/emacs/.offlineimaprc diff --git a/config/emacs/.offlineimap.py b/config/emacs/.offlineimap.py new file mode 100644 index 00000000..79f37aae --- /dev/null +++ b/config/emacs/.offlineimap.py @@ -0,0 +1,162 @@ +#! /usr/bin/env python +from subprocess import check_output +import re + + +def get_pass(account): + return check_output("pass " + account, shell=True).splitlines()[0] + + +def get_user(account): + usercmd = check_output("pass " + account, shell=True) + + return re.search(rb"login: (.*)", usercmd, flags=0).group(1) + + +def hydroxide(path): + + file = open(path, "r") + + pword = file.read() + + return pword + + +class oauth: + def get_client_id(account): + cmd = check_output("pass " + account, shell=True) + + return re.search(rb"client_id: (.*)", cmd, flags=0).group(1) + + def get_client_secret(account): + cmd = check_output("pass " + account, shell=True) + + return re.search(rb"client_secret: (.*)", cmd, flags=0).group(1) + + def get_client_token(account): + cmd = check_output("pass " + account, shell=True) + + return re.search(rb"client_token: (.*)", cmd, flags=0).group(1) + + +#! /usr/bin/env python +from subprocess import check_output +import re + + +def get_pass(account): + return check_output("pass " + account, shell=True).splitlines()[0] + + +def get_user(account): + usercmd = check_output("pass " + account, shell=True) + + return re.search(rb"login: (.*)", usercmd, flags=0).group(1) + + +def hydroxide(path): + + file = open(path, "r") + + pword = file.read() + + return pword + + +class oauth: + def get_client_id(account): + cmd = check_output("pass " + account, shell=True) + + return re.search(rb"client_id: (.*)", cmd, flags=0).group(1) + + def get_client_secret(account): + cmd = check_output("pass " + account, shell=True) + + return re.search(rb"client_secret: (.*)", cmd, flags=0).group(1) + + def get_client_token(account): + cmd = check_output("pass " + account, shell=True) + + return re.search(rb"client_token: (.*)", cmd, flags=0).group(1) + + +#! /usr/bin/env python +from subprocess import check_output +import re + + +def get_pass(account): + return check_output("pass " + account, shell=True).splitlines()[0] + + +def get_user(account): + usercmd = check_output("pass " + account, shell=True) + + return re.search(rb"login: (.*)", usercmd, flags=0).group(1) + + +def hydroxide(path): + + file = open(path, "r") + + pword = file.read() + + return pword + + +class oauth: + def get_client_id(account): + cmd = check_output("pass " + account, shell=True) + + return re.search(rb"client_id: (.*)", cmd, flags=0).group(1) + + def get_client_secret(account): + cmd = check_output("pass " + account, shell=True) + + return re.search(rb"client_secret: (.*)", cmd, flags=0).group(1) + + def get_client_token(account): + cmd = check_output("pass " + account, shell=True) + + return re.search(rb"client_token: (.*)", cmd, flags=0).group(1) + + +#! /usr/bin/env python +from subprocess import check_output +import re + + +def get_pass(account): + return check_output("pass " + account, shell=True).splitlines()[0] + + +def get_user(account): + usercmd = check_output("pass " + account, shell=True) + + return re.search(rb"login: (.*)", usercmd, flags=0).group(1) + + +def hydroxide(path): + + file = open(path, "r") + + pword = file.read() + + return pword + + +class oauth: + def get_client_id(account): + cmd = check_output("pass " + account, shell=True) + + return re.search(rb"client_id: (.*)", cmd, flags=0).group(1) + + def get_client_secret(account): + cmd = check_output("pass " + account, shell=True) + + return re.search(rb"client_secret: (.*)", cmd, flags=0).group(1) + + def get_client_token(account): + cmd = check_output("pass " + account, shell=True) + + return re.search(rb"client_token: (.*)", cmd, flags=0).group(1) diff --git a/config/emacs/.offlineimaprc b/config/emacs/.offlineimaprc new file mode 100644 index 00000000..c8657e20 --- /dev/null +++ b/config/emacs/.offlineimaprc @@ -0,0 +1,19 @@ +[general] +pythonfile = ~/.offlineimap.py +accounts = Proton + +[Account Proton] +localrepository = Proton-local +remoterepository = Proton-remote + +[Repository Proton-local] +type = Maildir +localfolders = ~/Mail/Proton + +[Repository Proton-remote] +type = IMAP +ssl = no +remotehost = 127.0.0.1 +remoteport = 1143 +remoteusereval = get_user("Proton\ Account") +remotepasseval = hydroxide("/home/sako/.hydroxide-bridge-pass") \ No newline at end of file From b49eb92cd65fcaee793a757be5f8a930d3851fbb Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Mon, 23 Sep 2024 11:50:53 +0400 Subject: [PATCH 047/319] config/emacs: use offlineimap to sync instead --- config/emacs/emacs.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 83799b18..4bfe0eaf 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1163,7 +1163,7 @@ GNU patch review metho dor sometihng idk (setq message-send-mail-function 'smtpmail-send-it) (setq mu4e-update-interval (* 10 60)) - (setq mu4e-get-mail-command "mbsync -a") + (setq mu4e-get-mail-command "offlineimap") (setq mu4e-maildir "~/Mail") (setq outlook-mail-address From 2132721ac47068f881448bf89eb621a44168f2b9 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Mon, 23 Sep 2024 11:52:21 +0400 Subject: [PATCH 048/319] modules/dev: emacs homemanager link offlineimap files --- modules/dev/editors/emacs/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/dev/editors/emacs/default.nix b/modules/dev/editors/emacs/default.nix index c1318c4e..a7495dee 100644 --- a/modules/dev/editors/emacs/default.nix +++ b/modules/dev/editors/emacs/default.nix @@ -152,6 +152,8 @@ in { ''; ".emacs.d/icon.png".source = ../../../../config/emacs/icon.png; ".mbsyncrc".source = ../../../../config/emacs/.mbsyncrc; + ".offlineimaprc".source = ../../../../cconfig/emacs/.offlineimaprc; + ".offlineimap.py".source = ../../../../cconfig/emacs/.offlineimap.py; }; }; From fb35078d1c339e0d24a1ebde9af50a1f5d80fddc Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Mon, 23 Sep 2024 11:52:57 +0400 Subject: [PATCH 049/319] modules/dev: comment out mbsync configuration --- modules/dev/editors/emacs/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/dev/editors/emacs/default.nix b/modules/dev/editors/emacs/default.nix index a7495dee..1194568c 100644 --- a/modules/dev/editors/emacs/default.nix +++ b/modules/dev/editors/emacs/default.nix @@ -108,8 +108,8 @@ in { # mu for email mu # email sync - isync - cyrus-sasl-xoauth2 + # isync + # cyrus-sasl-xoauth2 offlineimap # protonmail hydroxide @@ -151,7 +151,7 @@ in { mv init.el $out ''; ".emacs.d/icon.png".source = ../../../../config/emacs/icon.png; - ".mbsyncrc".source = ../../../../config/emacs/.mbsyncrc; + # ".mbsyncrc".source = ../../../../config/emacs/.mbsyncrc; ".offlineimaprc".source = ../../../../cconfig/emacs/.offlineimaprc; ".offlineimap.py".source = ../../../../cconfig/emacs/.offlineimap.py; }; From b3adba2b3b6b489638bae7190ed657254c759e0e Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Mon, 23 Sep 2024 11:54:50 +0400 Subject: [PATCH 050/319] typo --- modules/dev/editors/emacs/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/dev/editors/emacs/default.nix b/modules/dev/editors/emacs/default.nix index 1194568c..d02c5bf1 100644 --- a/modules/dev/editors/emacs/default.nix +++ b/modules/dev/editors/emacs/default.nix @@ -152,7 +152,7 @@ in { ''; ".emacs.d/icon.png".source = ../../../../config/emacs/icon.png; # ".mbsyncrc".source = ../../../../config/emacs/.mbsyncrc; - ".offlineimaprc".source = ../../../../cconfig/emacs/.offlineimaprc; + ".offlineimaprc".source = ../../../../config/emacs/.offlineimaprc; ".offlineimap.py".source = ../../../../cconfig/emacs/.offlineimap.py; }; }; From 84c892caf9d403342e4ac575942315cf56c4194a Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Mon, 23 Sep 2024 11:56:17 +0400 Subject: [PATCH 051/319] another typo ffs --- modules/dev/editors/emacs/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/dev/editors/emacs/default.nix b/modules/dev/editors/emacs/default.nix index d02c5bf1..dd8f3301 100644 --- a/modules/dev/editors/emacs/default.nix +++ b/modules/dev/editors/emacs/default.nix @@ -153,7 +153,7 @@ in { ".emacs.d/icon.png".source = ../../../../config/emacs/icon.png; # ".mbsyncrc".source = ../../../../config/emacs/.mbsyncrc; ".offlineimaprc".source = ../../../../config/emacs/.offlineimaprc; - ".offlineimap.py".source = ../../../../cconfig/emacs/.offlineimap.py; + ".offlineimap.py".source = ../../../../config/emacs/.offlineimap.py; }; }; From 9af4536e43664c2fb3ada76400857cc5bd048206 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 24 Sep 2024 06:22:13 +0400 Subject: [PATCH 052/319] config/emacs: offlineimap attempt to fix weird bullshit error --- config/emacs/.offlineimaprc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/emacs/.offlineimaprc b/config/emacs/.offlineimaprc index c8657e20..1f9e6117 100644 --- a/config/emacs/.offlineimaprc +++ b/config/emacs/.offlineimaprc @@ -16,4 +16,5 @@ ssl = no remotehost = 127.0.0.1 remoteport = 1143 remoteusereval = get_user("Proton\ Account") -remotepasseval = hydroxide("/home/sako/.hydroxide-bridge-pass") \ No newline at end of file +remotepasseval = hydroxide("/home/sako/.hydroxide-bridge-pass") +folderfilter = lambda foldername: foldername in [ "All Mail", "Archive", "Drafts", "INBOX", "Sent", "Spam", "Starred", "Trash" ] \ No newline at end of file From a3a383707d49957706b0077f0e75a64c9c9e298c Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 24 Sep 2024 06:54:23 +0400 Subject: [PATCH 053/319] dev/emacs: add microsoft oauth bullshit --- modules/dev/editors/emacs/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/dev/editors/emacs/default.nix b/modules/dev/editors/emacs/default.nix index dd8f3301..5aff8fd6 100644 --- a/modules/dev/editors/emacs/default.nix +++ b/modules/dev/editors/emacs/default.nix @@ -111,6 +111,8 @@ in { # isync # cyrus-sasl-xoauth2 offlineimap + # oauth for microsoft + oauth2ms # protonmail hydroxide # doc-view From f33ec26dbf0e2c9d9a758f233569584c84b3f5f4 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 24 Sep 2024 09:38:56 +0400 Subject: [PATCH 054/319] config/emacs: hopefully add outlook support to offlineimap --- config/emacs/.offlineimap.py | 5 +++++ config/emacs/.offlineimaprc | 24 ++++++++++++++++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/config/emacs/.offlineimap.py b/config/emacs/.offlineimap.py index 79f37aae..072f5014 100644 --- a/config/emacs/.offlineimap.py +++ b/config/emacs/.offlineimap.py @@ -160,3 +160,8 @@ class oauth: cmd = check_output("pass " + account, shell=True) return re.search(rb"client_token: (.*)", cmd, flags=0).group(1) + + def get_client_refresh_token(account): + cmd = check_output("pass " + account, shell=True) + + return re.search(rb"client_refresh_token: (.*)", cmd, flags=0).group(1) diff --git a/config/emacs/.offlineimaprc b/config/emacs/.offlineimaprc index 1f9e6117..67a04c65 100644 --- a/config/emacs/.offlineimaprc +++ b/config/emacs/.offlineimaprc @@ -1,6 +1,6 @@ [general] pythonfile = ~/.offlineimap.py -accounts = Proton +accounts = Proton, Outlook [Account Proton] localrepository = Proton-local @@ -17,4 +17,24 @@ remotehost = 127.0.0.1 remoteport = 1143 remoteusereval = get_user("Proton\ Account") remotepasseval = hydroxide("/home/sako/.hydroxide-bridge-pass") -folderfilter = lambda foldername: foldername in [ "All Mail", "Archive", "Drafts", "INBOX", "Sent", "Spam", "Starred", "Trash" ] \ No newline at end of file +folderfilter = lambda foldername: foldername in [ "All Mail", "Archive", "Drafts", "INBOX", "Sent", "Spam", "Starred", "Trash" ] + +[Account Outlook] +localrepostiory = Outlook-local +remoterepository = Outlook-remote + +[Repository Outlook-local] +type = maildir +localfolders = ~/Mail/Outlook + +[Repository Outlook-remote] +type = IMAP +remoteusereval = get_user("Microsoft") +remotehost = outlook.office365.com +remoteport = 993 +auth_mechanisms = XOAUTH2 +oauth2_request_url = https://login.microsoftonline.com/common/oauth2/v2.0/token +oauth2_client_id = 9e5f94bc-e8a4-4e73-b8be-63364c29d753 # thunderbird's token not mine lol +oauth2_client_secret = "" # no need for this lmao +oauth2_refresh_token_eval = oauth.get_client_refresh_token("Microsoft") +oauth2_access_token_eval = oauth.get_client_token("Microsoft") \ No newline at end of file From ab63c7a5080407536372e7d95ab2f1f33be554fb Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 24 Sep 2024 09:45:15 +0400 Subject: [PATCH 055/319] take two --- config/emacs/.offlineimap.py | 147 +++-------------------------------- config/emacs/.offlineimaprc | 4 +- 2 files changed, 12 insertions(+), 139 deletions(-) diff --git a/config/emacs/.offlineimap.py b/config/emacs/.offlineimap.py index 072f5014..dfc61682 100644 --- a/config/emacs/.offlineimap.py +++ b/config/emacs/.offlineimap.py @@ -22,146 +22,19 @@ def hydroxide(path): return pword -class oauth: - def get_client_id(account): - cmd = check_output("pass " + account, shell=True) +def get_client_id(account): + cmd = check_output("pass " + account, shell=True) - return re.search(rb"client_id: (.*)", cmd, flags=0).group(1) - - def get_client_secret(account): - cmd = check_output("pass " + account, shell=True) - - return re.search(rb"client_secret: (.*)", cmd, flags=0).group(1) - - def get_client_token(account): - cmd = check_output("pass " + account, shell=True) - - return re.search(rb"client_token: (.*)", cmd, flags=0).group(1) + return re.search(rb"client_id: (.*)", cmd, flags=0).group(1) -#! /usr/bin/env python -from subprocess import check_output -import re +def get_client_secret(account): + cmd = check_output("pass " + account, shell=True) + + return re.search(rb"client_secret: (.*)", cmd, flags=0).group(1) -def get_pass(account): - return check_output("pass " + account, shell=True).splitlines()[0] +def get_client_token(account): + cmd = check_output("pass " + account, shell=True) - -def get_user(account): - usercmd = check_output("pass " + account, shell=True) - - return re.search(rb"login: (.*)", usercmd, flags=0).group(1) - - -def hydroxide(path): - - file = open(path, "r") - - pword = file.read() - - return pword - - -class oauth: - def get_client_id(account): - cmd = check_output("pass " + account, shell=True) - - return re.search(rb"client_id: (.*)", cmd, flags=0).group(1) - - def get_client_secret(account): - cmd = check_output("pass " + account, shell=True) - - return re.search(rb"client_secret: (.*)", cmd, flags=0).group(1) - - def get_client_token(account): - cmd = check_output("pass " + account, shell=True) - - return re.search(rb"client_token: (.*)", cmd, flags=0).group(1) - - -#! /usr/bin/env python -from subprocess import check_output -import re - - -def get_pass(account): - return check_output("pass " + account, shell=True).splitlines()[0] - - -def get_user(account): - usercmd = check_output("pass " + account, shell=True) - - return re.search(rb"login: (.*)", usercmd, flags=0).group(1) - - -def hydroxide(path): - - file = open(path, "r") - - pword = file.read() - - return pword - - -class oauth: - def get_client_id(account): - cmd = check_output("pass " + account, shell=True) - - return re.search(rb"client_id: (.*)", cmd, flags=0).group(1) - - def get_client_secret(account): - cmd = check_output("pass " + account, shell=True) - - return re.search(rb"client_secret: (.*)", cmd, flags=0).group(1) - - def get_client_token(account): - cmd = check_output("pass " + account, shell=True) - - return re.search(rb"client_token: (.*)", cmd, flags=0).group(1) - - -#! /usr/bin/env python -from subprocess import check_output -import re - - -def get_pass(account): - return check_output("pass " + account, shell=True).splitlines()[0] - - -def get_user(account): - usercmd = check_output("pass " + account, shell=True) - - return re.search(rb"login: (.*)", usercmd, flags=0).group(1) - - -def hydroxide(path): - - file = open(path, "r") - - pword = file.read() - - return pword - - -class oauth: - def get_client_id(account): - cmd = check_output("pass " + account, shell=True) - - return re.search(rb"client_id: (.*)", cmd, flags=0).group(1) - - def get_client_secret(account): - cmd = check_output("pass " + account, shell=True) - - return re.search(rb"client_secret: (.*)", cmd, flags=0).group(1) - - def get_client_token(account): - cmd = check_output("pass " + account, shell=True) - - return re.search(rb"client_token: (.*)", cmd, flags=0).group(1) - - def get_client_refresh_token(account): - cmd = check_output("pass " + account, shell=True) - - return re.search(rb"client_refresh_token: (.*)", cmd, flags=0).group(1) + return re.search(rb"client_token: (.*)", cmd, flags=0).group(1) diff --git a/config/emacs/.offlineimaprc b/config/emacs/.offlineimaprc index 67a04c65..e0e554f4 100644 --- a/config/emacs/.offlineimaprc +++ b/config/emacs/.offlineimaprc @@ -36,5 +36,5 @@ auth_mechanisms = XOAUTH2 oauth2_request_url = https://login.microsoftonline.com/common/oauth2/v2.0/token oauth2_client_id = 9e5f94bc-e8a4-4e73-b8be-63364c29d753 # thunderbird's token not mine lol oauth2_client_secret = "" # no need for this lmao -oauth2_refresh_token_eval = oauth.get_client_refresh_token("Microsoft") -oauth2_access_token_eval = oauth.get_client_token("Microsoft") \ No newline at end of file +oauth2_refresh_token_eval = get_client_refresh_token("Microsoft") +oauth2_access_token_eval = get_client_token("Microsoft") \ No newline at end of file From b6e290800088303734d6719e6ab3cb1be10a9f7e Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 24 Sep 2024 10:02:45 +0400 Subject: [PATCH 056/319] aaa --- config/emacs/.offlineimap.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/config/emacs/.offlineimap.py b/config/emacs/.offlineimap.py index dfc61682..4257ebb6 100644 --- a/config/emacs/.offlineimap.py +++ b/config/emacs/.offlineimap.py @@ -38,3 +38,9 @@ def get_client_token(account): cmd = check_output("pass " + account, shell=True) return re.search(rb"client_token: (.*)", cmd, flags=0).group(1) + + +def get_client_token(account): + cmd = check_output("pass " + account, shell=True) + + return re.search(rb"client_refresh_token: (.*)", cmd, flags=0).group(1) From 5b559b4941e28db2fccf7de166f0c51b17392f85 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 24 Sep 2024 10:04:40 +0400 Subject: [PATCH 057/319] im slow --- config/emacs/.offlineimap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/emacs/.offlineimap.py b/config/emacs/.offlineimap.py index 4257ebb6..081cafc6 100644 --- a/config/emacs/.offlineimap.py +++ b/config/emacs/.offlineimap.py @@ -40,7 +40,7 @@ def get_client_token(account): return re.search(rb"client_token: (.*)", cmd, flags=0).group(1) -def get_client_token(account): +def get_client_refresh_token(account): cmd = check_output("pass " + account, shell=True) return re.search(rb"client_refresh_token: (.*)", cmd, flags=0).group(1) From 1738331cf48abc3a47aa98567d1be46be3bd6352 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 24 Sep 2024 10:06:17 +0400 Subject: [PATCH 058/319] what --- config/emacs/.offlineimap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/emacs/.offlineimap.py b/config/emacs/.offlineimap.py index 081cafc6..a4e6e542 100644 --- a/config/emacs/.offlineimap.py +++ b/config/emacs/.offlineimap.py @@ -43,4 +43,4 @@ def get_client_token(account): def get_client_refresh_token(account): cmd = check_output("pass " + account, shell=True) - return re.search(rb"client_refresh_token: (.*)", cmd, flags=0).group(1) + return re.search("client_refresh_token: (.*)", cmd, flags=0).group(1) From 83b4e9e80959cfd5c6d07f325638f24fffa9b4e9 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 24 Sep 2024 10:20:07 +0400 Subject: [PATCH 059/319] what --- config/emacs/.offlineimap.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config/emacs/.offlineimap.py b/config/emacs/.offlineimap.py index a4e6e542..0557d433 100644 --- a/config/emacs/.offlineimap.py +++ b/config/emacs/.offlineimap.py @@ -43,4 +43,6 @@ def get_client_token(account): def get_client_refresh_token(account): cmd = check_output("pass " + account, shell=True) - return re.search("client_refresh_token: (.*)", cmd, flags=0).group(1) + output = re.search(rb"client_refresh_token: (.*)", cmd, flags=0).group(1) + + return str.encode(output) From 2095df4129add3e56e315bbc3837d54bbda0122c Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 24 Sep 2024 10:22:42 +0400 Subject: [PATCH 060/319] (feat) config/emacs: setup outlook support lmao!!!! --- config/emacs/.offlineimap.py | 10 ++++++---- config/emacs/.offlineimaprc | 14 +++++++++----- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/config/emacs/.offlineimap.py b/config/emacs/.offlineimap.py index 0557d433..77a09b04 100644 --- a/config/emacs/.offlineimap.py +++ b/config/emacs/.offlineimap.py @@ -10,7 +10,7 @@ def get_pass(account): def get_user(account): usercmd = check_output("pass " + account, shell=True) - return re.search(rb"login: (.*)", usercmd, flags=0).group(1) + return re.search(rb"login: (.*)", usercmd, flags=0).group(1).decode("utf-8") def hydroxide(path): @@ -37,12 +37,14 @@ def get_client_secret(account): def get_client_token(account): cmd = check_output("pass " + account, shell=True) - return re.search(rb"client_token: (.*)", cmd, flags=0).group(1) + output = re.search("client_token: (.*)", cmd.decode(), flags=0).group(1) + + return output def get_client_refresh_token(account): cmd = check_output("pass " + account, shell=True) - output = re.search(rb"client_refresh_token: (.*)", cmd, flags=0).group(1) + output = re.search("client_refresh_token: (.*)", cmd.decode(), flags=0).group(1) - return str.encode(output) + return output diff --git a/config/emacs/.offlineimaprc b/config/emacs/.offlineimaprc index e0e554f4..d5011dff 100644 --- a/config/emacs/.offlineimaprc +++ b/config/emacs/.offlineimaprc @@ -1,6 +1,7 @@ [general] pythonfile = ~/.offlineimap.py accounts = Proton, Outlook +socktimeout = 10 [Account Proton] localrepository = Proton-local @@ -20,21 +21,24 @@ remotepasseval = hydroxide("/home/sako/.hydroxide-bridge-pass") folderfilter = lambda foldername: foldername in [ "All Mail", "Archive", "Drafts", "INBOX", "Sent", "Spam", "Starred", "Trash" ] [Account Outlook] -localrepostiory = Outlook-local +localrepository = Outlook-local remoterepository = Outlook-remote [Repository Outlook-local] -type = maildir +type = Maildir localfolders = ~/Mail/Outlook [Repository Outlook-remote] +ssl = yes +sslcacertfile = /etc/ssl/certs/ca-certificates.crt type = IMAP remoteusereval = get_user("Microsoft") remotehost = outlook.office365.com remoteport = 993 auth_mechanisms = XOAUTH2 oauth2_request_url = https://login.microsoftonline.com/common/oauth2/v2.0/token -oauth2_client_id = 9e5f94bc-e8a4-4e73-b8be-63364c29d753 # thunderbird's token not mine lol -oauth2_client_secret = "" # no need for this lmao +oauth2_client_id = 9e5f94bc-e8a4-4e73-b8be-63364c29d753 +# oauth2_client_secret = "" oauth2_refresh_token_eval = get_client_refresh_token("Microsoft") -oauth2_access_token_eval = get_client_token("Microsoft") \ No newline at end of file +oauth2_access_token_eval = get_client_token("Microsoft") +folderfilter = lambda folder: not folder.startswith('Calendar') and not folder.startswith('Contacts') \ No newline at end of file From dead68f5da8f70d7c7fa3a615865c39b4d3c1cb0 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 24 Sep 2024 15:19:17 +0400 Subject: [PATCH 061/319] config/emacs: I DID IT HHAAHAHUDHUWAHFUIOWAHGUIO --- config/emacs/.offlineimap.py | 8 -------- config/emacs/.offlineimaprc | 3 +-- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/config/emacs/.offlineimap.py b/config/emacs/.offlineimap.py index 77a09b04..665407b9 100644 --- a/config/emacs/.offlineimap.py +++ b/config/emacs/.offlineimap.py @@ -34,14 +34,6 @@ def get_client_secret(account): return re.search(rb"client_secret: (.*)", cmd, flags=0).group(1) -def get_client_token(account): - cmd = check_output("pass " + account, shell=True) - - output = re.search("client_token: (.*)", cmd.decode(), flags=0).group(1) - - return output - - def get_client_refresh_token(account): cmd = check_output("pass " + account, shell=True) diff --git a/config/emacs/.offlineimaprc b/config/emacs/.offlineimaprc index d5011dff..bea21ee0 100644 --- a/config/emacs/.offlineimaprc +++ b/config/emacs/.offlineimaprc @@ -38,7 +38,6 @@ remoteport = 993 auth_mechanisms = XOAUTH2 oauth2_request_url = https://login.microsoftonline.com/common/oauth2/v2.0/token oauth2_client_id = 9e5f94bc-e8a4-4e73-b8be-63364c29d753 -# oauth2_client_secret = "" +oauth2_client_secret = oauth2_refresh_token_eval = get_client_refresh_token("Microsoft") -oauth2_access_token_eval = get_client_token("Microsoft") folderfilter = lambda folder: not folder.startswith('Calendar') and not folder.startswith('Contacts') \ No newline at end of file From e25dfc791a73130996612267d13aa0b6090f0372 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 24 Sep 2024 19:59:17 +0400 Subject: [PATCH 062/319] config/emacs: add my gmail accounts or something --- config/emacs/.offlineimap.py | 8 +++-- config/emacs/.offlineimaprc | 57 ++++++++++++++++++++++++++++++++++-- 2 files changed, 60 insertions(+), 5 deletions(-) diff --git a/config/emacs/.offlineimap.py b/config/emacs/.offlineimap.py index 665407b9..b53741ba 100644 --- a/config/emacs/.offlineimap.py +++ b/config/emacs/.offlineimap.py @@ -25,13 +25,17 @@ def hydroxide(path): def get_client_id(account): cmd = check_output("pass " + account, shell=True) - return re.search(rb"client_id: (.*)", cmd, flags=0).group(1) + output = re.search("client_id: (.*)", cmd.decode(), flags=0).group(1) + + return output def get_client_secret(account): cmd = check_output("pass " + account, shell=True) - return re.search(rb"client_secret: (.*)", cmd, flags=0).group(1) + output = re.search("client_secret: (.*)", cmd.decode(), flags=0).group(1) + + return output def get_client_refresh_token(account): diff --git a/config/emacs/.offlineimaprc b/config/emacs/.offlineimaprc index bea21ee0..486afa77 100644 --- a/config/emacs/.offlineimaprc +++ b/config/emacs/.offlineimaprc @@ -1,7 +1,8 @@ [general] pythonfile = ~/.offlineimap.py -accounts = Proton, Outlook -socktimeout = 10 +accounts = Proton, Outlook, Gmail-personal-1 +socktimeout = 60 +maxsyncaccounts = 3 [Account Proton] localrepository = Proton-local @@ -37,7 +38,57 @@ remotehost = outlook.office365.com remoteport = 993 auth_mechanisms = XOAUTH2 oauth2_request_url = https://login.microsoftonline.com/common/oauth2/v2.0/token +# Thunderbird client_id below oauth2_client_id = 9e5f94bc-e8a4-4e73-b8be-63364c29d753 +# Do not need client_secret :D oauth2_client_secret = oauth2_refresh_token_eval = get_client_refresh_token("Microsoft") -folderfilter = lambda folder: not folder.startswith('Calendar') and not folder.startswith('Contacts') \ No newline at end of file +folderfilter = lambda folder: not folder.startswith('Calendar') and not folder.startswith('Contacts') + +[Account Gmail-personal-1] +localrepository = Gmail-personal-1-local +remoterepository = Gmail-personal-1-remote + +[Repository Gmail-personal-1-local] +type = GmailMaildir +localfolders = ~/Mail/Gmail-Personal-1 +# Google IMAP weirdness +nametrans = lambda f: '[Gmail]/' + f if f in ['Drafts', 'Starred', 'Important', 'Spam', 'Trash', 'All Mail', 'Sent Mail'] else f + +[Repository Gmail-personal-1-remote] +ssl = yes +sslcacertfile = /etc/ssl/certs/ca-certificates.crt +type = Gmail +remotehost = imap.gmail.com +auth_mechanisms = XOAUTH2 +remoteusereval = get_user("accounts.google.com/one") +oauth2_request_url = https://accounts.google.com/o/oauth2/token +oauth2_client_id_eval = get_client_id("email/oauth/gmail") +oauth2_client_secret_eval = get_client_secret("email/oauth/gmail") +oauth2_refresh_token_eval = get_client_refresh_token("accounts.google.com/one") +# Google IMAP weirdness +nametrans = lambda f: f.replace('[Gmail]/', '') if f.startswith('[Gmail]/') else f + +[Account Gmail-personal-2] +localrepository = Gmail-personal-2-local +remoterepository = Gmail-personal-2-remote + +[Repository Gmail-personal-2-local] +type = GmailMaildir +localfolders = ~/Mail/Gmail-Personal-2 +# Google IMAP weirdness +nametrans = lambda f: '[Gmail]/' + f if f in ['Drafts', 'Starred', 'Important', 'Spam', 'Trash', 'All Mail', 'Sent Mail'] else f + +[Repository Gmail-personal-2-remote] +ssl = yes +sslcacertfile = /etc/ssl/certs/ca-certificates.crt +type = Gmail +remotehost = imap.gmail.com +auth_mechanisms = XOAUTH2 +remoteusereval = get_user("accounts.google.com/two") +oauth2_request_url = https://accounts.google.com/o/oauth2/token +oauth2_client_id_eval = get_client_id("email/oauth/gmail") +oauth2_client_secret_eval = get_client_secret("email/oauth/gmail") +oauth2_refresh_token_eval = get_client_refresh_token("accounts.google.com/two") +# Google IMAP weirdness +nametrans = lambda f: f.replace('[Gmail]/', '') if f.startswith('[Gmail]/') else f \ No newline at end of file From 2b0f29b12ac92876f0aba716c3dcc8a65140fbc0 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 24 Sep 2024 22:02:28 +0400 Subject: [PATCH 063/319] config/emacs: add mu4e contexts for other accounts --- config/emacs/emacs.org | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 4bfe0eaf..d1c7fe52 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1167,7 +1167,7 @@ GNU patch review metho dor sometihng idk (setq mu4e-maildir "~/Mail") (setq outlook-mail-address - (string-trim (shell-command-to-string "pass mail | awk 'BEGIN {ORS=\"\"} FNR == 2{gsub(\"login: \", \"\"); gsub(/ /, \"\"); print}'"))) + (string-trim (shell-command-to-string "pass Microsoft | awk 'BEGIN {ORS=\"\"} FNR == 2{gsub(\"login: \", \"\"); gsub(/ /, \"\"); print}'"))) (defvar proton-mail-address nil) @@ -1180,6 +1180,12 @@ GNU patch review metho dor sometihng idk (setq my-greeting (concat "@proton.me" output)))) (get-proton-mail-address-from-pass "pass Proton\ Account | awk 'BEGIN {ORS=\"\"} FNR == 2{gsub(\"login: \", \"\"); gsub(/ /, \"\"); print}'") + + (setq gmail-1-mail-address + (string-trim (shell-command-to-string "pass accounts.google.com/one | awk 'BEGIN {ORS=\"\"} FNR == 2{gsub(\"login: \", \"\"); gsub(/ /, \"\"); print}'"))) + + (setq gmail-2-mail-address + (string-trim (shell-command-to-string "pass accounts.google.com/two | awk 'BEGIN {ORS=\"\"} FNR == 2{gsub(\"login: \", \"\"); gsub(/ /, \"\"); print}'"))) (setq mu4e-contexts (list @@ -1208,6 +1214,30 @@ GNU patch review metho dor sometihng idk (mu4e-sent-folder . "/Proton/Sent") (mu4e-refile-folder . "/Proton/Inbox") (mu4e-trash-folder . "/Proton/Trash"))) + (make-mu4e-context + :name "Gmail Personal 1" + :match-func + (lambda (msg) + (when msg + (string-prefix-p "/Gmail-Personal-1" (mu4e-message-field msg :maildir)))) + :vars `((user-mail-address . ,gmail-1-mail-address) + (user-full-name . "Sako") + (mu4e-drafts-folder . "/Gmail-Personal-1/Drafts") + (mu4e-sent-folder . "/Gmail-Personal-1/Sent Mail") + (mu4e-refile-folder . "/Gmail-Personal-1/Inbox") + (mu4e-trash-folder . "Gmail-Personal-1/Trash"))) + (make-mu4e-context + :name "Gmail Personal 2" + :match-func + (lambda (msg) + (when msg + (string-prefix-p "/Gmail-Personal-2" (mu4e-message-field msg :maildir)))) + :vars `((user-mail-address . ,gmail-2-mail-address) + (user-full-name . "Sako") + (mu4e-drafts-folder . "/Gmail-Personal-2/Drafts") + (mu4e-sent-folder . "/Gmail-Personal-2/Sent Mail") + (mu4e-refile-folder . "/Gmail-Personal-2/Inbox") + (mu4e-trash-folder . "Gmail-Personal-2/Trash"))) )) ) #+end_src From f31fe58c5f540ec2ace688b79ca29ec4b3c452bb Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 24 Sep 2024 22:02:43 +0400 Subject: [PATCH 064/319] config/emacs: sync other email account too --- config/emacs/.offlineimaprc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/emacs/.offlineimaprc b/config/emacs/.offlineimaprc index 486afa77..9ba9f511 100644 --- a/config/emacs/.offlineimaprc +++ b/config/emacs/.offlineimaprc @@ -1,6 +1,6 @@ [general] pythonfile = ~/.offlineimap.py -accounts = Proton, Outlook, Gmail-personal-1 +accounts = Proton, Outlook, Gmail-personal-1, Gmail-personal-2 socktimeout = 60 maxsyncaccounts = 3 From 579401bd42eab2a5e69fc2310f08430e9528033f Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 24 Sep 2024 22:30:10 +0400 Subject: [PATCH 065/319] I cna't siwtch contexts its over --- config/emacs/emacs.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index d1c7fe52..4585599e 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1227,7 +1227,7 @@ GNU patch review metho dor sometihng idk (mu4e-refile-folder . "/Gmail-Personal-1/Inbox") (mu4e-trash-folder . "Gmail-Personal-1/Trash"))) (make-mu4e-context - :name "Gmail Personal 2" + :name "Second Personal Gmail" :match-func (lambda (msg) (when msg From 33eb418765c26a3902ecdb1c080468a27683bd85 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 24 Sep 2024 22:33:31 +0400 Subject: [PATCH 066/319] config/emacs: i am stupid --- config/emacs/emacs.org | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 4585599e..82edd0af 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1174,10 +1174,8 @@ GNU patch review metho dor sometihng idk (defun get-proton-mail-address-from-pass (command) "Execute COMMAND, concatenate its output with 'hello', and store it in my-greeting." (let ((output (shell-command-to-string command))) - ;; Trim whitespace from the output (setq output (string-trim output)) - ;; Concatenate 'hello' with the command output - (setq my-greeting (concat "@proton.me" output)))) + (setq proton-mail-address (concat "@proton.me" output)))) (get-proton-mail-address-from-pass "pass Proton\ Account | awk 'BEGIN {ORS=\"\"} FNR == 2{gsub(\"login: \", \"\"); gsub(/ /, \"\"); print}'") From b3736f30f3681a0201735d47ee5029539d9674be Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 24 Sep 2024 22:38:29 +0400 Subject: [PATCH 067/319] config/emacs: ok --- config/emacs/emacs.org | 39 ++++++++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 82edd0af..43bd71e4 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1184,7 +1184,9 @@ GNU patch review metho dor sometihng idk (setq gmail-2-mail-address (string-trim (shell-command-to-string "pass accounts.google.com/two | awk 'BEGIN {ORS=\"\"} FNR == 2{gsub(\"login: \", \"\"); gsub(/ /, \"\"); print}'"))) - + + (setq mu4e-context-policy 'pick-first) + (setq mu4e-compose-context-policy 'always-ask) (setq mu4e-contexts (list ;; outlook @@ -1199,7 +1201,13 @@ GNU patch review metho dor sometihng idk (mu4e-drafts-folder . "/Outlook/Drafts") (mu4e-sent-folder . "/Outlook/Sent") (mu4e-refile-folder . "/Outlook/Inbox") - (mu4e-trash-folder . "/Outlook/Deleted"))) + (mu4e-trash-folder . "/Outlook/Deleted") + ;; todo stmpmail and compose signatures + (mu4e-maildir-shortcuts . ( + ("/Outlook/Inbox" . ?i) + ("/Outlook/Sent" . ?s) + ("/Outlook/Drafts" . ?d) + )))) (make-mu4e-context :name "Proton" :match-func @@ -1211,7 +1219,14 @@ GNU patch review metho dor sometihng idk (mu4e-drafts-folder . "/Proton/Drafts") (mu4e-sent-folder . "/Proton/Sent") (mu4e-refile-folder . "/Proton/Inbox") - (mu4e-trash-folder . "/Proton/Trash"))) + (mu4e-trash-folder . "/Proton/Trash")) + ;; todo stmpmail and compose signatures + (mu4e-maildir-shortcuts . ( + ("/Proton/Inbox" . ?i) + ("/Proton/Sent" . ?s) + ("/Proton/Drafts" . ?d) + ) + )) (make-mu4e-context :name "Gmail Personal 1" :match-func @@ -1223,7 +1238,14 @@ GNU patch review metho dor sometihng idk (mu4e-drafts-folder . "/Gmail-Personal-1/Drafts") (mu4e-sent-folder . "/Gmail-Personal-1/Sent Mail") (mu4e-refile-folder . "/Gmail-Personal-1/Inbox") - (mu4e-trash-folder . "Gmail-Personal-1/Trash"))) + (mu4e-trash-folder . "Gmail-Personal-1/Trash") + ;; todo stmpmail and compose signatures + (mu4e-maildir-shortcuts . ( + ("/Gmail-Personal-1/Inbox" . ?i) + ("/Gmail-Personal-1/Sent Mail" . ?s) + ("/Gmail-Personal-1/Drafts" . ?d) + ) + ))) (make-mu4e-context :name "Second Personal Gmail" :match-func @@ -1235,7 +1257,14 @@ GNU patch review metho dor sometihng idk (mu4e-drafts-folder . "/Gmail-Personal-2/Drafts") (mu4e-sent-folder . "/Gmail-Personal-2/Sent Mail") (mu4e-refile-folder . "/Gmail-Personal-2/Inbox") - (mu4e-trash-folder . "Gmail-Personal-2/Trash"))) + (mu4e-trash-folder . "Gmail-Personal-2/Trash") + (mu4e-maildir-shortcuts . ( + ("/Gmail-Personal-2/Inbox" . ?i) + ("/Gmail-Personal-2/Sent Mail" . ?s) + ("/Gmail-Personal-2/Drafts" . ?d) + ) + ))) + )) ) #+end_src From 93d1c752616bb0d23439a9402023d0b864808664 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 24 Sep 2024 22:41:16 +0400 Subject: [PATCH 068/319] config/emacs: nvm --- config/emacs/emacs.org | 173 ++++++++++++++++++----------------------- 1 file changed, 77 insertions(+), 96 deletions(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 43bd71e4..cc94265d 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1153,120 +1153,101 @@ its over the machines took over guys can i get my likes now ** mu4e GNU patch review metho dor sometihng idk #+begin_src emacs-lisp - (use-package mu4e - :config + (use-package mu4e + :config - ;; mu4e syncing issue with isync - (setq mu4e-change-filenames-when-moving t) + ;; mu4e syncing issue with isync + (setq mu4e-change-filenames-when-moving t) - ;; sending mail - (setq message-send-mail-function 'smtpmail-send-it) + ;; sending mail + (setq message-send-mail-function 'smtpmail-send-it) - (setq mu4e-update-interval (* 10 60)) - (setq mu4e-get-mail-command "offlineimap") - (setq mu4e-maildir "~/Mail") + (setq mu4e-update-interval (* 10 60)) + (setq mu4e-get-mail-command "offlineimap") + (setq mu4e-maildir "~/Mail") - (setq outlook-mail-address - (string-trim (shell-command-to-string "pass Microsoft | awk 'BEGIN {ORS=\"\"} FNR == 2{gsub(\"login: \", \"\"); gsub(/ /, \"\"); print}'"))) + (setq outlook-mail-address + (string-trim (shell-command-to-string "pass Microsoft | awk 'BEGIN {ORS=\"\"} FNR == 2{gsub(\"login: \", \"\"); gsub(/ /, \"\"); print}'"))) - (defvar proton-mail-address nil) + (defvar proton-mail-address nil) - (defun get-proton-mail-address-from-pass (command) - "Execute COMMAND, concatenate its output with 'hello', and store it in my-greeting." - (let ((output (shell-command-to-string command))) - (setq output (string-trim output)) - (setq proton-mail-address (concat "@proton.me" output)))) + (defun get-proton-mail-address-from-pass (command) + "Execute COMMAND, concatenate its output with 'hello', and store it in my-greeting." + (let ((output (shell-command-to-string command))) + (setq output (string-trim output)) + (setq proton-mail-address (concat "@proton.me" output)))) - (get-proton-mail-address-from-pass "pass Proton\ Account | awk 'BEGIN {ORS=\"\"} FNR == 2{gsub(\"login: \", \"\"); gsub(/ /, \"\"); print}'") + (get-proton-mail-address-from-pass "pass Proton\ Account | awk 'BEGIN {ORS=\"\"} FNR == 2{gsub(\"login: \", \"\"); gsub(/ /, \"\"); print}'") - (setq gmail-1-mail-address - (string-trim (shell-command-to-string "pass accounts.google.com/one | awk 'BEGIN {ORS=\"\"} FNR == 2{gsub(\"login: \", \"\"); gsub(/ /, \"\"); print}'"))) + (setq gmail-1-mail-address + (string-trim (shell-command-to-string "pass accounts.google.com/one | awk 'BEGIN {ORS=\"\"} FNR == 2{gsub(\"login: \", \"\"); gsub(/ /, \"\"); print}'"))) - (setq gmail-2-mail-address - (string-trim (shell-command-to-string "pass accounts.google.com/two | awk 'BEGIN {ORS=\"\"} FNR == 2{gsub(\"login: \", \"\"); gsub(/ /, \"\"); print}'"))) + (setq gmail-2-mail-address + (string-trim (shell-command-to-string "pass accounts.google.com/two | awk 'BEGIN {ORS=\"\"} FNR == 2{gsub(\"login: \", \"\"); gsub(/ /, \"\"); print}'"))) - (setq mu4e-context-policy 'pick-first) - (setq mu4e-compose-context-policy 'always-ask) - (setq mu4e-contexts - (list - ;; outlook + (setq mu4e-context-policy 'pick-first) + (setq mu4e-compose-context-policy 'always-ask) + (setq mu4e-contexts + (list + ;; outlook + (make-mu4e-context + :name "Outlook" + :match-func + (lambda (msg) + (when msg + (string-prefix-p "/Outlook" (mu4e-message-field msg :maildir)))) + :vars `((user-mail-address . ,outlook-mail-address) + (user-full-name . "Sako") + (mu4e-drafts-folder . "/Outlook/Drafts") + (mu4e-sent-folder . "/Outlook/Sent") + (mu4e-refile-folder . "/Outlook/Inbox") + (mu4e-trash-folder . "/Outlook/Deleted") + ;; todo stmpmail and compose signatures + )) + (make-mu4e-context + :name "Proton" + :match-func + (lambda (msg) + (when msg + (string-prefix-p "/Proton" (mu4e-message-field msg :maildir)))) + :vars `((user-mail-address . ,proton-mail-address) + (user-full-name . "Sako") + (mu4e-drafts-folder . "/Proton/Drafts") + (mu4e-sent-folder . "/Proton/Sent") + (mu4e-refile-folder . "/Proton/Inbox") + (mu4e-trash-folder . "/Proton/Trash")) + ;; todo stmpmail and compose signatures + ) (make-mu4e-context - :name "Outlook" + :name "Gmail Personal 1" :match-func (lambda (msg) (when msg - (string-prefix-p "/Outlook" (mu4e-message-field msg :maildir)))) - :vars `((user-mail-address . ,outlook-mail-address) - (user-full-name . "Sako") - (mu4e-drafts-folder . "/Outlook/Drafts") - (mu4e-sent-folder . "/Outlook/Sent") - (mu4e-refile-folder . "/Outlook/Inbox") - (mu4e-trash-folder . "/Outlook/Deleted") - ;; todo stmpmail and compose signatures - (mu4e-maildir-shortcuts . ( - ("/Outlook/Inbox" . ?i) - ("/Outlook/Sent" . ?s) - ("/Outlook/Drafts" . ?d) - )))) + (string-prefix-p "/Gmail-Personal-1" (mu4e-message-field msg :maildir)))) + :vars `((user-mail-address . ,gmail-1-mail-address) + (user-full-name . "Sako") + (mu4e-drafts-folder . "/Gmail-Personal-1/Drafts") + (mu4e-sent-folder . "/Gmail-Personal-1/Sent Mail") + (mu4e-refile-folder . "/Gmail-Personal-1/Inbox") + (mu4e-trash-folder . "Gmail-Personal-1/Trash") + ;; todo stmpmail and compose signatures + )) (make-mu4e-context - :name "Proton" + :name "Second Personal Gmail" :match-func (lambda (msg) (when msg - (string-prefix-p "/Proton" (mu4e-message-field msg :maildir)))) - :vars `((user-mail-address . ,proton-mail-address) - (user-full-name . "Sako") - (mu4e-drafts-folder . "/Proton/Drafts") - (mu4e-sent-folder . "/Proton/Sent") - (mu4e-refile-folder . "/Proton/Inbox") - (mu4e-trash-folder . "/Proton/Trash")) - ;; todo stmpmail and compose signatures - (mu4e-maildir-shortcuts . ( - ("/Proton/Inbox" . ?i) - ("/Proton/Sent" . ?s) - ("/Proton/Drafts" . ?d) - ) - )) - (make-mu4e-context - :name "Gmail Personal 1" - :match-func - (lambda (msg) - (when msg - (string-prefix-p "/Gmail-Personal-1" (mu4e-message-field msg :maildir)))) - :vars `((user-mail-address . ,gmail-1-mail-address) - (user-full-name . "Sako") - (mu4e-drafts-folder . "/Gmail-Personal-1/Drafts") - (mu4e-sent-folder . "/Gmail-Personal-1/Sent Mail") - (mu4e-refile-folder . "/Gmail-Personal-1/Inbox") - (mu4e-trash-folder . "Gmail-Personal-1/Trash") - ;; todo stmpmail and compose signatures - (mu4e-maildir-shortcuts . ( - ("/Gmail-Personal-1/Inbox" . ?i) - ("/Gmail-Personal-1/Sent Mail" . ?s) - ("/Gmail-Personal-1/Drafts" . ?d) - ) - ))) - (make-mu4e-context - :name "Second Personal Gmail" - :match-func - (lambda (msg) - (when msg - (string-prefix-p "/Gmail-Personal-2" (mu4e-message-field msg :maildir)))) - :vars `((user-mail-address . ,gmail-2-mail-address) - (user-full-name . "Sako") - (mu4e-drafts-folder . "/Gmail-Personal-2/Drafts") - (mu4e-sent-folder . "/Gmail-Personal-2/Sent Mail") - (mu4e-refile-folder . "/Gmail-Personal-2/Inbox") - (mu4e-trash-folder . "Gmail-Personal-2/Trash") - (mu4e-maildir-shortcuts . ( - ("/Gmail-Personal-2/Inbox" . ?i) - ("/Gmail-Personal-2/Sent Mail" . ?s) - ("/Gmail-Personal-2/Drafts" . ?d) - ) - ))) - - )) - ) + (string-prefix-p "/Gmail-Personal-2" (mu4e-message-field msg :maildir)))) + :vars `((user-mail-address . ,gmail-2-mail-address) + (user-full-name . "Sako") + (mu4e-drafts-folder . "/Gmail-Personal-2/Drafts") + (mu4e-sent-folder . "/Gmail-Personal-2/Sent Mail") + (mu4e-refile-folder . "/Gmail-Personal-2/Inbox") + (mu4e-trash-folder . "Gmail-Personal-2/Trash") + )) + + )) + ) #+end_src * Org #+begin_src emacs-lisp From 8b25144db81010e708ccf1e5c78651105788d228 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 25 Sep 2024 06:37:41 +0400 Subject: [PATCH 069/319] config/emacs: offlineimap remove maxsyncaccounts --- config/emacs/.offlineimaprc | 1 - 1 file changed, 1 deletion(-) diff --git a/config/emacs/.offlineimaprc b/config/emacs/.offlineimaprc index 9ba9f511..ffec3266 100644 --- a/config/emacs/.offlineimaprc +++ b/config/emacs/.offlineimaprc @@ -2,7 +2,6 @@ pythonfile = ~/.offlineimap.py accounts = Proton, Outlook, Gmail-personal-1, Gmail-personal-2 socktimeout = 60 -maxsyncaccounts = 3 [Account Proton] localrepository = Proton-local From dfc4a689df5335a7cd2fec073fb1f6cabb0febd7 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 25 Sep 2024 06:41:33 +0400 Subject: [PATCH 070/319] modues/dev: i might try this again --- modules/dev/editors/emacs/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/dev/editors/emacs/default.nix b/modules/dev/editors/emacs/default.nix index 5aff8fd6..ff601f8e 100644 --- a/modules/dev/editors/emacs/default.nix +++ b/modules/dev/editors/emacs/default.nix @@ -108,7 +108,7 @@ in { # mu for email mu # email sync - # isync + isync # cyrus-sasl-xoauth2 offlineimap # oauth for microsoft From 4d8eb545cc8b3eb44cdfce482fd87365da7007cd Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 25 Sep 2024 08:07:24 +0400 Subject: [PATCH 071/319] config/emacs: uhhhh --- config/emacs/emacs.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index cc94265d..d77b4410 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1177,7 +1177,7 @@ GNU patch review metho dor sometihng idk (setq output (string-trim output)) (setq proton-mail-address (concat "@proton.me" output)))) - (get-proton-mail-address-from-pass "pass Proton\ Account | awk 'BEGIN {ORS=\"\"} FNR == 2{gsub(\"login: \", \"\"); gsub(/ /, \"\"); print}'") + (get-proton-mail-address-from-pass "pass Proton Account | awk 'BEGIN {ORS=\"\"} FNR == 2{gsub(\"login: \", \"\"); gsub(/ /, \"\"); print}'") (setq gmail-1-mail-address (string-trim (shell-command-to-string "pass accounts.google.com/one | awk 'BEGIN {ORS=\"\"} FNR == 2{gsub(\"login: \", \"\"); gsub(/ /, \"\"); print}'"))) From d235c7f66c131a881de0e179b22648ea27efd819 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 25 Sep 2024 09:44:48 +0400 Subject: [PATCH 072/319] dev/emacs: remove useless packages --- modules/dev/editors/emacs/default.nix | 4 ---- 1 file changed, 4 deletions(-) diff --git a/modules/dev/editors/emacs/default.nix b/modules/dev/editors/emacs/default.nix index ff601f8e..d1dfd70d 100644 --- a/modules/dev/editors/emacs/default.nix +++ b/modules/dev/editors/emacs/default.nix @@ -108,11 +108,7 @@ in { # mu for email mu # email sync - isync - # cyrus-sasl-xoauth2 offlineimap - # oauth for microsoft - oauth2ms # protonmail hydroxide # doc-view From 6a2a914ec4f144a4362853f46c21da14215b9445 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 25 Sep 2024 11:49:55 +0400 Subject: [PATCH 073/319] config/emacs: terrible --- config/emacs/emacs.org | 144 ++++++++++++++++++++++++++++++++++------- 1 file changed, 120 insertions(+), 24 deletions(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index d77b4410..6dee39df 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1153,41 +1153,137 @@ its over the machines took over guys can i get my likes now ** mu4e GNU patch review metho dor sometihng idk #+begin_src emacs-lisp - (use-package mu4e - :config + (use-package mu4e + :config - ;; mu4e syncing issue with isync - (setq mu4e-change-filenames-when-moving t) + ;; mu4e syncing issue with isync + (setq mu4e-change-filenames-when-moving t) - ;; sending mail - (setq message-send-mail-function 'smtpmail-send-it) + ;; sending mail + (setq message-send-mail-function 'smtpmail-send-it) - (setq mu4e-update-interval (* 10 60)) - (setq mu4e-get-mail-command "offlineimap") - (setq mu4e-maildir "~/Mail") - (setq outlook-mail-address + ;; refresh token for stmpmail + (cl-defmethod smtpmail-try-auth-method + (process (_mech (eql xoauth2)) user password) + (cond + ((or (equal user ,outlook-mail-address )) + ;; from https://github.com/UvA-FNWI/M365-IMAP/issues/3 + (let ((token (gethash "access_token" + (let ((url-request-method "POST") + (url-request-extra-headers `(("Content-Type" . "application/x-www-form-urlencoded"))) + (url-request-data (concat "client_id=" "9e5f94bc-e8a4-4e73-b8be-63364c29d753") + "&client_secret=" + "&refresh_token=" (password-store-get-field "Microsoft" "client_refresh_token") + "&grant_type=refresh_token"))) + (with-temp-buffer (url-insert-file-contents + "https://login.microsoftonline.com/common/oauth2/v2.0/token") + (json-parse-buffer :object-type 'hash-table))) + ))) + (smtpmail-command-or-throw + process + (concat "AUTH XOAUTH2 " + (base64-encode-string + (concat "user=" user "\1auth=Bearer " token "\1\1") t))))) + ((equal user ,gmail-1-mail-address) + (let ((token (gethash "access_token" + (let ((url-request-method "POST") + (url-request-extra-headers `(("Content-Type" . "application/x-www-form-urlencoded"))) + (url-request-data (concat "client_id=" (password-store-get-field "email/oauth/gmail" "client_id") + "&client_secret=" (password-store-get-field "email/oauth/gmail" "client_secret") + "&refresh_token=" (password-store-get-field "accounts.google.com/one" "client_refresh_token") + "&grant_type=refresh_token"))) + (with-temp-buffer (url-insert-file-contents + "https://oauth2.googleapis.com/token") + (json-parse-buffer :object-type 'hash-table))) + ))) + (smtpmail-command-or-throw + process + (concat "AUTH XOAUTH2 " + (base64-encode-string + (concat "user=" user "\1auth=Bearer " token "\1\1") t))))) + ((equal user ,gmail-2-mail-address) + (let ((token (gethash "access_token" + (let ((url-request-method "POST") + (url-request-extra-headers `(("Content-Type" . "application/x-www-form-urlencoded"))) + (url-request-data (concat "client_id=" (password-store-get-field "email/oauth/gmail" "client_id") + "&client_secret=" (password-store-get-field "email/oauth/gmail" "client_secret") + "&refresh_token=" (password-store-get-field "accounts.google.com/two" "client_refresh_token") + "&grant_type=refresh_token"))) + (with-temp-buffer (url-insert-file-contents + "https://oauth2.googleapis.com/token") + (json-parse-buffer :object-type 'hash-table))) + ))) + (smtpmail-command-or-throw + process + (concat "AUTH XOAUTH2 " + (base64-encode-string + (concat "user=" user "\1auth=Bearer " token "\1\1") t))))) + ((equal user ,gmail-1-mail-address) + (let ((token (gethash "access_token" + (let ((url-request-method "POST") + (url-request-extra-headers `(("Content-Type" . "application/x-www-form-urlencoded"))) + (url-request-data (concat "client_id=" (password-store-get-field "email/oauth/gmail" "client_id") + "&client_secret=" (password-store-get-field "email/oauth/gmail" "client_secret") + "&refresh_token=" (password-store-get-field "accounts.google.com/two" "client_refresh_token") + "&grant_type=refresh_token"))) + (with-temp-buffer (url-insert-file-contents + "https://oauth2.googleapis.com/token") + (json-parse-buffer :object-type 'hash-table))) + ))) + (smtpmail-command-or-throw + process + (concat "AUTH XOAUTH2 " + (base64-encode-string + (concat "user=" user "\1auth=Bearer " token "\1\1") t))))) + ((equal user ,gmail-2-mail-address) + (let ((token (gethash "access_token" + (let ((url-request-method "POST") + (url-request-extra-headers `(("Content-Type" . "application/x-www-form-urlencoded"))) + (url-request-data (concat "client_id=" (password-store-get-field "email/oauth/gmail" "client_id") + "&client_secret=" (password-store-get-field "email/oauth/gmail" "client_secret") + "&refresh_token=" (password-store-get-field "accounts.google.com/one" "client_refresh_token") + "&grant_type=refresh_token"))) + (with-temp-buffer (url-insert-file-contents + "https://oauth2.googleapis.com/token") + (json-parse-buffer :object-type 'hash-table))) + ))) + (smtpmail-command-or-throw + process + (concat "AUTH XOAUTH2 " + (base64-encode-string + (concat "user=" user "\1auth=Bearer " token "\1\1") t))))) + (t nil))) + + + + + (setq mu4e-update-interval (* 10 60)) + (setq mu4e-get-mail-command "offlineimap") + (setq mu4e-maildir "~/Mail") + + (setq outlook-mail-address (string-trim (shell-command-to-string "pass Microsoft | awk 'BEGIN {ORS=\"\"} FNR == 2{gsub(\"login: \", \"\"); gsub(/ /, \"\"); print}'"))) - (defvar proton-mail-address nil) + (defvar proton-mail-address nil) - (defun get-proton-mail-address-from-pass (command) - "Execute COMMAND, concatenate its output with 'hello', and store it in my-greeting." - (let ((output (shell-command-to-string command))) - (setq output (string-trim output)) - (setq proton-mail-address (concat "@proton.me" output)))) + (defun get-proton-mail-address-from-pass (command) + "Execute COMMAND, concatenate its output with 'hello', and store it in my-greeting." + (let ((output (shell-command-to-string command))) + (setq output (string-trim output)) + (setq proton-mail-address (concat "@proton.me" output)))) - (get-proton-mail-address-from-pass "pass Proton Account | awk 'BEGIN {ORS=\"\"} FNR == 2{gsub(\"login: \", \"\"); gsub(/ /, \"\"); print}'") + (get-proton-mail-address-from-pass "pass 'Proton Account' | awk 'BEGIN {ORS=\"\"} FNR == 2{gsub(\"login: \", \"\"); gsub(/ /, \"\"); print}'") - (setq gmail-1-mail-address + (setq gmail-1-mail-address (string-trim (shell-command-to-string "pass accounts.google.com/one | awk 'BEGIN {ORS=\"\"} FNR == 2{gsub(\"login: \", \"\"); gsub(/ /, \"\"); print}'"))) - (setq gmail-2-mail-address + (setq gmail-2-mail-address (string-trim (shell-command-to-string "pass accounts.google.com/two | awk 'BEGIN {ORS=\"\"} FNR == 2{gsub(\"login: \", \"\"); gsub(/ /, \"\"); print}'"))) - (setq mu4e-context-policy 'pick-first) - (setq mu4e-compose-context-policy 'always-ask) - (setq mu4e-contexts + (setq mu4e-context-policy 'pick-first) + (setq mu4e-compose-context-policy 'always-ask) + (setq mu4e-contexts (list ;; outlook (make-mu4e-context @@ -1203,7 +1299,7 @@ GNU patch review metho dor sometihng idk (mu4e-refile-folder . "/Outlook/Inbox") (mu4e-trash-folder . "/Outlook/Deleted") ;; todo stmpmail and compose signatures - )) + )) (make-mu4e-context :name "Proton" :match-func @@ -1247,7 +1343,7 @@ GNU patch review metho dor sometihng idk )) )) - ) + ) #+end_src * Org #+begin_src emacs-lisp From feb403f6b82f041e139d0e19f2364c1a5911d319 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 25 Sep 2024 11:51:13 +0400 Subject: [PATCH 074/319] config/emacs: paren hell --- config/emacs/emacs.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 6dee39df..210b0041 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1253,7 +1253,7 @@ GNU patch review metho dor sometihng idk (concat "AUTH XOAUTH2 " (base64-encode-string (concat "user=" user "\1auth=Bearer " token "\1\1") t))))) - (t nil))) + (t nil)) From a0b28b81019ad173414fa08aa66a8bacad5c624f Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 25 Sep 2024 12:03:26 +0400 Subject: [PATCH 075/319] config/emacs: nvm lmao --- config/emacs/emacs.org | 96 ------------------------------------------ 1 file changed, 96 deletions(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 210b0041..f1cc9281 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1162,102 +1162,6 @@ GNU patch review metho dor sometihng idk ;; sending mail (setq message-send-mail-function 'smtpmail-send-it) - - ;; refresh token for stmpmail - (cl-defmethod smtpmail-try-auth-method - (process (_mech (eql xoauth2)) user password) - (cond - ((or (equal user ,outlook-mail-address )) - ;; from https://github.com/UvA-FNWI/M365-IMAP/issues/3 - (let ((token (gethash "access_token" - (let ((url-request-method "POST") - (url-request-extra-headers `(("Content-Type" . "application/x-www-form-urlencoded"))) - (url-request-data (concat "client_id=" "9e5f94bc-e8a4-4e73-b8be-63364c29d753") - "&client_secret=" - "&refresh_token=" (password-store-get-field "Microsoft" "client_refresh_token") - "&grant_type=refresh_token"))) - (with-temp-buffer (url-insert-file-contents - "https://login.microsoftonline.com/common/oauth2/v2.0/token") - (json-parse-buffer :object-type 'hash-table))) - ))) - (smtpmail-command-or-throw - process - (concat "AUTH XOAUTH2 " - (base64-encode-string - (concat "user=" user "\1auth=Bearer " token "\1\1") t))))) - ((equal user ,gmail-1-mail-address) - (let ((token (gethash "access_token" - (let ((url-request-method "POST") - (url-request-extra-headers `(("Content-Type" . "application/x-www-form-urlencoded"))) - (url-request-data (concat "client_id=" (password-store-get-field "email/oauth/gmail" "client_id") - "&client_secret=" (password-store-get-field "email/oauth/gmail" "client_secret") - "&refresh_token=" (password-store-get-field "accounts.google.com/one" "client_refresh_token") - "&grant_type=refresh_token"))) - (with-temp-buffer (url-insert-file-contents - "https://oauth2.googleapis.com/token") - (json-parse-buffer :object-type 'hash-table))) - ))) - (smtpmail-command-or-throw - process - (concat "AUTH XOAUTH2 " - (base64-encode-string - (concat "user=" user "\1auth=Bearer " token "\1\1") t))))) - ((equal user ,gmail-2-mail-address) - (let ((token (gethash "access_token" - (let ((url-request-method "POST") - (url-request-extra-headers `(("Content-Type" . "application/x-www-form-urlencoded"))) - (url-request-data (concat "client_id=" (password-store-get-field "email/oauth/gmail" "client_id") - "&client_secret=" (password-store-get-field "email/oauth/gmail" "client_secret") - "&refresh_token=" (password-store-get-field "accounts.google.com/two" "client_refresh_token") - "&grant_type=refresh_token"))) - (with-temp-buffer (url-insert-file-contents - "https://oauth2.googleapis.com/token") - (json-parse-buffer :object-type 'hash-table))) - ))) - (smtpmail-command-or-throw - process - (concat "AUTH XOAUTH2 " - (base64-encode-string - (concat "user=" user "\1auth=Bearer " token "\1\1") t))))) - ((equal user ,gmail-1-mail-address) - (let ((token (gethash "access_token" - (let ((url-request-method "POST") - (url-request-extra-headers `(("Content-Type" . "application/x-www-form-urlencoded"))) - (url-request-data (concat "client_id=" (password-store-get-field "email/oauth/gmail" "client_id") - "&client_secret=" (password-store-get-field "email/oauth/gmail" "client_secret") - "&refresh_token=" (password-store-get-field "accounts.google.com/two" "client_refresh_token") - "&grant_type=refresh_token"))) - (with-temp-buffer (url-insert-file-contents - "https://oauth2.googleapis.com/token") - (json-parse-buffer :object-type 'hash-table))) - ))) - (smtpmail-command-or-throw - process - (concat "AUTH XOAUTH2 " - (base64-encode-string - (concat "user=" user "\1auth=Bearer " token "\1\1") t))))) - ((equal user ,gmail-2-mail-address) - (let ((token (gethash "access_token" - (let ((url-request-method "POST") - (url-request-extra-headers `(("Content-Type" . "application/x-www-form-urlencoded"))) - (url-request-data (concat "client_id=" (password-store-get-field "email/oauth/gmail" "client_id") - "&client_secret=" (password-store-get-field "email/oauth/gmail" "client_secret") - "&refresh_token=" (password-store-get-field "accounts.google.com/one" "client_refresh_token") - "&grant_type=refresh_token"))) - (with-temp-buffer (url-insert-file-contents - "https://oauth2.googleapis.com/token") - (json-parse-buffer :object-type 'hash-table))) - ))) - (smtpmail-command-or-throw - process - (concat "AUTH XOAUTH2 " - (base64-encode-string - (concat "user=" user "\1auth=Bearer " token "\1\1") t))))) - (t nil)) - - - - (setq mu4e-update-interval (* 10 60)) (setq mu4e-get-mail-command "offlineimap") (setq mu4e-maildir "~/Mail") From bb7e14fba74bf35e0215e671bfcced360918e43c Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 25 Sep 2024 22:05:55 +0400 Subject: [PATCH 076/319] pin emacs-overlay for now --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 9dc9d51b..fe3974a4 100644 --- a/flake.nix +++ b/flake.nix @@ -21,7 +21,7 @@ inputs.nixpkgs.follows = "nixpkgs"; }; emacs-overlay = { - url = "github:nix-community/emacs-overlay"; + url = "github:nix-community/emacs-overlay/0442d57ffa83985ec2ffaec95db9c0fe742f5182"; }; ags = { url = "github:Aylur/ags"; From a2cf30e9d103c5797c3e0c68c70bea6df72815fe Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 25 Sep 2024 22:08:49 +0400 Subject: [PATCH 077/319] nix flake update --- flake.lock | 101 +++++++++++++++++++++++++++++------------------------ 1 file changed, 55 insertions(+), 46 deletions(-) diff --git a/flake.lock b/flake.lock index b644d5f5..b4358281 100644 --- a/flake.lock +++ b/flake.lock @@ -9,11 +9,11 @@ ] }, "locked": { - "lastModified": 1725358307, - "narHash": "sha256-su/Nzp2X8JlaD9wPYQGXeTilaVa5H06X7A3kqCLJNuo=", + "lastModified": 1727091786, + "narHash": "sha256-n36Vtdtx7tTTKFI9aoWxdNIlJ2dwxoitFDwcPXrS+Jk=", "owner": "nix-community", "repo": "NixOS-WSL", - "rev": "8a89995f745b1a9029d654c391a0f62ca03f7fe7", + "rev": "1fcec53c692c15091ca5bb9eaf86a2cac6c53278", "type": "github" }, "original": { @@ -30,11 +30,11 @@ "systems": "systems_2" }, "locked": { - "lastModified": 1721306136, - "narHash": "sha256-VKPsIGf3/a+RONBipx4lEE4LXG2sdMNkWQu22LNQItg=", + "lastModified": 1725841979, + "narHash": "sha256-SXYqzpHPuXFR6w/cUKo3VN8XRn6XA2mGbdRXs9oLk6k=", "owner": "Aylur", "repo": "ags", - "rev": "344ea72cd3b8d4911f362fec34bce7d8fb37028c", + "rev": "aaef50bb2c80ef4b4a359329d72669a95e7c4796", "type": "github" }, "original": { @@ -63,11 +63,11 @@ ] }, "locked": { - "lastModified": 1725199881, - "narHash": "sha256-jsmipf/u1GFZE5tBUkr56CHMN6VpUWCAjfLIhvQijU0=", + "lastModified": 1726665257, + "narHash": "sha256-rEzEZtd3iyVo5RJ1OGujOlnywNf3gsrOnjAn1NLciD4=", "owner": "hyprwm", "repo": "aquamarine", - "rev": "f8a687dd29ff019657498f1bd14da2fbbf0e604b", + "rev": "752d0fbd141fabb5a1e7f865199b80e6e76f8d8e", "type": "github" }, "original": { @@ -93,6 +93,7 @@ "original": { "owner": "nix-community", "repo": "emacs-overlay", + "rev": "0442d57ffa83985ec2ffaec95db9c0fe742f5182", "type": "github" } }, @@ -117,11 +118,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", "type": "github" }, "original": { @@ -155,11 +156,11 @@ ] }, "locked": { - "lastModified": 1725694918, - "narHash": "sha256-+HsjshXpqNiJHLaJaK0JnIicJ/a1NquKcfn4YZ3ILgg=", + "lastModified": 1727246346, + "narHash": "sha256-TcUaKtya339Asu+g6KTJ8h7KiKcKXKp2V+At+7tksyY=", "owner": "nix-community", "repo": "home-manager", - "rev": "aaebdea769a5c10f1c6e50ebdf5924c1a13f0cda", + "rev": "1e22ef1518fb175d762006f9cae7f6312b8caedb", "type": "github" }, "original": { @@ -209,11 +210,11 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1725667615, - "narHash": "sha256-ksmD1gNS/AX4qHvcCS7u+agvB+0fg2wCukFr3Hy4A3I=", + "lastModified": 1727257173, + "narHash": "sha256-J4VU76LLWEILNTZ8osUaUxSny+cTUH/wCKcV+Lqr3Bw=", "ref": "refs/heads/main", - "rev": "0500213086f8402ccbdb2acb4748dbc6d22e21f6", - "revCount": 5192, + "rev": "8b86ee8bf08eaf8b57d0a7f12af876216323cc3d", + "revCount": 5257, "submodules": true, "type": "git", "url": "https://github.com/hyprwm/Hyprland" @@ -267,11 +268,11 @@ ] }, "locked": { - "lastModified": 1725188252, - "narHash": "sha256-yBH8c4GDaEAtBrh+BqIlrx5vp6gG/Gu8fQQK63KAQgs=", + "lastModified": 1725997860, + "narHash": "sha256-d/rZ/fHR5l1n7PeyLw0StWMNLXVU9c4HFyfskw568so=", "owner": "hyprwm", "repo": "hyprlang", - "rev": "c12ab785ce1982f82594aff03b3104c598186ddd", + "rev": "dfeb5811dd6485490cce18d6cc1e38a055eea876", "type": "github" }, "original": { @@ -343,11 +344,11 @@ ] }, "locked": { - "lastModified": 1724966483, - "narHash": "sha256-WXDgKIbzjYKczxSZOsJplCS1i1yrTUpsDPuJV/xpYLo=", + "lastModified": 1727219120, + "narHash": "sha256-wmT+JpnDk6EjgASU2VGfS0nnu6oKA4Cw25o5fzpDD/Q=", "owner": "hyprwm", "repo": "hyprutils", - "rev": "8976e3f6a5357da953a09511d0c7f6a890fb6ec2", + "rev": "db956287d3aa194dda91d05c8eb286de2a569edf", "type": "github" }, "original": { @@ -393,11 +394,11 @@ ] }, "locked": { - "lastModified": 1721324119, - "narHash": "sha256-SOOqIT27/X792+vsLSeFdrNTF+OSRp5qXv6Te+fb2Qg=", + "lastModified": 1726840673, + "narHash": "sha256-HIPEXyRRVZoqD6U+lFS1B0tsIU7p83FaB9m7KT/x6mQ=", "owner": "hyprwm", "repo": "hyprwayland-scanner", - "rev": "a048a6cb015340bd82f97c1f40a4b595ca85cc30", + "rev": "b68dab23fc922eae99306988133ee80a40b39ca5", "type": "github" }, "original": { @@ -465,11 +466,11 @@ }, "nixpkgs-stable_2": { "locked": { - "lastModified": 1725407940, - "narHash": "sha256-tiN5Rlg/jiY0tyky+soJZoRzLKbPyIdlQ77xVgREDNM=", + "lastModified": 1727129439, + "narHash": "sha256-nPyrcFm6FSk7CxzVW4x2hu62aLDghNcv9dX6DF3dXw8=", "owner": "nixos", "repo": "nixpkgs", - "rev": "6f6c45b5134a8ee2e465164811e451dcb5ad86e3", + "rev": "babc25a577c3310cce57c72d5bed70f4c3c3843a", "type": "github" }, "original": { @@ -481,11 +482,11 @@ }, "nixpkgs-stable_3": { "locked": { - "lastModified": 1721524707, - "narHash": "sha256-5NctRsoE54N86nWd0psae70YSLfrOek3Kv1e8KoXe/0=", + "lastModified": 1725762081, + "narHash": "sha256-vNv+aJUW5/YurRy1ocfvs4q/48yVESwlC/yHzjkZSP8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "556533a23879fc7e5f98dd2e0b31a6911a213171", + "rev": "dc454045f5b5d814e5862a6d057e7bb5c29edc05", "type": "github" }, "original": { @@ -497,11 +498,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1725103162, - "narHash": "sha256-Ym04C5+qovuQDYL/rKWSR+WESseQBbNAe5DsXNx5trY=", + "lastModified": 1726755586, + "narHash": "sha256-PmUr/2GQGvFTIJ6/Tvsins7Q43KTMvMFhvG6oaYK+Wk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "12228ff1752d7b7624a54e9c1af4b222b3c1073b", + "rev": "c04d5652cfa9742b1d519688f65d1bbccea9eb7e", "type": "github" }, "original": { @@ -529,11 +530,11 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1725432240, - "narHash": "sha256-+yj+xgsfZaErbfYM3T+QvEE2hU7UuE+Jf0fJCJ8uPS0=", + "lastModified": 1726937504, + "narHash": "sha256-bvGoiQBvponpZh8ClUcmJ6QnsNKw0EMrCQJARK3bI1c=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "ad416d066ca1222956472ab7d0555a6946746a80", + "rev": "9357f4f23713673f310988025d9dc261c20e70c6", "type": "github" }, "original": { @@ -564,11 +565,11 @@ "nixpkgs-stable": "nixpkgs-stable_3" }, "locked": { - "lastModified": 1725540166, - "narHash": "sha256-htc9rsTMSAY5ek+DB3tpntdD/es0eam2hJgO92bWSys=", + "lastModified": 1726524647, + "narHash": "sha256-qis6BtOOBBEAfUl7FMHqqTwRLB61OL5OFzIsOmRz2J4=", "owner": "Mic92", "repo": "sops-nix", - "rev": "d9d781523a1463965cd1e1333a306e70d9feff07", + "rev": "e2d404a7ea599a013189aa42947f66cede0645c8", "type": "github" }, "original": { @@ -659,6 +660,14 @@ "hyprland", "hyprlang" ], + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "hyprwayland-scanner": [ + "hyprland", + "hyprwayland-scanner" + ], "nixpkgs": [ "hyprland", "nixpkgs" @@ -669,11 +678,11 @@ ] }, "locked": { - "lastModified": 1725203932, - "narHash": "sha256-VLULC/OnI+6R9KEP2OIGk+uLJJsfRlaLouZ5gyFd2+Y=", + "lastModified": 1727109343, + "narHash": "sha256-1PFckA8Im7wMSl26okwOKqBZeCFLD3LvZZFaxswDhbY=", "owner": "hyprwm", "repo": "xdg-desktop-portal-hyprland", - "rev": "2425e8f541525fa7409d9f26a8ffaf92a3767251", + "rev": "4adb6c4c41ee5014bfe608123bfeddb26e5f5cea", "type": "github" }, "original": { From 68be4f403930fc620bb6a6d068bd06f77493230e Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 25 Sep 2024 22:09:09 +0400 Subject: [PATCH 078/319] comment out blender overlay --- overlays/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/overlays/default.nix b/overlays/default.nix index 2a1c2cd5..7eefd3a1 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -38,9 +38,9 @@ isync = prev.isync.overrideAttrs (old: { withCyrusSaslXoauth2 = true; }); - blender = prev.blender.overrideAttrs (old: { - nativeBuildInputs = (old.nativeBuildInputs or []) ++ [ inputs.nixpkgs.legacyPackages.x86_64-linux.pkg-config inputs.nixpkgs.legacyPackages.x86_64-linux.wayland-scanner ]; - }); + # blender = prev.blender.overrideAttrs (old: { + # nativeBuildInputs = (old.nativeBuildInputs or []) ++ [ inputs.nixpkgs.legacyPackages.x86_64-linux.pkg-config inputs.nixpkgs.legacyPackages.x86_64-linux.wayland-scanner ]; + # }); }; # incase something breaks From 0a0694a48e97687aee35bcaf7c50ec8757a07ed9 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Thu, 26 Sep 2024 08:37:54 +0400 Subject: [PATCH 079/319] flake.nix: add agenix --- flake.lock | 130 ++++++++++++++++++++++++++++++++++++++++++++++------- flake.nix | 2 + 2 files changed, 115 insertions(+), 17 deletions(-) diff --git a/flake.lock b/flake.lock index b4358281..61cabe3f 100644 --- a/flake.lock +++ b/flake.lock @@ -22,12 +22,33 @@ "type": "github" } }, + "agenix": { + "inputs": { + "darwin": "darwin", + "home-manager": "home-manager", + "nixpkgs": "nixpkgs", + "systems": "systems_2" + }, + "locked": { + "lastModified": 1723293904, + "narHash": "sha256-b+uqzj+Wa6xgMS9aNbX4I+sXeb5biPDi39VgvSFqFvU=", + "owner": "ryantm", + "repo": "agenix", + "rev": "f6291c5935fdc4e0bef208cfc0dcab7e3f7a1c41", + "type": "github" + }, + "original": { + "owner": "ryantm", + "repo": "agenix", + "type": "github" + } + }, "ags": { "inputs": { "nixpkgs": [ "nixpkgs" ], - "systems": "systems_2" + "systems": "systems_3" }, "locked": { "lastModified": 1725841979, @@ -76,10 +97,32 @@ "type": "github" } }, + "darwin": { + "inputs": { + "nixpkgs": [ + "agenix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1700795494, + "narHash": "sha256-gzGLZSiOhf155FW7262kdHo2YDeugp3VuIFb4/GGng0=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "4b9b83d5a92e8c1fbfd8eb27eda375908c11ec4d", + "type": "github" + }, + "original": { + "owner": "lnl7", + "ref": "master", + "repo": "nix-darwin", + "type": "github" + } + }, "emacs-overlay": { "inputs": { "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs", + "nixpkgs": "nixpkgs_2", "nixpkgs-stable": "nixpkgs-stable" }, "locked": { @@ -133,7 +176,7 @@ }, "flake-utils_2": { "inputs": { - "systems": "systems_3" + "systems": "systems_4" }, "locked": { "lastModified": 1710146030, @@ -150,6 +193,27 @@ } }, "home-manager": { + "inputs": { + "nixpkgs": [ + "agenix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1703113217, + "narHash": "sha256-7ulcXOk63TIT2lVDSExj7XzFx09LpdSAPtvgtM7yQPE=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "3bfaacf46133c037bb356193bd2f1765d9dc82c1", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "home-manager_2": { "inputs": { "nixpkgs": [ "nixpkgs" @@ -205,8 +269,8 @@ "hyprlang": "hyprlang", "hyprutils": "hyprutils", "hyprwayland-scanner": "hyprwayland-scanner", - "nixpkgs": "nixpkgs_2", - "systems": "systems_4", + "nixpkgs": "nixpkgs_3", + "systems": "systems_5", "xdph": "xdph" }, "locked": { @@ -315,8 +379,8 @@ "hyprlang": "hyprlang_2", "hyprutils": "hyprutils_2", "hyprwayland-scanner": "hyprwayland-scanner_2", - "nixpkgs": "nixpkgs_3", - "systems": "systems_5" + "nixpkgs": "nixpkgs_4", + "systems": "systems_6" }, "locked": { "lastModified": 1725200438, @@ -434,11 +498,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1725432240, - "narHash": "sha256-+yj+xgsfZaErbfYM3T+QvEE2hU7UuE+Jf0fJCJ8uPS0=", + "lastModified": 1703013332, + "narHash": "sha256-+tFNwMvlXLbJZXiMHqYq77z/RfmpfpiI3yjL6o/Zo9M=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "ad416d066ca1222956472ab7d0555a6946746a80", + "rev": "54aac082a4d9bb5bbc5c4e899603abfb76a3f6d6", "type": "github" }, "original": { @@ -497,6 +561,22 @@ } }, "nixpkgs_2": { + "locked": { + "lastModified": 1725432240, + "narHash": "sha256-+yj+xgsfZaErbfYM3T+QvEE2hU7UuE+Jf0fJCJ8uPS0=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "ad416d066ca1222956472ab7d0555a6946746a80", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1726755586, "narHash": "sha256-PmUr/2GQGvFTIJ6/Tvsins7Q43KTMvMFhvG6oaYK+Wk=", @@ -512,7 +592,7 @@ "type": "github" } }, - "nixpkgs_3": { + "nixpkgs_4": { "locked": { "lastModified": 1725103162, "narHash": "sha256-Ym04C5+qovuQDYL/rKWSR+WESseQBbNAe5DsXNx5trY=", @@ -528,7 +608,7 @@ "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_5": { "locked": { "lastModified": 1726937504, "narHash": "sha256-bvGoiQBvponpZh8ClUcmJ6QnsNKw0EMrCQJARK3bI1c=", @@ -547,12 +627,13 @@ "root": { "inputs": { "NixOS-WSL": "NixOS-WSL", + "agenix": "agenix", "ags": "ags", "emacs-overlay": "emacs-overlay", - "home-manager": "home-manager", + "home-manager": "home-manager_2", "hyprland": "hyprland", "hyprpaper": "hyprpaper", - "nixpkgs": "nixpkgs_4", + "nixpkgs": "nixpkgs_5", "nixpkgs-stable": "nixpkgs-stable_2", "sops-nix": "sops-nix" } @@ -594,6 +675,21 @@ } }, "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_3": { "locked": { "lastModified": 1689347949, "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", @@ -608,7 +704,7 @@ "type": "github" } }, - "systems_3": { + "systems_4": { "locked": { "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", @@ -623,7 +719,7 @@ "type": "github" } }, - "systems_4": { + "systems_5": { "locked": { "lastModified": 1689347949, "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", @@ -638,7 +734,7 @@ "type": "github" } }, - "systems_5": { + "systems_6": { "locked": { "lastModified": 1689347949, "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", diff --git a/flake.nix b/flake.nix index fe3974a4..055cf243 100644 --- a/flake.nix +++ b/flake.nix @@ -20,6 +20,7 @@ url = "github:Mic92/sops-nix"; inputs.nixpkgs.follows = "nixpkgs"; }; + agenix.url = "github:ryantm/agenix"; emacs-overlay = { url = "github:nix-community/emacs-overlay/0442d57ffa83985ec2ffaec95db9c0fe742f5182"; }; @@ -41,6 +42,7 @@ hyprland, hyprpaper, ags, + agenix, ... } @ inputs: let inherit (self) outputs; From 2a15d327fa0317b7f53169b91ffc93b815b3e404 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Thu, 26 Sep 2024 08:44:35 +0400 Subject: [PATCH 080/319] flake.nix: enable agenix for sakotop --- flake.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/flake.nix b/flake.nix index 055cf243..0c83d52e 100644 --- a/flake.nix +++ b/flake.nix @@ -78,6 +78,7 @@ ./default.nix ./hosts/sakotop/configuration.nix sops-nix.nixosModules.sops + agenix.nixosModues.default ]; }; sakopc = nixpkgs.lib.nixosSystem { From 03f82e2c63ddaa075f31b367aa710ffe944ad962 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Thu, 26 Sep 2024 10:02:15 +0400 Subject: [PATCH 081/319] modules/wireguard: add openresolv because wg-quick moment nixos --- modules/desktop/wireguard/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/desktop/wireguard/default.nix b/modules/desktop/wireguard/default.nix index 0120a996..1078fd4e 100644 --- a/modules/desktop/wireguard/default.nix +++ b/modules/desktop/wireguard/default.nix @@ -16,5 +16,10 @@ in { config = lib.mkIf cfg.enable { # todo declaritivly setting it up networking.wireguard.enable = true; + + environment.systemPackages = with pkgs; [ + openresolv + ]; + }; } From 2cb23af3831be343305b6a9ed786346ddd012c2a Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Thu, 26 Sep 2024 10:04:28 +0400 Subject: [PATCH 082/319] flake.nix: typo --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 0c83d52e..5cc149d0 100644 --- a/flake.nix +++ b/flake.nix @@ -78,7 +78,7 @@ ./default.nix ./hosts/sakotop/configuration.nix sops-nix.nixosModules.sops - agenix.nixosModues.default + agenix.nixosModules.default ]; }; sakopc = nixpkgs.lib.nixosSystem { From f09d3e0c35bc366198937b59a5a0282c5cb8a391 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Thu, 26 Sep 2024 11:58:40 +0400 Subject: [PATCH 083/319] bro --- modules/dev/editors/emacs/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/dev/editors/emacs/default.nix b/modules/dev/editors/emacs/default.nix index d1dfd70d..b141a1aa 100644 --- a/modules/dev/editors/emacs/default.nix +++ b/modules/dev/editors/emacs/default.nix @@ -115,7 +115,7 @@ in { unoconv # org to pdf # this might be bloat... - texliveMinimal + texliveSmall # lsp emacs-lsp-booster # zenity-color-picker From 9890e8eeffafbc0b61b61cdb2ee453f15523aab0 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Thu, 26 Sep 2024 12:03:33 +0400 Subject: [PATCH 084/319] for the love of GOD --- modules/dev/editors/emacs/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/dev/editors/emacs/default.nix b/modules/dev/editors/emacs/default.nix index b141a1aa..1ebb727d 100644 --- a/modules/dev/editors/emacs/default.nix +++ b/modules/dev/editors/emacs/default.nix @@ -115,7 +115,7 @@ in { unoconv # org to pdf # this might be bloat... - texliveSmall + texliveFull # lsp emacs-lsp-booster # zenity-color-picker From 7fe732ac736cb4bc6fc7a0d9b5bd90107886d4a1 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Thu, 26 Sep 2024 13:28:18 +0400 Subject: [PATCH 085/319] desktop/wireguard: ?????? --- modules/desktop/wireguard/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/desktop/wireguard/default.nix b/modules/desktop/wireguard/default.nix index 1078fd4e..3f77616e 100644 --- a/modules/desktop/wireguard/default.nix +++ b/modules/desktop/wireguard/default.nix @@ -17,7 +17,7 @@ in { # todo declaritivly setting it up networking.wireguard.enable = true; - environment.systemPackages = with pkgs; [ + users.users.sako.packages = with pkgs; [ openresolv ]; From d3efb6c5c80448b012a453b3a4ce511fcca221c8 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Thu, 26 Sep 2024 13:45:56 +0400 Subject: [PATCH 086/319] please --- modules/dev/editors/emacs/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/dev/editors/emacs/default.nix b/modules/dev/editors/emacs/default.nix index 1ebb727d..050b8343 100644 --- a/modules/dev/editors/emacs/default.nix +++ b/modules/dev/editors/emacs/default.nix @@ -115,7 +115,7 @@ in { unoconv # org to pdf # this might be bloat... - texliveFull + texliveMedium # lsp emacs-lsp-booster # zenity-color-picker From 5ef4e7c7d33222fb43917a79873bb2673155914a Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Thu, 26 Sep 2024 20:01:32 +0400 Subject: [PATCH 087/319] oik --- config/emacs/emacs.org | 2 -- 1 file changed, 2 deletions(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index f1cc9281..11f6a3cf 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -13,9 +13,7 @@ (setq package-archives `(("mepla" . "https://melpa.org/packages/") ("org" . "https://orgmode.org/elpa/") ("elpa" . "https://elpa.gnu.org/packages/"))) - (package-initialize) - (unless (package-installed-p 'use-package) (progn (package-refresh-contents) From 6aea3cd3b5ea491508469ea937ccc48b88549b31 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Thu, 26 Sep 2024 20:46:14 +0400 Subject: [PATCH 088/319] hardware/pipewire: enable jack because ardour? --- modules/hardware/pipewire/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/hardware/pipewire/default.nix b/modules/hardware/pipewire/default.nix index db0333d7..ce680e42 100644 --- a/modules/hardware/pipewire/default.nix +++ b/modules/hardware/pipewire/default.nix @@ -23,6 +23,7 @@ in enable = true; alsa.enable = true; alsa.support32Bit = true; + jack.enable = true; pulse.enable = true; }; From 1a08fa63d0f439b469c9f9e911a1714e56f96482 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Thu, 26 Sep 2024 20:47:58 +0400 Subject: [PATCH 089/319] desktop/media: init ardour --- modules/desktop/media/ardour/default.nix | 15 +++++++++++++++ modules/desktop/media/default.nix | 1 + 2 files changed, 16 insertions(+) create mode 100644 modules/desktop/media/ardour/default.nix diff --git a/modules/desktop/media/ardour/default.nix b/modules/desktop/media/ardour/default.nix new file mode 100644 index 00000000..f47b9069 --- /dev/null +++ b/modules/desktop/media/ardour/default.nix @@ -0,0 +1,15 @@ +{ outputs, options, config, lib, pkgs, ...}: +let + cfg = config.modules.desktop.media.ardour; +in +{ + options.modules.desktop.media.ardour = { + enable = lib.mkEnableOption false; + }; + + config = lib.mkIf cfg.enable { + users.users.sako.packages = with pkgs; [ + ardour + ]; + }; +} diff --git a/modules/desktop/media/default.nix b/modules/desktop/media/default.nix index 8c705539..3c37e70f 100644 --- a/modules/desktop/media/default.nix +++ b/modules/desktop/media/default.nix @@ -6,6 +6,7 @@ ./blender ./kdenlive ./lmms + ./ardour ./mpv ./jellyfin ./feishin From 19b41a4c5229b8889bdc8d88a901abb955256173 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Thu, 26 Sep 2024 20:48:19 +0400 Subject: [PATCH 090/319] hosts/sakopc: enable ardour and disable jellyfin-media-player --- hosts/sakopc/configuration.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hosts/sakopc/configuration.nix b/hosts/sakopc/configuration.nix index ddbab93a..08bbab32 100644 --- a/hosts/sakopc/configuration.nix +++ b/hosts/sakopc/configuration.nix @@ -59,10 +59,11 @@ }; media = { mpv.enable = true; + ardour.enable = true; kdenlive.enable = true; blender.enable = true; feishin.enable = true; - jellyfin.enable = true; + jellyfin.enable = false; }; }; dev = { From c6928d7f9a80dda738b63a08bfb3c0ab0f21563a Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Thu, 26 Sep 2024 20:54:07 +0400 Subject: [PATCH 091/319] ardour fix? --- default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/default.nix b/default.nix index 2fd49b2f..1b2c88fb 100644 --- a/default.nix +++ b/default.nix @@ -99,7 +99,7 @@ users.users.sako = { isNormalUser = true; - extraGroups = ["wheel" "networkmanager"]; # Enable ‘sudo’ for the user. + extraGroups = ["wheel" "networkmanager" "audio"]; }; home-manager.useUserPackages = true; From 0073c0933bf8e6e00376e202eecc6dfe18ab7c5e Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Fri, 27 Sep 2024 12:31:00 +0400 Subject: [PATCH 092/319] config/hyprland: disable animations --- config/hyprland/hyprland.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/hyprland/hyprland.conf b/config/hyprland/hyprland.conf index bce191fd..06d36be3 100644 --- a/config/hyprland/hyprland.conf +++ b/config/hyprland/hyprland.conf @@ -105,7 +105,7 @@ decoration { } animations { - enabled = true + enabled = false # Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more From 08023ac7fd9506b042dc5298c0b035f5e853a9c1 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Fri, 27 Sep 2024 21:56:12 +0400 Subject: [PATCH 093/319] dev/emacs: make texlive download less bloat --- modules/dev/editors/emacs/default.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/dev/editors/emacs/default.nix b/modules/dev/editors/emacs/default.nix index 050b8343..1eeebb53 100644 --- a/modules/dev/editors/emacs/default.nix +++ b/modules/dev/editors/emacs/default.nix @@ -10,6 +10,12 @@ let cfg = config.modules.dev.editors.emacs; + # so we dont cry later on why texLive is MASSIVE + tex = (pkgs.texlive.combine { + inherit (pkgs.texlive) scheme-basic + dvisvgm dvipng # for preview and export as html + wrapfig amsmath ulem hyperref capt-of; + }); myEmacs = pkgs.emacsWithPackagesFromUsePackage { config = ../../../../config/emacs/emacs.org; @@ -114,8 +120,7 @@ in { # doc-view unoconv # org to pdf - # this might be bloat... - texliveMedium + tex # lsp emacs-lsp-booster # zenity-color-picker From 70f7ac9863098b9681702d3217342001956feed0 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Fri, 27 Sep 2024 21:56:37 +0400 Subject: [PATCH 094/319] config/emacs: change default latex compiler and preview process --- config/emacs/emacs.org | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 11f6a3cf..9f86a9c0 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1288,6 +1288,10 @@ GNU patch review metho dor sometihng idk (setq org-hide-leading-stars t) (setq org-hide-emphasis-markers nil) + ;; org latex pdf options + (setq org-latex-compiler "lualatex") + (setq org-preview-latex-default-process 'dvisvgm) + ;; templates (require 'org-tempo) From 59dfdc16aee229eeb714669b9e998050bead3eb9 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Fri, 27 Sep 2024 22:08:37 +0400 Subject: [PATCH 095/319] dev/emacs: more latex packages for some reason --- modules/dev/editors/emacs/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/dev/editors/emacs/default.nix b/modules/dev/editors/emacs/default.nix index 1eeebb53..b6f59c3b 100644 --- a/modules/dev/editors/emacs/default.nix +++ b/modules/dev/editors/emacs/default.nix @@ -14,7 +14,8 @@ let tex = (pkgs.texlive.combine { inherit (pkgs.texlive) scheme-basic dvisvgm dvipng # for preview and export as html - wrapfig amsmath ulem hyperref capt-of; + wrapfig amsmath ulem hyperref capt-of fontspec inputenc graphicx + longtable rotating amssymb; }); myEmacs = pkgs.emacsWithPackagesFromUsePackage { From 9cbdbbda3cdc14ebecfcd65a6e62ff7081028063 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Fri, 27 Sep 2024 22:10:08 +0400 Subject: [PATCH 096/319] dev/emacs: fix latex skill issue --- modules/dev/editors/emacs/default.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/dev/editors/emacs/default.nix b/modules/dev/editors/emacs/default.nix index b6f59c3b..fc5b5c7f 100644 --- a/modules/dev/editors/emacs/default.nix +++ b/modules/dev/editors/emacs/default.nix @@ -14,8 +14,7 @@ let tex = (pkgs.texlive.combine { inherit (pkgs.texlive) scheme-basic dvisvgm dvipng # for preview and export as html - wrapfig amsmath ulem hyperref capt-of fontspec inputenc graphicx - longtable rotating amssymb; + wrapfig amsmath ulem hyperref capt-of fontspec inputenx graphics; }); myEmacs = pkgs.emacsWithPackagesFromUsePackage { From 3fea1f5d047f27e1d38f9e10e0266423a566bf8d Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Fri, 27 Sep 2024 22:16:51 +0400 Subject: [PATCH 097/319] latex skill issue electric boogalo 1 --- modules/dev/editors/emacs/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/dev/editors/emacs/default.nix b/modules/dev/editors/emacs/default.nix index fc5b5c7f..a7e3867c 100644 --- a/modules/dev/editors/emacs/default.nix +++ b/modules/dev/editors/emacs/default.nix @@ -14,7 +14,8 @@ let tex = (pkgs.texlive.combine { inherit (pkgs.texlive) scheme-basic dvisvgm dvipng # for preview and export as html - wrapfig amsmath ulem hyperref capt-of fontspec inputenx graphics; + wrapfig amsmath ulem hyperref capt-of fontspec inputenx graphics + etoolbox; }); myEmacs = pkgs.emacsWithPackagesFromUsePackage { From 0da3da4fba1393d6e607982d7433a6e2ca5da651 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Fri, 27 Sep 2024 23:10:27 +0400 Subject: [PATCH 098/319] remove credits --- README.md | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/README.md b/README.md index 91d8e491..e5477ee1 100644 --- a/README.md +++ b/README.md @@ -5,14 +5,3 @@ TODO:: Make this better lmfao TODO::TODO:: Get markdown preview for emacs silly! - -## Credits - -[Misterio77/nix-starter-configs2](https://github.com/Misterio77/nix-starter-configs) -[pull request for a bug](https://github.com/Misterio77/nix-starter-configs/pull/34/commits/2a5f3ca3dde606b83ea30b5507347bf989819301)

-[doom emacs guy -> hlissner/dotfiles](https://github.com/hlissner/dotfiles)

-^ reason i found out about nixos

-[nixos.wiki (unofficial)](https://nixos.wiki/) -[colemickens/nixcfg](https://github.com/colemickens/nixcfg) -[NotAShelf](https://github.com/NotAShelf) - config really helps, also helped me setup nix for a couple of things -[Fsnkty](https://github.com/fsnkty) From f968a9dbf5082cf4bd460d3ed8b008e6ed208219 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Fri, 27 Sep 2024 23:22:38 +0400 Subject: [PATCH 099/319] desktop: remove dwm --- config/dwm/LICENSE | 38 - config/dwm/Makefile | 45 - config/dwm/README | 48 - config/dwm/config.def.h | 116 -- config/dwm/config.h | 113 -- config/dwm/config.mk | 39 - config/dwm/drw.c | 450 ------- config/dwm/drw.h | 58 - config/dwm/dwm.1 | 176 --- config/dwm/dwm.c | 2049 ------------------------------- config/dwm/dwm.png | Bin 373 -> 0 bytes config/dwm/transient.c | 42 - config/dwm/util.c | 36 - config/dwm/util.h | 8 - modules/desktop/default.nix | 1 - modules/desktop/dwm/default.nix | 110 -- 16 files changed, 3329 deletions(-) delete mode 100644 config/dwm/LICENSE delete mode 100644 config/dwm/Makefile delete mode 100644 config/dwm/README delete mode 100644 config/dwm/config.def.h delete mode 100644 config/dwm/config.h delete mode 100644 config/dwm/config.mk delete mode 100644 config/dwm/drw.c delete mode 100644 config/dwm/drw.h delete mode 100644 config/dwm/dwm.1 delete mode 100644 config/dwm/dwm.c delete mode 100644 config/dwm/dwm.png delete mode 100644 config/dwm/transient.c delete mode 100644 config/dwm/util.c delete mode 100644 config/dwm/util.h delete mode 100644 modules/desktop/dwm/default.nix diff --git a/config/dwm/LICENSE b/config/dwm/LICENSE deleted file mode 100644 index 995172fa..00000000 --- a/config/dwm/LICENSE +++ /dev/null @@ -1,38 +0,0 @@ -MIT/X Consortium License - -© 2006-2019 Anselm R Garbe -© 2006-2009 Jukka Salmi -© 2006-2007 Sander van Dijk -© 2007-2011 Peter Hartlich -© 2007-2009 Szabolcs Nagy -© 2007-2009 Christof Musik -© 2007-2009 Premysl Hruby -© 2007-2008 Enno Gottox Boland -© 2008 Martin Hurton -© 2008 Neale Pickett -© 2009 Mate Nagy -© 2010-2016 Hiltjo Posthuma -© 2010-2012 Connor Lane Smith -© 2011 Christoph Lohmann <20h@r-36.net> -© 2015-2016 Quentin Rameau -© 2015-2016 Eric Pruitt -© 2016-2017 Markus Teich -© 2020-2022 Chris Down - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. diff --git a/config/dwm/Makefile b/config/dwm/Makefile deleted file mode 100644 index ffa69b40..00000000 --- a/config/dwm/Makefile +++ /dev/null @@ -1,45 +0,0 @@ -# dwm - dynamic window manager -# See LICENSE file for copyright and license details. - -include config.mk - -SRC = drw.c dwm.c util.c -OBJ = ${SRC:.c=.o} - -all: dwm - -.c.o: - ${CC} -c ${CFLAGS} $< - -${OBJ}: config.h config.mk - -config.h: - cp config.def.h $@ - -dwm: ${OBJ} - ${CC} -o $@ ${OBJ} ${LDFLAGS} - -clean: - rm -f dwm ${OBJ} dwm-${VERSION}.tar.gz - -dist: clean - mkdir -p dwm-${VERSION} - cp -R LICENSE Makefile README config.def.h config.mk\ - dwm.1 drw.h util.h ${SRC} dwm.png transient.c dwm-${VERSION} - tar -cf dwm-${VERSION}.tar dwm-${VERSION} - gzip dwm-${VERSION}.tar - rm -rf dwm-${VERSION} - -install: all - mkdir -p ${DESTDIR}${PREFIX}/bin - cp -f dwm ${DESTDIR}${PREFIX}/bin - chmod 755 ${DESTDIR}${PREFIX}/bin/dwm - mkdir -p ${DESTDIR}${MANPREFIX}/man1 - sed "s/VERSION/${VERSION}/g" < dwm.1 > ${DESTDIR}${MANPREFIX}/man1/dwm.1 - chmod 644 ${DESTDIR}${MANPREFIX}/man1/dwm.1 - -uninstall: - rm -f ${DESTDIR}${PREFIX}/bin/dwm\ - ${DESTDIR}${MANPREFIX}/man1/dwm.1 - -.PHONY: all clean dist install uninstall diff --git a/config/dwm/README b/config/dwm/README deleted file mode 100644 index 95d4fd05..00000000 --- a/config/dwm/README +++ /dev/null @@ -1,48 +0,0 @@ -dwm - dynamic window manager -============================ -dwm is an extremely fast, small, and dynamic window manager for X. - - -Requirements ------------- -In order to build dwm you need the Xlib header files. - - -Installation ------------- -Edit config.mk to match your local setup (dwm is installed into -the /usr/local namespace by default). - -Afterwards enter the following command to build and install dwm (if -necessary as root): - - make clean install - - -Running dwm ------------ -Add the following line to your .xinitrc to start dwm using startx: - - exec dwm - -In order to connect dwm to a specific display, make sure that -the DISPLAY environment variable is set correctly, e.g.: - - DISPLAY=foo.bar:1 exec dwm - -(This will start dwm on display :1 of the host foo.bar.) - -In order to display status info in the bar, you can do something -like this in your .xinitrc: - - while xsetroot -name "`date` `uptime | sed 's/.*,//'`" - do - sleep 1 - done & - exec dwm - - -Configuration -------------- -The configuration of dwm is done by creating a custom config.h -and (re)compiling the source code. diff --git a/config/dwm/config.def.h b/config/dwm/config.def.h deleted file mode 100644 index 9efa7744..00000000 --- a/config/dwm/config.def.h +++ /dev/null @@ -1,116 +0,0 @@ -/* See LICENSE file for copyright and license details. */ - -/* appearance */ -static const unsigned int borderpx = 1; /* border pixel of windows */ -static const unsigned int snap = 32; /* snap pixel */ -static const int showbar = 1; /* 0 means no bar */ -static const int topbar = 1; /* 0 means bottom bar */ -static const char *fonts[] = { "monospace:size=10" }; -static const char dmenufont[] = "monospace:size=10"; -static const char col_gray1[] = "#222222"; -static const char col_gray2[] = "#444444"; -static const char col_gray3[] = "#bbbbbb"; -static const char col_gray4[] = "#eeeeee"; -static const char col_cyan[] = "#005577"; -static const char *colors[][3] = { - /* fg bg border */ - [SchemeNorm] = { col_gray3, col_gray1, col_gray2 }, - [SchemeSel] = { col_gray4, col_cyan, col_cyan }, -}; - -/* tagging */ -static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; - -static const Rule rules[] = { - /* xprop(1): - * WM_CLASS(STRING) = instance, class - * WM_NAME(STRING) = title - */ - /* class instance title tags mask isfloating monitor */ - { "Gimp", NULL, NULL, 0, 1, -1 }, - { "Firefox", NULL, NULL, 1 << 8, 0, -1 }, -}; - -/* layout(s) */ -static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */ -static const int nmaster = 1; /* number of clients in master area */ -static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */ -static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */ - -static const Layout layouts[] = { - /* symbol arrange function */ - { "[]=", tile }, /* first entry is default */ - { "><>", NULL }, /* no layout function means floating behavior */ - { "[M]", monocle }, -}; - -/* key definitions */ -#define MODKEY Mod1Mask -#define TAGKEYS(KEY,TAG) \ - { MODKEY, KEY, view, {.ui = 1 << TAG} }, \ - { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ - { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \ - { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, - -/* helper for spawning shell commands in the pre dwm-5.0 fashion */ -#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } - -/* commands */ -static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ -static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL }; -static const char *termcmd[] = { "st", NULL }; - -static const Key keys[] = { - /* modifier key function argument */ - { MODKEY, XK_p, spawn, {.v = dmenucmd } }, - { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } }, - { MODKEY, XK_b, togglebar, {0} }, - { MODKEY, XK_j, focusstack, {.i = +1 } }, - { MODKEY, XK_k, focusstack, {.i = -1 } }, - { MODKEY, XK_i, incnmaster, {.i = +1 } }, - { MODKEY, XK_d, incnmaster, {.i = -1 } }, - { MODKEY, XK_h, setmfact, {.f = -0.05} }, - { MODKEY, XK_l, setmfact, {.f = +0.05} }, - { MODKEY, XK_Return, zoom, {0} }, - { MODKEY, XK_Tab, view, {0} }, - { MODKEY|ShiftMask, XK_c, killclient, {0} }, - { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, - { MODKEY, XK_f, setlayout, {.v = &layouts[1]} }, - { MODKEY, XK_m, setlayout, {.v = &layouts[2]} }, - { MODKEY, XK_space, setlayout, {0} }, - { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, - { MODKEY, XK_0, view, {.ui = ~0 } }, - { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, - { MODKEY, XK_comma, focusmon, {.i = -1 } }, - { MODKEY, XK_period, focusmon, {.i = +1 } }, - { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, - { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, - TAGKEYS( XK_1, 0) - TAGKEYS( XK_2, 1) - TAGKEYS( XK_3, 2) - TAGKEYS( XK_4, 3) - TAGKEYS( XK_5, 4) - TAGKEYS( XK_6, 5) - TAGKEYS( XK_7, 6) - TAGKEYS( XK_8, 7) - TAGKEYS( XK_9, 8) - { MODKEY|ShiftMask, XK_q, quit, {0} }, -}; - -/* button definitions */ -/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */ -static const Button buttons[] = { - /* click event mask button function argument */ - { ClkLtSymbol, 0, Button1, setlayout, {0} }, - { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} }, - { ClkWinTitle, 0, Button2, zoom, {0} }, - { ClkStatusText, 0, Button2, spawn, {.v = termcmd } }, - { ClkClientWin, MODKEY, Button1, movemouse, {0} }, - { ClkClientWin, MODKEY, Button2, togglefloating, {0} }, - { ClkClientWin, MODKEY, Button3, resizemouse, {0} }, - { ClkTagBar, 0, Button1, view, {0} }, - { ClkTagBar, 0, Button3, toggleview, {0} }, - { ClkTagBar, MODKEY, Button1, tag, {0} }, - { ClkTagBar, MODKEY, Button3, toggletag, {0} }, -}; - diff --git a/config/dwm/config.h b/config/dwm/config.h deleted file mode 100644 index 8ff5e516..00000000 --- a/config/dwm/config.h +++ /dev/null @@ -1,113 +0,0 @@ -/* See LICENSE file for copyright and license details. */ - -/* appearance */ -static const unsigned int borderpx = 1; /* border pixel of windows */ -static const unsigned int snap = 32; /* snap pixel */ -static const int showbar = 1; /* 0 means no bar */ -static const int topbar = 1; /* 0 means bottom bar */ -static const char *fonts[] = {"monospace:size=10"}; -static const char dmenufont[] = "monospace:size=10"; -static const char col_gray1[] = "#222222"; -static const char col_gray2[] = "#444444"; -static const char col_gray3[] = "#bbbbbb"; -static const char col_gray4[] = "#eeeeee"; -static const char col_cyan[] = "#005577"; -static const char *colors[][3] = { - /* fg bg border */ - [SchemeNorm] = {col_gray3, col_gray1, col_gray2}, - [SchemeSel] = {col_gray4, col_cyan, col_cyan}, -}; - -/* tagging */ -static const char *tags[] = {"1", "2", "3", "4", "5", "6", "7", "8", "9"}; - -static const Rule rules[] = { - /* xprop(1): - * WM_CLASS(STRING) = instance, class - * WM_NAME(STRING) = title - */ - /* class instance title tags mask isfloating monitor */ - {"Gimp", NULL, NULL, 0, 1, -1}, - {"Firefox", NULL, NULL, 1 << 8, 0, -1}, -}; - -/* layout(s) */ -static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */ -static const int nmaster = 1; /* number of clients in master area */ -static const int resizehints = - 1; /* 1 means respect size hints in tiled resizals */ -static const int lockfullscreen = - 1; /* 1 will force focus on the fullscreen window */ - -static const Layout layouts[] = { - /* symbol arrange function */ - {"[]=", tile}, /* first entry is default */ - {"><>", NULL}, /* no layout function means floating behavior */ - {"[M]", monocle}, -}; - -/* key definitions */ -#define MODKEY Mod1Mask -#define TAGKEYS(KEY, TAG) \ - {MODKEY, KEY, view, {.ui = 1 << TAG}}, \ - {MODKEY | ControlMask, KEY, toggleview, {.ui = 1 << TAG}}, \ - {MODKEY | ShiftMask, KEY, tag, {.ui = 1 << TAG}}, \ - {MODKEY | ControlMask | ShiftMask, KEY, toggletag, {.ui = 1 << TAG}}, - -/* helper for spawning shell commands in the pre dwm-5.0 fashion */ -#define SHCMD(cmd) \ - { \ - .v = (const char *[]) { "/bin/sh", "-c", cmd, NULL } \ - } - -/* commands */ -static const char *roficmd[] = {"rofi", "-show", "drun", NULL}; -static const char *termcmd[] = {"wezterm", NULL}; - -static const Key keys[] = { - /* modifier key function argument */ - {MODKEY, XK_p, spawn, {.v = roficmd}}, - {MODKEY | ShiftMask, XK_Return, spawn, {.v = termcmd}}, - {MODKEY, XK_b, togglebar, {0}}, - {MODKEY, XK_j, focusstack, {.i = +1}}, - {MODKEY, XK_k, focusstack, {.i = -1}}, - {MODKEY, XK_i, incnmaster, {.i = +1}}, - {MODKEY, XK_d, incnmaster, {.i = -1}}, - {MODKEY, XK_h, setmfact, {.f = -0.05}}, - {MODKEY, XK_l, setmfact, {.f = +0.05}}, - {MODKEY, XK_Return, zoom, {0}}, - {MODKEY, XK_Tab, view, {0}}, - {MODKEY | ShiftMask, XK_c, killclient, {0}}, - {MODKEY, XK_t, setlayout, {.v = &layouts[0]}}, - {MODKEY, XK_f, setlayout, {.v = &layouts[1]}}, - {MODKEY, XK_m, setlayout, {.v = &layouts[2]}}, - {MODKEY, XK_space, setlayout, {0}}, - {MODKEY | ShiftMask, XK_space, togglefloating, {0}}, - {MODKEY, XK_0, view, {.ui = ~0}}, - {MODKEY | ShiftMask, XK_0, tag, {.ui = ~0}}, - {MODKEY, XK_comma, focusmon, {.i = -1}}, - {MODKEY, XK_period, focusmon, {.i = +1}}, - {MODKEY | ShiftMask, XK_comma, tagmon, {.i = -1}}, - {MODKEY | ShiftMask, XK_period, tagmon, {.i = +1}}, - TAGKEYS(XK_1, 0) TAGKEYS(XK_2, 1) TAGKEYS(XK_3, 2) TAGKEYS(XK_4, 3) - TAGKEYS(XK_5, 4) TAGKEYS(XK_6, 5) TAGKEYS(XK_7, 6) TAGKEYS(XK_8, 7) - TAGKEYS(XK_9, 8){MODKEY | ShiftMask, XK_q, quit, {0}}, -}; - -/* button definitions */ -/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, - * ClkClientWin, or ClkRootWin */ -static const Button buttons[] = { - /* click event mask button function argument */ - {ClkLtSymbol, 0, Button1, setlayout, {0}}, - {ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]}}, - {ClkWinTitle, 0, Button2, zoom, {0}}, - {ClkStatusText, 0, Button2, spawn, {.v = termcmd}}, - {ClkClientWin, MODKEY, Button1, movemouse, {0}}, - {ClkClientWin, MODKEY, Button2, togglefloating, {0}}, - {ClkClientWin, MODKEY, Button3, resizemouse, {0}}, - {ClkTagBar, 0, Button1, view, {0}}, - {ClkTagBar, 0, Button3, toggleview, {0}}, - {ClkTagBar, MODKEY, Button1, tag, {0}}, - {ClkTagBar, MODKEY, Button3, toggletag, {0}}, -}; diff --git a/config/dwm/config.mk b/config/dwm/config.mk deleted file mode 100644 index 8efca9ad..00000000 --- a/config/dwm/config.mk +++ /dev/null @@ -1,39 +0,0 @@ -# dwm version -VERSION = 6.5 - -# Customize below to fit your system - -# paths -PREFIX = /usr/local -MANPREFIX = ${PREFIX}/share/man - -X11INC = /usr/X11R6/include -X11LIB = /usr/X11R6/lib - -# Xinerama, comment if you don't want it -XINERAMALIBS = -lXinerama -XINERAMAFLAGS = -DXINERAMA - -# freetype -FREETYPELIBS = -lfontconfig -lXft -FREETYPEINC = /usr/include/freetype2 -# OpenBSD (uncomment) -#FREETYPEINC = ${X11INC}/freetype2 -#MANPREFIX = ${PREFIX}/man - -# includes and libs -INCS = -I${X11INC} -I${FREETYPEINC} -LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS} - -# flags -CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700L -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS} -#CFLAGS = -g -std=c99 -pedantic -Wall -O0 ${INCS} ${CPPFLAGS} -CFLAGS = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os ${INCS} ${CPPFLAGS} -LDFLAGS = ${LIBS} - -# Solaris -#CFLAGS = -fast ${INCS} -DVERSION=\"${VERSION}\" -#LDFLAGS = ${LIBS} - -# compiler and linker -CC = cc diff --git a/config/dwm/drw.c b/config/dwm/drw.c deleted file mode 100644 index a58a2b48..00000000 --- a/config/dwm/drw.c +++ /dev/null @@ -1,450 +0,0 @@ -/* See LICENSE file for copyright and license details. */ -#include -#include -#include -#include -#include - -#include "drw.h" -#include "util.h" - -#define UTF_INVALID 0xFFFD -#define UTF_SIZ 4 - -static const unsigned char utfbyte[UTF_SIZ + 1] = {0x80, 0, 0xC0, 0xE0, 0xF0}; -static const unsigned char utfmask[UTF_SIZ + 1] = {0xC0, 0x80, 0xE0, 0xF0, 0xF8}; -static const long utfmin[UTF_SIZ + 1] = { 0, 0, 0x80, 0x800, 0x10000}; -static const long utfmax[UTF_SIZ + 1] = {0x10FFFF, 0x7F, 0x7FF, 0xFFFF, 0x10FFFF}; - -static long -utf8decodebyte(const char c, size_t *i) -{ - for (*i = 0; *i < (UTF_SIZ + 1); ++(*i)) - if (((unsigned char)c & utfmask[*i]) == utfbyte[*i]) - return (unsigned char)c & ~utfmask[*i]; - return 0; -} - -static size_t -utf8validate(long *u, size_t i) -{ - if (!BETWEEN(*u, utfmin[i], utfmax[i]) || BETWEEN(*u, 0xD800, 0xDFFF)) - *u = UTF_INVALID; - for (i = 1; *u > utfmax[i]; ++i) - ; - return i; -} - -static size_t -utf8decode(const char *c, long *u, size_t clen) -{ - size_t i, j, len, type; - long udecoded; - - *u = UTF_INVALID; - if (!clen) - return 0; - udecoded = utf8decodebyte(c[0], &len); - if (!BETWEEN(len, 1, UTF_SIZ)) - return 1; - for (i = 1, j = 1; i < clen && j < len; ++i, ++j) { - udecoded = (udecoded << 6) | utf8decodebyte(c[i], &type); - if (type) - return j; - } - if (j < len) - return 0; - *u = udecoded; - utf8validate(u, len); - - return len; -} - -Drw * -drw_create(Display *dpy, int screen, Window root, unsigned int w, unsigned int h) -{ - Drw *drw = ecalloc(1, sizeof(Drw)); - - drw->dpy = dpy; - drw->screen = screen; - drw->root = root; - drw->w = w; - drw->h = h; - drw->drawable = XCreatePixmap(dpy, root, w, h, DefaultDepth(dpy, screen)); - drw->gc = XCreateGC(dpy, root, 0, NULL); - XSetLineAttributes(dpy, drw->gc, 1, LineSolid, CapButt, JoinMiter); - - return drw; -} - -void -drw_resize(Drw *drw, unsigned int w, unsigned int h) -{ - if (!drw) - return; - - drw->w = w; - drw->h = h; - if (drw->drawable) - XFreePixmap(drw->dpy, drw->drawable); - drw->drawable = XCreatePixmap(drw->dpy, drw->root, w, h, DefaultDepth(drw->dpy, drw->screen)); -} - -void -drw_free(Drw *drw) -{ - XFreePixmap(drw->dpy, drw->drawable); - XFreeGC(drw->dpy, drw->gc); - drw_fontset_free(drw->fonts); - free(drw); -} - -/* This function is an implementation detail. Library users should use - * drw_fontset_create instead. - */ -static Fnt * -xfont_create(Drw *drw, const char *fontname, FcPattern *fontpattern) -{ - Fnt *font; - XftFont *xfont = NULL; - FcPattern *pattern = NULL; - - if (fontname) { - /* Using the pattern found at font->xfont->pattern does not yield the - * same substitution results as using the pattern returned by - * FcNameParse; using the latter results in the desired fallback - * behaviour whereas the former just results in missing-character - * rectangles being drawn, at least with some fonts. */ - if (!(xfont = XftFontOpenName(drw->dpy, drw->screen, fontname))) { - fprintf(stderr, "error, cannot load font from name: '%s'\n", fontname); - return NULL; - } - if (!(pattern = FcNameParse((FcChar8 *) fontname))) { - fprintf(stderr, "error, cannot parse font name to pattern: '%s'\n", fontname); - XftFontClose(drw->dpy, xfont); - return NULL; - } - } else if (fontpattern) { - if (!(xfont = XftFontOpenPattern(drw->dpy, fontpattern))) { - fprintf(stderr, "error, cannot load font from pattern.\n"); - return NULL; - } - } else { - die("no font specified."); - } - - font = ecalloc(1, sizeof(Fnt)); - font->xfont = xfont; - font->pattern = pattern; - font->h = xfont->ascent + xfont->descent; - font->dpy = drw->dpy; - - return font; -} - -static void -xfont_free(Fnt *font) -{ - if (!font) - return; - if (font->pattern) - FcPatternDestroy(font->pattern); - XftFontClose(font->dpy, font->xfont); - free(font); -} - -Fnt* -drw_fontset_create(Drw* drw, const char *fonts[], size_t fontcount) -{ - Fnt *cur, *ret = NULL; - size_t i; - - if (!drw || !fonts) - return NULL; - - for (i = 1; i <= fontcount; i++) { - if ((cur = xfont_create(drw, fonts[fontcount - i], NULL))) { - cur->next = ret; - ret = cur; - } - } - return (drw->fonts = ret); -} - -void -drw_fontset_free(Fnt *font) -{ - if (font) { - drw_fontset_free(font->next); - xfont_free(font); - } -} - -void -drw_clr_create(Drw *drw, Clr *dest, const char *clrname) -{ - if (!drw || !dest || !clrname) - return; - - if (!XftColorAllocName(drw->dpy, DefaultVisual(drw->dpy, drw->screen), - DefaultColormap(drw->dpy, drw->screen), - clrname, dest)) - die("error, cannot allocate color '%s'", clrname); -} - -/* Wrapper to create color schemes. The caller has to call free(3) on the - * returned color scheme when done using it. */ -Clr * -drw_scm_create(Drw *drw, const char *clrnames[], size_t clrcount) -{ - size_t i; - Clr *ret; - - /* need at least two colors for a scheme */ - if (!drw || !clrnames || clrcount < 2 || !(ret = ecalloc(clrcount, sizeof(XftColor)))) - return NULL; - - for (i = 0; i < clrcount; i++) - drw_clr_create(drw, &ret[i], clrnames[i]); - return ret; -} - -void -drw_setfontset(Drw *drw, Fnt *set) -{ - if (drw) - drw->fonts = set; -} - -void -drw_setscheme(Drw *drw, Clr *scm) -{ - if (drw) - drw->scheme = scm; -} - -void -drw_rect(Drw *drw, int x, int y, unsigned int w, unsigned int h, int filled, int invert) -{ - if (!drw || !drw->scheme) - return; - XSetForeground(drw->dpy, drw->gc, invert ? drw->scheme[ColBg].pixel : drw->scheme[ColFg].pixel); - if (filled) - XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h); - else - XDrawRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w - 1, h - 1); -} - -int -drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lpad, const char *text, int invert) -{ - int i, ty, ellipsis_x = 0; - unsigned int tmpw, ew, ellipsis_w = 0, ellipsis_len; - XftDraw *d = NULL; - Fnt *usedfont, *curfont, *nextfont; - int utf8strlen, utf8charlen, render = x || y || w || h; - long utf8codepoint = 0; - const char *utf8str; - FcCharSet *fccharset; - FcPattern *fcpattern; - FcPattern *match; - XftResult result; - int charexists = 0, overflow = 0; - /* keep track of a couple codepoints for which we have no match. */ - enum { nomatches_len = 64 }; - static struct { long codepoint[nomatches_len]; unsigned int idx; } nomatches; - static unsigned int ellipsis_width = 0; - - if (!drw || (render && (!drw->scheme || !w)) || !text || !drw->fonts) - return 0; - - if (!render) { - w = invert ? invert : ~invert; - } else { - XSetForeground(drw->dpy, drw->gc, drw->scheme[invert ? ColFg : ColBg].pixel); - XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h); - d = XftDrawCreate(drw->dpy, drw->drawable, - DefaultVisual(drw->dpy, drw->screen), - DefaultColormap(drw->dpy, drw->screen)); - x += lpad; - w -= lpad; - } - - usedfont = drw->fonts; - if (!ellipsis_width && render) - ellipsis_width = drw_fontset_getwidth(drw, "..."); - while (1) { - ew = ellipsis_len = utf8strlen = 0; - utf8str = text; - nextfont = NULL; - while (*text) { - utf8charlen = utf8decode(text, &utf8codepoint, UTF_SIZ); - for (curfont = drw->fonts; curfont; curfont = curfont->next) { - charexists = charexists || XftCharExists(drw->dpy, curfont->xfont, utf8codepoint); - if (charexists) { - drw_font_getexts(curfont, text, utf8charlen, &tmpw, NULL); - if (ew + ellipsis_width <= w) { - /* keep track where the ellipsis still fits */ - ellipsis_x = x + ew; - ellipsis_w = w - ew; - ellipsis_len = utf8strlen; - } - - if (ew + tmpw > w) { - overflow = 1; - /* called from drw_fontset_getwidth_clamp(): - * it wants the width AFTER the overflow - */ - if (!render) - x += tmpw; - else - utf8strlen = ellipsis_len; - } else if (curfont == usedfont) { - utf8strlen += utf8charlen; - text += utf8charlen; - ew += tmpw; - } else { - nextfont = curfont; - } - break; - } - } - - if (overflow || !charexists || nextfont) - break; - else - charexists = 0; - } - - if (utf8strlen) { - if (render) { - ty = y + (h - usedfont->h) / 2 + usedfont->xfont->ascent; - XftDrawStringUtf8(d, &drw->scheme[invert ? ColBg : ColFg], - usedfont->xfont, x, ty, (XftChar8 *)utf8str, utf8strlen); - } - x += ew; - w -= ew; - } - if (render && overflow) - drw_text(drw, ellipsis_x, y, ellipsis_w, h, 0, "...", invert); - - if (!*text || overflow) { - break; - } else if (nextfont) { - charexists = 0; - usedfont = nextfont; - } else { - /* Regardless of whether or not a fallback font is found, the - * character must be drawn. */ - charexists = 1; - - for (i = 0; i < nomatches_len; ++i) { - /* avoid calling XftFontMatch if we know we won't find a match */ - if (utf8codepoint == nomatches.codepoint[i]) - goto no_match; - } - - fccharset = FcCharSetCreate(); - FcCharSetAddChar(fccharset, utf8codepoint); - - if (!drw->fonts->pattern) { - /* Refer to the comment in xfont_create for more information. */ - die("the first font in the cache must be loaded from a font string."); - } - - fcpattern = FcPatternDuplicate(drw->fonts->pattern); - FcPatternAddCharSet(fcpattern, FC_CHARSET, fccharset); - FcPatternAddBool(fcpattern, FC_SCALABLE, FcTrue); - - FcConfigSubstitute(NULL, fcpattern, FcMatchPattern); - FcDefaultSubstitute(fcpattern); - match = XftFontMatch(drw->dpy, drw->screen, fcpattern, &result); - - FcCharSetDestroy(fccharset); - FcPatternDestroy(fcpattern); - - if (match) { - usedfont = xfont_create(drw, NULL, match); - if (usedfont && XftCharExists(drw->dpy, usedfont->xfont, utf8codepoint)) { - for (curfont = drw->fonts; curfont->next; curfont = curfont->next) - ; /* NOP */ - curfont->next = usedfont; - } else { - xfont_free(usedfont); - nomatches.codepoint[++nomatches.idx % nomatches_len] = utf8codepoint; -no_match: - usedfont = drw->fonts; - } - } - } - } - if (d) - XftDrawDestroy(d); - - return x + (render ? w : 0); -} - -void -drw_map(Drw *drw, Window win, int x, int y, unsigned int w, unsigned int h) -{ - if (!drw) - return; - - XCopyArea(drw->dpy, drw->drawable, win, drw->gc, x, y, w, h, x, y); - XSync(drw->dpy, False); -} - -unsigned int -drw_fontset_getwidth(Drw *drw, const char *text) -{ - if (!drw || !drw->fonts || !text) - return 0; - return drw_text(drw, 0, 0, 0, 0, 0, text, 0); -} - -unsigned int -drw_fontset_getwidth_clamp(Drw *drw, const char *text, unsigned int n) -{ - unsigned int tmp = 0; - if (drw && drw->fonts && text && n) - tmp = drw_text(drw, 0, 0, 0, 0, 0, text, n); - return MIN(n, tmp); -} - -void -drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w, unsigned int *h) -{ - XGlyphInfo ext; - - if (!font || !text) - return; - - XftTextExtentsUtf8(font->dpy, font->xfont, (XftChar8 *)text, len, &ext); - if (w) - *w = ext.xOff; - if (h) - *h = font->h; -} - -Cur * -drw_cur_create(Drw *drw, int shape) -{ - Cur *cur; - - if (!drw || !(cur = ecalloc(1, sizeof(Cur)))) - return NULL; - - cur->cursor = XCreateFontCursor(drw->dpy, shape); - - return cur; -} - -void -drw_cur_free(Drw *drw, Cur *cursor) -{ - if (!cursor) - return; - - XFreeCursor(drw->dpy, cursor->cursor); - free(cursor); -} diff --git a/config/dwm/drw.h b/config/dwm/drw.h deleted file mode 100644 index 64714316..00000000 --- a/config/dwm/drw.h +++ /dev/null @@ -1,58 +0,0 @@ -/* See LICENSE file for copyright and license details. */ - -typedef struct { - Cursor cursor; -} Cur; - -typedef struct Fnt { - Display *dpy; - unsigned int h; - XftFont *xfont; - FcPattern *pattern; - struct Fnt *next; -} Fnt; - -enum { ColFg, ColBg, ColBorder }; /* Clr scheme index */ -typedef XftColor Clr; - -typedef struct { - unsigned int w, h; - Display *dpy; - int screen; - Window root; - Drawable drawable; - GC gc; - Clr *scheme; - Fnt *fonts; -} Drw; - -/* Drawable abstraction */ -Drw *drw_create(Display *dpy, int screen, Window win, unsigned int w, unsigned int h); -void drw_resize(Drw *drw, unsigned int w, unsigned int h); -void drw_free(Drw *drw); - -/* Fnt abstraction */ -Fnt *drw_fontset_create(Drw* drw, const char *fonts[], size_t fontcount); -void drw_fontset_free(Fnt* set); -unsigned int drw_fontset_getwidth(Drw *drw, const char *text); -unsigned int drw_fontset_getwidth_clamp(Drw *drw, const char *text, unsigned int n); -void drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w, unsigned int *h); - -/* Colorscheme abstraction */ -void drw_clr_create(Drw *drw, Clr *dest, const char *clrname); -Clr *drw_scm_create(Drw *drw, const char *clrnames[], size_t clrcount); - -/* Cursor abstraction */ -Cur *drw_cur_create(Drw *drw, int shape); -void drw_cur_free(Drw *drw, Cur *cursor); - -/* Drawing context manipulation */ -void drw_setfontset(Drw *drw, Fnt *set); -void drw_setscheme(Drw *drw, Clr *scm); - -/* Drawing functions */ -void drw_rect(Drw *drw, int x, int y, unsigned int w, unsigned int h, int filled, int invert); -int drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lpad, const char *text, int invert); - -/* Map functions */ -void drw_map(Drw *drw, Window win, int x, int y, unsigned int w, unsigned int h); diff --git a/config/dwm/dwm.1 b/config/dwm/dwm.1 deleted file mode 100644 index ddc8321f..00000000 --- a/config/dwm/dwm.1 +++ /dev/null @@ -1,176 +0,0 @@ -.TH DWM 1 dwm\-VERSION -.SH NAME -dwm \- dynamic window manager -.SH SYNOPSIS -.B dwm -.RB [ \-v ] -.SH DESCRIPTION -dwm is a dynamic window manager for X. It manages windows in tiled, monocle -and floating layouts. Either layout can be applied dynamically, optimising the -environment for the application in use and the task performed. -.P -In tiled layouts windows are managed in a master and stacking area. The master -area on the left contains one window by default, and the stacking area on the -right contains all other windows. The number of master area windows can be -adjusted from zero to an arbitrary number. In monocle layout all windows are -maximised to the screen size. In floating layout windows can be resized and -moved freely. Dialog windows are always managed floating, regardless of the -layout applied. -.P -Windows are grouped by tags. Each window can be tagged with one or multiple -tags. Selecting certain tags displays all windows with these tags. -.P -Each screen contains a small status bar which displays all available tags, the -layout, the title of the focused window, and the text read from the root window -name property, if the screen is focused. A floating window is indicated with an -empty square and a maximised floating window is indicated with a filled square -before the windows title. The selected tags are indicated with a different -color. The tags of the focused window are indicated with a filled square in the -top left corner. The tags which are applied to one or more windows are -indicated with an empty square in the top left corner. -.P -dwm draws a small border around windows to indicate the focus state. -.SH OPTIONS -.TP -.B \-v -prints version information to stderr, then exits. -.SH USAGE -.SS Status bar -.TP -.B X root window name -is read and displayed in the status text area. It can be set with the -.BR xsetroot (1) -command. -.TP -.B Button1 -click on a tag label to display all windows with that tag, click on the layout -label toggles between tiled and floating layout. -.TP -.B Button3 -click on a tag label adds/removes all windows with that tag to/from the view. -.TP -.B Mod1\-Button1 -click on a tag label applies that tag to the focused window. -.TP -.B Mod1\-Button3 -click on a tag label adds/removes that tag to/from the focused window. -.SS Keyboard commands -.TP -.B Mod1\-Shift\-Return -Start -.BR st(1). -.TP -.B Mod1\-p -Spawn -.BR dmenu(1) -for launching other programs. -.TP -.B Mod1\-, -Focus previous screen, if any. -.TP -.B Mod1\-. -Focus next screen, if any. -.TP -.B Mod1\-Shift\-, -Send focused window to previous screen, if any. -.TP -.B Mod1\-Shift\-. -Send focused window to next screen, if any. -.TP -.B Mod1\-b -Toggles bar on and off. -.TP -.B Mod1\-t -Sets tiled layout. -.TP -.B Mod1\-f -Sets floating layout. -.TP -.B Mod1\-m -Sets monocle layout. -.TP -.B Mod1\-space -Toggles between current and previous layout. -.TP -.B Mod1\-j -Focus next window. -.TP -.B Mod1\-k -Focus previous window. -.TP -.B Mod1\-i -Increase number of windows in master area. -.TP -.B Mod1\-d -Decrease number of windows in master area. -.TP -.B Mod1\-l -Increase master area size. -.TP -.B Mod1\-h -Decrease master area size. -.TP -.B Mod1\-Return -Zooms/cycles focused window to/from master area (tiled layouts only). -.TP -.B Mod1\-Shift\-c -Close focused window. -.TP -.B Mod1\-Shift\-space -Toggle focused window between tiled and floating state. -.TP -.B Mod1\-Tab -Toggles to the previously selected tags. -.TP -.B Mod1\-Shift\-[1..n] -Apply nth tag to focused window. -.TP -.B Mod1\-Shift\-0 -Apply all tags to focused window. -.TP -.B Mod1\-Control\-Shift\-[1..n] -Add/remove nth tag to/from focused window. -.TP -.B Mod1\-[1..n] -View all windows with nth tag. -.TP -.B Mod1\-0 -View all windows with any tag. -.TP -.B Mod1\-Control\-[1..n] -Add/remove all windows with nth tag to/from the view. -.TP -.B Mod1\-Shift\-q -Quit dwm. -.SS Mouse commands -.TP -.B Mod1\-Button1 -Move focused window while dragging. Tiled windows will be toggled to the floating state. -.TP -.B Mod1\-Button2 -Toggles focused window between floating and tiled state. -.TP -.B Mod1\-Button3 -Resize focused window while dragging. Tiled windows will be toggled to the floating state. -.SH CUSTOMIZATION -dwm is customized by creating a custom config.h and (re)compiling the source -code. This keeps it fast, secure and simple. -.SH SEE ALSO -.BR dmenu (1), -.BR st (1) -.SH ISSUES -Java applications which use the XToolkit/XAWT backend may draw grey windows -only. The XToolkit/XAWT backend breaks ICCCM-compliance in recent JDK 1.5 and early -JDK 1.6 versions, because it assumes a reparenting window manager. Possible workarounds -are using JDK 1.4 (which doesn't contain the XToolkit/XAWT backend) or setting the -environment variable -.BR AWT_TOOLKIT=MToolkit -(to use the older Motif backend instead) or running -.B xprop -root -f _NET_WM_NAME 32a -set _NET_WM_NAME LG3D -or -.B wmname LG3D -(to pretend that a non-reparenting window manager is running that the -XToolkit/XAWT backend can recognize) or when using OpenJDK setting the environment variable -.BR _JAVA_AWT_WM_NONREPARENTING=1 . -.SH BUGS -Send all bug reports with a patch to hackers@suckless.org. diff --git a/config/dwm/dwm.c b/config/dwm/dwm.c deleted file mode 100644 index 7e44d659..00000000 --- a/config/dwm/dwm.c +++ /dev/null @@ -1,2049 +0,0 @@ -/* See LICENSE file for copyright and license details. - * - * dynamic window manager is designed like any other X client as well. It is - * driven through handling X events. In contrast to other X clients, a window - * manager selects for SubstructureRedirectMask on the root window, to receive - * events about window (dis-)appearance. Only one X connection at a time is - * allowed to select for this event mask. - * - * The event handlers of dwm are organized in an array which is accessed - * whenever a new event has been fetched. This allows event dispatching - * in O(1) time. - * - * Each child of the root window is called a client, except windows which have - * set the override_redirect flag. Clients are organized in a linked client - * list on each monitor, the focus history is remembered through a stack list - * on each monitor. Each client contains a bit array to indicate the tags of a - * client. - * - * Keys and tagging rules are organized as arrays and defined in config.h. - * - * To understand everything else, start reading main(). - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef XINERAMA -#include -#endif /* XINERAMA */ -#include - -#include "drw.h" -#include "util.h" - -/* macros */ -#define BUTTONMASK (ButtonPressMask | ButtonReleaseMask) -#define CLEANMASK(mask) \ - (mask & ~(numlockmask | LockMask) & \ - (ShiftMask | ControlMask | Mod1Mask | Mod2Mask | Mod3Mask | Mod4Mask | \ - Mod5Mask)) -#define INTERSECT(x, y, w, h, m) \ - (MAX(0, MIN((x) + (w), (m)->wx + (m)->ww) - MAX((x), (m)->wx)) * \ - MAX(0, MIN((y) + (h), (m)->wy + (m)->wh) - MAX((y), (m)->wy))) -#define ISVISIBLE(C) ((C->tags & C->mon->tagset[C->mon->seltags])) -#define LENGTH(X) (sizeof X / sizeof X[0]) -#define MOUSEMASK (BUTTONMASK | PointerMotionMask) -#define WIDTH(X) ((X)->w + 2 * (X)->bw) -#define HEIGHT(X) ((X)->h + 2 * (X)->bw) -#define TAGMASK ((1 << LENGTH(tags)) - 1) -#define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad) - -/* enums */ -enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ -enum { SchemeNorm, SchemeSel }; /* color schemes */ -enum { - NetSupported, - NetWMName, - NetWMState, - NetWMCheck, - NetWMFullscreen, - NetActiveWindow, - NetWMWindowType, - NetWMWindowTypeDialog, - NetClientList, - NetLast -}; /* EWMH atoms */ -enum { - WMProtocols, - WMDelete, - WMState, - WMTakeFocus, - WMLast -}; /* default atoms */ -enum { - ClkTagBar, - ClkLtSymbol, - ClkStatusText, - ClkWinTitle, - ClkClientWin, - ClkRootWin, - ClkLast -}; /* clicks */ - -typedef union { - int i; - unsigned int ui; - float f; - const void *v; -} Arg; - -typedef struct { - unsigned int click; - unsigned int mask; - unsigned int button; - void (*func)(const Arg *arg); - const Arg arg; -} Button; - -typedef struct Monitor Monitor; -typedef struct Client Client; -struct Client { - char name[256]; - float mina, maxa; - int x, y, w, h; - int oldx, oldy, oldw, oldh; - int basew, baseh, incw, inch, maxw, maxh, minw, minh, hintsvalid; - int bw, oldbw; - unsigned int tags; - int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen; - Client *next; - Client *snext; - Monitor *mon; - Window win; -}; - -typedef struct { - unsigned int mod; - KeySym keysym; - void (*func)(const Arg *); - const Arg arg; -} Key; - -typedef struct { - const char *symbol; - void (*arrange)(Monitor *); -} Layout; - -struct Monitor { - char ltsymbol[16]; - float mfact; - int nmaster; - int num; - int by; /* bar geometry */ - int mx, my, mw, mh; /* screen size */ - int wx, wy, ww, wh; /* window area */ - unsigned int seltags; - unsigned int sellt; - unsigned int tagset[2]; - int showbar; - int topbar; - Client *clients; - Client *sel; - Client *stack; - Monitor *next; - Window barwin; - const Layout *lt[2]; -}; - -typedef struct { - const char *class; - const char *instance; - const char *title; - unsigned int tags; - int isfloating; - int monitor; -} Rule; - -/* function declarations */ -static void applyrules(Client *c); -static int applysizehints(Client *c, int *x, int *y, int *w, int *h, - int interact); -static void arrange(Monitor *m); -static void arrangemon(Monitor *m); -static void attach(Client *c); -static void attachstack(Client *c); -static void buttonpress(XEvent *e); -static void checkotherwm(void); -static void cleanup(void); -static void cleanupmon(Monitor *mon); -static void clientmessage(XEvent *e); -static void configure(Client *c); -static void configurenotify(XEvent *e); -static void configurerequest(XEvent *e); -static Monitor *createmon(void); -static void destroynotify(XEvent *e); -static void detach(Client *c); -static void detachstack(Client *c); -static Monitor *dirtomon(int dir); -static void drawbar(Monitor *m); -static void drawbars(void); -static void enternotify(XEvent *e); -static void expose(XEvent *e); -static void focus(Client *c); -static void focusin(XEvent *e); -static void focusmon(const Arg *arg); -static void focusstack(const Arg *arg); -static Atom getatomprop(Client *c, Atom prop); -static int getrootptr(int *x, int *y); -static long getstate(Window w); -static int gettextprop(Window w, Atom atom, char *text, unsigned int size); -static void grabbuttons(Client *c, int focused); -static void grabkeys(void); -static void incnmaster(const Arg *arg); -static void keypress(XEvent *e); -static void killclient(const Arg *arg); -static void manage(Window w, XWindowAttributes *wa); -static void mappingnotify(XEvent *e); -static void maprequest(XEvent *e); -static void monocle(Monitor *m); -static void motionnotify(XEvent *e); -static void movemouse(const Arg *arg); -static Client *nexttiled(Client *c); -static void pop(Client *c); -static void propertynotify(XEvent *e); -static void quit(const Arg *arg); -static Monitor *recttomon(int x, int y, int w, int h); -static void resize(Client *c, int x, int y, int w, int h, int interact); -static void resizeclient(Client *c, int x, int y, int w, int h); -static void resizemouse(const Arg *arg); -static void restack(Monitor *m); -static void run(void); -static void scan(void); -static int sendevent(Client *c, Atom proto); -static void sendmon(Client *c, Monitor *m); -static void setclientstate(Client *c, long state); -static void setfocus(Client *c); -static void setfullscreen(Client *c, int fullscreen); -static void setlayout(const Arg *arg); -static void setmfact(const Arg *arg); -static void setup(void); -static void seturgent(Client *c, int urg); -static void showhide(Client *c); -static void spawn(const Arg *arg); -static void tag(const Arg *arg); -static void tagmon(const Arg *arg); -static void tile(Monitor *m); -static void togglebar(const Arg *arg); -static void togglefloating(const Arg *arg); -static void toggletag(const Arg *arg); -static void toggleview(const Arg *arg); -static void unfocus(Client *c, int setfocus); -static void unmanage(Client *c, int destroyed); -static void unmapnotify(XEvent *e); -static void updatebarpos(Monitor *m); -static void updatebars(void); -static void updateclientlist(void); -static int updategeom(void); -static void updatenumlockmask(void); -static void updatesizehints(Client *c); -static void updatestatus(void); -static void updatetitle(Client *c); -static void updatewindowtype(Client *c); -static void updatewmhints(Client *c); -static void view(const Arg *arg); -static Client *wintoclient(Window w); -static Monitor *wintomon(Window w); -static int xerror(Display *dpy, XErrorEvent *ee); -static int xerrordummy(Display *dpy, XErrorEvent *ee); -static int xerrorstart(Display *dpy, XErrorEvent *ee); -static void zoom(const Arg *arg); - -/* variables */ -static const char broken[] = "broken"; -static char stext[256]; -static int screen; -static int sw, sh; /* X display screen geometry width, height */ -static int bh; /* bar height */ -static int lrpad; /* sum of left and right padding for text */ -static int (*xerrorxlib)(Display *, XErrorEvent *); -static unsigned int numlockmask = 0; -static void (*handler[LASTEvent])(XEvent *) = { - [ButtonPress] = buttonpress, - [ClientMessage] = clientmessage, - [ConfigureRequest] = configurerequest, - [ConfigureNotify] = configurenotify, - [DestroyNotify] = destroynotify, - [EnterNotify] = enternotify, - [Expose] = expose, - [FocusIn] = focusin, - [KeyPress] = keypress, - [MappingNotify] = mappingnotify, - [MapRequest] = maprequest, - [MotionNotify] = motionnotify, - [PropertyNotify] = propertynotify, - [UnmapNotify] = unmapnotify}; -static Atom wmatom[WMLast], netatom[NetLast]; -static int running = 1; -static Cur *cursor[CurLast]; -static Clr **scheme; -static Display *dpy; -static Drw *drw; -static Monitor *mons, *selmon; -static Window root, wmcheckwin; - -/* configuration, allows nested code to access above variables */ -#include "config.h" - -/* compile-time check if all tags fit into an unsigned int bit array. */ -struct NumTags { - char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; -}; - -/* function implementations */ -void applyrules(Client *c) { - const char *class, *instance; - unsigned int i; - const Rule *r; - Monitor *m; - XClassHint ch = {NULL, NULL}; - - /* rule matching */ - c->isfloating = 0; - c->tags = 0; - XGetClassHint(dpy, c->win, &ch); - class = ch.res_class ? ch.res_class : broken; - instance = ch.res_name ? ch.res_name : broken; - - for (i = 0; i < LENGTH(rules); i++) { - r = &rules[i]; - if ((!r->title || strstr(c->name, r->title)) && - (!r->class || strstr(class, r->class)) && - (!r->instance || strstr(instance, r->instance))) { - c->isfloating = r->isfloating; - c->tags |= r->tags; - for (m = mons; m && m->num != r->monitor; m = m->next) - ; - if (m) - c->mon = m; - } - } - if (ch.res_class) - XFree(ch.res_class); - if (ch.res_name) - XFree(ch.res_name); - c->tags = - c->tags & TAGMASK ? c->tags & TAGMASK : c->mon->tagset[c->mon->seltags]; -} - -int applysizehints(Client *c, int *x, int *y, int *w, int *h, int interact) { - int baseismin; - Monitor *m = c->mon; - - /* set minimum possible */ - *w = MAX(1, *w); - *h = MAX(1, *h); - if (interact) { - if (*x > sw) - *x = sw - WIDTH(c); - if (*y > sh) - *y = sh - HEIGHT(c); - if (*x + *w + 2 * c->bw < 0) - *x = 0; - if (*y + *h + 2 * c->bw < 0) - *y = 0; - } else { - if (*x >= m->wx + m->ww) - *x = m->wx + m->ww - WIDTH(c); - if (*y >= m->wy + m->wh) - *y = m->wy + m->wh - HEIGHT(c); - if (*x + *w + 2 * c->bw <= m->wx) - *x = m->wx; - if (*y + *h + 2 * c->bw <= m->wy) - *y = m->wy; - } - if (*h < bh) - *h = bh; - if (*w < bh) - *w = bh; - if (resizehints || c->isfloating || !c->mon->lt[c->mon->sellt]->arrange) { - if (!c->hintsvalid) - updatesizehints(c); - /* see last two sentences in ICCCM 4.1.2.3 */ - baseismin = c->basew == c->minw && c->baseh == c->minh; - if (!baseismin) { /* temporarily remove base dimensions */ - *w -= c->basew; - *h -= c->baseh; - } - /* adjust for aspect limits */ - if (c->mina > 0 && c->maxa > 0) { - if (c->maxa < (float)*w / *h) - *w = *h * c->maxa + 0.5; - else if (c->mina < (float)*h / *w) - *h = *w * c->mina + 0.5; - } - if (baseismin) { /* increment calculation requires this */ - *w -= c->basew; - *h -= c->baseh; - } - /* adjust for increment value */ - if (c->incw) - *w -= *w % c->incw; - if (c->inch) - *h -= *h % c->inch; - /* restore base dimensions */ - *w = MAX(*w + c->basew, c->minw); - *h = MAX(*h + c->baseh, c->minh); - if (c->maxw) - *w = MIN(*w, c->maxw); - if (c->maxh) - *h = MIN(*h, c->maxh); - } - return *x != c->x || *y != c->y || *w != c->w || *h != c->h; -} - -void arrange(Monitor *m) { - if (m) - showhide(m->stack); - else - for (m = mons; m; m = m->next) - showhide(m->stack); - if (m) { - arrangemon(m); - restack(m); - } else - for (m = mons; m; m = m->next) - arrangemon(m); -} - -void arrangemon(Monitor *m) { - strncpy(m->ltsymbol, m->lt[m->sellt]->symbol, sizeof m->ltsymbol); - if (m->lt[m->sellt]->arrange) - m->lt[m->sellt]->arrange(m); -} - -void attach(Client *c) { - c->next = c->mon->clients; - c->mon->clients = c; -} - -void attachstack(Client *c) { - c->snext = c->mon->stack; - c->mon->stack = c; -} - -void buttonpress(XEvent *e) { - unsigned int i, x, click; - Arg arg = {0}; - Client *c; - Monitor *m; - XButtonPressedEvent *ev = &e->xbutton; - - click = ClkRootWin; - /* focus monitor if necessary */ - if ((m = wintomon(ev->window)) && m != selmon) { - unfocus(selmon->sel, 1); - selmon = m; - focus(NULL); - } - if (ev->window == selmon->barwin) { - i = x = 0; - do - x += TEXTW(tags[i]); - while (ev->x >= x && ++i < LENGTH(tags)); - if (i < LENGTH(tags)) { - click = ClkTagBar; - arg.ui = 1 << i; - } else if (ev->x < x + TEXTW(selmon->ltsymbol)) - click = ClkLtSymbol; - else if (ev->x > selmon->ww - (int)TEXTW(stext)) - click = ClkStatusText; - else - click = ClkWinTitle; - } else if ((c = wintoclient(ev->window))) { - focus(c); - restack(selmon); - XAllowEvents(dpy, ReplayPointer, CurrentTime); - click = ClkClientWin; - } - for (i = 0; i < LENGTH(buttons); i++) - if (click == buttons[i].click && buttons[i].func && - buttons[i].button == ev->button && - CLEANMASK(buttons[i].mask) == CLEANMASK(ev->state)) - buttons[i].func( - click == ClkTagBar && buttons[i].arg.i == 0 ? &arg : &buttons[i].arg); -} - -void checkotherwm(void) { - xerrorxlib = XSetErrorHandler(xerrorstart); - /* this causes an error if some other window manager is running */ - XSelectInput(dpy, DefaultRootWindow(dpy), SubstructureRedirectMask); - XSync(dpy, False); - XSetErrorHandler(xerror); - XSync(dpy, False); -} - -void cleanup(void) { - Arg a = {.ui = ~0}; - Layout foo = {"", NULL}; - Monitor *m; - size_t i; - - view(&a); - selmon->lt[selmon->sellt] = &foo; - for (m = mons; m; m = m->next) - while (m->stack) - unmanage(m->stack, 0); - XUngrabKey(dpy, AnyKey, AnyModifier, root); - while (mons) - cleanupmon(mons); - for (i = 0; i < CurLast; i++) - drw_cur_free(drw, cursor[i]); - for (i = 0; i < LENGTH(colors); i++) - free(scheme[i]); - free(scheme); - XDestroyWindow(dpy, wmcheckwin); - drw_free(drw); - XSync(dpy, False); - XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime); - XDeleteProperty(dpy, root, netatom[NetActiveWindow]); -} - -void cleanupmon(Monitor *mon) { - Monitor *m; - - if (mon == mons) - mons = mons->next; - else { - for (m = mons; m && m->next != mon; m = m->next) - ; - m->next = mon->next; - } - XUnmapWindow(dpy, mon->barwin); - XDestroyWindow(dpy, mon->barwin); - free(mon); -} - -void clientmessage(XEvent *e) { - XClientMessageEvent *cme = &e->xclient; - Client *c = wintoclient(cme->window); - - if (!c) - return; - if (cme->message_type == netatom[NetWMState]) { - if (cme->data.l[1] == netatom[NetWMFullscreen] || - cme->data.l[2] == netatom[NetWMFullscreen]) - setfullscreen(c, (cme->data.l[0] == 1 /* _NET_WM_STATE_ADD */ - || (cme->data.l[0] == 2 /* _NET_WM_STATE_TOGGLE */ && - !c->isfullscreen))); - } else if (cme->message_type == netatom[NetActiveWindow]) { - if (c != selmon->sel && !c->isurgent) - seturgent(c, 1); - } -} - -void configure(Client *c) { - XConfigureEvent ce; - - ce.type = ConfigureNotify; - ce.display = dpy; - ce.event = c->win; - ce.window = c->win; - ce.x = c->x; - ce.y = c->y; - ce.width = c->w; - ce.height = c->h; - ce.border_width = c->bw; - ce.above = None; - ce.override_redirect = False; - XSendEvent(dpy, c->win, False, StructureNotifyMask, (XEvent *)&ce); -} - -void configurenotify(XEvent *e) { - Monitor *m; - Client *c; - XConfigureEvent *ev = &e->xconfigure; - int dirty; - - /* TODO: updategeom handling sucks, needs to be simplified */ - if (ev->window == root) { - dirty = (sw != ev->width || sh != ev->height); - sw = ev->width; - sh = ev->height; - if (updategeom() || dirty) { - drw_resize(drw, sw, bh); - updatebars(); - for (m = mons; m; m = m->next) { - for (c = m->clients; c; c = c->next) - if (c->isfullscreen) - resizeclient(c, m->mx, m->my, m->mw, m->mh); - XMoveResizeWindow(dpy, m->barwin, m->wx, m->by, m->ww, bh); - } - focus(NULL); - arrange(NULL); - } - } -} - -void configurerequest(XEvent *e) { - Client *c; - Monitor *m; - XConfigureRequestEvent *ev = &e->xconfigurerequest; - XWindowChanges wc; - - if ((c = wintoclient(ev->window))) { - if (ev->value_mask & CWBorderWidth) - c->bw = ev->border_width; - else if (c->isfloating || !selmon->lt[selmon->sellt]->arrange) { - m = c->mon; - if (ev->value_mask & CWX) { - c->oldx = c->x; - c->x = m->mx + ev->x; - } - if (ev->value_mask & CWY) { - c->oldy = c->y; - c->y = m->my + ev->y; - } - if (ev->value_mask & CWWidth) { - c->oldw = c->w; - c->w = ev->width; - } - if (ev->value_mask & CWHeight) { - c->oldh = c->h; - c->h = ev->height; - } - if ((c->x + c->w) > m->mx + m->mw && c->isfloating) - c->x = m->mx + (m->mw / 2 - WIDTH(c) / 2); /* center in x direction */ - if ((c->y + c->h) > m->my + m->mh && c->isfloating) - c->y = m->my + (m->mh / 2 - HEIGHT(c) / 2); /* center in y direction */ - if ((ev->value_mask & (CWX | CWY)) && - !(ev->value_mask & (CWWidth | CWHeight))) - configure(c); - if (ISVISIBLE(c)) - XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h); - } else - configure(c); - } else { - wc.x = ev->x; - wc.y = ev->y; - wc.width = ev->width; - wc.height = ev->height; - wc.border_width = ev->border_width; - wc.sibling = ev->above; - wc.stack_mode = ev->detail; - XConfigureWindow(dpy, ev->window, ev->value_mask, &wc); - } - XSync(dpy, False); -} - -Monitor *createmon(void) { - Monitor *m; - - m = ecalloc(1, sizeof(Monitor)); - m->tagset[0] = m->tagset[1] = 1; - m->mfact = mfact; - m->nmaster = nmaster; - m->showbar = showbar; - m->topbar = topbar; - m->lt[0] = &layouts[0]; - m->lt[1] = &layouts[1 % LENGTH(layouts)]; - strncpy(m->ltsymbol, layouts[0].symbol, sizeof m->ltsymbol); - return m; -} - -void destroynotify(XEvent *e) { - Client *c; - XDestroyWindowEvent *ev = &e->xdestroywindow; - - if ((c = wintoclient(ev->window))) - unmanage(c, 1); -} - -void detach(Client *c) { - Client **tc; - - for (tc = &c->mon->clients; *tc && *tc != c; tc = &(*tc)->next) - ; - *tc = c->next; -} - -void detachstack(Client *c) { - Client **tc, *t; - - for (tc = &c->mon->stack; *tc && *tc != c; tc = &(*tc)->snext) - ; - *tc = c->snext; - - if (c == c->mon->sel) { - for (t = c->mon->stack; t && !ISVISIBLE(t); t = t->snext) - ; - c->mon->sel = t; - } -} - -Monitor *dirtomon(int dir) { - Monitor *m = NULL; - - if (dir > 0) { - if (!(m = selmon->next)) - m = mons; - } else if (selmon == mons) - for (m = mons; m->next; m = m->next) - ; - else - for (m = mons; m->next != selmon; m = m->next) - ; - return m; -} - -void drawbar(Monitor *m) { - int x, w, tw = 0; - int boxs = drw->fonts->h / 9; - int boxw = drw->fonts->h / 6 + 2; - unsigned int i, occ = 0, urg = 0; - Client *c; - - if (!m->showbar) - return; - - /* draw status first so it can be overdrawn by tags later */ - if (m == selmon) { /* status is only drawn on selected monitor */ - drw_setscheme(drw, scheme[SchemeNorm]); - tw = TEXTW(stext) - lrpad + 2; /* 2px right padding */ - drw_text(drw, m->ww - tw, 0, tw, bh, 0, stext, 0); - } - - for (c = m->clients; c; c = c->next) { - occ |= c->tags; - if (c->isurgent) - urg |= c->tags; - } - x = 0; - for (i = 0; i < LENGTH(tags); i++) { - w = TEXTW(tags[i]); - drw_setscheme( - drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]); - drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i); - if (occ & 1 << i) - drw_rect(drw, x + boxs, boxs, boxw, boxw, - m == selmon && selmon->sel && selmon->sel->tags & 1 << i, - urg & 1 << i); - x += w; - } - w = TEXTW(m->ltsymbol); - drw_setscheme(drw, scheme[SchemeNorm]); - x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0); - - if ((w = m->ww - tw - x) > bh) { - if (m->sel) { - drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]); - drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0); - if (m->sel->isfloating) - drw_rect(drw, x + boxs, boxs, boxw, boxw, m->sel->isfixed, 0); - } else { - drw_setscheme(drw, scheme[SchemeNorm]); - drw_rect(drw, x, 0, w, bh, 1, 1); - } - } - drw_map(drw, m->barwin, 0, 0, m->ww, bh); -} - -void drawbars(void) { - Monitor *m; - - for (m = mons; m; m = m->next) - drawbar(m); -} - -void enternotify(XEvent *e) { - Client *c; - Monitor *m; - XCrossingEvent *ev = &e->xcrossing; - - if ((ev->mode != NotifyNormal || ev->detail == NotifyInferior) && - ev->window != root) - return; - c = wintoclient(ev->window); - m = c ? c->mon : wintomon(ev->window); - if (m != selmon) { - unfocus(selmon->sel, 1); - selmon = m; - } else if (!c || c == selmon->sel) - return; - focus(c); -} - -void expose(XEvent *e) { - Monitor *m; - XExposeEvent *ev = &e->xexpose; - - if (ev->count == 0 && (m = wintomon(ev->window))) - drawbar(m); -} - -void focus(Client *c) { - if (!c || !ISVISIBLE(c)) - for (c = selmon->stack; c && !ISVISIBLE(c); c = c->snext) - ; - if (selmon->sel && selmon->sel != c) - unfocus(selmon->sel, 0); - if (c) { - if (c->mon != selmon) - selmon = c->mon; - if (c->isurgent) - seturgent(c, 0); - detachstack(c); - attachstack(c); - grabbuttons(c, 1); - XSetWindowBorder(dpy, c->win, scheme[SchemeSel][ColBorder].pixel); - setfocus(c); - } else { - XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); - XDeleteProperty(dpy, root, netatom[NetActiveWindow]); - } - selmon->sel = c; - drawbars(); -} - -/* there are some broken focus acquiring clients needing extra handling */ -void focusin(XEvent *e) { - XFocusChangeEvent *ev = &e->xfocus; - - if (selmon->sel && ev->window != selmon->sel->win) - setfocus(selmon->sel); -} - -void focusmon(const Arg *arg) { - Monitor *m; - - if (!mons->next) - return; - if ((m = dirtomon(arg->i)) == selmon) - return; - unfocus(selmon->sel, 0); - selmon = m; - focus(NULL); -} - -void focusstack(const Arg *arg) { - Client *c = NULL, *i; - - if (!selmon->sel || (selmon->sel->isfullscreen && lockfullscreen)) - return; - if (arg->i > 0) { - for (c = selmon->sel->next; c && !ISVISIBLE(c); c = c->next) - ; - if (!c) - for (c = selmon->clients; c && !ISVISIBLE(c); c = c->next) - ; - } else { - for (i = selmon->clients; i != selmon->sel; i = i->next) - if (ISVISIBLE(i)) - c = i; - if (!c) - for (; i; i = i->next) - if (ISVISIBLE(i)) - c = i; - } - if (c) { - focus(c); - restack(selmon); - } -} - -Atom getatomprop(Client *c, Atom prop) { - int di; - unsigned long dl; - unsigned char *p = NULL; - Atom da, atom = None; - - if (XGetWindowProperty(dpy, c->win, prop, 0L, sizeof atom, False, XA_ATOM, - &da, &di, &dl, &dl, &p) == Success && - p) { - atom = *(Atom *)p; - XFree(p); - } - return atom; -} - -int getrootptr(int *x, int *y) { - int di; - unsigned int dui; - Window dummy; - - return XQueryPointer(dpy, root, &dummy, &dummy, x, y, &di, &di, &dui); -} - -long getstate(Window w) { - int format; - long result = -1; - unsigned char *p = NULL; - unsigned long n, extra; - Atom real; - - if (XGetWindowProperty(dpy, w, wmatom[WMState], 0L, 2L, False, - wmatom[WMState], &real, &format, &n, &extra, - (unsigned char **)&p) != Success) - return -1; - if (n != 0) - result = *p; - XFree(p); - return result; -} - -int gettextprop(Window w, Atom atom, char *text, unsigned int size) { - char **list = NULL; - int n; - XTextProperty name; - - if (!text || size == 0) - return 0; - text[0] = '\0'; - if (!XGetTextProperty(dpy, w, &name, atom) || !name.nitems) - return 0; - if (name.encoding == XA_STRING) { - strncpy(text, (char *)name.value, size - 1); - } else if (XmbTextPropertyToTextList(dpy, &name, &list, &n) >= Success && - n > 0 && *list) { - strncpy(text, *list, size - 1); - XFreeStringList(list); - } - text[size - 1] = '\0'; - XFree(name.value); - return 1; -} - -void grabbuttons(Client *c, int focused) { - updatenumlockmask(); - { - unsigned int i, j; - unsigned int modifiers[] = {0, LockMask, numlockmask, - numlockmask | LockMask}; - XUngrabButton(dpy, AnyButton, AnyModifier, c->win); - if (!focused) - XGrabButton(dpy, AnyButton, AnyModifier, c->win, False, BUTTONMASK, - GrabModeSync, GrabModeSync, None, None); - for (i = 0; i < LENGTH(buttons); i++) - if (buttons[i].click == ClkClientWin) - for (j = 0; j < LENGTH(modifiers); j++) - XGrabButton(dpy, buttons[i].button, buttons[i].mask | modifiers[j], - c->win, False, BUTTONMASK, GrabModeAsync, GrabModeSync, - None, None); - } -} - -void grabkeys(void) { - updatenumlockmask(); - { - unsigned int i, j, k; - unsigned int modifiers[] = {0, LockMask, numlockmask, - numlockmask | LockMask}; - int start, end, skip; - KeySym *syms; - - XUngrabKey(dpy, AnyKey, AnyModifier, root); - XDisplayKeycodes(dpy, &start, &end); - syms = XGetKeyboardMapping(dpy, start, end - start + 1, &skip); - if (!syms) - return; - for (k = start; k <= end; k++) - for (i = 0; i < LENGTH(keys); i++) - /* skip modifier codes, we do that ourselves */ - if (keys[i].keysym == syms[(k - start) * skip]) - for (j = 0; j < LENGTH(modifiers); j++) - XGrabKey(dpy, k, keys[i].mod | modifiers[j], root, True, - GrabModeAsync, GrabModeAsync); - XFree(syms); - } -} - -void incnmaster(const Arg *arg) { - selmon->nmaster = MAX(selmon->nmaster + arg->i, 0); - arrange(selmon); -} - -#ifdef XINERAMA -static int isuniquegeom(XineramaScreenInfo *unique, size_t n, - XineramaScreenInfo *info) { - while (n--) - if (unique[n].x_org == info->x_org && unique[n].y_org == info->y_org && - unique[n].width == info->width && unique[n].height == info->height) - return 0; - return 1; -} -#endif /* XINERAMA */ - -void keypress(XEvent *e) { - unsigned int i; - KeySym keysym; - XKeyEvent *ev; - - ev = &e->xkey; - keysym = XKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0); - for (i = 0; i < LENGTH(keys); i++) - if (keysym == keys[i].keysym && - CLEANMASK(keys[i].mod) == CLEANMASK(ev->state) && keys[i].func) - keys[i].func(&(keys[i].arg)); -} - -void killclient(const Arg *arg) { - if (!selmon->sel) - return; - if (!sendevent(selmon->sel, wmatom[WMDelete])) { - XGrabServer(dpy); - XSetErrorHandler(xerrordummy); - XSetCloseDownMode(dpy, DestroyAll); - XKillClient(dpy, selmon->sel->win); - XSync(dpy, False); - XSetErrorHandler(xerror); - XUngrabServer(dpy); - } -} - -void manage(Window w, XWindowAttributes *wa) { - Client *c, *t = NULL; - Window trans = None; - XWindowChanges wc; - - c = ecalloc(1, sizeof(Client)); - c->win = w; - /* geometry */ - c->x = c->oldx = wa->x; - c->y = c->oldy = wa->y; - c->w = c->oldw = wa->width; - c->h = c->oldh = wa->height; - c->oldbw = wa->border_width; - - updatetitle(c); - if (XGetTransientForHint(dpy, w, &trans) && (t = wintoclient(trans))) { - c->mon = t->mon; - c->tags = t->tags; - } else { - c->mon = selmon; - applyrules(c); - } - - if (c->x + WIDTH(c) > c->mon->wx + c->mon->ww) - c->x = c->mon->wx + c->mon->ww - WIDTH(c); - if (c->y + HEIGHT(c) > c->mon->wy + c->mon->wh) - c->y = c->mon->wy + c->mon->wh - HEIGHT(c); - c->x = MAX(c->x, c->mon->wx); - c->y = MAX(c->y, c->mon->wy); - c->bw = borderpx; - - wc.border_width = c->bw; - XConfigureWindow(dpy, w, CWBorderWidth, &wc); - XSetWindowBorder(dpy, w, scheme[SchemeNorm][ColBorder].pixel); - configure(c); /* propagates border_width, if size doesn't change */ - updatewindowtype(c); - updatesizehints(c); - updatewmhints(c); - XSelectInput(dpy, w, - EnterWindowMask | FocusChangeMask | PropertyChangeMask | - StructureNotifyMask); - grabbuttons(c, 0); - if (!c->isfloating) - c->isfloating = c->oldstate = trans != None || c->isfixed; - if (c->isfloating) - XRaiseWindow(dpy, c->win); - attach(c); - attachstack(c); - XChangeProperty(dpy, root, netatom[NetClientList], XA_WINDOW, 32, - PropModeAppend, (unsigned char *)&(c->win), 1); - XMoveResizeWindow(dpy, c->win, c->x + 2 * sw, c->y, c->w, - c->h); /* some windows require this */ - setclientstate(c, NormalState); - if (c->mon == selmon) - unfocus(selmon->sel, 0); - c->mon->sel = c; - arrange(c->mon); - XMapWindow(dpy, c->win); - focus(NULL); -} - -void mappingnotify(XEvent *e) { - XMappingEvent *ev = &e->xmapping; - - XRefreshKeyboardMapping(ev); - if (ev->request == MappingKeyboard) - grabkeys(); -} - -void maprequest(XEvent *e) { - static XWindowAttributes wa; - XMapRequestEvent *ev = &e->xmaprequest; - - if (!XGetWindowAttributes(dpy, ev->window, &wa) || wa.override_redirect) - return; - if (!wintoclient(ev->window)) - manage(ev->window, &wa); -} - -void monocle(Monitor *m) { - unsigned int n = 0; - Client *c; - - for (c = m->clients; c; c = c->next) - if (ISVISIBLE(c)) - n++; - if (n > 0) /* override layout symbol */ - snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n); - for (c = nexttiled(m->clients); c; c = nexttiled(c->next)) - resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, 0); -} - -void motionnotify(XEvent *e) { - static Monitor *mon = NULL; - Monitor *m; - XMotionEvent *ev = &e->xmotion; - - if (ev->window != root) - return; - if ((m = recttomon(ev->x_root, ev->y_root, 1, 1)) != mon && mon) { - unfocus(selmon->sel, 1); - selmon = m; - focus(NULL); - } - mon = m; -} - -void movemouse(const Arg *arg) { - int x, y, ocx, ocy, nx, ny; - Client *c; - Monitor *m; - XEvent ev; - Time lasttime = 0; - - if (!(c = selmon->sel)) - return; - if (c->isfullscreen) /* no support moving fullscreen windows by mouse */ - return; - restack(selmon); - ocx = c->x; - ocy = c->y; - if (XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync, - None, cursor[CurMove]->cursor, CurrentTime) != GrabSuccess) - return; - if (!getrootptr(&x, &y)) - return; - do { - XMaskEvent(dpy, MOUSEMASK | ExposureMask | SubstructureRedirectMask, &ev); - switch (ev.type) { - case ConfigureRequest: - case Expose: - case MapRequest: - handler[ev.type](&ev); - break; - case MotionNotify: - if ((ev.xmotion.time - lasttime) <= (1000 / 60)) - continue; - lasttime = ev.xmotion.time; - - nx = ocx + (ev.xmotion.x - x); - ny = ocy + (ev.xmotion.y - y); - if (abs(selmon->wx - nx) < snap) - nx = selmon->wx; - else if (abs((selmon->wx + selmon->ww) - (nx + WIDTH(c))) < snap) - nx = selmon->wx + selmon->ww - WIDTH(c); - if (abs(selmon->wy - ny) < snap) - ny = selmon->wy; - else if (abs((selmon->wy + selmon->wh) - (ny + HEIGHT(c))) < snap) - ny = selmon->wy + selmon->wh - HEIGHT(c); - if (!c->isfloating && selmon->lt[selmon->sellt]->arrange && - (abs(nx - c->x) > snap || abs(ny - c->y) > snap)) - togglefloating(NULL); - if (!selmon->lt[selmon->sellt]->arrange || c->isfloating) - resize(c, nx, ny, c->w, c->h, 1); - break; - } - } while (ev.type != ButtonRelease); - XUngrabPointer(dpy, CurrentTime); - if ((m = recttomon(c->x, c->y, c->w, c->h)) != selmon) { - sendmon(c, m); - selmon = m; - focus(NULL); - } -} - -Client *nexttiled(Client *c) { - for (; c && (c->isfloating || !ISVISIBLE(c)); c = c->next) - ; - return c; -} - -void pop(Client *c) { - detach(c); - attach(c); - focus(c); - arrange(c->mon); -} - -void propertynotify(XEvent *e) { - Client *c; - Window trans; - XPropertyEvent *ev = &e->xproperty; - - if ((ev->window == root) && (ev->atom == XA_WM_NAME)) - updatestatus(); - else if (ev->state == PropertyDelete) - return; /* ignore */ - else if ((c = wintoclient(ev->window))) { - switch (ev->atom) { - default: - break; - case XA_WM_TRANSIENT_FOR: - if (!c->isfloating && (XGetTransientForHint(dpy, c->win, &trans)) && - (c->isfloating = (wintoclient(trans)) != NULL)) - arrange(c->mon); - break; - case XA_WM_NORMAL_HINTS: - c->hintsvalid = 0; - break; - case XA_WM_HINTS: - updatewmhints(c); - drawbars(); - break; - } - if (ev->atom == XA_WM_NAME || ev->atom == netatom[NetWMName]) { - updatetitle(c); - if (c == c->mon->sel) - drawbar(c->mon); - } - if (ev->atom == netatom[NetWMWindowType]) - updatewindowtype(c); - } -} - -void quit(const Arg *arg) { running = 0; } - -Monitor *recttomon(int x, int y, int w, int h) { - Monitor *m, *r = selmon; - int a, area = 0; - - for (m = mons; m; m = m->next) - if ((a = INTERSECT(x, y, w, h, m)) > area) { - area = a; - r = m; - } - return r; -} - -void resize(Client *c, int x, int y, int w, int h, int interact) { - if (applysizehints(c, &x, &y, &w, &h, interact)) - resizeclient(c, x, y, w, h); -} - -void resizeclient(Client *c, int x, int y, int w, int h) { - XWindowChanges wc; - - c->oldx = c->x; - c->x = wc.x = x; - c->oldy = c->y; - c->y = wc.y = y; - c->oldw = c->w; - c->w = wc.width = w; - c->oldh = c->h; - c->h = wc.height = h; - wc.border_width = c->bw; - XConfigureWindow(dpy, c->win, CWX | CWY | CWWidth | CWHeight | CWBorderWidth, - &wc); - configure(c); - XSync(dpy, False); -} - -void resizemouse(const Arg *arg) { - int ocx, ocy, nw, nh; - Client *c; - Monitor *m; - XEvent ev; - Time lasttime = 0; - - if (!(c = selmon->sel)) - return; - if (c->isfullscreen) /* no support resizing fullscreen windows by mouse */ - return; - restack(selmon); - ocx = c->x; - ocy = c->y; - if (XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync, - None, cursor[CurResize]->cursor, CurrentTime) != GrabSuccess) - return; - XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w + c->bw - 1, - c->h + c->bw - 1); - do { - XMaskEvent(dpy, MOUSEMASK | ExposureMask | SubstructureRedirectMask, &ev); - switch (ev.type) { - case ConfigureRequest: - case Expose: - case MapRequest: - handler[ev.type](&ev); - break; - case MotionNotify: - if ((ev.xmotion.time - lasttime) <= (1000 / 60)) - continue; - lasttime = ev.xmotion.time; - - nw = MAX(ev.xmotion.x - ocx - 2 * c->bw + 1, 1); - nh = MAX(ev.xmotion.y - ocy - 2 * c->bw + 1, 1); - if (c->mon->wx + nw >= selmon->wx && - c->mon->wx + nw <= selmon->wx + selmon->ww && - c->mon->wy + nh >= selmon->wy && - c->mon->wy + nh <= selmon->wy + selmon->wh) { - if (!c->isfloating && selmon->lt[selmon->sellt]->arrange && - (abs(nw - c->w) > snap || abs(nh - c->h) > snap)) - togglefloating(NULL); - } - if (!selmon->lt[selmon->sellt]->arrange || c->isfloating) - resize(c, c->x, c->y, nw, nh, 1); - break; - } - } while (ev.type != ButtonRelease); - XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w + c->bw - 1, - c->h + c->bw - 1); - XUngrabPointer(dpy, CurrentTime); - while (XCheckMaskEvent(dpy, EnterWindowMask, &ev)) - ; - if ((m = recttomon(c->x, c->y, c->w, c->h)) != selmon) { - sendmon(c, m); - selmon = m; - focus(NULL); - } -} - -void restack(Monitor *m) { - Client *c; - XEvent ev; - XWindowChanges wc; - - drawbar(m); - if (!m->sel) - return; - if (m->sel->isfloating || !m->lt[m->sellt]->arrange) - XRaiseWindow(dpy, m->sel->win); - if (m->lt[m->sellt]->arrange) { - wc.stack_mode = Below; - wc.sibling = m->barwin; - for (c = m->stack; c; c = c->snext) - if (!c->isfloating && ISVISIBLE(c)) { - XConfigureWindow(dpy, c->win, CWSibling | CWStackMode, &wc); - wc.sibling = c->win; - } - } - XSync(dpy, False); - while (XCheckMaskEvent(dpy, EnterWindowMask, &ev)) - ; -} - -void run(void) { - XEvent ev; - /* main event loop */ - XSync(dpy, False); - while (running && !XNextEvent(dpy, &ev)) - if (handler[ev.type]) - handler[ev.type](&ev); /* call handler */ -} - -void scan(void) { - unsigned int i, num; - Window d1, d2, *wins = NULL; - XWindowAttributes wa; - - if (XQueryTree(dpy, root, &d1, &d2, &wins, &num)) { - for (i = 0; i < num; i++) { - if (!XGetWindowAttributes(dpy, wins[i], &wa) || wa.override_redirect || - XGetTransientForHint(dpy, wins[i], &d1)) - continue; - if (wa.map_state == IsViewable || getstate(wins[i]) == IconicState) - manage(wins[i], &wa); - } - for (i = 0; i < num; i++) { /* now the transients */ - if (!XGetWindowAttributes(dpy, wins[i], &wa)) - continue; - if (XGetTransientForHint(dpy, wins[i], &d1) && - (wa.map_state == IsViewable || getstate(wins[i]) == IconicState)) - manage(wins[i], &wa); - } - if (wins) - XFree(wins); - } -} - -void sendmon(Client *c, Monitor *m) { - if (c->mon == m) - return; - unfocus(c, 1); - detach(c); - detachstack(c); - c->mon = m; - c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */ - attach(c); - attachstack(c); - focus(NULL); - arrange(NULL); -} - -void setclientstate(Client *c, long state) { - long data[] = {state, None}; - - XChangeProperty(dpy, c->win, wmatom[WMState], wmatom[WMState], 32, - PropModeReplace, (unsigned char *)data, 2); -} - -int sendevent(Client *c, Atom proto) { - int n; - Atom *protocols; - int exists = 0; - XEvent ev; - - if (XGetWMProtocols(dpy, c->win, &protocols, &n)) { - while (!exists && n--) - exists = protocols[n] == proto; - XFree(protocols); - } - if (exists) { - ev.type = ClientMessage; - ev.xclient.window = c->win; - ev.xclient.message_type = wmatom[WMProtocols]; - ev.xclient.format = 32; - ev.xclient.data.l[0] = proto; - ev.xclient.data.l[1] = CurrentTime; - XSendEvent(dpy, c->win, False, NoEventMask, &ev); - } - return exists; -} - -void setfocus(Client *c) { - if (!c->neverfocus) { - XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime); - XChangeProperty(dpy, root, netatom[NetActiveWindow], XA_WINDOW, 32, - PropModeReplace, (unsigned char *)&(c->win), 1); - } - sendevent(c, wmatom[WMTakeFocus]); -} - -void setfullscreen(Client *c, int fullscreen) { - if (fullscreen && !c->isfullscreen) { - XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32, - PropModeReplace, (unsigned char *)&netatom[NetWMFullscreen], - 1); - c->isfullscreen = 1; - c->oldstate = c->isfloating; - c->oldbw = c->bw; - c->bw = 0; - c->isfloating = 1; - resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh); - XRaiseWindow(dpy, c->win); - } else if (!fullscreen && c->isfullscreen) { - XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32, - PropModeReplace, (unsigned char *)0, 0); - c->isfullscreen = 0; - c->isfloating = c->oldstate; - c->bw = c->oldbw; - c->x = c->oldx; - c->y = c->oldy; - c->w = c->oldw; - c->h = c->oldh; - resizeclient(c, c->x, c->y, c->w, c->h); - arrange(c->mon); - } -} - -void setlayout(const Arg *arg) { - if (!arg || !arg->v || arg->v != selmon->lt[selmon->sellt]) - selmon->sellt ^= 1; - if (arg && arg->v) - selmon->lt[selmon->sellt] = (Layout *)arg->v; - strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, - sizeof selmon->ltsymbol); - if (selmon->sel) - arrange(selmon); - else - drawbar(selmon); -} - -/* arg > 1.0 will set mfact absolutely */ -void setmfact(const Arg *arg) { - float f; - - if (!arg || !selmon->lt[selmon->sellt]->arrange) - return; - f = arg->f < 1.0 ? arg->f + selmon->mfact : arg->f - 1.0; - if (f < 0.05 || f > 0.95) - return; - selmon->mfact = f; - arrange(selmon); -} - -void setup(void) { - int i; - XSetWindowAttributes wa; - Atom utf8string; - struct sigaction sa; - - /* do not transform children into zombies when they terminate */ - sigemptyset(&sa.sa_mask); - sa.sa_flags = SA_NOCLDSTOP | SA_NOCLDWAIT | SA_RESTART; - sa.sa_handler = SIG_IGN; - sigaction(SIGCHLD, &sa, NULL); - - /* clean up any zombies (inherited from .xinitrc etc) immediately */ - while (waitpid(-1, NULL, WNOHANG) > 0) - ; - - /* init screen */ - screen = DefaultScreen(dpy); - sw = DisplayWidth(dpy, screen); - sh = DisplayHeight(dpy, screen); - root = RootWindow(dpy, screen); - drw = drw_create(dpy, screen, root, sw, sh); - if (!drw_fontset_create(drw, fonts, LENGTH(fonts))) - die("no fonts could be loaded."); - lrpad = drw->fonts->h; - bh = drw->fonts->h + 2; - updategeom(); - /* init atoms */ - utf8string = XInternAtom(dpy, "UTF8_STRING", False); - wmatom[WMProtocols] = XInternAtom(dpy, "WM_PROTOCOLS", False); - wmatom[WMDelete] = XInternAtom(dpy, "WM_DELETE_WINDOW", False); - wmatom[WMState] = XInternAtom(dpy, "WM_STATE", False); - wmatom[WMTakeFocus] = XInternAtom(dpy, "WM_TAKE_FOCUS", False); - netatom[NetActiveWindow] = XInternAtom(dpy, "_NET_ACTIVE_WINDOW", False); - netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False); - netatom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False); - netatom[NetWMState] = XInternAtom(dpy, "_NET_WM_STATE", False); - netatom[NetWMCheck] = XInternAtom(dpy, "_NET_SUPPORTING_WM_CHECK", False); - netatom[NetWMFullscreen] = - XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", False); - netatom[NetWMWindowType] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE", False); - netatom[NetWMWindowTypeDialog] = - XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DIALOG", False); - netatom[NetClientList] = XInternAtom(dpy, "_NET_CLIENT_LIST", False); - /* init cursors */ - cursor[CurNormal] = drw_cur_create(drw, XC_left_ptr); - cursor[CurResize] = drw_cur_create(drw, XC_sizing); - cursor[CurMove] = drw_cur_create(drw, XC_fleur); - /* init appearance */ - scheme = ecalloc(LENGTH(colors), sizeof(Clr *)); - for (i = 0; i < LENGTH(colors); i++) - scheme[i] = drw_scm_create(drw, colors[i], 3); - /* init bars */ - updatebars(); - updatestatus(); - /* supporting window for NetWMCheck */ - wmcheckwin = XCreateSimpleWindow(dpy, root, 0, 0, 1, 1, 0, 0, 0); - XChangeProperty(dpy, wmcheckwin, netatom[NetWMCheck], XA_WINDOW, 32, - PropModeReplace, (unsigned char *)&wmcheckwin, 1); - XChangeProperty(dpy, wmcheckwin, netatom[NetWMName], utf8string, 8, - PropModeReplace, (unsigned char *)"dwm", 3); - XChangeProperty(dpy, root, netatom[NetWMCheck], XA_WINDOW, 32, - PropModeReplace, (unsigned char *)&wmcheckwin, 1); - /* EWMH support per view */ - XChangeProperty(dpy, root, netatom[NetSupported], XA_ATOM, 32, - PropModeReplace, (unsigned char *)netatom, NetLast); - XDeleteProperty(dpy, root, netatom[NetClientList]); - /* select events */ - wa.cursor = cursor[CurNormal]->cursor; - wa.event_mask = SubstructureRedirectMask | SubstructureNotifyMask | - ButtonPressMask | PointerMotionMask | EnterWindowMask | - LeaveWindowMask | StructureNotifyMask | PropertyChangeMask; - XChangeWindowAttributes(dpy, root, CWEventMask | CWCursor, &wa); - XSelectInput(dpy, root, wa.event_mask); - grabkeys(); - focus(NULL); -} - -void seturgent(Client *c, int urg) { - XWMHints *wmh; - - c->isurgent = urg; - if (!(wmh = XGetWMHints(dpy, c->win))) - return; - wmh->flags = urg ? (wmh->flags | XUrgencyHint) : (wmh->flags & ~XUrgencyHint); - XSetWMHints(dpy, c->win, wmh); - XFree(wmh); -} - -void showhide(Client *c) { - if (!c) - return; - if (ISVISIBLE(c)) { - /* show clients top down */ - XMoveWindow(dpy, c->win, c->x, c->y); - if ((!c->mon->lt[c->mon->sellt]->arrange || c->isfloating) && - !c->isfullscreen) - resize(c, c->x, c->y, c->w, c->h, 0); - showhide(c->snext); - } else { - /* hide clients bottom up */ - showhide(c->snext); - XMoveWindow(dpy, c->win, WIDTH(c) * -2, c->y); - } -} - -void spawn(const Arg *arg) { - struct sigaction sa; - - // commented out because we dont use dmenu - /* if (arg->v == dmenucmd) */ - /* dmenumon[0] = '0' + selmon->num; */ - if (fork() == 0) { - if (dpy) - close(ConnectionNumber(dpy)); - setsid(); - - sigemptyset(&sa.sa_mask); - sa.sa_flags = 0; - sa.sa_handler = SIG_DFL; - sigaction(SIGCHLD, &sa, NULL); - - execvp(((char **)arg->v)[0], (char **)arg->v); - die("dwm: execvp '%s' failed:", ((char **)arg->v)[0]); - } -} - -void tag(const Arg *arg) { - if (selmon->sel && arg->ui & TAGMASK) { - selmon->sel->tags = arg->ui & TAGMASK; - focus(NULL); - arrange(selmon); - } -} - -void tagmon(const Arg *arg) { - if (!selmon->sel || !mons->next) - return; - sendmon(selmon->sel, dirtomon(arg->i)); -} - -void tile(Monitor *m) { - unsigned int i, n, h, mw, my, ty; - Client *c; - - for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++) - ; - if (n == 0) - return; - - if (n > m->nmaster) - mw = m->nmaster ? m->ww * m->mfact : 0; - else - mw = m->ww; - for (i = my = ty = 0, c = nexttiled(m->clients); c; - c = nexttiled(c->next), i++) - if (i < m->nmaster) { - h = (m->wh - my) / (MIN(n, m->nmaster) - i); - resize(c, m->wx, m->wy + my, mw - (2 * c->bw), h - (2 * c->bw), 0); - if (my + HEIGHT(c) < m->wh) - my += HEIGHT(c); - } else { - h = (m->wh - ty) / (n - i); - resize(c, m->wx + mw, m->wy + ty, m->ww - mw - (2 * c->bw), - h - (2 * c->bw), 0); - if (ty + HEIGHT(c) < m->wh) - ty += HEIGHT(c); - } -} - -void togglebar(const Arg *arg) { - selmon->showbar = !selmon->showbar; - updatebarpos(selmon); - XMoveResizeWindow(dpy, selmon->barwin, selmon->wx, selmon->by, selmon->ww, - bh); - arrange(selmon); -} - -void togglefloating(const Arg *arg) { - if (!selmon->sel) - return; - if (selmon->sel->isfullscreen) /* no support for fullscreen windows */ - return; - selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed; - if (selmon->sel->isfloating) - resize(selmon->sel, selmon->sel->x, selmon->sel->y, selmon->sel->w, - selmon->sel->h, 0); - arrange(selmon); -} - -void toggletag(const Arg *arg) { - unsigned int newtags; - - if (!selmon->sel) - return; - newtags = selmon->sel->tags ^ (arg->ui & TAGMASK); - if (newtags) { - selmon->sel->tags = newtags; - focus(NULL); - arrange(selmon); - } -} - -void toggleview(const Arg *arg) { - unsigned int newtagset = - selmon->tagset[selmon->seltags] ^ (arg->ui & TAGMASK); - - if (newtagset) { - selmon->tagset[selmon->seltags] = newtagset; - focus(NULL); - arrange(selmon); - } -} - -void unfocus(Client *c, int setfocus) { - if (!c) - return; - grabbuttons(c, 0); - XSetWindowBorder(dpy, c->win, scheme[SchemeNorm][ColBorder].pixel); - if (setfocus) { - XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); - XDeleteProperty(dpy, root, netatom[NetActiveWindow]); - } -} - -void unmanage(Client *c, int destroyed) { - Monitor *m = c->mon; - XWindowChanges wc; - - detach(c); - detachstack(c); - if (!destroyed) { - wc.border_width = c->oldbw; - XGrabServer(dpy); /* avoid race conditions */ - XSetErrorHandler(xerrordummy); - XSelectInput(dpy, c->win, NoEventMask); - XConfigureWindow(dpy, c->win, CWBorderWidth, &wc); /* restore border */ - XUngrabButton(dpy, AnyButton, AnyModifier, c->win); - setclientstate(c, WithdrawnState); - XSync(dpy, False); - XSetErrorHandler(xerror); - XUngrabServer(dpy); - } - free(c); - focus(NULL); - updateclientlist(); - arrange(m); -} - -void unmapnotify(XEvent *e) { - Client *c; - XUnmapEvent *ev = &e->xunmap; - - if ((c = wintoclient(ev->window))) { - if (ev->send_event) - setclientstate(c, WithdrawnState); - else - unmanage(c, 0); - } -} - -void updatebars(void) { - Monitor *m; - XSetWindowAttributes wa = {.override_redirect = True, - .background_pixmap = ParentRelative, - .event_mask = ButtonPressMask | ExposureMask}; - XClassHint ch = {"dwm", "dwm"}; - for (m = mons; m; m = m->next) { - if (m->barwin) - continue; - m->barwin = XCreateWindow( - dpy, root, m->wx, m->by, m->ww, bh, 0, DefaultDepth(dpy, screen), - CopyFromParent, DefaultVisual(dpy, screen), - CWOverrideRedirect | CWBackPixmap | CWEventMask, &wa); - XDefineCursor(dpy, m->barwin, cursor[CurNormal]->cursor); - XMapRaised(dpy, m->barwin); - XSetClassHint(dpy, m->barwin, &ch); - } -} - -void updatebarpos(Monitor *m) { - m->wy = m->my; - m->wh = m->mh; - if (m->showbar) { - m->wh -= bh; - m->by = m->topbar ? m->wy : m->wy + m->wh; - m->wy = m->topbar ? m->wy + bh : m->wy; - } else - m->by = -bh; -} - -void updateclientlist(void) { - Client *c; - Monitor *m; - - XDeleteProperty(dpy, root, netatom[NetClientList]); - for (m = mons; m; m = m->next) - for (c = m->clients; c; c = c->next) - XChangeProperty(dpy, root, netatom[NetClientList], XA_WINDOW, 32, - PropModeAppend, (unsigned char *)&(c->win), 1); -} - -int updategeom(void) { - int dirty = 0; - -#ifdef XINERAMA - if (XineramaIsActive(dpy)) { - int i, j, n, nn; - Client *c; - Monitor *m; - XineramaScreenInfo *info = XineramaQueryScreens(dpy, &nn); - XineramaScreenInfo *unique = NULL; - - for (n = 0, m = mons; m; m = m->next, n++) - ; - /* only consider unique geometries as separate screens */ - unique = ecalloc(nn, sizeof(XineramaScreenInfo)); - for (i = 0, j = 0; i < nn; i++) - if (isuniquegeom(unique, j, &info[i])) - memcpy(&unique[j++], &info[i], sizeof(XineramaScreenInfo)); - XFree(info); - nn = j; - - /* new monitors if nn > n */ - for (i = n; i < nn; i++) { - for (m = mons; m && m->next; m = m->next) - ; - if (m) - m->next = createmon(); - else - mons = createmon(); - } - for (i = 0, m = mons; i < nn && m; m = m->next, i++) - if (i >= n || unique[i].x_org != m->mx || unique[i].y_org != m->my || - unique[i].width != m->mw || unique[i].height != m->mh) { - dirty = 1; - m->num = i; - m->mx = m->wx = unique[i].x_org; - m->my = m->wy = unique[i].y_org; - m->mw = m->ww = unique[i].width; - m->mh = m->wh = unique[i].height; - updatebarpos(m); - } - /* removed monitors if n > nn */ - for (i = nn; i < n; i++) { - for (m = mons; m && m->next; m = m->next) - ; - while ((c = m->clients)) { - dirty = 1; - m->clients = c->next; - detachstack(c); - c->mon = mons; - attach(c); - attachstack(c); - } - if (m == selmon) - selmon = mons; - cleanupmon(m); - } - free(unique); - } else -#endif /* XINERAMA */ - { /* default monitor setup */ - if (!mons) - mons = createmon(); - if (mons->mw != sw || mons->mh != sh) { - dirty = 1; - mons->mw = mons->ww = sw; - mons->mh = mons->wh = sh; - updatebarpos(mons); - } - } - if (dirty) { - selmon = mons; - selmon = wintomon(root); - } - return dirty; -} - -void updatenumlockmask(void) { - unsigned int i, j; - XModifierKeymap *modmap; - - numlockmask = 0; - modmap = XGetModifierMapping(dpy); - for (i = 0; i < 8; i++) - for (j = 0; j < modmap->max_keypermod; j++) - if (modmap->modifiermap[i * modmap->max_keypermod + j] == - XKeysymToKeycode(dpy, XK_Num_Lock)) - numlockmask = (1 << i); - XFreeModifiermap(modmap); -} - -void updatesizehints(Client *c) { - long msize; - XSizeHints size; - - if (!XGetWMNormalHints(dpy, c->win, &size, &msize)) - /* size is uninitialized, ensure that size.flags aren't used */ - size.flags = PSize; - if (size.flags & PBaseSize) { - c->basew = size.base_width; - c->baseh = size.base_height; - } else if (size.flags & PMinSize) { - c->basew = size.min_width; - c->baseh = size.min_height; - } else - c->basew = c->baseh = 0; - if (size.flags & PResizeInc) { - c->incw = size.width_inc; - c->inch = size.height_inc; - } else - c->incw = c->inch = 0; - if (size.flags & PMaxSize) { - c->maxw = size.max_width; - c->maxh = size.max_height; - } else - c->maxw = c->maxh = 0; - if (size.flags & PMinSize) { - c->minw = size.min_width; - c->minh = size.min_height; - } else if (size.flags & PBaseSize) { - c->minw = size.base_width; - c->minh = size.base_height; - } else - c->minw = c->minh = 0; - if (size.flags & PAspect) { - c->mina = (float)size.min_aspect.y / size.min_aspect.x; - c->maxa = (float)size.max_aspect.x / size.max_aspect.y; - } else - c->maxa = c->mina = 0.0; - c->isfixed = (c->maxw && c->maxh && c->maxw == c->minw && c->maxh == c->minh); - c->hintsvalid = 1; -} - -void updatestatus(void) { - if (!gettextprop(root, XA_WM_NAME, stext, sizeof(stext))) - strcpy(stext, "dwm-" VERSION); - drawbar(selmon); -} - -void updatetitle(Client *c) { - if (!gettextprop(c->win, netatom[NetWMName], c->name, sizeof c->name)) - gettextprop(c->win, XA_WM_NAME, c->name, sizeof c->name); - if (c->name[0] == '\0') /* hack to mark broken clients */ - strcpy(c->name, broken); -} - -void updatewindowtype(Client *c) { - Atom state = getatomprop(c, netatom[NetWMState]); - Atom wtype = getatomprop(c, netatom[NetWMWindowType]); - - if (state == netatom[NetWMFullscreen]) - setfullscreen(c, 1); - if (wtype == netatom[NetWMWindowTypeDialog]) - c->isfloating = 1; -} - -void updatewmhints(Client *c) { - XWMHints *wmh; - - if ((wmh = XGetWMHints(dpy, c->win))) { - if (c == selmon->sel && wmh->flags & XUrgencyHint) { - wmh->flags &= ~XUrgencyHint; - XSetWMHints(dpy, c->win, wmh); - } else - c->isurgent = (wmh->flags & XUrgencyHint) ? 1 : 0; - if (wmh->flags & InputHint) - c->neverfocus = !wmh->input; - else - c->neverfocus = 0; - XFree(wmh); - } -} - -void view(const Arg *arg) { - if ((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags]) - return; - selmon->seltags ^= 1; /* toggle sel tagset */ - if (arg->ui & TAGMASK) - selmon->tagset[selmon->seltags] = arg->ui & TAGMASK; - focus(NULL); - arrange(selmon); -} - -Client *wintoclient(Window w) { - Client *c; - Monitor *m; - - for (m = mons; m; m = m->next) - for (c = m->clients; c; c = c->next) - if (c->win == w) - return c; - return NULL; -} - -Monitor *wintomon(Window w) { - int x, y; - Client *c; - Monitor *m; - - if (w == root && getrootptr(&x, &y)) - return recttomon(x, y, 1, 1); - for (m = mons; m; m = m->next) - if (w == m->barwin) - return m; - if ((c = wintoclient(w))) - return c->mon; - return selmon; -} - -/* There's no way to check accesses to destroyed windows, thus those cases are - * ignored (especially on UnmapNotify's). Other types of errors call Xlibs - * default error handler, which may call exit. */ -int xerror(Display *dpy, XErrorEvent *ee) { - if (ee->error_code == BadWindow || - (ee->request_code == X_SetInputFocus && ee->error_code == BadMatch) || - (ee->request_code == X_PolyText8 && ee->error_code == BadDrawable) || - (ee->request_code == X_PolyFillRectangle && - ee->error_code == BadDrawable) || - (ee->request_code == X_PolySegment && ee->error_code == BadDrawable) || - (ee->request_code == X_ConfigureWindow && ee->error_code == BadMatch) || - (ee->request_code == X_GrabButton && ee->error_code == BadAccess) || - (ee->request_code == X_GrabKey && ee->error_code == BadAccess) || - (ee->request_code == X_CopyArea && ee->error_code == BadDrawable)) - return 0; - fprintf(stderr, "dwm: fatal error: request code=%d, error code=%d\n", - ee->request_code, ee->error_code); - return xerrorxlib(dpy, ee); /* may call exit */ -} - -int xerrordummy(Display *dpy, XErrorEvent *ee) { return 0; } - -/* Startup Error handler to check if another window manager - * is already running. */ -int xerrorstart(Display *dpy, XErrorEvent *ee) { - die("dwm: another window manager is already running"); - return -1; -} - -void zoom(const Arg *arg) { - Client *c = selmon->sel; - - if (!selmon->lt[selmon->sellt]->arrange || !c || c->isfloating) - return; - if (c == nexttiled(selmon->clients) && !(c = nexttiled(c->next))) - return; - pop(c); -} - -int main(int argc, char *argv[]) { - if (argc == 2 && !strcmp("-v", argv[1])) - die("dwm-" VERSION); - else if (argc != 1) - die("usage: dwm [-v]"); - if (!setlocale(LC_CTYPE, "") || !XSupportsLocale()) - fputs("warning: no locale support\n", stderr); - if (!(dpy = XOpenDisplay(NULL))) - die("dwm: cannot open display"); - checkotherwm(); - setup(); -#ifdef __OpenBSD__ - if (pledge("stdio rpath proc exec", NULL) == -1) - die("pledge"); -#endif /* __OpenBSD__ */ - scan(); - run(); - cleanup(); - XCloseDisplay(dpy); - return EXIT_SUCCESS; -} diff --git a/config/dwm/dwm.png b/config/dwm/dwm.png deleted file mode 100644 index b1f9ba7e5f4cc7350ee2392ebcea5fcbe00fb49b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 373 zcmeAS@N?(olHy`uVBq!ia0vp^2Y@($g9*gC@m3f}u_bxCyDx`7I;J! zGca%iWx0hJ8D`Cq01C2~c>21sUt<^MF=V?Ztt9{yk}YwKC~?lu%}vcKVQ?-=O)N=G zQ7F$W$xsN%NL6t6^bL5QqM8R(c+=CxF{I+w+q;fj4F)_6j>`Z3pZ>_($QEQ&92OXP z%lpEKGwG8$G-U1H{@Y%;mx-mNK|p|siBVAj$Z~Mt-~h6K0!}~{PyozQ07(f5fTdVi zm=-zT`NweeJ#%S&{fequZGmkDDC*%x$$Sa*fAP=$`nJkhx1Y~k<8b2;Hq)FOdV=P$ q&oWzoxz_&nv&n0)xBzV8k*jsxheTIy&cCY600f?{elF{r5}E*x)opSB diff --git a/config/dwm/transient.c b/config/dwm/transient.c deleted file mode 100644 index 040adb5b..00000000 --- a/config/dwm/transient.c +++ /dev/null @@ -1,42 +0,0 @@ -/* cc transient.c -o transient -lX11 */ - -#include -#include -#include -#include - -int main(void) { - Display *d; - Window r, f, t = None; - XSizeHints h; - XEvent e; - - d = XOpenDisplay(NULL); - if (!d) - exit(1); - r = DefaultRootWindow(d); - - f = XCreateSimpleWindow(d, r, 100, 100, 400, 400, 0, 0, 0); - h.min_width = h.max_width = h.min_height = h.max_height = 400; - h.flags = PMinSize | PMaxSize; - XSetWMNormalHints(d, f, &h); - XStoreName(d, f, "floating"); - XMapWindow(d, f); - - XSelectInput(d, f, ExposureMask); - while (1) { - XNextEvent(d, &e); - - if (t == None) { - sleep(5); - t = XCreateSimpleWindow(d, r, 50, 50, 100, 100, 0, 0, 0); - XSetTransientForHint(d, t, f); - XStoreName(d, t, "transient"); - XMapWindow(d, t); - XSelectInput(d, t, ExposureMask); - } - } - - XCloseDisplay(d); - exit(0); -} diff --git a/config/dwm/util.c b/config/dwm/util.c deleted file mode 100644 index 96b82c98..00000000 --- a/config/dwm/util.c +++ /dev/null @@ -1,36 +0,0 @@ -/* See LICENSE file for copyright and license details. */ -#include -#include -#include -#include - -#include "util.h" - -void -die(const char *fmt, ...) -{ - va_list ap; - - va_start(ap, fmt); - vfprintf(stderr, fmt, ap); - va_end(ap); - - if (fmt[0] && fmt[strlen(fmt)-1] == ':') { - fputc(' ', stderr); - perror(NULL); - } else { - fputc('\n', stderr); - } - - exit(1); -} - -void * -ecalloc(size_t nmemb, size_t size) -{ - void *p; - - if (!(p = calloc(nmemb, size))) - die("calloc:"); - return p; -} diff --git a/config/dwm/util.h b/config/dwm/util.h deleted file mode 100644 index f633b517..00000000 --- a/config/dwm/util.h +++ /dev/null @@ -1,8 +0,0 @@ -/* See LICENSE file for copyright and license details. */ - -#define MAX(A, B) ((A) > (B) ? (A) : (B)) -#define MIN(A, B) ((A) < (B) ? (A) : (B)) -#define BETWEEN(X, A, B) ((A) <= (X) && (X) <= (B)) - -void die(const char *fmt, ...); -void *ecalloc(size_t nmemb, size_t size); diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index e604c43c..b82aa979 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -3,7 +3,6 @@ # window managers ./awesome ./bspwm - ./dwm ./hyprland ./xmonad ./qtile diff --git a/modules/desktop/dwm/default.nix b/modules/desktop/dwm/default.nix deleted file mode 100644 index 2a1a0136..00000000 --- a/modules/desktop/dwm/default.nix +++ /dev/null @@ -1,110 +0,0 @@ -{ - outputs, - options, - config, - lib, - pkgs, - ... -}: -let - cfg = config.modules.desktop.dwm; -in { - options.modules.desktop.dwm = { - enable = lib.mkEnableOption false; - }; - - config = lib.mkIf cfg.enable { - # this needs to be enabled for gtk apps - programs.dconf.enable = true; - # enable dwm - services.displayManager.defaultSession = "none+dwm"; - - services.xserver = { - enable = true; - windowManager = { - dwm.enable = true; - }; - displayManager = { - lightdm = { - enable = true; - background = ../../../config/background.png; - greeters.gtk = { - enable = true; - theme = { - name = "vimix-dark-ruby"; - package = pkgs.vimix-gtk-themes; - }; - cursorTheme = { - name = "Catppuccin-Mocha-Dark"; - size = 16; - package = pkgs.catppuccin-cursors.mochaDark; - }; - }; - # greeters.mini = { - # enable = true; - # user = "sako"; - # extraConfig = '' - # [greeter] - # show-password-label = true - # password-label-text = magic word - # invalid-password-text = skull issue - # ''; - # }; - }; - }; - }; - - services.libinput = { - mouse = { - accelProfile = "flat"; - }; - - touchpad = { - accelProfile = "flat"; - }; - }; - users.users.sako.packages = with pkgs; [ - rofi - # network - networkmanagerapplet - # brightness - brightnessctl - # gee tee k - vimix-gtk-themes - vimix-icon-theme - lxappearance - catppuccin-cursors.mochaDark - # screen shot (s) - flameshot - # clipboard - xclip - ]; - home-manager.users.sako = {pkgs, ...}: { - home.file = { - "background.png" = { - enable = true; - source = ../../../config/background.png; - }; - ".dwmscripts" = { - enable = true; - recursive = true; - source = ../../../config/dwmbar; - }; - }; - home.pointerCursor = { - name = "Catppuccin-Mocha-Dark"; - size = 16; - x11 = { - enable = true; - }; - gtk.enable = true; - package = pkgs.catppuccin-cursors.mochaDark; - }; - gtk = { - enable = true; - theme.name = "vimix-dark-ruby"; - iconTheme.name = "Vimix Ruby Dark"; - }; - }; - }; -} From b7f57b292c635bc771781e6af94c52214236da51 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Fri, 27 Sep 2024 23:23:57 +0400 Subject: [PATCH 100/319] desktop: remove qtile --- config/qtile/config.py | 213 ------------------------------ modules/desktop/default.nix | 1 - modules/desktop/qtile/default.nix | 97 -------------- 3 files changed, 311 deletions(-) delete mode 100644 config/qtile/config.py delete mode 100644 modules/desktop/qtile/default.nix diff --git a/config/qtile/config.py b/config/qtile/config.py deleted file mode 100644 index b1463fd4..00000000 --- a/config/qtile/config.py +++ /dev/null @@ -1,213 +0,0 @@ -# Copyright (c) 2010 Aldo Cortesi -# Copyright (c) 2010, 2014 dequis -# Copyright (c) 2012 Randall Ma -# Copyright (c) 2012-2014 Tycho Andersen -# Copyright (c) 2012 Craig Barnes -# Copyright (c) 2013 horsik -# Copyright (c) 2013 Tao Sauvage -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - -from libqtile import bar, layout, widget -from libqtile.config import Click, Drag, Group, Key, Match, Screen -from libqtile.lazy import lazy -from libqtile.utils import guess_terminal - -mod = "mod4" -terminal = "kitty" - -keys = [ - # A list of available commands that can be bound to keys can be found - # at https://docs.qtile.org/en/latest/manual/config/lazy.html - # Switch between windows - Key([mod], "h", lazy.layout.left(), desc="Move focus to left"), - Key([mod], "l", lazy.layout.right(), desc="Move focus to right"), - Key([mod], "j", lazy.layout.down(), desc="Move focus down"), - Key([mod], "k", lazy.layout.up(), desc="Move focus up"), - Key([mod], "space", lazy.layout.next(), desc="Move window focus to other window"), - # Move windows between left/right columns or move up/down in current stack. - # Moving out of range in Columns layout will create new column. - Key( - [mod, "shift"], "h", lazy.layout.shuffle_left(), desc="Move window to the left" - ), - Key( - [mod, "shift"], - "l", - lazy.layout.shuffle_right(), - desc="Move window to the right", - ), - Key([mod, "shift"], "j", lazy.layout.shuffle_down(), desc="Move window down"), - Key([mod, "shift"], "k", lazy.layout.shuffle_up(), desc="Move window up"), - # Grow windows. If current window is on the edge of screen and direction - # will be to screen edge - window would shrink. - Key([mod, "control"], "h", lazy.layout.grow_left(), desc="Grow window to the left"), - Key( - [mod, "control"], "l", lazy.layout.grow_right(), desc="Grow window to the right" - ), - Key([mod, "control"], "j", lazy.layout.grow_down(), desc="Grow window down"), - Key([mod, "control"], "k", lazy.layout.grow_up(), desc="Grow window up"), - Key([mod], "n", lazy.layout.normalize(), desc="Reset all window sizes"), - # Toggle between split and unsplit sides of stack. - # Split = all windows displayed - # Unsplit = 1 window displayed, like Max layout, but still with - # multiple stack panes - Key( - [mod, "shift"], - "Return", - lazy.layout.toggle_split(), - desc="Toggle between split and unsplit sides of stack", - ), - Key([mod], "Return", lazy.spawn(terminal), desc="Launch terminal"), - # Toggle between different layouts as defined below - Key([mod], "Tab", lazy.next_layout(), desc="Toggle between layouts"), - Key([mod], "w", lazy.window.kill(), desc="Kill focused window"), - Key([mod, "control"], "r", lazy.reload_config(), desc="Reload the config"), - Key([mod, "control"], "q", lazy.shutdown(), desc="Shutdown Qtile"), - Key([mod], "r", lazy.spawncmd(), desc="Spawn a command using a prompt widget"), -] - -groups = [Group(i) for i in "123456789"] - -for i in groups: - keys.extend( - [ - # mod1 + letter of group = switch to group - Key( - [mod], - i.name, - lazy.group[i.name].toscreen(), - desc="Switch to group {}".format(i.name), - ), - # mod1 + shift + letter of group = switch to & move focused window to group - Key( - [mod, "shift"], - i.name, - lazy.window.togroup(i.name, switch_group=True), - desc="Switch to & move focused window to group {}".format(i.name), - ), - # Or, use below if you prefer not to switch to that group. - # # mod1 + shift + letter of group = move focused window to group - # Key([mod, "shift"], i.name, lazy.window.togroup(i.name), - # desc="move focused window to group {}".format(i.name)), - ] - ) - -layouts = [ - layout.Columns(border_focus_stack=["#d75f5f", "#8f3d3d"], border_width=4), - layout.Max(), - # Try more layouts by unleashing below layouts. - # layout.Stack(num_stacks=2), - # layout.Bsp(), - # layout.Matrix(), - # layout.MonadTall(), - # layout.MonadWide(), - # layout.RatioTile(), - # layout.Tile(), - # layout.TreeTab(), - # layout.VerticalTile(), - # layout.Zoomy(), -] - -widget_defaults = dict( - font="sans", - fontsize=12, - padding=3, -) -extension_defaults = widget_defaults.copy() - -screens = [ - Screen( - bottom=bar.Bar( - [ - widget.CurrentLayout(), - widget.GroupBox(), - widget.Prompt(), - widget.WindowName(), - widget.Chord( - chords_colors={ - "launch": ("#ff0000", "#ffffff"), - }, - name_transform=lambda name: name.upper(), - ), - widget.TextBox("default config", name="default"), - widget.TextBox("Press <M-r> to spawn", foreground="#d75f5f"), - # NB Systray is incompatible with Wayland, consider using StatusNotifier instead - # widget.StatusNotifier(), - widget.Systray(), - widget.Clock(format="%Y-%m-%d %a %I:%M %p"), - widget.QuickExit(), - ], - 24, - # border_width=[2, 0, 2, 0], # Draw top and bottom borders - # border_color=["ff00ff", "000000", "ff00ff", "000000"] # Borders are magenta - ), - ), -] - -# Drag floating layouts. -mouse = [ - Drag( - [mod], - "Button1", - lazy.window.set_position_floating(), - start=lazy.window.get_position(), - ), - Drag( - [mod], "Button3", lazy.window.set_size_floating(), start=lazy.window.get_size() - ), - Click([mod], "Button2", lazy.window.bring_to_front()), -] - -dgroups_key_binder = None -dgroups_app_rules = [] # type: list -follow_mouse_focus = True -bring_front_click = False -cursor_warp = False -floating_layout = layout.Floating( - float_rules=[ - # Run the utility of `xprop` to see the wm class and name of an X client. - *layout.Floating.default_float_rules, - Match(wm_class="confirmreset"), # gitk - Match(wm_class="makebranch"), # gitk - Match(wm_class="maketag"), # gitk - Match(wm_class="ssh-askpass"), # ssh-askpass - Match(title="branchdialog"), # gitk - Match(title="pinentry"), # GPG key password entry - ] -) -auto_fullscreen = True -focus_on_window_activation = "smart" -reconfigure_screens = True - -# If things like steam games want to auto-minimize themselves when losing -# focus, should we respect this or not? -auto_minimize = True - -# When using the Wayland backend, this can be used to configure input devices. -wl_input_rules = None - -# XXX: Gasp! We're lying here. In fact, nobody really uses or cares about this -# string besides java UI toolkits; you can see several discussions on the -# mailing lists, GitHub issues, and other WM documentation that suggest setting -# this string if your java app doesn't work correctly. We may as well just lie -# and say that we're a working one by default. -# -# We choose LG3D to maximize irony: it is a 3D non-reparenting WM written in -# java that happens to be on java's whitelist. -wmname = "LG3D" diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index b82aa979..89251b90 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -5,7 +5,6 @@ ./bspwm ./hyprland ./xmonad - ./qtile ./exwm ./i3 # desktop environ men t s s s s diff --git a/modules/desktop/qtile/default.nix b/modules/desktop/qtile/default.nix deleted file mode 100644 index 8b2b8cc6..00000000 --- a/modules/desktop/qtile/default.nix +++ /dev/null @@ -1,97 +0,0 @@ -{ - outputs, - options, - config, - lib, - pkgs, - ... -}: -let - cfg = config.modules.desktop.qtile; -in { - options.modules.desktop.qtile = { - enable = lib.mkEnableOption false; - }; - - #TODO Do this - - config = lib.mkIf cfg.enable { - services.xserver = { - enable = true; - windowManager.qtile = { - enable = true; - }; - displayManager = { - defaultSession = "none+qtile"; - lightdm = { - enable = true; - background = ../../../config/background.png; - greeters.gtk = { - enable = true; - theme = { - name = "vimix-dark-ruby"; - package = pkgs.vimix-gtk-themes; - }; - }; - }; - }; - libinput = { - enable = true; - - # no mouse accel - mouse = { - accelProfile = "flat"; - }; - - # no touchpad accel - touchpad = { - accelProfile = "flat"; - }; - }; - }; - users.users.sako.packages = with pkgs; [ - rofi - # network - networkmanagerapplet - # brightness - brightnessctl - # gee tee k - vimix-gtk-themes - vimix-icon-theme - lxappearance - catppuccin-cursors.mochaDark - # screen shot (s) - flameshot - ]; - - home-manager.users.sako = {pkgs, ...}: { - home.pointerCursor = { - name = "Catppuccin-Mocha-Dark"; - size = 16; - x11 = { - enable = true; - }; - gtk.enable = true; - package = pkgs.catppuccin-cursors.mochaDark; - }; - gtk = { - enable = true; - theme.name = "vimix-dark-ruby"; - iconTheme.name = "Vimix Ruby Dark"; - }; - home.file = { - "background.png" = { - enable = true; - source = ../../../config/background.png; - }; - }; - #xdg.configFile = { - # qtile = { - # enable = true; - # source = ../../../config/qtile; - # recursive = true; - # }; - #}; - }; - }; -} From 2c8d28fc5ab98b08001acdf918050271fea036e8 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Fri, 27 Sep 2024 23:51:40 +0400 Subject: [PATCH 101/319] config: remove dwm remains --- config/dwm-old/LICENSE | 38 - config/dwm-old/Makefile | 51 - config/dwm-old/README | 48 - config/dwm-old/config.def.h | 131 -- config/dwm-old/config.def.h.orig | 123 -- config/dwm-old/config.mk | 39 - config/dwm-old/drw.c | 450 ----- config/dwm-old/drw.h | 58 - config/dwm-old/dwm.1 | 176 -- config/dwm-old/dwm.c | 2684 ------------------------------ config/dwm-old/dwm.c.orig | 2634 ----------------------------- config/dwm-old/dwm.c.rej | 29 - config/dwm-old/dwm.png | Bin 373 -> 0 bytes config/dwm-old/transient.c | 42 - config/dwm-old/util.c | 36 - config/dwm-old/util.h | 8 - config/dwmbar/bar.sh | 30 - 17 files changed, 6577 deletions(-) delete mode 100644 config/dwm-old/LICENSE delete mode 100644 config/dwm-old/Makefile delete mode 100644 config/dwm-old/README delete mode 100644 config/dwm-old/config.def.h delete mode 100644 config/dwm-old/config.def.h.orig delete mode 100644 config/dwm-old/config.mk delete mode 100644 config/dwm-old/drw.c delete mode 100644 config/dwm-old/drw.h delete mode 100644 config/dwm-old/dwm.1 delete mode 100644 config/dwm-old/dwm.c delete mode 100644 config/dwm-old/dwm.c.orig delete mode 100644 config/dwm-old/dwm.c.rej delete mode 100644 config/dwm-old/dwm.png delete mode 100644 config/dwm-old/transient.c delete mode 100644 config/dwm-old/util.c delete mode 100644 config/dwm-old/util.h delete mode 100755 config/dwmbar/bar.sh diff --git a/config/dwm-old/LICENSE b/config/dwm-old/LICENSE deleted file mode 100644 index 995172fa..00000000 --- a/config/dwm-old/LICENSE +++ /dev/null @@ -1,38 +0,0 @@ -MIT/X Consortium License - -© 2006-2019 Anselm R Garbe -© 2006-2009 Jukka Salmi -© 2006-2007 Sander van Dijk -© 2007-2011 Peter Hartlich -© 2007-2009 Szabolcs Nagy -© 2007-2009 Christof Musik -© 2007-2009 Premysl Hruby -© 2007-2008 Enno Gottox Boland -© 2008 Martin Hurton -© 2008 Neale Pickett -© 2009 Mate Nagy -© 2010-2016 Hiltjo Posthuma -© 2010-2012 Connor Lane Smith -© 2011 Christoph Lohmann <20h@r-36.net> -© 2015-2016 Quentin Rameau -© 2015-2016 Eric Pruitt -© 2016-2017 Markus Teich -© 2020-2022 Chris Down - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. diff --git a/config/dwm-old/Makefile b/config/dwm-old/Makefile deleted file mode 100644 index 77bcbc02..00000000 --- a/config/dwm-old/Makefile +++ /dev/null @@ -1,51 +0,0 @@ -# dwm - dynamic window manager -# See LICENSE file for copyright and license details. - -include config.mk - -SRC = drw.c dwm.c util.c -OBJ = ${SRC:.c=.o} - -all: options dwm - -options: - @echo dwm build options: - @echo "CFLAGS = ${CFLAGS}" - @echo "LDFLAGS = ${LDFLAGS}" - @echo "CC = ${CC}" - -.c.o: - ${CC} -c ${CFLAGS} $< - -${OBJ}: config.h config.mk - -config.h: - cp config.def.h $@ - -dwm: ${OBJ} - ${CC} -o $@ ${OBJ} ${LDFLAGS} - -clean: - rm -f dwm ${OBJ} dwm-${VERSION}.tar.gz - -dist: clean - mkdir -p dwm-${VERSION} - cp -R LICENSE Makefile README config.def.h config.mk\ - dwm.1 drw.h util.h ${SRC} dwm.png transient.c dwm-${VERSION} - tar -cf dwm-${VERSION}.tar dwm-${VERSION} - gzip dwm-${VERSION}.tar - rm -rf dwm-${VERSION} - -install: all - mkdir -p ${DESTDIR}${PREFIX}/bin - cp -f dwm ${DESTDIR}${PREFIX}/bin - chmod 755 ${DESTDIR}${PREFIX}/bin/dwm - mkdir -p ${DESTDIR}${MANPREFIX}/man1 - sed "s/VERSION/${VERSION}/g" < dwm.1 > ${DESTDIR}${MANPREFIX}/man1/dwm.1 - chmod 644 ${DESTDIR}${MANPREFIX}/man1/dwm.1 - -uninstall: - rm -f ${DESTDIR}${PREFIX}/bin/dwm\ - ${DESTDIR}${MANPREFIX}/man1/dwm.1 - -.PHONY: all options clean dist install uninstall diff --git a/config/dwm-old/README b/config/dwm-old/README deleted file mode 100644 index 95d4fd05..00000000 --- a/config/dwm-old/README +++ /dev/null @@ -1,48 +0,0 @@ -dwm - dynamic window manager -============================ -dwm is an extremely fast, small, and dynamic window manager for X. - - -Requirements ------------- -In order to build dwm you need the Xlib header files. - - -Installation ------------- -Edit config.mk to match your local setup (dwm is installed into -the /usr/local namespace by default). - -Afterwards enter the following command to build and install dwm (if -necessary as root): - - make clean install - - -Running dwm ------------ -Add the following line to your .xinitrc to start dwm using startx: - - exec dwm - -In order to connect dwm to a specific display, make sure that -the DISPLAY environment variable is set correctly, e.g.: - - DISPLAY=foo.bar:1 exec dwm - -(This will start dwm on display :1 of the host foo.bar.) - -In order to display status info in the bar, you can do something -like this in your .xinitrc: - - while xsetroot -name "`date` `uptime | sed 's/.*,//'`" - do - sleep 1 - done & - exec dwm - - -Configuration -------------- -The configuration of dwm is done by creating a custom config.h -and (re)compiling the source code. diff --git a/config/dwm-old/config.def.h b/config/dwm-old/config.def.h deleted file mode 100644 index 8a275dc8..00000000 --- a/config/dwm-old/config.def.h +++ /dev/null @@ -1,131 +0,0 @@ -/* See LICENSE file for copyright and license details. */ - -/* appearance */ -static const unsigned int borderpx = 1; /* border pixel of windows */ -static const unsigned int snap = 32; /* snap pixel */ -static const unsigned int systraypinning = 0; /* 0: sloppy systray follows selected monitor, >0: pin systray to monitor X */ -static const unsigned int systrayonleft = 0; /* 0: systray in the right corner, >0: systray on left of status text */ -static const unsigned int systrayspacing = 2; /* systray spacing */ -static const int systraypinningfailfirst = 1; /* 1: if pinning fails, display systray on the first monitor, False: display systray on the last monitor*/ -static const int showsystray = 1; /* 0 means no systray */ -static const int showbar = 1; /* 0 means no bar */ -static const int topbar = 1; /* 0 means bottom bar */ -static const char *fonts[] = { "JetBrainsMono NF:size=10" }; -static const char dmenufont[] = "monospace:size=10"; -// default colors -static const char col_gray1[] = "#222222"; -static const char col_gray2[] = "#444444"; -static const char col_gray3[] = "#bbbbbb"; -static const char col_gray4[] = "#eeeeee"; -static const char col_cyan[] = "#005577"; -// default colors -static const char *colors[][3] = { - /* fg bg border */ - [SchemeNorm] = { col_gray3, col_gray1, col_gray2 }, - [SchemeSel] = { col_gray4, col_cyan, col_cyan }, -}; - -static const char *const autostart[] = { - "picom", NULL, - "keepassxc", NULL, - "nm-applet", NULL, - "blueman-applet", NULL, - NULL /* terminate */ -}; - -/* tagging */ -static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; - -static const Rule rules[] = { - /* xprop(1): - * WM_CLASS(STRING) = instance, class - * WM_NAME(STRING) = title - */ - /* class instance title tags mask isfloating monitor */ - { "Gimp", NULL, NULL, 0, 1, -1 }, - { "Firefox", NULL, NULL, 1 << 8, 0, -1 }, -}; - -/* layout(s) */ -static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */ -static const int nmaster = 1; /* number of clients in master area */ -static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */ -static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */ - -static const Layout layouts[] = { - /* symbol arrange function */ - { "[]=", tile }, /* first entry is default */ - { "><>", NULL }, /* no layout function means floating behavior */ - { "[M]", monocle }, -}; - -/* key definitions */ -#define MODKEY Mod4Mask -#define TAGKEYS(KEY,TAG) \ - { MODKEY, KEY, view, {.ui = 1 << TAG} }, \ - { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ - { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \ - { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, - -/* helper for spawning shell commands in the pre dwm-5.0 fashion */ -#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } - -/* commands */ -static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ -static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL }; -static const char *roficmd[] = { "rofi", "-show-icons", "-show", "drun", NULL }; -static const char *termcmd[] = { "kitty", NULL }; - -static const Key keys[] = { - /* modifier key function argument */ - { MODKEY, XK_space, spawn, {.v = roficmd } }, - { MODKEY, XK_Return, spawn, {.v = termcmd } }, - { MODKEY, XK_b, togglebar, {0} }, - { MODKEY, XK_j, focusstack, {.i = +1 } }, - { MODKEY, XK_k, focusstack, {.i = -1 } }, - { MODKEY, XK_i, incnmaster, {.i = +1 } }, - { MODKEY, XK_d, incnmaster, {.i = -1 } }, - { MODKEY, XK_h, setmfact, {.f = -0.05} }, - { MODKEY, XK_l, setmfact, {.f = +0.05} }, - { MODKEY|ShiftMask, XK_Return, zoom, {0} }, - { MODKEY, XK_Tab, view, {0} }, - { MODKEY, XK_w, killclient, {0} }, - { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, - { MODKEY, XK_f, setlayout, {.v = &layouts[1]} }, - { MODKEY, XK_m, setlayout, {.v = &layouts[2]} }, - { MODKEY, XK_p, setlayout, {0} }, - { MODKEY|ShiftMask, XK_p, togglefloating, {0} }, - { MODKEY, XK_0, view, {.ui = ~0 } }, - { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, - { MODKEY, XK_comma, focusmon, {.i = -1 } }, - { MODKEY, XK_period, focusmon, {.i = +1 } }, - { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, - { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, - TAGKEYS( XK_1, 0) - TAGKEYS( XK_2, 1) - TAGKEYS( XK_3, 2) - TAGKEYS( XK_4, 3) - TAGKEYS( XK_5, 4) - TAGKEYS( XK_6, 5) - TAGKEYS( XK_7, 6) - TAGKEYS( XK_8, 7) - TAGKEYS( XK_9, 8) - { MODKEY|ShiftMask, XK_q, quit, {0} }, -}; - -/* button definitions */ -/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */ -static const Button buttons[] = { - /* click event mask button function argument */ - { ClkLtSymbol, 0, Button1, setlayout, {0} }, - { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} }, - { ClkWinTitle, 0, Button2, zoom, {0} }, - { ClkStatusText, 0, Button2, spawn, {.v = termcmd } }, - { ClkClientWin, MODKEY, Button1, movemouse, {0} }, - { ClkClientWin, MODKEY, Button2, togglefloating, {0} }, - { ClkClientWin, MODKEY, Button3, resizemouse, {0} }, - { ClkTagBar, 0, Button1, view, {0} }, - { ClkTagBar, 0, Button3, toggleview, {0} }, - { ClkTagBar, MODKEY, Button1, tag, {0} }, - { ClkTagBar, MODKEY, Button3, toggletag, {0} }, -}; diff --git a/config/dwm-old/config.def.h.orig b/config/dwm-old/config.def.h.orig deleted file mode 100644 index 5b674f4b..00000000 --- a/config/dwm-old/config.def.h.orig +++ /dev/null @@ -1,123 +0,0 @@ -/* See LICENSE file for copyright and license details. */ - -/* appearance */ -static const unsigned int borderpx = 1; /* border pixel of windows */ -static const unsigned int snap = 32; /* snap pixel */ -static const unsigned int systraypinning = 0; /* 0: sloppy systray follows selected monitor, >0: pin systray to monitor X */ -static const unsigned int systrayonleft = 0; /* 0: systray in the right corner, >0: systray on left of status text */ -static const unsigned int systrayspacing = 2; /* systray spacing */ -static const int systraypinningfailfirst = 1; /* 1: if pinning fails, display systray on the first monitor, False: display systray on the last monitor*/ -static const int showsystray = 1; /* 0 means no systray */ -static const int showbar = 1; /* 0 means no bar */ -static const int topbar = 1; /* 0 means bottom bar */ -static const char *fonts[] = { "JetBrainsMono NF:size=10" }; -static const char dmenufont[] = "monospace:size=10"; -// default colors -static const char col_gray1[] = "#222222"; -static const char col_gray2[] = "#444444"; -static const char col_gray3[] = "#bbbbbb"; -static const char col_gray4[] = "#eeeeee"; -static const char col_cyan[] = "#005577"; -// default colors -static const char *colors[][3] = { - /* fg bg border */ - [SchemeNorm] = { col_gray3, col_gray1, col_gray2 }, - [SchemeSel] = { col_gray4, col_cyan, col_cyan }, -}; - -/* tagging */ -static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; - -static const Rule rules[] = { - /* xprop(1): - * WM_CLASS(STRING) = instance, class - * WM_NAME(STRING) = title - */ - /* class instance title tags mask isfloating monitor */ - { "Gimp", NULL, NULL, 0, 1, -1 }, - { "Firefox", NULL, NULL, 1 << 8, 0, -1 }, -}; - -/* layout(s) */ -static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */ -static const int nmaster = 1; /* number of clients in master area */ -static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */ -static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */ - -static const Layout layouts[] = { - /* symbol arrange function */ - { "[]=", tile }, /* first entry is default */ - { "><>", NULL }, /* no layout function means floating behavior */ - { "[M]", monocle }, -}; - -/* key definitions */ -#define MODKEY Mod4Mask -#define TAGKEYS(KEY,TAG) \ - { MODKEY, KEY, view, {.ui = 1 << TAG} }, \ - { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ - { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \ - { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, - -/* helper for spawning shell commands in the pre dwm-5.0 fashion */ -#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } - -/* commands */ -static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ -static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL }; -static const char *roficmd[] = { "rofi", "-show-icons", "-show", "drun", NULL }; -static const char *termcmd[] = { "kitty", NULL }; - -static const Key keys[] = { - /* modifier key function argument */ - { MODKEY, XK_space, spawn, {.v = roficmd } }, - { MODKEY, XK_Return, spawn, {.v = termcmd } }, - { MODKEY, XK_b, togglebar, {0} }, - { MODKEY, XK_j, focusstack, {.i = +1 } }, - { MODKEY, XK_k, focusstack, {.i = -1 } }, - { MODKEY, XK_i, incnmaster, {.i = +1 } }, - { MODKEY, XK_d, incnmaster, {.i = -1 } }, - { MODKEY, XK_h, setmfact, {.f = -0.05} }, - { MODKEY, XK_l, setmfact, {.f = +0.05} }, - { MODKEY|ShiftMask, XK_Return, zoom, {0} }, - { MODKEY, XK_Tab, view, {0} }, - { MODKEY|ShiftMask, XK_c, killclient, {0} }, - { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, - { MODKEY, XK_f, setlayout, {.v = &layouts[1]} }, - { MODKEY, XK_m, setlayout, {.v = &layouts[2]} }, - { MODKEY, XK_p, setlayout, {0} }, - { MODKEY|ShiftMask, XK_p, togglefloating, {0} }, - { MODKEY, XK_0, view, {.ui = ~0 } }, - { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, - { MODKEY, XK_comma, focusmon, {.i = -1 } }, - { MODKEY, XK_period, focusmon, {.i = +1 } }, - { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, - { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, - TAGKEYS( XK_1, 0) - TAGKEYS( XK_2, 1) - TAGKEYS( XK_3, 2) - TAGKEYS( XK_4, 3) - TAGKEYS( XK_5, 4) - TAGKEYS( XK_6, 5) - TAGKEYS( XK_7, 6) - TAGKEYS( XK_8, 7) - TAGKEYS( XK_9, 8) - { MODKEY|ShiftMask, XK_q, quit, {0} }, -}; - -/* button definitions */ -/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */ -static const Button buttons[] = { - /* click event mask button function argument */ - { ClkLtSymbol, 0, Button1, setlayout, {0} }, - { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} }, - { ClkWinTitle, 0, Button2, zoom, {0} }, - { ClkStatusText, 0, Button2, spawn, {.v = termcmd } }, - { ClkClientWin, MODKEY, Button1, movemouse, {0} }, - { ClkClientWin, MODKEY, Button2, togglefloating, {0} }, - { ClkClientWin, MODKEY, Button3, resizemouse, {0} }, - { ClkTagBar, 0, Button1, view, {0} }, - { ClkTagBar, 0, Button3, toggleview, {0} }, - { ClkTagBar, MODKEY, Button1, tag, {0} }, - { ClkTagBar, MODKEY, Button3, toggletag, {0} }, -}; diff --git a/config/dwm-old/config.mk b/config/dwm-old/config.mk deleted file mode 100644 index ba64d3d1..00000000 --- a/config/dwm-old/config.mk +++ /dev/null @@ -1,39 +0,0 @@ -# dwm version -VERSION = 6.4 - -# Customize below to fit your system - -# paths -PREFIX = /usr/local -MANPREFIX = ${PREFIX}/share/man - -X11INC = /usr/X11R6/include -X11LIB = /usr/X11R6/lib - -# Xinerama, comment if you don't want it -XINERAMALIBS = -lXinerama -XINERAMAFLAGS = -DXINERAMA - -# freetype -FREETYPELIBS = -lfontconfig -lXft -FREETYPEINC = /usr/include/freetype2 -# OpenBSD (uncomment) -#FREETYPEINC = ${X11INC}/freetype2 -#MANPREFIX = ${PREFIX}/man - -# includes and libs -INCS = -I${X11INC} -I${FREETYPEINC} -LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS} - -# flags -CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700L -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS} -#CFLAGS = -g -std=c99 -pedantic -Wall -O0 ${INCS} ${CPPFLAGS} -CFLAGS = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os ${INCS} ${CPPFLAGS} -LDFLAGS = ${LIBS} - -# Solaris -#CFLAGS = -fast ${INCS} -DVERSION=\"${VERSION}\" -#LDFLAGS = ${LIBS} - -# compiler and linker -CC = cc diff --git a/config/dwm-old/drw.c b/config/dwm-old/drw.c deleted file mode 100644 index a58a2b48..00000000 --- a/config/dwm-old/drw.c +++ /dev/null @@ -1,450 +0,0 @@ -/* See LICENSE file for copyright and license details. */ -#include -#include -#include -#include -#include - -#include "drw.h" -#include "util.h" - -#define UTF_INVALID 0xFFFD -#define UTF_SIZ 4 - -static const unsigned char utfbyte[UTF_SIZ + 1] = {0x80, 0, 0xC0, 0xE0, 0xF0}; -static const unsigned char utfmask[UTF_SIZ + 1] = {0xC0, 0x80, 0xE0, 0xF0, 0xF8}; -static const long utfmin[UTF_SIZ + 1] = { 0, 0, 0x80, 0x800, 0x10000}; -static const long utfmax[UTF_SIZ + 1] = {0x10FFFF, 0x7F, 0x7FF, 0xFFFF, 0x10FFFF}; - -static long -utf8decodebyte(const char c, size_t *i) -{ - for (*i = 0; *i < (UTF_SIZ + 1); ++(*i)) - if (((unsigned char)c & utfmask[*i]) == utfbyte[*i]) - return (unsigned char)c & ~utfmask[*i]; - return 0; -} - -static size_t -utf8validate(long *u, size_t i) -{ - if (!BETWEEN(*u, utfmin[i], utfmax[i]) || BETWEEN(*u, 0xD800, 0xDFFF)) - *u = UTF_INVALID; - for (i = 1; *u > utfmax[i]; ++i) - ; - return i; -} - -static size_t -utf8decode(const char *c, long *u, size_t clen) -{ - size_t i, j, len, type; - long udecoded; - - *u = UTF_INVALID; - if (!clen) - return 0; - udecoded = utf8decodebyte(c[0], &len); - if (!BETWEEN(len, 1, UTF_SIZ)) - return 1; - for (i = 1, j = 1; i < clen && j < len; ++i, ++j) { - udecoded = (udecoded << 6) | utf8decodebyte(c[i], &type); - if (type) - return j; - } - if (j < len) - return 0; - *u = udecoded; - utf8validate(u, len); - - return len; -} - -Drw * -drw_create(Display *dpy, int screen, Window root, unsigned int w, unsigned int h) -{ - Drw *drw = ecalloc(1, sizeof(Drw)); - - drw->dpy = dpy; - drw->screen = screen; - drw->root = root; - drw->w = w; - drw->h = h; - drw->drawable = XCreatePixmap(dpy, root, w, h, DefaultDepth(dpy, screen)); - drw->gc = XCreateGC(dpy, root, 0, NULL); - XSetLineAttributes(dpy, drw->gc, 1, LineSolid, CapButt, JoinMiter); - - return drw; -} - -void -drw_resize(Drw *drw, unsigned int w, unsigned int h) -{ - if (!drw) - return; - - drw->w = w; - drw->h = h; - if (drw->drawable) - XFreePixmap(drw->dpy, drw->drawable); - drw->drawable = XCreatePixmap(drw->dpy, drw->root, w, h, DefaultDepth(drw->dpy, drw->screen)); -} - -void -drw_free(Drw *drw) -{ - XFreePixmap(drw->dpy, drw->drawable); - XFreeGC(drw->dpy, drw->gc); - drw_fontset_free(drw->fonts); - free(drw); -} - -/* This function is an implementation detail. Library users should use - * drw_fontset_create instead. - */ -static Fnt * -xfont_create(Drw *drw, const char *fontname, FcPattern *fontpattern) -{ - Fnt *font; - XftFont *xfont = NULL; - FcPattern *pattern = NULL; - - if (fontname) { - /* Using the pattern found at font->xfont->pattern does not yield the - * same substitution results as using the pattern returned by - * FcNameParse; using the latter results in the desired fallback - * behaviour whereas the former just results in missing-character - * rectangles being drawn, at least with some fonts. */ - if (!(xfont = XftFontOpenName(drw->dpy, drw->screen, fontname))) { - fprintf(stderr, "error, cannot load font from name: '%s'\n", fontname); - return NULL; - } - if (!(pattern = FcNameParse((FcChar8 *) fontname))) { - fprintf(stderr, "error, cannot parse font name to pattern: '%s'\n", fontname); - XftFontClose(drw->dpy, xfont); - return NULL; - } - } else if (fontpattern) { - if (!(xfont = XftFontOpenPattern(drw->dpy, fontpattern))) { - fprintf(stderr, "error, cannot load font from pattern.\n"); - return NULL; - } - } else { - die("no font specified."); - } - - font = ecalloc(1, sizeof(Fnt)); - font->xfont = xfont; - font->pattern = pattern; - font->h = xfont->ascent + xfont->descent; - font->dpy = drw->dpy; - - return font; -} - -static void -xfont_free(Fnt *font) -{ - if (!font) - return; - if (font->pattern) - FcPatternDestroy(font->pattern); - XftFontClose(font->dpy, font->xfont); - free(font); -} - -Fnt* -drw_fontset_create(Drw* drw, const char *fonts[], size_t fontcount) -{ - Fnt *cur, *ret = NULL; - size_t i; - - if (!drw || !fonts) - return NULL; - - for (i = 1; i <= fontcount; i++) { - if ((cur = xfont_create(drw, fonts[fontcount - i], NULL))) { - cur->next = ret; - ret = cur; - } - } - return (drw->fonts = ret); -} - -void -drw_fontset_free(Fnt *font) -{ - if (font) { - drw_fontset_free(font->next); - xfont_free(font); - } -} - -void -drw_clr_create(Drw *drw, Clr *dest, const char *clrname) -{ - if (!drw || !dest || !clrname) - return; - - if (!XftColorAllocName(drw->dpy, DefaultVisual(drw->dpy, drw->screen), - DefaultColormap(drw->dpy, drw->screen), - clrname, dest)) - die("error, cannot allocate color '%s'", clrname); -} - -/* Wrapper to create color schemes. The caller has to call free(3) on the - * returned color scheme when done using it. */ -Clr * -drw_scm_create(Drw *drw, const char *clrnames[], size_t clrcount) -{ - size_t i; - Clr *ret; - - /* need at least two colors for a scheme */ - if (!drw || !clrnames || clrcount < 2 || !(ret = ecalloc(clrcount, sizeof(XftColor)))) - return NULL; - - for (i = 0; i < clrcount; i++) - drw_clr_create(drw, &ret[i], clrnames[i]); - return ret; -} - -void -drw_setfontset(Drw *drw, Fnt *set) -{ - if (drw) - drw->fonts = set; -} - -void -drw_setscheme(Drw *drw, Clr *scm) -{ - if (drw) - drw->scheme = scm; -} - -void -drw_rect(Drw *drw, int x, int y, unsigned int w, unsigned int h, int filled, int invert) -{ - if (!drw || !drw->scheme) - return; - XSetForeground(drw->dpy, drw->gc, invert ? drw->scheme[ColBg].pixel : drw->scheme[ColFg].pixel); - if (filled) - XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h); - else - XDrawRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w - 1, h - 1); -} - -int -drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lpad, const char *text, int invert) -{ - int i, ty, ellipsis_x = 0; - unsigned int tmpw, ew, ellipsis_w = 0, ellipsis_len; - XftDraw *d = NULL; - Fnt *usedfont, *curfont, *nextfont; - int utf8strlen, utf8charlen, render = x || y || w || h; - long utf8codepoint = 0; - const char *utf8str; - FcCharSet *fccharset; - FcPattern *fcpattern; - FcPattern *match; - XftResult result; - int charexists = 0, overflow = 0; - /* keep track of a couple codepoints for which we have no match. */ - enum { nomatches_len = 64 }; - static struct { long codepoint[nomatches_len]; unsigned int idx; } nomatches; - static unsigned int ellipsis_width = 0; - - if (!drw || (render && (!drw->scheme || !w)) || !text || !drw->fonts) - return 0; - - if (!render) { - w = invert ? invert : ~invert; - } else { - XSetForeground(drw->dpy, drw->gc, drw->scheme[invert ? ColFg : ColBg].pixel); - XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h); - d = XftDrawCreate(drw->dpy, drw->drawable, - DefaultVisual(drw->dpy, drw->screen), - DefaultColormap(drw->dpy, drw->screen)); - x += lpad; - w -= lpad; - } - - usedfont = drw->fonts; - if (!ellipsis_width && render) - ellipsis_width = drw_fontset_getwidth(drw, "..."); - while (1) { - ew = ellipsis_len = utf8strlen = 0; - utf8str = text; - nextfont = NULL; - while (*text) { - utf8charlen = utf8decode(text, &utf8codepoint, UTF_SIZ); - for (curfont = drw->fonts; curfont; curfont = curfont->next) { - charexists = charexists || XftCharExists(drw->dpy, curfont->xfont, utf8codepoint); - if (charexists) { - drw_font_getexts(curfont, text, utf8charlen, &tmpw, NULL); - if (ew + ellipsis_width <= w) { - /* keep track where the ellipsis still fits */ - ellipsis_x = x + ew; - ellipsis_w = w - ew; - ellipsis_len = utf8strlen; - } - - if (ew + tmpw > w) { - overflow = 1; - /* called from drw_fontset_getwidth_clamp(): - * it wants the width AFTER the overflow - */ - if (!render) - x += tmpw; - else - utf8strlen = ellipsis_len; - } else if (curfont == usedfont) { - utf8strlen += utf8charlen; - text += utf8charlen; - ew += tmpw; - } else { - nextfont = curfont; - } - break; - } - } - - if (overflow || !charexists || nextfont) - break; - else - charexists = 0; - } - - if (utf8strlen) { - if (render) { - ty = y + (h - usedfont->h) / 2 + usedfont->xfont->ascent; - XftDrawStringUtf8(d, &drw->scheme[invert ? ColBg : ColFg], - usedfont->xfont, x, ty, (XftChar8 *)utf8str, utf8strlen); - } - x += ew; - w -= ew; - } - if (render && overflow) - drw_text(drw, ellipsis_x, y, ellipsis_w, h, 0, "...", invert); - - if (!*text || overflow) { - break; - } else if (nextfont) { - charexists = 0; - usedfont = nextfont; - } else { - /* Regardless of whether or not a fallback font is found, the - * character must be drawn. */ - charexists = 1; - - for (i = 0; i < nomatches_len; ++i) { - /* avoid calling XftFontMatch if we know we won't find a match */ - if (utf8codepoint == nomatches.codepoint[i]) - goto no_match; - } - - fccharset = FcCharSetCreate(); - FcCharSetAddChar(fccharset, utf8codepoint); - - if (!drw->fonts->pattern) { - /* Refer to the comment in xfont_create for more information. */ - die("the first font in the cache must be loaded from a font string."); - } - - fcpattern = FcPatternDuplicate(drw->fonts->pattern); - FcPatternAddCharSet(fcpattern, FC_CHARSET, fccharset); - FcPatternAddBool(fcpattern, FC_SCALABLE, FcTrue); - - FcConfigSubstitute(NULL, fcpattern, FcMatchPattern); - FcDefaultSubstitute(fcpattern); - match = XftFontMatch(drw->dpy, drw->screen, fcpattern, &result); - - FcCharSetDestroy(fccharset); - FcPatternDestroy(fcpattern); - - if (match) { - usedfont = xfont_create(drw, NULL, match); - if (usedfont && XftCharExists(drw->dpy, usedfont->xfont, utf8codepoint)) { - for (curfont = drw->fonts; curfont->next; curfont = curfont->next) - ; /* NOP */ - curfont->next = usedfont; - } else { - xfont_free(usedfont); - nomatches.codepoint[++nomatches.idx % nomatches_len] = utf8codepoint; -no_match: - usedfont = drw->fonts; - } - } - } - } - if (d) - XftDrawDestroy(d); - - return x + (render ? w : 0); -} - -void -drw_map(Drw *drw, Window win, int x, int y, unsigned int w, unsigned int h) -{ - if (!drw) - return; - - XCopyArea(drw->dpy, drw->drawable, win, drw->gc, x, y, w, h, x, y); - XSync(drw->dpy, False); -} - -unsigned int -drw_fontset_getwidth(Drw *drw, const char *text) -{ - if (!drw || !drw->fonts || !text) - return 0; - return drw_text(drw, 0, 0, 0, 0, 0, text, 0); -} - -unsigned int -drw_fontset_getwidth_clamp(Drw *drw, const char *text, unsigned int n) -{ - unsigned int tmp = 0; - if (drw && drw->fonts && text && n) - tmp = drw_text(drw, 0, 0, 0, 0, 0, text, n); - return MIN(n, tmp); -} - -void -drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w, unsigned int *h) -{ - XGlyphInfo ext; - - if (!font || !text) - return; - - XftTextExtentsUtf8(font->dpy, font->xfont, (XftChar8 *)text, len, &ext); - if (w) - *w = ext.xOff; - if (h) - *h = font->h; -} - -Cur * -drw_cur_create(Drw *drw, int shape) -{ - Cur *cur; - - if (!drw || !(cur = ecalloc(1, sizeof(Cur)))) - return NULL; - - cur->cursor = XCreateFontCursor(drw->dpy, shape); - - return cur; -} - -void -drw_cur_free(Drw *drw, Cur *cursor) -{ - if (!cursor) - return; - - XFreeCursor(drw->dpy, cursor->cursor); - free(cursor); -} diff --git a/config/dwm-old/drw.h b/config/dwm-old/drw.h deleted file mode 100644 index 64714316..00000000 --- a/config/dwm-old/drw.h +++ /dev/null @@ -1,58 +0,0 @@ -/* See LICENSE file for copyright and license details. */ - -typedef struct { - Cursor cursor; -} Cur; - -typedef struct Fnt { - Display *dpy; - unsigned int h; - XftFont *xfont; - FcPattern *pattern; - struct Fnt *next; -} Fnt; - -enum { ColFg, ColBg, ColBorder }; /* Clr scheme index */ -typedef XftColor Clr; - -typedef struct { - unsigned int w, h; - Display *dpy; - int screen; - Window root; - Drawable drawable; - GC gc; - Clr *scheme; - Fnt *fonts; -} Drw; - -/* Drawable abstraction */ -Drw *drw_create(Display *dpy, int screen, Window win, unsigned int w, unsigned int h); -void drw_resize(Drw *drw, unsigned int w, unsigned int h); -void drw_free(Drw *drw); - -/* Fnt abstraction */ -Fnt *drw_fontset_create(Drw* drw, const char *fonts[], size_t fontcount); -void drw_fontset_free(Fnt* set); -unsigned int drw_fontset_getwidth(Drw *drw, const char *text); -unsigned int drw_fontset_getwidth_clamp(Drw *drw, const char *text, unsigned int n); -void drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w, unsigned int *h); - -/* Colorscheme abstraction */ -void drw_clr_create(Drw *drw, Clr *dest, const char *clrname); -Clr *drw_scm_create(Drw *drw, const char *clrnames[], size_t clrcount); - -/* Cursor abstraction */ -Cur *drw_cur_create(Drw *drw, int shape); -void drw_cur_free(Drw *drw, Cur *cursor); - -/* Drawing context manipulation */ -void drw_setfontset(Drw *drw, Fnt *set); -void drw_setscheme(Drw *drw, Clr *scm); - -/* Drawing functions */ -void drw_rect(Drw *drw, int x, int y, unsigned int w, unsigned int h, int filled, int invert); -int drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lpad, const char *text, int invert); - -/* Map functions */ -void drw_map(Drw *drw, Window win, int x, int y, unsigned int w, unsigned int h); diff --git a/config/dwm-old/dwm.1 b/config/dwm-old/dwm.1 deleted file mode 100644 index ddc8321f..00000000 --- a/config/dwm-old/dwm.1 +++ /dev/null @@ -1,176 +0,0 @@ -.TH DWM 1 dwm\-VERSION -.SH NAME -dwm \- dynamic window manager -.SH SYNOPSIS -.B dwm -.RB [ \-v ] -.SH DESCRIPTION -dwm is a dynamic window manager for X. It manages windows in tiled, monocle -and floating layouts. Either layout can be applied dynamically, optimising the -environment for the application in use and the task performed. -.P -In tiled layouts windows are managed in a master and stacking area. The master -area on the left contains one window by default, and the stacking area on the -right contains all other windows. The number of master area windows can be -adjusted from zero to an arbitrary number. In monocle layout all windows are -maximised to the screen size. In floating layout windows can be resized and -moved freely. Dialog windows are always managed floating, regardless of the -layout applied. -.P -Windows are grouped by tags. Each window can be tagged with one or multiple -tags. Selecting certain tags displays all windows with these tags. -.P -Each screen contains a small status bar which displays all available tags, the -layout, the title of the focused window, and the text read from the root window -name property, if the screen is focused. A floating window is indicated with an -empty square and a maximised floating window is indicated with a filled square -before the windows title. The selected tags are indicated with a different -color. The tags of the focused window are indicated with a filled square in the -top left corner. The tags which are applied to one or more windows are -indicated with an empty square in the top left corner. -.P -dwm draws a small border around windows to indicate the focus state. -.SH OPTIONS -.TP -.B \-v -prints version information to stderr, then exits. -.SH USAGE -.SS Status bar -.TP -.B X root window name -is read and displayed in the status text area. It can be set with the -.BR xsetroot (1) -command. -.TP -.B Button1 -click on a tag label to display all windows with that tag, click on the layout -label toggles between tiled and floating layout. -.TP -.B Button3 -click on a tag label adds/removes all windows with that tag to/from the view. -.TP -.B Mod1\-Button1 -click on a tag label applies that tag to the focused window. -.TP -.B Mod1\-Button3 -click on a tag label adds/removes that tag to/from the focused window. -.SS Keyboard commands -.TP -.B Mod1\-Shift\-Return -Start -.BR st(1). -.TP -.B Mod1\-p -Spawn -.BR dmenu(1) -for launching other programs. -.TP -.B Mod1\-, -Focus previous screen, if any. -.TP -.B Mod1\-. -Focus next screen, if any. -.TP -.B Mod1\-Shift\-, -Send focused window to previous screen, if any. -.TP -.B Mod1\-Shift\-. -Send focused window to next screen, if any. -.TP -.B Mod1\-b -Toggles bar on and off. -.TP -.B Mod1\-t -Sets tiled layout. -.TP -.B Mod1\-f -Sets floating layout. -.TP -.B Mod1\-m -Sets monocle layout. -.TP -.B Mod1\-space -Toggles between current and previous layout. -.TP -.B Mod1\-j -Focus next window. -.TP -.B Mod1\-k -Focus previous window. -.TP -.B Mod1\-i -Increase number of windows in master area. -.TP -.B Mod1\-d -Decrease number of windows in master area. -.TP -.B Mod1\-l -Increase master area size. -.TP -.B Mod1\-h -Decrease master area size. -.TP -.B Mod1\-Return -Zooms/cycles focused window to/from master area (tiled layouts only). -.TP -.B Mod1\-Shift\-c -Close focused window. -.TP -.B Mod1\-Shift\-space -Toggle focused window between tiled and floating state. -.TP -.B Mod1\-Tab -Toggles to the previously selected tags. -.TP -.B Mod1\-Shift\-[1..n] -Apply nth tag to focused window. -.TP -.B Mod1\-Shift\-0 -Apply all tags to focused window. -.TP -.B Mod1\-Control\-Shift\-[1..n] -Add/remove nth tag to/from focused window. -.TP -.B Mod1\-[1..n] -View all windows with nth tag. -.TP -.B Mod1\-0 -View all windows with any tag. -.TP -.B Mod1\-Control\-[1..n] -Add/remove all windows with nth tag to/from the view. -.TP -.B Mod1\-Shift\-q -Quit dwm. -.SS Mouse commands -.TP -.B Mod1\-Button1 -Move focused window while dragging. Tiled windows will be toggled to the floating state. -.TP -.B Mod1\-Button2 -Toggles focused window between floating and tiled state. -.TP -.B Mod1\-Button3 -Resize focused window while dragging. Tiled windows will be toggled to the floating state. -.SH CUSTOMIZATION -dwm is customized by creating a custom config.h and (re)compiling the source -code. This keeps it fast, secure and simple. -.SH SEE ALSO -.BR dmenu (1), -.BR st (1) -.SH ISSUES -Java applications which use the XToolkit/XAWT backend may draw grey windows -only. The XToolkit/XAWT backend breaks ICCCM-compliance in recent JDK 1.5 and early -JDK 1.6 versions, because it assumes a reparenting window manager. Possible workarounds -are using JDK 1.4 (which doesn't contain the XToolkit/XAWT backend) or setting the -environment variable -.BR AWT_TOOLKIT=MToolkit -(to use the older Motif backend instead) or running -.B xprop -root -f _NET_WM_NAME 32a -set _NET_WM_NAME LG3D -or -.B wmname LG3D -(to pretend that a non-reparenting window manager is running that the -XToolkit/XAWT backend can recognize) or when using OpenJDK setting the environment variable -.BR _JAVA_AWT_WM_NONREPARENTING=1 . -.SH BUGS -Send all bug reports with a patch to hackers@suckless.org. diff --git a/config/dwm-old/dwm.c b/config/dwm-old/dwm.c deleted file mode 100644 index 380815a5..00000000 --- a/config/dwm-old/dwm.c +++ /dev/null @@ -1,2684 +0,0 @@ -/* See LICENSE file for copyright and license details. - * - * dynamic window manager is designed like any other X client as well. It is - * driven through handling X events. In contrast to other X clients, a window - * manager selects for SubstructureRedirectMask on the root window, to receive - * events about window (dis-)appearance. Only one X connection at a time is - * allowed to select for this event mask. - * - * The event handlers of dwm are organized in an array which is accessed - * whenever a new event has been fetched. This allows event dispatching - * in O(1) time. - * - * Each child of the root window is called a client, except windows which have - * set the override_redirect flag. Clients are organized in a linked client - * list on each monitor, the focus history is remembered through a stack list - * on each monitor. Each client contains a bit array to indicate the tags of a - * client. - * - * Keys and tagging rules are organized as arrays and defined in config.h. - * - * To understand everything else, start reading main(). - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef XINERAMA -#include -#endif /* XINERAMA */ -#include - -#include "drw.h" -#include "util.h" - -/* macros */ -#define BUTTONMASK (ButtonPressMask|ButtonReleaseMask) -#define CLEANMASK(mask) (mask & ~(numlockmask|LockMask) & (ShiftMask|ControlMask|Mod1Mask|Mod2Mask|Mod3Mask|Mod4Mask|Mod5Mask)) -#define INTERSECT(x,y,w,h,m) (MAX(0, MIN((x)+(w),(m)->wx+(m)->ww) - MAX((x),(m)->wx)) \ - * MAX(0, MIN((y)+(h),(m)->wy+(m)->wh) - MAX((y),(m)->wy))) -#define ISVISIBLE(C) ((C->tags & C->mon->tagset[C->mon->seltags])) -#define LENGTH(X) (sizeof X / sizeof X[0]) -#define MOUSEMASK (BUTTONMASK|PointerMotionMask) -#define WIDTH(X) ((X)->w + 2 * (X)->bw) -#define HEIGHT(X) ((X)->h + 2 * (X)->bw) -#define TAGMASK ((1 << LENGTH(tags)) - 1) -#define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad) - -#define SYSTEM_TRAY_REQUEST_DOCK 0 -/* XEMBED messages */ -#define XEMBED_EMBEDDED_NOTIFY 0 -#define XEMBED_WINDOW_ACTIVATE 1 -#define XEMBED_FOCUS_IN 4 -#define XEMBED_MODALITY_ON 10 -#define XEMBED_MAPPED (1 << 0) -#define XEMBED_WINDOW_ACTIVATE 1 -#define XEMBED_WINDOW_DEACTIVATE 2 -#define VERSION_MAJOR 0 -#define VERSION_MINOR 0 -#define XEMBED_EMBEDDED_VERSION (VERSION_MAJOR << 16) | VERSION_MINOR - -/* enums */ -enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ -enum { SchemeNorm, SchemeSel }; /* color schemes */ -enum { NetSupported, NetWMName, NetWMState, NetWMCheck, - NetSystemTray, NetSystemTrayOP, NetSystemTrayOrientation, NetSystemTrayOrientationHorz, - NetWMFullscreen, NetActiveWindow, NetWMWindowType, - NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */ -enum { Manager, Xembed, XembedInfo, XLast }; /* Xembed atoms */ -enum { WMProtocols, WMDelete, WMState, WMTakeFocus, WMLast }; /* default atoms */ -enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, - ClkClientWin, ClkRootWin, ClkLast }; /* clicks */ - -typedef union { - int i; - unsigned int ui; - float f; - const void *v; -} Arg; - -typedef struct { - unsigned int click; - unsigned int mask; - unsigned int button; - void (*func)(const Arg *arg); - const Arg arg; -} Button; - -typedef struct Monitor Monitor; -typedef struct Client Client; -struct Client { - char name[256]; - float mina, maxa; - int x, y, w, h; - int oldx, oldy, oldw, oldh; - int basew, baseh, incw, inch, maxw, maxh, minw, minh, hintsvalid; - int bw, oldbw; - unsigned int tags; - int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen; - Client *next; - Client *snext; - Monitor *mon; - Window win; -}; - -typedef struct { - unsigned int mod; - KeySym keysym; - void (*func)(const Arg *); - const Arg arg; -} Key; - -typedef struct { - const char *symbol; - void (*arrange)(Monitor *); -} Layout; - -struct Monitor { - char ltsymbol[16]; - float mfact; - int nmaster; - int num; - int by; /* bar geometry */ - int mx, my, mw, mh; /* screen size */ - int wx, wy, ww, wh; /* window area */ - unsigned int seltags; - unsigned int sellt; - unsigned int tagset[2]; - int showbar; - int topbar; - Client *clients; - Client *sel; - Client *stack; - Monitor *next; - Window barwin; - const Layout *lt[2]; -}; - -typedef struct { - const char *class; - const char *instance; - const char *title; - unsigned int tags; - int isfloating; - int monitor; -} Rule; - -typedef struct Systray Systray; -struct Systray { - Window win; - Client *icons; -}; - -/* function declarations */ -static void applyrules(Client *c); -static int applysizehints(Client *c, int *x, int *y, int *w, int *h, int interact); -static void arrange(Monitor *m); -static void arrangemon(Monitor *m); -static void attach(Client *c); -static void attachstack(Client *c); -static void buttonpress(XEvent *e); -static void checkotherwm(void); -static void cleanup(void); -static void cleanupmon(Monitor *mon); -static void clientmessage(XEvent *e); -static void configure(Client *c); -static void configurenotify(XEvent *e); -static void configurerequest(XEvent *e); -static Monitor *createmon(void); -static void destroynotify(XEvent *e); -static void detach(Client *c); -static void detachstack(Client *c); -static Monitor *dirtomon(int dir); -static void drawbar(Monitor *m); -static void drawbars(void); -static int drawstatusbar(Monitor *m, int bh, char* text); -static void enternotify(XEvent *e); -static void expose(XEvent *e); -static void focus(Client *c); -static void focusin(XEvent *e); -static void focusmon(const Arg *arg); -static void focusstack(const Arg *arg); -static Atom getatomprop(Client *c, Atom prop); -static int getrootptr(int *x, int *y); -static long getstate(Window w); -static unsigned int getsystraywidth(); -static int gettextprop(Window w, Atom atom, char *text, unsigned int size); -static void grabbuttons(Client *c, int focused); -static void grabkeys(void); -static void incnmaster(const Arg *arg); -static void keypress(XEvent *e); -static void killclient(const Arg *arg); -static void manage(Window w, XWindowAttributes *wa); -static void mappingnotify(XEvent *e); -static void maprequest(XEvent *e); -static void monocle(Monitor *m); -static void motionnotify(XEvent *e); -static void movemouse(const Arg *arg); -static Client *nexttiled(Client *c); -static void pop(Client *c); -static void propertynotify(XEvent *e); -static void quit(const Arg *arg); -static Monitor *recttomon(int x, int y, int w, int h); -static void removesystrayicon(Client *i); -static void resize(Client *c, int x, int y, int w, int h, int interact); -static void resizebarwin(Monitor *m); -static void resizeclient(Client *c, int x, int y, int w, int h); -static void resizemouse(const Arg *arg); -static void resizerequest(XEvent *e); -static void restack(Monitor *m); -static void run(void); -static void scan(void); -static int sendevent(Window w, Atom proto, int m, long d0, long d1, long d2, long d3, long d4); -static void sendmon(Client *c, Monitor *m); -static void setclientstate(Client *c, long state); -static void setfocus(Client *c); -static void setfullscreen(Client *c, int fullscreen); -static void setlayout(const Arg *arg); -static void setmfact(const Arg *arg); -static void setup(void); -static void seturgent(Client *c, int urg); -static void showhide(Client *c); -static void spawn(const Arg *arg); -static Monitor *systraytomon(Monitor *m); -static void tag(const Arg *arg); -static void tagmon(const Arg *arg); -static void tile(Monitor *m); -static void togglebar(const Arg *arg); -static void togglefloating(const Arg *arg); -static void toggletag(const Arg *arg); -static void toggleview(const Arg *arg); -static void unfocus(Client *c, int setfocus); -static void unmanage(Client *c, int destroyed); -static void unmapnotify(XEvent *e); -static void updatebarpos(Monitor *m); -static void updatebars(void); -static void updateclientlist(void); -static int updategeom(void); -static void updatenumlockmask(void); -static void updatesizehints(Client *c); -static void updatestatus(void); -static void updatesystray(void); -static void updatesystrayicongeom(Client *i, int w, int h); -static void updatesystrayiconstate(Client *i, XPropertyEvent *ev); -static void updatetitle(Client *c); -static void updatewindowtype(Client *c); -static void updatewmhints(Client *c); -static void view(const Arg *arg); -static Client *wintoclient(Window w); -static Monitor *wintomon(Window w); -static Client *wintosystrayicon(Window w); -static int xerror(Display *dpy, XErrorEvent *ee); -static int xerrordummy(Display *dpy, XErrorEvent *ee); -static int xerrorstart(Display *dpy, XErrorEvent *ee); -static void zoom(const Arg *arg); -static void autostart_exec(void); - -/* variables */ -static Systray *systray = NULL; -static const char broken[] = "broken"; -static char stext[1024]; -static int screen; -static int sw, sh; /* X display screen geometry width, height */ -static int bh; /* bar height */ -static int lrpad; /* sum of left and right padding for text */ -static int (*xerrorxlib)(Display *, XErrorEvent *); -static unsigned int numlockmask = 0; -static void (*handler[LASTEvent]) (XEvent *) = { - [ButtonPress] = buttonpress, - [ClientMessage] = clientmessage, - [ConfigureRequest] = configurerequest, - [ConfigureNotify] = configurenotify, - [DestroyNotify] = destroynotify, - [EnterNotify] = enternotify, - [Expose] = expose, - [FocusIn] = focusin, - [KeyPress] = keypress, - [MappingNotify] = mappingnotify, - [MapRequest] = maprequest, - [MotionNotify] = motionnotify, - [PropertyNotify] = propertynotify, - [ResizeRequest] = resizerequest, - [UnmapNotify] = unmapnotify -}; -static Atom wmatom[WMLast], netatom[NetLast], xatom[XLast]; -static int running = 1; -static Cur *cursor[CurLast]; -static Clr **scheme; -static Display *dpy; -static Drw *drw; -static Monitor *mons, *selmon; -static Window root, wmcheckwin; - -/* configuration, allows nested code to access above variables */ -#include "config.h" - -/* compile-time check if all tags fit into an unsigned int bit array. */ -struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; }; - -/* dwm will keep pid's of processes from autostart array and kill them at quit */ -static pid_t *autostart_pids; -static size_t autostart_len; - -/* execute command from autostart array */ -static void -autostart_exec() { - const char *const *p; - // https://github.com/bakkeby/dwm-flexipatch/blob/master/patch/cool_autostart.c#L21 - struct sigaction sa; - size_t i = 0; - - /* count entries */ - for (p = autostart; *p; autostart_len++, p++) - while (*++p); - - autostart_pids = malloc(autostart_len * sizeof(pid_t)); - for (p = autostart; *p; i++, p++) { - if ((autostart_pids[i] = fork()) == 0) { - setsid(); - - // https://github.com/bakkeby/dwm-flexipatch/blob/master/patch/cool_autostart.c#L21 - /* Restore SIGCHLD sighandler to default before spawning a program */ - sigemptyset(&sa.sa_mask); - sa.sa_flags = 0; - sa.sa_handler = SIG_DFL; - sigaction(SIGCHLD, &sa, NULL); - - execvp(*p, (char *const *)p); - fprintf(stderr, "dwm: execvp %s\n", *p); - perror(" failed"); - _exit(EXIT_FAILURE); - } - /* skip arguments */ - while (*++p); - } -} - -/* function implementations */ -void -applyrules(Client *c) -{ - const char *class, *instance; - unsigned int i; - const Rule *r; - Monitor *m; - XClassHint ch = { NULL, NULL }; - - /* rule matching */ - c->isfloating = 0; - c->tags = 0; - XGetClassHint(dpy, c->win, &ch); - class = ch.res_class ? ch.res_class : broken; - instance = ch.res_name ? ch.res_name : broken; - - for (i = 0; i < LENGTH(rules); i++) { - r = &rules[i]; - if ((!r->title || strstr(c->name, r->title)) - && (!r->class || strstr(class, r->class)) - && (!r->instance || strstr(instance, r->instance))) - { - c->isfloating = r->isfloating; - c->tags |= r->tags; - for (m = mons; m && m->num != r->monitor; m = m->next); - if (m) - c->mon = m; - } - } - if (ch.res_class) - XFree(ch.res_class); - if (ch.res_name) - XFree(ch.res_name); - c->tags = c->tags & TAGMASK ? c->tags & TAGMASK : c->mon->tagset[c->mon->seltags]; -} - -int -applysizehints(Client *c, int *x, int *y, int *w, int *h, int interact) -{ - int baseismin; - Monitor *m = c->mon; - - /* set minimum possible */ - *w = MAX(1, *w); - *h = MAX(1, *h); - if (interact) { - if (*x > sw) - *x = sw - WIDTH(c); - if (*y > sh) - *y = sh - HEIGHT(c); - if (*x + *w + 2 * c->bw < 0) - *x = 0; - if (*y + *h + 2 * c->bw < 0) - *y = 0; - } else { - if (*x >= m->wx + m->ww) - *x = m->wx + m->ww - WIDTH(c); - if (*y >= m->wy + m->wh) - *y = m->wy + m->wh - HEIGHT(c); - if (*x + *w + 2 * c->bw <= m->wx) - *x = m->wx; - if (*y + *h + 2 * c->bw <= m->wy) - *y = m->wy; - } - if (*h < bh) - *h = bh; - if (*w < bh) - *w = bh; - if (resizehints || c->isfloating || !c->mon->lt[c->mon->sellt]->arrange) { - if (!c->hintsvalid) - updatesizehints(c); - /* see last two sentences in ICCCM 4.1.2.3 */ - baseismin = c->basew == c->minw && c->baseh == c->minh; - if (!baseismin) { /* temporarily remove base dimensions */ - *w -= c->basew; - *h -= c->baseh; - } - /* adjust for aspect limits */ - if (c->mina > 0 && c->maxa > 0) { - if (c->maxa < (float)*w / *h) - *w = *h * c->maxa + 0.5; - else if (c->mina < (float)*h / *w) - *h = *w * c->mina + 0.5; - } - if (baseismin) { /* increment calculation requires this */ - *w -= c->basew; - *h -= c->baseh; - } - /* adjust for increment value */ - if (c->incw) - *w -= *w % c->incw; - if (c->inch) - *h -= *h % c->inch; - /* restore base dimensions */ - *w = MAX(*w + c->basew, c->minw); - *h = MAX(*h + c->baseh, c->minh); - if (c->maxw) - *w = MIN(*w, c->maxw); - if (c->maxh) - *h = MIN(*h, c->maxh); - } - return *x != c->x || *y != c->y || *w != c->w || *h != c->h; -} - -void -arrange(Monitor *m) -{ - if (m) - showhide(m->stack); - else for (m = mons; m; m = m->next) - showhide(m->stack); - if (m) { - arrangemon(m); - restack(m); - } else for (m = mons; m; m = m->next) - arrangemon(m); -} - -void -arrangemon(Monitor *m) -{ - strncpy(m->ltsymbol, m->lt[m->sellt]->symbol, sizeof m->ltsymbol); - if (m->lt[m->sellt]->arrange) - m->lt[m->sellt]->arrange(m); -} - -void -attach(Client *c) -{ - c->next = c->mon->clients; - c->mon->clients = c; -} - -void -attachstack(Client *c) -{ - c->snext = c->mon->stack; - c->mon->stack = c; -} - -void -buttonpress(XEvent *e) -{ - unsigned int i, x, click; - Arg arg = {0}; - Client *c; - Monitor *m; - XButtonPressedEvent *ev = &e->xbutton; - - click = ClkRootWin; - /* focus monitor if necessary */ - if ((m = wintomon(ev->window)) && m != selmon) { - unfocus(selmon->sel, 1); - selmon = m; - focus(NULL); - } - if (ev->window == selmon->barwin) { - i = x = 0; - do - x += TEXTW(tags[i]); - while (ev->x >= x && ++i < LENGTH(tags)); - if (i < LENGTH(tags)) { - click = ClkTagBar; - arg.ui = 1 << i; - } else if (ev->x < x + TEXTW(selmon->ltsymbol)) - click = ClkLtSymbol; - else if (ev->x > selmon->ww - (int)TEXTW(stext) - getsystraywidth()) - click = ClkStatusText; - else - click = ClkWinTitle; - } else if ((c = wintoclient(ev->window))) { - focus(c); - restack(selmon); - XAllowEvents(dpy, ReplayPointer, CurrentTime); - click = ClkClientWin; - } - for (i = 0; i < LENGTH(buttons); i++) - if (click == buttons[i].click && buttons[i].func && buttons[i].button == ev->button - && CLEANMASK(buttons[i].mask) == CLEANMASK(ev->state)) - buttons[i].func(click == ClkTagBar && buttons[i].arg.i == 0 ? &arg : &buttons[i].arg); -} - -void -checkotherwm(void) -{ - xerrorxlib = XSetErrorHandler(xerrorstart); - /* this causes an error if some other window manager is running */ - XSelectInput(dpy, DefaultRootWindow(dpy), SubstructureRedirectMask); - XSync(dpy, False); - XSetErrorHandler(xerror); - XSync(dpy, False); -} - -void -cleanup(void) -{ - Arg a = {.ui = ~0}; - Layout foo = { "", NULL }; - Monitor *m; - size_t i; - - view(&a); - selmon->lt[selmon->sellt] = &foo; - for (m = mons; m; m = m->next) - while (m->stack) - unmanage(m->stack, 0); - XUngrabKey(dpy, AnyKey, AnyModifier, root); - while (mons) - cleanupmon(mons); - - if (showsystray) { - XUnmapWindow(dpy, systray->win); - XDestroyWindow(dpy, systray->win); - free(systray); - } - - for (i = 0; i < CurLast; i++) - drw_cur_free(drw, cursor[i]); - for (i = 0; i < LENGTH(colors) + 1; i++) - free(scheme[i]); - free(scheme); - XDestroyWindow(dpy, wmcheckwin); - drw_free(drw); - XSync(dpy, False); - XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime); - XDeleteProperty(dpy, root, netatom[NetActiveWindow]); -} - -void -cleanupmon(Monitor *mon) -{ - Monitor *m; - - if (mon == mons) - mons = mons->next; - else { - for (m = mons; m && m->next != mon; m = m->next); - m->next = mon->next; - } - XUnmapWindow(dpy, mon->barwin); - XDestroyWindow(dpy, mon->barwin); - free(mon); -} - -void -clientmessage(XEvent *e) -{ - XWindowAttributes wa; - XSetWindowAttributes swa; - XClientMessageEvent *cme = &e->xclient; - Client *c = wintoclient(cme->window); - - if (showsystray && cme->window == systray->win && cme->message_type == netatom[NetSystemTrayOP]) { - /* add systray icons */ - if (cme->data.l[1] == SYSTEM_TRAY_REQUEST_DOCK) { - if (!(c = (Client *)calloc(1, sizeof(Client)))) - die("fatal: could not malloc() %u bytes\n", sizeof(Client)); - if (!(c->win = cme->data.l[2])) { - free(c); - return; - } - c->mon = selmon; - c->next = systray->icons; - systray->icons = c; - if (!XGetWindowAttributes(dpy, c->win, &wa)) { - /* use sane defaults */ - wa.width = bh; - wa.height = bh; - wa.border_width = 0; - } - c->x = c->oldx = c->y = c->oldy = 0; - c->w = c->oldw = wa.width; - c->h = c->oldh = wa.height; - c->oldbw = wa.border_width; - c->bw = 0; - c->isfloating = True; - /* reuse tags field as mapped status */ - c->tags = 1; - updatesizehints(c); - updatesystrayicongeom(c, wa.width, wa.height); - XAddToSaveSet(dpy, c->win); - XSelectInput(dpy, c->win, StructureNotifyMask | PropertyChangeMask | ResizeRedirectMask); - XReparentWindow(dpy, c->win, systray->win, 0, 0); - /* use parents background color */ - swa.background_pixel = scheme[SchemeNorm][ColBg].pixel; - XChangeWindowAttributes(dpy, c->win, CWBackPixel, &swa); - sendevent(c->win, netatom[Xembed], StructureNotifyMask, CurrentTime, XEMBED_EMBEDDED_NOTIFY, 0 , systray->win, XEMBED_EMBEDDED_VERSION); - /* FIXME not sure if I have to send these events, too */ - sendevent(c->win, netatom[Xembed], StructureNotifyMask, CurrentTime, XEMBED_FOCUS_IN, 0 , systray->win, XEMBED_EMBEDDED_VERSION); - sendevent(c->win, netatom[Xembed], StructureNotifyMask, CurrentTime, XEMBED_WINDOW_ACTIVATE, 0 , systray->win, XEMBED_EMBEDDED_VERSION); - sendevent(c->win, netatom[Xembed], StructureNotifyMask, CurrentTime, XEMBED_MODALITY_ON, 0 , systray->win, XEMBED_EMBEDDED_VERSION); - XSync(dpy, False); - resizebarwin(selmon); - updatesystray(); - setclientstate(c, NormalState); - } - return; - } - - if (!c) - return; - if (cme->message_type == netatom[NetWMState]) { - if (cme->data.l[1] == netatom[NetWMFullscreen] - || cme->data.l[2] == netatom[NetWMFullscreen]) - setfullscreen(c, (cme->data.l[0] == 1 /* _NET_WM_STATE_ADD */ - || (cme->data.l[0] == 2 /* _NET_WM_STATE_TOGGLE */ && !c->isfullscreen))); - } else if (cme->message_type == netatom[NetActiveWindow]) { - if (c != selmon->sel && !c->isurgent) - seturgent(c, 1); - } -} - -void -configure(Client *c) -{ - XConfigureEvent ce; - - ce.type = ConfigureNotify; - ce.display = dpy; - ce.event = c->win; - ce.window = c->win; - ce.x = c->x; - ce.y = c->y; - ce.width = c->w; - ce.height = c->h; - ce.border_width = c->bw; - ce.above = None; - ce.override_redirect = False; - XSendEvent(dpy, c->win, False, StructureNotifyMask, (XEvent *)&ce); -} - -void -configurenotify(XEvent *e) -{ - Monitor *m; - Client *c; - XConfigureEvent *ev = &e->xconfigure; - int dirty; - - /* TODO: updategeom handling sucks, needs to be simplified */ - if (ev->window == root) { - dirty = (sw != ev->width || sh != ev->height); - sw = ev->width; - sh = ev->height; - if (updategeom() || dirty) { - drw_resize(drw, sw, bh); - updatebars(); - for (m = mons; m; m = m->next) { - for (c = m->clients; c; c = c->next) - if (c->isfullscreen) - resizeclient(c, m->mx, m->my, m->mw, m->mh); - resizebarwin(m); - } - focus(NULL); - arrange(NULL); - } - } -} - -void -configurerequest(XEvent *e) -{ - Client *c; - Monitor *m; - XConfigureRequestEvent *ev = &e->xconfigurerequest; - XWindowChanges wc; - - if ((c = wintoclient(ev->window))) { - if (ev->value_mask & CWBorderWidth) - c->bw = ev->border_width; - else if (c->isfloating || !selmon->lt[selmon->sellt]->arrange) { - m = c->mon; - if (ev->value_mask & CWX) { - c->oldx = c->x; - c->x = m->mx + ev->x; - } - if (ev->value_mask & CWY) { - c->oldy = c->y; - c->y = m->my + ev->y; - } - if (ev->value_mask & CWWidth) { - c->oldw = c->w; - c->w = ev->width; - } - if (ev->value_mask & CWHeight) { - c->oldh = c->h; - c->h = ev->height; - } - if ((c->x + c->w) > m->mx + m->mw && c->isfloating) - c->x = m->mx + (m->mw / 2 - WIDTH(c) / 2); /* center in x direction */ - if ((c->y + c->h) > m->my + m->mh && c->isfloating) - c->y = m->my + (m->mh / 2 - HEIGHT(c) / 2); /* center in y direction */ - if ((ev->value_mask & (CWX|CWY)) && !(ev->value_mask & (CWWidth|CWHeight))) - configure(c); - if (ISVISIBLE(c)) - XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h); - } else - configure(c); - } else { - wc.x = ev->x; - wc.y = ev->y; - wc.width = ev->width; - wc.height = ev->height; - wc.border_width = ev->border_width; - wc.sibling = ev->above; - wc.stack_mode = ev->detail; - XConfigureWindow(dpy, ev->window, ev->value_mask, &wc); - } - XSync(dpy, False); -} - -Monitor * -createmon(void) -{ - Monitor *m; - - m = ecalloc(1, sizeof(Monitor)); - m->tagset[0] = m->tagset[1] = 1; - m->mfact = mfact; - m->nmaster = nmaster; - m->showbar = showbar; - m->topbar = topbar; - m->lt[0] = &layouts[0]; - m->lt[1] = &layouts[1 % LENGTH(layouts)]; - strncpy(m->ltsymbol, layouts[0].symbol, sizeof m->ltsymbol); - return m; -} - -void -destroynotify(XEvent *e) -{ - Client *c; - XDestroyWindowEvent *ev = &e->xdestroywindow; - - if ((c = wintoclient(ev->window))) - unmanage(c, 1); - else if ((c = wintosystrayicon(ev->window))) { - removesystrayicon(c); - resizebarwin(selmon); - updatesystray(); - } -} - -void -detach(Client *c) -{ - Client **tc; - - for (tc = &c->mon->clients; *tc && *tc != c; tc = &(*tc)->next); - *tc = c->next; -} - -void -detachstack(Client *c) -{ - Client **tc, *t; - - for (tc = &c->mon->stack; *tc && *tc != c; tc = &(*tc)->snext); - *tc = c->snext; - - if (c == c->mon->sel) { - for (t = c->mon->stack; t && !ISVISIBLE(t); t = t->snext); - c->mon->sel = t; - } -} - -Monitor * -dirtomon(int dir) -{ - Monitor *m = NULL; - - if (dir > 0) { - if (!(m = selmon->next)) - m = mons; - } else if (selmon == mons) - for (m = mons; m->next; m = m->next); - else - for (m = mons; m->next != selmon; m = m->next); - return m; -} - -int -drawstatusbar(Monitor *m, int bh, char* stext) { - int ret, i, w, x, len; - short isCode = 0; - char *text; - char *p; - - len = strlen(stext) + 1 ; - if (!(text = (char*) malloc(sizeof(char)*len))) - die("malloc"); - p = text; - memcpy(text, stext, len); - - /* compute width of the status text */ - w = 0; - i = -1; - while (text[++i]) { - if (text[i] == '^') { - if (!isCode) { - isCode = 1; - text[i] = '\0'; - w += TEXTW(text) - lrpad; - text[i] = '^'; - if (text[++i] == 'f') - w += atoi(text + ++i); - } else { - isCode = 0; - text = text + i + 1; - i = -1; - } - } - } - if (!isCode) - w += TEXTW(text) - lrpad; - else - isCode = 0; - text = p; - - w += 2; /* 1px padding on both sides */ - ret = m->ww - w; - x = m->ww - w - getsystraywidth(); - - drw_setscheme(drw, scheme[LENGTH(colors)]); - drw->scheme[ColFg] = scheme[SchemeNorm][ColFg]; - drw->scheme[ColBg] = scheme[SchemeNorm][ColBg]; - drw_rect(drw, x, 0, w, bh, 1, 1); - x++; - - /* process status text */ - i = -1; - while (text[++i]) { - if (text[i] == '^' && !isCode) { - isCode = 1; - - text[i] = '\0'; - w = TEXTW(text) - lrpad; - drw_text(drw, x, 0, w, bh, 0, text, 0); - - x += w; - - /* process code */ - while (text[++i] != '^') { - if (text[i] == 'c') { - char buf[8]; - memcpy(buf, (char*)text+i+1, 7); - buf[7] = '\0'; - drw_clr_create(drw, &drw->scheme[ColFg], buf); - i += 7; - } else if (text[i] == 'b') { - char buf[8]; - memcpy(buf, (char*)text+i+1, 7); - buf[7] = '\0'; - drw_clr_create(drw, &drw->scheme[ColBg], buf); - i += 7; - } else if (text[i] == 'd') { - drw->scheme[ColFg] = scheme[SchemeNorm][ColFg]; - drw->scheme[ColBg] = scheme[SchemeNorm][ColBg]; - } else if (text[i] == 'r') { - int rx = atoi(text + ++i); - while (text[++i] != ','); - int ry = atoi(text + ++i); - while (text[++i] != ','); - int rw = atoi(text + ++i); - while (text[++i] != ','); - int rh = atoi(text + ++i); - - drw_rect(drw, rx + x, ry, rw, rh, 1, 0); - } else if (text[i] == 'f') { - x += atoi(text + ++i); - } - } - - text = text + i + 1; - i=-1; - isCode = 0; - } - } - - if (!isCode) { - w = TEXTW(text) - lrpad; - drw_text(drw, x, 0, w, bh, 0, text, 0); - } - - drw_setscheme(drw, scheme[SchemeNorm]); - free(p); - - return ret; -} - -void -drawbar(Monitor *m) -{ - int x, w, tw = 0, stw = 0; - int boxs = drw->fonts->h / 9; - int boxw = drw->fonts->h / 6 + 2; - unsigned int i, occ = 0, urg = 0; - Client *c; - - if (!m->showbar) - return; - - if(showsystray && m == systraytomon(m) && !systrayonleft) - stw = getsystraywidth(); - - /* draw status first so it can be overdrawn by tags later */ - if (m == selmon) { /* status is only drawn on selected monitor */ - tw = m->ww - drawstatusbar(m, bh, stext); - } - - resizebarwin(m); - for (c = m->clients; c; c = c->next) { - occ |= c->tags; - if (c->isurgent) - urg |= c->tags; - } - x = 0; - for (i = 0; i < LENGTH(tags); i++) { - w = TEXTW(tags[i]); - drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]); - drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i); - if (occ & 1 << i) - drw_rect(drw, x + boxs, boxs, boxw, boxw, - m == selmon && selmon->sel && selmon->sel->tags & 1 << i, - urg & 1 << i); - x += w; - } - w = TEXTW(m->ltsymbol); - drw_setscheme(drw, scheme[SchemeNorm]); - x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0); - - if ((w = m->ww - tw - stw - x) > bh) { - if (m->sel) { - drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]); - drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0); - if (m->sel->isfloating) - drw_rect(drw, x + boxs, boxs, boxw, boxw, m->sel->isfixed, 0); - } else { - drw_setscheme(drw, scheme[SchemeNorm]); - drw_rect(drw, x, 0, w, bh, 1, 1); - } - } - drw_map(drw, m->barwin, 0, 0, m->ww - stw, bh); -} - -void -drawbars(void) -{ - Monitor *m; - - for (m = mons; m; m = m->next) - drawbar(m); -} - -void -enternotify(XEvent *e) -{ - Client *c; - Monitor *m; - XCrossingEvent *ev = &e->xcrossing; - - if ((ev->mode != NotifyNormal || ev->detail == NotifyInferior) && ev->window != root) - return; - c = wintoclient(ev->window); - m = c ? c->mon : wintomon(ev->window); - if (m != selmon) { - unfocus(selmon->sel, 1); - selmon = m; - } else if (!c || c == selmon->sel) - return; - focus(c); -} - -void -expose(XEvent *e) -{ - Monitor *m; - XExposeEvent *ev = &e->xexpose; - - if (ev->count == 0 && (m = wintomon(ev->window))) { - drawbar(m); - if (m == selmon) - updatesystray(); - } -} - -void -focus(Client *c) -{ - if (!c || !ISVISIBLE(c)) - for (c = selmon->stack; c && !ISVISIBLE(c); c = c->snext); - if (selmon->sel && selmon->sel != c) - unfocus(selmon->sel, 0); - if (c) { - if (c->mon != selmon) - selmon = c->mon; - if (c->isurgent) - seturgent(c, 0); - detachstack(c); - attachstack(c); - grabbuttons(c, 1); - XSetWindowBorder(dpy, c->win, scheme[SchemeSel][ColBorder].pixel); - setfocus(c); - } else { - XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); - XDeleteProperty(dpy, root, netatom[NetActiveWindow]); - } - selmon->sel = c; - drawbars(); -} - -/* there are some broken focus acquiring clients needing extra handling */ -void -focusin(XEvent *e) -{ - XFocusChangeEvent *ev = &e->xfocus; - - if (selmon->sel && ev->window != selmon->sel->win) - setfocus(selmon->sel); -} - -void -focusmon(const Arg *arg) -{ - Monitor *m; - - if (!mons->next) - return; - if ((m = dirtomon(arg->i)) == selmon) - return; - unfocus(selmon->sel, 0); - selmon = m; - focus(NULL); -} - -void -focusstack(const Arg *arg) -{ - Client *c = NULL, *i; - - if (!selmon->sel || (selmon->sel->isfullscreen && lockfullscreen)) - return; - if (arg->i > 0) { - for (c = selmon->sel->next; c && !ISVISIBLE(c); c = c->next); - if (!c) - for (c = selmon->clients; c && !ISVISIBLE(c); c = c->next); - } else { - for (i = selmon->clients; i != selmon->sel; i = i->next) - if (ISVISIBLE(i)) - c = i; - if (!c) - for (; i; i = i->next) - if (ISVISIBLE(i)) - c = i; - } - if (c) { - focus(c); - restack(selmon); - } -} - -Atom -getatomprop(Client *c, Atom prop) -{ - int di; - unsigned long dl; - unsigned char *p = NULL; - Atom da, atom = None; - - /* FIXME getatomprop should return the number of items and a pointer to - * the stored data instead of this workaround */ - Atom req = XA_ATOM; - if (prop == xatom[XembedInfo]) - req = xatom[XembedInfo]; - - if (XGetWindowProperty(dpy, c->win, prop, 0L, sizeof atom, False, req, - &da, &di, &dl, &dl, &p) == Success && p) { - atom = *(Atom *)p; - if (da == xatom[XembedInfo] && dl == 2) - atom = ((Atom *)p)[1]; - XFree(p); - } - return atom; -} - -int -getrootptr(int *x, int *y) -{ - int di; - unsigned int dui; - Window dummy; - - return XQueryPointer(dpy, root, &dummy, &dummy, x, y, &di, &di, &dui); -} - -long -getstate(Window w) -{ - int format; - long result = -1; - unsigned char *p = NULL; - unsigned long n, extra; - Atom real; - - if (XGetWindowProperty(dpy, w, wmatom[WMState], 0L, 2L, False, wmatom[WMState], - &real, &format, &n, &extra, (unsigned char **)&p) != Success) - return -1; - if (n != 0) - result = *p; - XFree(p); - return result; -} - -unsigned int -getsystraywidth() -{ - unsigned int w = 0; - Client *i; - if(showsystray) - for(i = systray->icons; i; w += i->w + systrayspacing, i = i->next) ; - return w ? w + systrayspacing : 1; -} - -int -gettextprop(Window w, Atom atom, char *text, unsigned int size) -{ - char **list = NULL; - int n; - XTextProperty name; - - if (!text || size == 0) - return 0; - text[0] = '\0'; - if (!XGetTextProperty(dpy, w, &name, atom) || !name.nitems) - return 0; - if (name.encoding == XA_STRING) { - strncpy(text, (char *)name.value, size - 1); - } else if (XmbTextPropertyToTextList(dpy, &name, &list, &n) >= Success && n > 0 && *list) { - strncpy(text, *list, size - 1); - XFreeStringList(list); - } - text[size - 1] = '\0'; - XFree(name.value); - return 1; -} - -void -grabbuttons(Client *c, int focused) -{ - updatenumlockmask(); - { - unsigned int i, j; - unsigned int modifiers[] = { 0, LockMask, numlockmask, numlockmask|LockMask }; - XUngrabButton(dpy, AnyButton, AnyModifier, c->win); - if (!focused) - XGrabButton(dpy, AnyButton, AnyModifier, c->win, False, - BUTTONMASK, GrabModeSync, GrabModeSync, None, None); - for (i = 0; i < LENGTH(buttons); i++) - if (buttons[i].click == ClkClientWin) - for (j = 0; j < LENGTH(modifiers); j++) - XGrabButton(dpy, buttons[i].button, - buttons[i].mask | modifiers[j], - c->win, False, BUTTONMASK, - GrabModeAsync, GrabModeSync, None, None); - } -} - -void -grabkeys(void) -{ - updatenumlockmask(); - { - unsigned int i, j, k; - unsigned int modifiers[] = { 0, LockMask, numlockmask, numlockmask|LockMask }; - int start, end, skip; - KeySym *syms; - - XUngrabKey(dpy, AnyKey, AnyModifier, root); - XDisplayKeycodes(dpy, &start, &end); - syms = XGetKeyboardMapping(dpy, start, end - start + 1, &skip); - if (!syms) - return; - for (k = start; k <= end; k++) - for (i = 0; i < LENGTH(keys); i++) - /* skip modifier codes, we do that ourselves */ - if (keys[i].keysym == syms[(k - start) * skip]) - for (j = 0; j < LENGTH(modifiers); j++) - XGrabKey(dpy, k, - keys[i].mod | modifiers[j], - root, True, - GrabModeAsync, GrabModeAsync); - XFree(syms); - } -} - -void -incnmaster(const Arg *arg) -{ - selmon->nmaster = MAX(selmon->nmaster + arg->i, 0); - arrange(selmon); -} - -#ifdef XINERAMA -static int -isuniquegeom(XineramaScreenInfo *unique, size_t n, XineramaScreenInfo *info) -{ - while (n--) - if (unique[n].x_org == info->x_org && unique[n].y_org == info->y_org - && unique[n].width == info->width && unique[n].height == info->height) - return 0; - return 1; -} -#endif /* XINERAMA */ - -void -keypress(XEvent *e) -{ - unsigned int i; - KeySym keysym; - XKeyEvent *ev; - - ev = &e->xkey; - keysym = XKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0); - for (i = 0; i < LENGTH(keys); i++) - if (keysym == keys[i].keysym - && CLEANMASK(keys[i].mod) == CLEANMASK(ev->state) - && keys[i].func) - keys[i].func(&(keys[i].arg)); -} - -void -killclient(const Arg *arg) -{ - if (!selmon->sel) - return; - - if (!sendevent(selmon->sel->win, wmatom[WMDelete], NoEventMask, wmatom[WMDelete], CurrentTime, 0 , 0, 0)) { - XGrabServer(dpy); - XSetErrorHandler(xerrordummy); - XSetCloseDownMode(dpy, DestroyAll); - XKillClient(dpy, selmon->sel->win); - XSync(dpy, False); - XSetErrorHandler(xerror); - XUngrabServer(dpy); - } -} - -void -manage(Window w, XWindowAttributes *wa) -{ - Client *c, *t = NULL; - Window trans = None; - XWindowChanges wc; - - c = ecalloc(1, sizeof(Client)); - c->win = w; - /* geometry */ - c->x = c->oldx = wa->x; - c->y = c->oldy = wa->y; - c->w = c->oldw = wa->width; - c->h = c->oldh = wa->height; - c->oldbw = wa->border_width; - - updatetitle(c); - if (XGetTransientForHint(dpy, w, &trans) && (t = wintoclient(trans))) { - c->mon = t->mon; - c->tags = t->tags; - } else { - c->mon = selmon; - applyrules(c); - } - - if (c->x + WIDTH(c) > c->mon->wx + c->mon->ww) - c->x = c->mon->wx + c->mon->ww - WIDTH(c); - if (c->y + HEIGHT(c) > c->mon->wy + c->mon->wh) - c->y = c->mon->wy + c->mon->wh - HEIGHT(c); - c->x = MAX(c->x, c->mon->wx); - c->y = MAX(c->y, c->mon->wy); - c->bw = borderpx; - - wc.border_width = c->bw; - XConfigureWindow(dpy, w, CWBorderWidth, &wc); - XSetWindowBorder(dpy, w, scheme[SchemeNorm][ColBorder].pixel); - configure(c); /* propagates border_width, if size doesn't change */ - updatewindowtype(c); - updatesizehints(c); - updatewmhints(c); - XSelectInput(dpy, w, EnterWindowMask|FocusChangeMask|PropertyChangeMask|StructureNotifyMask); - grabbuttons(c, 0); - if (!c->isfloating) - c->isfloating = c->oldstate = trans != None || c->isfixed; - if (c->isfloating) - XRaiseWindow(dpy, c->win); - attach(c); - attachstack(c); - XChangeProperty(dpy, root, netatom[NetClientList], XA_WINDOW, 32, PropModeAppend, - (unsigned char *) &(c->win), 1); - XMoveResizeWindow(dpy, c->win, c->x + 2 * sw, c->y, c->w, c->h); /* some windows require this */ - setclientstate(c, NormalState); - if (c->mon == selmon) - unfocus(selmon->sel, 0); - c->mon->sel = c; - arrange(c->mon); - XMapWindow(dpy, c->win); - focus(NULL); -} - -void -mappingnotify(XEvent *e) -{ - XMappingEvent *ev = &e->xmapping; - - XRefreshKeyboardMapping(ev); - if (ev->request == MappingKeyboard) - grabkeys(); -} - -void -maprequest(XEvent *e) -{ - static XWindowAttributes wa; - XMapRequestEvent *ev = &e->xmaprequest; - - Client *i; - if ((i = wintosystrayicon(ev->window))) { - sendevent(i->win, netatom[Xembed], StructureNotifyMask, CurrentTime, XEMBED_WINDOW_ACTIVATE, 0, systray->win, XEMBED_EMBEDDED_VERSION); - resizebarwin(selmon); - updatesystray(); - } - - - if (!XGetWindowAttributes(dpy, ev->window, &wa) || wa.override_redirect) - return; - if (!wintoclient(ev->window)) - manage(ev->window, &wa); -} - -void -monocle(Monitor *m) -{ - unsigned int n = 0; - Client *c; - - for (c = m->clients; c; c = c->next) - if (ISVISIBLE(c)) - n++; - if (n > 0) /* override layout symbol */ - snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n); - for (c = nexttiled(m->clients); c; c = nexttiled(c->next)) - resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, 0); -} - -void -motionnotify(XEvent *e) -{ - static Monitor *mon = NULL; - Monitor *m; - XMotionEvent *ev = &e->xmotion; - - if (ev->window != root) - return; - if ((m = recttomon(ev->x_root, ev->y_root, 1, 1)) != mon && mon) { - unfocus(selmon->sel, 1); - selmon = m; - focus(NULL); - } - mon = m; -} - -void -movemouse(const Arg *arg) -{ - int x, y, ocx, ocy, nx, ny; - Client *c; - Monitor *m; - XEvent ev; - Time lasttime = 0; - - if (!(c = selmon->sel)) - return; - if (c->isfullscreen) /* no support moving fullscreen windows by mouse */ - return; - restack(selmon); - ocx = c->x; - ocy = c->y; - if (XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync, - None, cursor[CurMove]->cursor, CurrentTime) != GrabSuccess) - return; - if (!getrootptr(&x, &y)) - return; - do { - XMaskEvent(dpy, MOUSEMASK|ExposureMask|SubstructureRedirectMask, &ev); - switch(ev.type) { - case ConfigureRequest: - case Expose: - case MapRequest: - handler[ev.type](&ev); - break; - case MotionNotify: - if ((ev.xmotion.time - lasttime) <= (1000 / 60)) - continue; - lasttime = ev.xmotion.time; - - nx = ocx + (ev.xmotion.x - x); - ny = ocy + (ev.xmotion.y - y); - if (abs(selmon->wx - nx) < snap) - nx = selmon->wx; - else if (abs((selmon->wx + selmon->ww) - (nx + WIDTH(c))) < snap) - nx = selmon->wx + selmon->ww - WIDTH(c); - if (abs(selmon->wy - ny) < snap) - ny = selmon->wy; - else if (abs((selmon->wy + selmon->wh) - (ny + HEIGHT(c))) < snap) - ny = selmon->wy + selmon->wh - HEIGHT(c); - if (!c->isfloating && selmon->lt[selmon->sellt]->arrange - && (abs(nx - c->x) > snap || abs(ny - c->y) > snap)) - togglefloating(NULL); - if (!selmon->lt[selmon->sellt]->arrange || c->isfloating) - resize(c, nx, ny, c->w, c->h, 1); - break; - } - } while (ev.type != ButtonRelease); - XUngrabPointer(dpy, CurrentTime); - if ((m = recttomon(c->x, c->y, c->w, c->h)) != selmon) { - sendmon(c, m); - selmon = m; - focus(NULL); - } -} - -Client * -nexttiled(Client *c) -{ - for (; c && (c->isfloating || !ISVISIBLE(c)); c = c->next); - return c; -} - -void -pop(Client *c) -{ - detach(c); - attach(c); - focus(c); - arrange(c->mon); -} - -void -propertynotify(XEvent *e) -{ - Client *c; - Window trans; - XPropertyEvent *ev = &e->xproperty; - - if ((c = wintosystrayicon(ev->window))) { - if (ev->atom == XA_WM_NORMAL_HINTS) { - updatesizehints(c); - updatesystrayicongeom(c, c->w, c->h); - } - else - updatesystrayiconstate(c, ev); - resizebarwin(selmon); - updatesystray(); - } - - if ((ev->window == root) && (ev->atom == XA_WM_NAME)) - updatestatus(); - else if (ev->state == PropertyDelete) - return; /* ignore */ - else if ((c = wintoclient(ev->window))) { - switch(ev->atom) { - default: break; - case XA_WM_TRANSIENT_FOR: - if (!c->isfloating && (XGetTransientForHint(dpy, c->win, &trans)) && - (c->isfloating = (wintoclient(trans)) != NULL)) - arrange(c->mon); - break; - case XA_WM_NORMAL_HINTS: - c->hintsvalid = 0; - break; - case XA_WM_HINTS: - updatewmhints(c); - drawbars(); - break; - } - if (ev->atom == XA_WM_NAME || ev->atom == netatom[NetWMName]) { - updatetitle(c); - if (c == c->mon->sel) - drawbar(c->mon); - } - if (ev->atom == netatom[NetWMWindowType]) - updatewindowtype(c); - } -} - -void -quit(const Arg *arg) -{ - size_t i; - - /* kill child processes */ - for (i = 0; i < autostart_len; i++) { - if (0 < autostart_pids[i]) { - kill(autostart_pids[i], SIGTERM); - waitpid(autostart_pids[i], NULL, 0); - } - } - - running = 0; -} - -Monitor * -recttomon(int x, int y, int w, int h) -{ - Monitor *m, *r = selmon; - int a, area = 0; - - for (m = mons; m; m = m->next) - if ((a = INTERSECT(x, y, w, h, m)) > area) { - area = a; - r = m; - } - return r; -} - -void -removesystrayicon(Client *i) -{ - Client **ii; - - if (!showsystray || !i) - return; - for (ii = &systray->icons; *ii && *ii != i; ii = &(*ii)->next); - if (ii) - *ii = i->next; - free(i); -} - -void -resize(Client *c, int x, int y, int w, int h, int interact) -{ - if (applysizehints(c, &x, &y, &w, &h, interact)) - resizeclient(c, x, y, w, h); -} - -void -resizebarwin(Monitor *m) { - unsigned int w = m->ww; - if (showsystray && m == systraytomon(m) && !systrayonleft) - w -= getsystraywidth(); - XMoveResizeWindow(dpy, m->barwin, m->wx, m->by, w, bh); -} - -void -resizeclient(Client *c, int x, int y, int w, int h) -{ - XWindowChanges wc; - - c->oldx = c->x; c->x = wc.x = x; - c->oldy = c->y; c->y = wc.y = y; - c->oldw = c->w; c->w = wc.width = w; - c->oldh = c->h; c->h = wc.height = h; - wc.border_width = c->bw; - XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc); - configure(c); - XSync(dpy, False); -} - -void -resizemouse(const Arg *arg) -{ - int ocx, ocy, nw, nh; - Client *c; - Monitor *m; - XEvent ev; - Time lasttime = 0; - - if (!(c = selmon->sel)) - return; - if (c->isfullscreen) /* no support resizing fullscreen windows by mouse */ - return; - restack(selmon); - ocx = c->x; - ocy = c->y; - if (XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync, - None, cursor[CurResize]->cursor, CurrentTime) != GrabSuccess) - return; - XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w + c->bw - 1, c->h + c->bw - 1); - do { - XMaskEvent(dpy, MOUSEMASK|ExposureMask|SubstructureRedirectMask, &ev); - switch(ev.type) { - case ConfigureRequest: - case Expose: - case MapRequest: - handler[ev.type](&ev); - break; - case MotionNotify: - if ((ev.xmotion.time - lasttime) <= (1000 / 60)) - continue; - lasttime = ev.xmotion.time; - - nw = MAX(ev.xmotion.x - ocx - 2 * c->bw + 1, 1); - nh = MAX(ev.xmotion.y - ocy - 2 * c->bw + 1, 1); - if (c->mon->wx + nw >= selmon->wx && c->mon->wx + nw <= selmon->wx + selmon->ww - && c->mon->wy + nh >= selmon->wy && c->mon->wy + nh <= selmon->wy + selmon->wh) - { - if (!c->isfloating && selmon->lt[selmon->sellt]->arrange - && (abs(nw - c->w) > snap || abs(nh - c->h) > snap)) - togglefloating(NULL); - } - if (!selmon->lt[selmon->sellt]->arrange || c->isfloating) - resize(c, c->x, c->y, nw, nh, 1); - break; - } - } while (ev.type != ButtonRelease); - XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w + c->bw - 1, c->h + c->bw - 1); - XUngrabPointer(dpy, CurrentTime); - while (XCheckMaskEvent(dpy, EnterWindowMask, &ev)); - if ((m = recttomon(c->x, c->y, c->w, c->h)) != selmon) { - sendmon(c, m); - selmon = m; - focus(NULL); - } -} - -void -resizerequest(XEvent *e) -{ - XResizeRequestEvent *ev = &e->xresizerequest; - Client *i; - - if ((i = wintosystrayicon(ev->window))) { - updatesystrayicongeom(i, ev->width, ev->height); - resizebarwin(selmon); - updatesystray(); - } -} - -void -restack(Monitor *m) -{ - Client *c; - XEvent ev; - XWindowChanges wc; - - drawbar(m); - if (!m->sel) - return; - if (m->sel->isfloating || !m->lt[m->sellt]->arrange) - XRaiseWindow(dpy, m->sel->win); - if (m->lt[m->sellt]->arrange) { - wc.stack_mode = Below; - wc.sibling = m->barwin; - for (c = m->stack; c; c = c->snext) - if (!c->isfloating && ISVISIBLE(c)) { - XConfigureWindow(dpy, c->win, CWSibling|CWStackMode, &wc); - wc.sibling = c->win; - } - } - XSync(dpy, False); - while (XCheckMaskEvent(dpy, EnterWindowMask, &ev)); -} - -void -run(void) -{ - XEvent ev; - /* main event loop */ - XSync(dpy, False); - while (running && !XNextEvent(dpy, &ev)) - if (handler[ev.type]) - handler[ev.type](&ev); /* call handler */ -} - -void -scan(void) -{ - unsigned int i, num; - Window d1, d2, *wins = NULL; - XWindowAttributes wa; - - if (XQueryTree(dpy, root, &d1, &d2, &wins, &num)) { - for (i = 0; i < num; i++) { - if (!XGetWindowAttributes(dpy, wins[i], &wa) - || wa.override_redirect || XGetTransientForHint(dpy, wins[i], &d1)) - continue; - if (wa.map_state == IsViewable || getstate(wins[i]) == IconicState) - manage(wins[i], &wa); - } - for (i = 0; i < num; i++) { /* now the transients */ - if (!XGetWindowAttributes(dpy, wins[i], &wa)) - continue; - if (XGetTransientForHint(dpy, wins[i], &d1) - && (wa.map_state == IsViewable || getstate(wins[i]) == IconicState)) - manage(wins[i], &wa); - } - if (wins) - XFree(wins); - } -} - -void -sendmon(Client *c, Monitor *m) -{ - if (c->mon == m) - return; - unfocus(c, 1); - detach(c); - detachstack(c); - c->mon = m; - c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */ - attach(c); - attachstack(c); - focus(NULL); - arrange(NULL); -} - -void -setclientstate(Client *c, long state) -{ - long data[] = { state, None }; - - XChangeProperty(dpy, c->win, wmatom[WMState], wmatom[WMState], 32, - PropModeReplace, (unsigned char *)data, 2); -} - -int -sendevent(Window w, Atom proto, int mask, long d0, long d1, long d2, long d3, long d4) -{ - int n; - Atom *protocols, mt; - int exists = 0; - XEvent ev; - - if (proto == wmatom[WMTakeFocus] || proto == wmatom[WMDelete]) { - mt = wmatom[WMProtocols]; - if (XGetWMProtocols(dpy, w, &protocols, &n)) { - while (!exists && n--) - exists = protocols[n] == proto; - XFree(protocols); - } - } - else { - exists = True; - mt = proto; - } - - if (exists) { - ev.type = ClientMessage; - ev.xclient.window = w; - ev.xclient.message_type = mt; - ev.xclient.format = 32; - ev.xclient.data.l[0] = d0; - ev.xclient.data.l[1] = d1; - ev.xclient.data.l[2] = d2; - ev.xclient.data.l[3] = d3; - ev.xclient.data.l[4] = d4; - XSendEvent(dpy, w, False, mask, &ev); - } - return exists; -} - -void -setfocus(Client *c) -{ - if (!c->neverfocus) { - XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime); - XChangeProperty(dpy, root, netatom[NetActiveWindow], - XA_WINDOW, 32, PropModeReplace, - (unsigned char *) &(c->win), 1); - } - sendevent(c->win, wmatom[WMTakeFocus], NoEventMask, wmatom[WMTakeFocus], CurrentTime, 0, 0, 0); -} - -void -setfullscreen(Client *c, int fullscreen) -{ - if (fullscreen && !c->isfullscreen) { - XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32, - PropModeReplace, (unsigned char*)&netatom[NetWMFullscreen], 1); - c->isfullscreen = 1; - c->oldstate = c->isfloating; - c->oldbw = c->bw; - c->bw = 0; - c->isfloating = 1; - resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh); - XRaiseWindow(dpy, c->win); - } else if (!fullscreen && c->isfullscreen){ - XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32, - PropModeReplace, (unsigned char*)0, 0); - c->isfullscreen = 0; - c->isfloating = c->oldstate; - c->bw = c->oldbw; - c->x = c->oldx; - c->y = c->oldy; - c->w = c->oldw; - c->h = c->oldh; - resizeclient(c, c->x, c->y, c->w, c->h); - arrange(c->mon); - } -} - -void -setlayout(const Arg *arg) -{ - if (!arg || !arg->v || arg->v != selmon->lt[selmon->sellt]) - selmon->sellt ^= 1; - if (arg && arg->v) - selmon->lt[selmon->sellt] = (Layout *)arg->v; - strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol); - if (selmon->sel) - arrange(selmon); - else - drawbar(selmon); -} - -/* arg > 1.0 will set mfact absolutely */ -void -setmfact(const Arg *arg) -{ - float f; - - if (!arg || !selmon->lt[selmon->sellt]->arrange) - return; - f = arg->f < 1.0 ? arg->f + selmon->mfact : arg->f - 1.0; - if (f < 0.05 || f > 0.95) - return; - selmon->mfact = f; - arrange(selmon); -} - -void -setup(void) -{ - int i; - XSetWindowAttributes wa; - Atom utf8string; - struct sigaction sa; - - /* do not transform children into zombies when they terminate */ - sigemptyset(&sa.sa_mask); - sa.sa_flags = SA_NOCLDSTOP | SA_NOCLDWAIT | SA_RESTART; - sa.sa_handler = SIG_IGN; - sigaction(SIGCHLD, &sa, NULL); - - /* clean up any zombies (inherited from .xinitrc etc) immediately */ - while (waitpid(-1, NULL, WNOHANG) > 0); - - /* init screen */ - screen = DefaultScreen(dpy); - sw = DisplayWidth(dpy, screen); - sh = DisplayHeight(dpy, screen); - root = RootWindow(dpy, screen); - drw = drw_create(dpy, screen, root, sw, sh); - if (!drw_fontset_create(drw, fonts, LENGTH(fonts))) - die("no fonts could be loaded."); - lrpad = drw->fonts->h; - bh = drw->fonts->h + 2; - updategeom(); - /* init atoms */ - utf8string = XInternAtom(dpy, "UTF8_STRING", False); - wmatom[WMProtocols] = XInternAtom(dpy, "WM_PROTOCOLS", False); - wmatom[WMDelete] = XInternAtom(dpy, "WM_DELETE_WINDOW", False); - wmatom[WMState] = XInternAtom(dpy, "WM_STATE", False); - wmatom[WMTakeFocus] = XInternAtom(dpy, "WM_TAKE_FOCUS", False); - netatom[NetActiveWindow] = XInternAtom(dpy, "_NET_ACTIVE_WINDOW", False); - netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False); - netatom[NetSystemTray] = XInternAtom(dpy, "_NET_SYSTEM_TRAY_S0", False); - netatom[NetSystemTrayOP] = XInternAtom(dpy, "_NET_SYSTEM_TRAY_OPCODE", False); - netatom[NetSystemTrayOrientation] = XInternAtom(dpy, "_NET_SYSTEM_TRAY_ORIENTATION", False); - netatom[NetSystemTrayOrientationHorz] = XInternAtom(dpy, "_NET_SYSTEM_TRAY_ORIENTATION_HORZ", False); - netatom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False); - netatom[NetWMState] = XInternAtom(dpy, "_NET_WM_STATE", False); - netatom[NetWMCheck] = XInternAtom(dpy, "_NET_SUPPORTING_WM_CHECK", False); - netatom[NetWMFullscreen] = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", False); - netatom[NetWMWindowType] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE", False); - netatom[NetWMWindowTypeDialog] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DIALOG", False); - netatom[NetClientList] = XInternAtom(dpy, "_NET_CLIENT_LIST", False); - xatom[Manager] = XInternAtom(dpy, "MANAGER", False); - xatom[Xembed] = XInternAtom(dpy, "_XEMBED", False); - xatom[XembedInfo] = XInternAtom(dpy, "_XEMBED_INFO", False); - /* init cursors */ - cursor[CurNormal] = drw_cur_create(drw, XC_left_ptr); - cursor[CurResize] = drw_cur_create(drw, XC_sizing); - cursor[CurMove] = drw_cur_create(drw, XC_fleur); - /* init appearance */ - scheme = ecalloc(LENGTH(colors) + 1, sizeof(Clr *)); - scheme[LENGTH(colors)] = drw_scm_create(drw, colors[0], 3); - for (i = 0; i < LENGTH(colors); i++) - scheme[i] = drw_scm_create(drw, colors[i], 3); - /* init system tray */ - updatesystray(); - /* init bars */ - updatebars(); - updatestatus(); - /* supporting window for NetWMCheck */ - wmcheckwin = XCreateSimpleWindow(dpy, root, 0, 0, 1, 1, 0, 0, 0); - XChangeProperty(dpy, wmcheckwin, netatom[NetWMCheck], XA_WINDOW, 32, - PropModeReplace, (unsigned char *) &wmcheckwin, 1); - XChangeProperty(dpy, wmcheckwin, netatom[NetWMName], utf8string, 8, - PropModeReplace, (unsigned char *) "dwm", 3); - XChangeProperty(dpy, root, netatom[NetWMCheck], XA_WINDOW, 32, - PropModeReplace, (unsigned char *) &wmcheckwin, 1); - /* EWMH support per view */ - XChangeProperty(dpy, root, netatom[NetSupported], XA_ATOM, 32, - PropModeReplace, (unsigned char *) netatom, NetLast); - XDeleteProperty(dpy, root, netatom[NetClientList]); - /* select events */ - wa.cursor = cursor[CurNormal]->cursor; - wa.event_mask = SubstructureRedirectMask|SubstructureNotifyMask - |ButtonPressMask|PointerMotionMask|EnterWindowMask - |LeaveWindowMask|StructureNotifyMask|PropertyChangeMask; - XChangeWindowAttributes(dpy, root, CWEventMask|CWCursor, &wa); - XSelectInput(dpy, root, wa.event_mask); - grabkeys(); - focus(NULL); -} - -void -seturgent(Client *c, int urg) -{ - XWMHints *wmh; - - c->isurgent = urg; - if (!(wmh = XGetWMHints(dpy, c->win))) - return; - wmh->flags = urg ? (wmh->flags | XUrgencyHint) : (wmh->flags & ~XUrgencyHint); - XSetWMHints(dpy, c->win, wmh); - XFree(wmh); -} - -void -showhide(Client *c) -{ - if (!c) - return; - if (ISVISIBLE(c)) { - /* show clients top down */ - XMoveWindow(dpy, c->win, c->x, c->y); - if ((!c->mon->lt[c->mon->sellt]->arrange || c->isfloating) && !c->isfullscreen) - resize(c, c->x, c->y, c->w, c->h, 0); - showhide(c->snext); - } else { - /* hide clients bottom up */ - showhide(c->snext); - XMoveWindow(dpy, c->win, WIDTH(c) * -2, c->y); - } -} - -void -spawn(const Arg *arg) -{ - struct sigaction sa; - - if (arg->v == dmenucmd) - dmenumon[0] = '0' + selmon->num; - if (fork() == 0) { - if (dpy) - close(ConnectionNumber(dpy)); - setsid(); - - sigemptyset(&sa.sa_mask); - sa.sa_flags = 0; - sa.sa_handler = SIG_DFL; - sigaction(SIGCHLD, &sa, NULL); - - execvp(((char **)arg->v)[0], (char **)arg->v); - die("dwm: execvp '%s' failed:", ((char **)arg->v)[0]); - } -} - -void -tag(const Arg *arg) -{ - if (selmon->sel && arg->ui & TAGMASK) { - selmon->sel->tags = arg->ui & TAGMASK; - focus(NULL); - arrange(selmon); - } -} - -void -tagmon(const Arg *arg) -{ - if (!selmon->sel || !mons->next) - return; - sendmon(selmon->sel, dirtomon(arg->i)); -} - -void -tile(Monitor *m) -{ - unsigned int i, n, h, mw, my, ty; - Client *c; - - for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); - if (n == 0) - return; - - if (n > m->nmaster) - mw = m->nmaster ? m->ww * m->mfact : 0; - else - mw = m->ww; - for (i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) - if (i < m->nmaster) { - h = (m->wh - my) / (MIN(n, m->nmaster) - i); - resize(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw), 0); - if (my + HEIGHT(c) < m->wh) - my += HEIGHT(c); - } else { - h = (m->wh - ty) / (n - i); - resize(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw), 0); - if (ty + HEIGHT(c) < m->wh) - ty += HEIGHT(c); - } -} - -void -togglebar(const Arg *arg) -{ - selmon->showbar = !selmon->showbar; - updatebarpos(selmon); - resizebarwin(selmon); - if (showsystray) { - XWindowChanges wc; - if (!selmon->showbar) - wc.y = -bh; - else if (selmon->showbar) { - wc.y = 0; - if (!selmon->topbar) - wc.y = selmon->mh - bh; - } - XConfigureWindow(dpy, systray->win, CWY, &wc); - } - arrange(selmon); -} - -void -togglefloating(const Arg *arg) -{ - if (!selmon->sel) - return; - if (selmon->sel->isfullscreen) /* no support for fullscreen windows */ - return; - selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed; - if (selmon->sel->isfloating) - resize(selmon->sel, selmon->sel->x, selmon->sel->y, - selmon->sel->w, selmon->sel->h, 0); - arrange(selmon); -} - -void -toggletag(const Arg *arg) -{ - unsigned int newtags; - - if (!selmon->sel) - return; - newtags = selmon->sel->tags ^ (arg->ui & TAGMASK); - if (newtags) { - selmon->sel->tags = newtags; - focus(NULL); - arrange(selmon); - } -} - -void -toggleview(const Arg *arg) -{ - unsigned int newtagset = selmon->tagset[selmon->seltags] ^ (arg->ui & TAGMASK); - - if (newtagset) { - selmon->tagset[selmon->seltags] = newtagset; - focus(NULL); - arrange(selmon); - } -} - -void -unfocus(Client *c, int setfocus) -{ - if (!c) - return; - grabbuttons(c, 0); - XSetWindowBorder(dpy, c->win, scheme[SchemeNorm][ColBorder].pixel); - if (setfocus) { - XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); - XDeleteProperty(dpy, root, netatom[NetActiveWindow]); - } -} - -void -unmanage(Client *c, int destroyed) -{ - Monitor *m = c->mon; - XWindowChanges wc; - - detach(c); - detachstack(c); - if (!destroyed) { - wc.border_width = c->oldbw; - XGrabServer(dpy); /* avoid race conditions */ - XSetErrorHandler(xerrordummy); - XSelectInput(dpy, c->win, NoEventMask); - XConfigureWindow(dpy, c->win, CWBorderWidth, &wc); /* restore border */ - XUngrabButton(dpy, AnyButton, AnyModifier, c->win); - setclientstate(c, WithdrawnState); - XSync(dpy, False); - XSetErrorHandler(xerror); - XUngrabServer(dpy); - } - free(c); - focus(NULL); - updateclientlist(); - arrange(m); -} - -void -unmapnotify(XEvent *e) -{ - Client *c; - XUnmapEvent *ev = &e->xunmap; - - if ((c = wintoclient(ev->window))) { - if (ev->send_event) - setclientstate(c, WithdrawnState); - else - unmanage(c, 0); - } - else if ((c = wintosystrayicon(ev->window))) { - /* KLUDGE! sometimes icons occasionally unmap their windows, but do - * _not_ destroy them. We map those windows back */ - XMapRaised(dpy, c->win); - updatesystray(); - } -} - -void -updatebars(void) -{ - unsigned int w; - Monitor *m; - XSetWindowAttributes wa = { - .override_redirect = True, - .background_pixmap = ParentRelative, - .event_mask = ButtonPressMask|ExposureMask - }; - XClassHint ch = {"dwm", "dwm"}; - for (m = mons; m; m = m->next) { - if (m->barwin) - continue; - w = m->ww; - if (showsystray && m == systraytomon(m)) - w -= getsystraywidth(); - m->barwin = XCreateWindow(dpy, root, m->wx, m->by, w, bh, 0, DefaultDepth(dpy, screen), - CopyFromParent, DefaultVisual(dpy, screen), - CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa); - XDefineCursor(dpy, m->barwin, cursor[CurNormal]->cursor); - if (showsystray && m == systraytomon(m)) - XMapRaised(dpy, systray->win); - XMapRaised(dpy, m->barwin); - XSetClassHint(dpy, m->barwin, &ch); - } -} - -void -updatebarpos(Monitor *m) -{ - m->wy = m->my; - m->wh = m->mh; - if (m->showbar) { - m->wh -= bh; - m->by = m->topbar ? m->wy : m->wy + m->wh; - m->wy = m->topbar ? m->wy + bh : m->wy; - } else - m->by = -bh; -} - -void -updateclientlist() -{ - Client *c; - Monitor *m; - - XDeleteProperty(dpy, root, netatom[NetClientList]); - for (m = mons; m; m = m->next) - for (c = m->clients; c; c = c->next) - XChangeProperty(dpy, root, netatom[NetClientList], - XA_WINDOW, 32, PropModeAppend, - (unsigned char *) &(c->win), 1); -} - -int -updategeom(void) -{ - int dirty = 0; - -#ifdef XINERAMA - if (XineramaIsActive(dpy)) { - int i, j, n, nn; - Client *c; - Monitor *m; - XineramaScreenInfo *info = XineramaQueryScreens(dpy, &nn); - XineramaScreenInfo *unique = NULL; - - for (n = 0, m = mons; m; m = m->next, n++); - /* only consider unique geometries as separate screens */ - unique = ecalloc(nn, sizeof(XineramaScreenInfo)); - for (i = 0, j = 0; i < nn; i++) - if (isuniquegeom(unique, j, &info[i])) - memcpy(&unique[j++], &info[i], sizeof(XineramaScreenInfo)); - XFree(info); - nn = j; - - /* new monitors if nn > n */ - for (i = n; i < nn; i++) { - for (m = mons; m && m->next; m = m->next); - if (m) - m->next = createmon(); - else - mons = createmon(); - } - for (i = 0, m = mons; i < nn && m; m = m->next, i++) - if (i >= n - || unique[i].x_org != m->mx || unique[i].y_org != m->my - || unique[i].width != m->mw || unique[i].height != m->mh) - { - dirty = 1; - m->num = i; - m->mx = m->wx = unique[i].x_org; - m->my = m->wy = unique[i].y_org; - m->mw = m->ww = unique[i].width; - m->mh = m->wh = unique[i].height; - updatebarpos(m); - } - /* removed monitors if n > nn */ - for (i = nn; i < n; i++) { - for (m = mons; m && m->next; m = m->next); - while ((c = m->clients)) { - dirty = 1; - m->clients = c->next; - detachstack(c); - c->mon = mons; - attach(c); - attachstack(c); - } - if (m == selmon) - selmon = mons; - cleanupmon(m); - } - free(unique); - } else -#endif /* XINERAMA */ - { /* default monitor setup */ - if (!mons) - mons = createmon(); - if (mons->mw != sw || mons->mh != sh) { - dirty = 1; - mons->mw = mons->ww = sw; - mons->mh = mons->wh = sh; - updatebarpos(mons); - } - } - if (dirty) { - selmon = mons; - selmon = wintomon(root); - } - return dirty; -} - -void -updatenumlockmask(void) -{ - unsigned int i, j; - XModifierKeymap *modmap; - - numlockmask = 0; - modmap = XGetModifierMapping(dpy); - for (i = 0; i < 8; i++) - for (j = 0; j < modmap->max_keypermod; j++) - if (modmap->modifiermap[i * modmap->max_keypermod + j] - == XKeysymToKeycode(dpy, XK_Num_Lock)) - numlockmask = (1 << i); - XFreeModifiermap(modmap); -} - -void -updatesizehints(Client *c) -{ - long msize; - XSizeHints size; - - if (!XGetWMNormalHints(dpy, c->win, &size, &msize)) - /* size is uninitialized, ensure that size.flags aren't used */ - size.flags = PSize; - if (size.flags & PBaseSize) { - c->basew = size.base_width; - c->baseh = size.base_height; - } else if (size.flags & PMinSize) { - c->basew = size.min_width; - c->baseh = size.min_height; - } else - c->basew = c->baseh = 0; - if (size.flags & PResizeInc) { - c->incw = size.width_inc; - c->inch = size.height_inc; - } else - c->incw = c->inch = 0; - if (size.flags & PMaxSize) { - c->maxw = size.max_width; - c->maxh = size.max_height; - } else - c->maxw = c->maxh = 0; - if (size.flags & PMinSize) { - c->minw = size.min_width; - c->minh = size.min_height; - } else if (size.flags & PBaseSize) { - c->minw = size.base_width; - c->minh = size.base_height; - } else - c->minw = c->minh = 0; - if (size.flags & PAspect) { - c->mina = (float)size.min_aspect.y / size.min_aspect.x; - c->maxa = (float)size.max_aspect.x / size.max_aspect.y; - } else - c->maxa = c->mina = 0.0; - c->isfixed = (c->maxw && c->maxh && c->maxw == c->minw && c->maxh == c->minh); - c->hintsvalid = 1; -} - -void -updatestatus(void) -{ - if (!gettextprop(root, XA_WM_NAME, stext, sizeof(stext))) - strcpy(stext, "dwm-"VERSION); - drawbar(selmon); - updatesystray(); -} - - -void -updatesystrayicongeom(Client *i, int w, int h) -{ - if (i) { - i->h = bh; - if (w == h) - i->w = bh; - else if (h == bh) - i->w = w; - else - i->w = (int) ((float)bh * ((float)w / (float)h)); - applysizehints(i, &(i->x), &(i->y), &(i->w), &(i->h), False); - /* force icons into the systray dimensions if they don't want to */ - if (i->h > bh) { - if (i->w == i->h) - i->w = bh; - else - i->w = (int) ((float)bh * ((float)i->w / (float)i->h)); - i->h = bh; - } - } -} - -void -updatesystrayiconstate(Client *i, XPropertyEvent *ev) -{ - long flags; - int code = 0; - - if (!showsystray || !i || ev->atom != xatom[XembedInfo] || - !(flags = getatomprop(i, xatom[XembedInfo]))) - return; - - if (flags & XEMBED_MAPPED && !i->tags) { - i->tags = 1; - code = XEMBED_WINDOW_ACTIVATE; - XMapRaised(dpy, i->win); - setclientstate(i, NormalState); - } - else if (!(flags & XEMBED_MAPPED) && i->tags) { - i->tags = 0; - code = XEMBED_WINDOW_DEACTIVATE; - XUnmapWindow(dpy, i->win); - setclientstate(i, WithdrawnState); - } - else - return; - sendevent(i->win, xatom[Xembed], StructureNotifyMask, CurrentTime, code, 0, - systray->win, XEMBED_EMBEDDED_VERSION); -} - -void -updatesystray(void) -{ - XSetWindowAttributes wa; - XWindowChanges wc; - Client *i; - Monitor *m = systraytomon(NULL); - unsigned int x = m->mx + m->mw; - unsigned int sw = TEXTW(stext) - lrpad + systrayspacing; - unsigned int w = 1; - - if (!showsystray) - return; - if (systrayonleft) - x -= sw + lrpad / 2; - if (!systray) { - /* init systray */ - if (!(systray = (Systray *)calloc(1, sizeof(Systray)))) - die("fatal: could not malloc() %u bytes\n", sizeof(Systray)); - systray->win = XCreateSimpleWindow(dpy, root, x, m->by, w, bh, 0, 0, scheme[SchemeSel][ColBg].pixel); - wa.event_mask = ButtonPressMask | ExposureMask; - wa.override_redirect = True; - wa.background_pixel = scheme[SchemeNorm][ColBg].pixel; - XSelectInput(dpy, systray->win, SubstructureNotifyMask); - XChangeProperty(dpy, systray->win, netatom[NetSystemTrayOrientation], XA_CARDINAL, 32, - PropModeReplace, (unsigned char *)&netatom[NetSystemTrayOrientationHorz], 1); - XChangeWindowAttributes(dpy, systray->win, CWEventMask|CWOverrideRedirect|CWBackPixel, &wa); - XMapRaised(dpy, systray->win); - XSetSelectionOwner(dpy, netatom[NetSystemTray], systray->win, CurrentTime); - if (XGetSelectionOwner(dpy, netatom[NetSystemTray]) == systray->win) { - sendevent(root, xatom[Manager], StructureNotifyMask, CurrentTime, netatom[NetSystemTray], systray->win, 0, 0); - XSync(dpy, False); - } - else { - fprintf(stderr, "dwm: unable to obtain system tray.\n"); - free(systray); - systray = NULL; - return; - } - } - for (w = 0, i = systray->icons; i; i = i->next) { - /* make sure the background color stays the same */ - wa.background_pixel = scheme[SchemeNorm][ColBg].pixel; - XChangeWindowAttributes(dpy, i->win, CWBackPixel, &wa); - XMapRaised(dpy, i->win); - w += systrayspacing; - i->x = w; - XMoveResizeWindow(dpy, i->win, i->x, 0, i->w, i->h); - w += i->w; - if (i->mon != m) - i->mon = m; - } - w = w ? w + systrayspacing : 1; - x -= w; - XMoveResizeWindow(dpy, systray->win, x, m->by, w, bh); - wc.x = x; wc.y = m->by; wc.width = w; wc.height = bh; - wc.stack_mode = Above; wc.sibling = m->barwin; - XConfigureWindow(dpy, systray->win, CWX|CWY|CWWidth|CWHeight|CWSibling|CWStackMode, &wc); - XMapWindow(dpy, systray->win); - XMapSubwindows(dpy, systray->win); - /* redraw background */ - XSetForeground(dpy, drw->gc, scheme[SchemeNorm][ColBg].pixel); - XFillRectangle(dpy, systray->win, drw->gc, 0, 0, w, bh); - XSync(dpy, False); -} - -void -updatetitle(Client *c) -{ - if (!gettextprop(c->win, netatom[NetWMName], c->name, sizeof c->name)) - gettextprop(c->win, XA_WM_NAME, c->name, sizeof c->name); - if (c->name[0] == '\0') /* hack to mark broken clients */ - strcpy(c->name, broken); -} - -void -updatewindowtype(Client *c) -{ - Atom state = getatomprop(c, netatom[NetWMState]); - Atom wtype = getatomprop(c, netatom[NetWMWindowType]); - - if (state == netatom[NetWMFullscreen]) - setfullscreen(c, 1); - if (wtype == netatom[NetWMWindowTypeDialog]) - c->isfloating = 1; -} - -void -updatewmhints(Client *c) -{ - XWMHints *wmh; - - if ((wmh = XGetWMHints(dpy, c->win))) { - if (c == selmon->sel && wmh->flags & XUrgencyHint) { - wmh->flags &= ~XUrgencyHint; - XSetWMHints(dpy, c->win, wmh); - } else - c->isurgent = (wmh->flags & XUrgencyHint) ? 1 : 0; - if (wmh->flags & InputHint) - c->neverfocus = !wmh->input; - else - c->neverfocus = 0; - XFree(wmh); - } -} - -void -view(const Arg *arg) -{ - if ((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags]) - return; - selmon->seltags ^= 1; /* toggle sel tagset */ - if (arg->ui & TAGMASK) - selmon->tagset[selmon->seltags] = arg->ui & TAGMASK; - focus(NULL); - arrange(selmon); -} - -Client * -wintoclient(Window w) -{ - Client *c; - Monitor *m; - - for (m = mons; m; m = m->next) - for (c = m->clients; c; c = c->next) - if (c->win == w) - return c; - return NULL; -} - -Client * -wintosystrayicon(Window w) { - Client *i = NULL; - - if (!showsystray || !w) - return i; - for (i = systray->icons; i && i->win != w; i = i->next) ; - return i; -} - -Monitor * -wintomon(Window w) -{ - int x, y; - Client *c; - Monitor *m; - - if (w == root && getrootptr(&x, &y)) - return recttomon(x, y, 1, 1); - for (m = mons; m; m = m->next) - if (w == m->barwin) - return m; - if ((c = wintoclient(w))) - return c->mon; - return selmon; -} - -/* There's no way to check accesses to destroyed windows, thus those cases are - * ignored (especially on UnmapNotify's). Other types of errors call Xlibs - * default error handler, which may call exit. */ -int -xerror(Display *dpy, XErrorEvent *ee) -{ - if (ee->error_code == BadWindow - || (ee->request_code == X_SetInputFocus && ee->error_code == BadMatch) - || (ee->request_code == X_PolyText8 && ee->error_code == BadDrawable) - || (ee->request_code == X_PolyFillRectangle && ee->error_code == BadDrawable) - || (ee->request_code == X_PolySegment && ee->error_code == BadDrawable) - || (ee->request_code == X_ConfigureWindow && ee->error_code == BadMatch) - || (ee->request_code == X_GrabButton && ee->error_code == BadAccess) - || (ee->request_code == X_GrabKey && ee->error_code == BadAccess) - || (ee->request_code == X_CopyArea && ee->error_code == BadDrawable)) - return 0; - fprintf(stderr, "dwm: fatal error: request code=%d, error code=%d\n", - ee->request_code, ee->error_code); - return xerrorxlib(dpy, ee); /* may call exit */ -} - -int -xerrordummy(Display *dpy, XErrorEvent *ee) -{ - return 0; -} - -/* Startup Error handler to check if another window manager - * is already running. */ -int -xerrorstart(Display *dpy, XErrorEvent *ee) -{ - die("dwm: another window manager is already running"); - return -1; -} - -Monitor * -systraytomon(Monitor *m) { - Monitor *t; - int i, n; - if(!systraypinning) { - if(!m) - return selmon; - return m == selmon ? m : NULL; - } - for(n = 1, t = mons; t && t->next; n++, t = t->next) ; - for(i = 1, t = mons; t && t->next && i < systraypinning; i++, t = t->next) ; - if(systraypinningfailfirst && n < systraypinning) - return mons; - return t; -} - -void -zoom(const Arg *arg) -{ - Client *c = selmon->sel; - - if (!selmon->lt[selmon->sellt]->arrange || !c || c->isfloating) - return; - if (c == nexttiled(selmon->clients) && !(c = nexttiled(c->next))) - return; - pop(c); -} - -int -main(int argc, char *argv[]) -{ - if (argc == 2 && !strcmp("-v", argv[1])) - die("dwm-"VERSION); - else if (argc != 1) - die("usage: dwm [-v]"); - if (!setlocale(LC_CTYPE, "") || !XSupportsLocale()) - fputs("warning: no locale support\n", stderr); - if (!(dpy = XOpenDisplay(NULL))) - die("dwm: cannot open display"); - checkotherwm(); - autostart_exec(); - setup(); -#ifdef __OpenBSD__ - if (pledge("stdio rpath proc exec", NULL) == -1) - die("pledge"); -#endif /* __OpenBSD__ */ - scan(); - run(); - cleanup(); - XCloseDisplay(dpy); - return EXIT_SUCCESS; -} diff --git a/config/dwm-old/dwm.c.orig b/config/dwm-old/dwm.c.orig deleted file mode 100644 index 01bbc3a4..00000000 --- a/config/dwm-old/dwm.c.orig +++ /dev/null @@ -1,2634 +0,0 @@ -/* See LICENSE file for copyright and license details. - * - * dynamic window manager is designed like any other X client as well. It is - * driven through handling X events. In contrast to other X clients, a window - * manager selects for SubstructureRedirectMask on the root window, to receive - * events about window (dis-)appearance. Only one X connection at a time is - * allowed to select for this event mask. - * - * The event handlers of dwm are organized in an array which is accessed - * whenever a new event has been fetched. This allows event dispatching - * in O(1) time. - * - * Each child of the root window is called a client, except windows which have - * set the override_redirect flag. Clients are organized in a linked client - * list on each monitor, the focus history is remembered through a stack list - * on each monitor. Each client contains a bit array to indicate the tags of a - * client. - * - * Keys and tagging rules are organized as arrays and defined in config.h. - * - * To understand everything else, start reading main(). - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef XINERAMA -#include -#endif /* XINERAMA */ -#include - -#include "drw.h" -#include "util.h" - -/* macros */ -#define BUTTONMASK (ButtonPressMask|ButtonReleaseMask) -#define CLEANMASK(mask) (mask & ~(numlockmask|LockMask) & (ShiftMask|ControlMask|Mod1Mask|Mod2Mask|Mod3Mask|Mod4Mask|Mod5Mask)) -#define INTERSECT(x,y,w,h,m) (MAX(0, MIN((x)+(w),(m)->wx+(m)->ww) - MAX((x),(m)->wx)) \ - * MAX(0, MIN((y)+(h),(m)->wy+(m)->wh) - MAX((y),(m)->wy))) -#define ISVISIBLE(C) ((C->tags & C->mon->tagset[C->mon->seltags])) -#define LENGTH(X) (sizeof X / sizeof X[0]) -#define MOUSEMASK (BUTTONMASK|PointerMotionMask) -#define WIDTH(X) ((X)->w + 2 * (X)->bw) -#define HEIGHT(X) ((X)->h + 2 * (X)->bw) -#define TAGMASK ((1 << LENGTH(tags)) - 1) -#define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad) - -#define SYSTEM_TRAY_REQUEST_DOCK 0 -/* XEMBED messages */ -#define XEMBED_EMBEDDED_NOTIFY 0 -#define XEMBED_WINDOW_ACTIVATE 1 -#define XEMBED_FOCUS_IN 4 -#define XEMBED_MODALITY_ON 10 -#define XEMBED_MAPPED (1 << 0) -#define XEMBED_WINDOW_ACTIVATE 1 -#define XEMBED_WINDOW_DEACTIVATE 2 -#define VERSION_MAJOR 0 -#define VERSION_MINOR 0 -#define XEMBED_EMBEDDED_VERSION (VERSION_MAJOR << 16) | VERSION_MINOR - -/* enums */ -enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ -enum { SchemeNorm, SchemeSel }; /* color schemes */ -enum { NetSupported, NetWMName, NetWMState, NetWMCheck, - NetSystemTray, NetSystemTrayOP, NetSystemTrayOrientation, NetSystemTrayOrientationHorz, - NetWMFullscreen, NetActiveWindow, NetWMWindowType, - NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */ -enum { Manager, Xembed, XembedInfo, XLast }; /* Xembed atoms */ -enum { WMProtocols, WMDelete, WMState, WMTakeFocus, WMLast }; /* default atoms */ -enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, - ClkClientWin, ClkRootWin, ClkLast }; /* clicks */ - -typedef union { - int i; - unsigned int ui; - float f; - const void *v; -} Arg; - -typedef struct { - unsigned int click; - unsigned int mask; - unsigned int button; - void (*func)(const Arg *arg); - const Arg arg; -} Button; - -typedef struct Monitor Monitor; -typedef struct Client Client; -struct Client { - char name[256]; - float mina, maxa; - int x, y, w, h; - int oldx, oldy, oldw, oldh; - int basew, baseh, incw, inch, maxw, maxh, minw, minh, hintsvalid; - int bw, oldbw; - unsigned int tags; - int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen; - Client *next; - Client *snext; - Monitor *mon; - Window win; -}; - -typedef struct { - unsigned int mod; - KeySym keysym; - void (*func)(const Arg *); - const Arg arg; -} Key; - -typedef struct { - const char *symbol; - void (*arrange)(Monitor *); -} Layout; - -struct Monitor { - char ltsymbol[16]; - float mfact; - int nmaster; - int num; - int by; /* bar geometry */ - int mx, my, mw, mh; /* screen size */ - int wx, wy, ww, wh; /* window area */ - unsigned int seltags; - unsigned int sellt; - unsigned int tagset[2]; - int showbar; - int topbar; - Client *clients; - Client *sel; - Client *stack; - Monitor *next; - Window barwin; - const Layout *lt[2]; -}; - -typedef struct { - const char *class; - const char *instance; - const char *title; - unsigned int tags; - int isfloating; - int monitor; -} Rule; - -typedef struct Systray Systray; -struct Systray { - Window win; - Client *icons; -}; - -/* function declarations */ -static void applyrules(Client *c); -static int applysizehints(Client *c, int *x, int *y, int *w, int *h, int interact); -static void arrange(Monitor *m); -static void arrangemon(Monitor *m); -static void attach(Client *c); -static void attachstack(Client *c); -static void buttonpress(XEvent *e); -static void checkotherwm(void); -static void cleanup(void); -static void cleanupmon(Monitor *mon); -static void clientmessage(XEvent *e); -static void configure(Client *c); -static void configurenotify(XEvent *e); -static void configurerequest(XEvent *e); -static Monitor *createmon(void); -static void destroynotify(XEvent *e); -static void detach(Client *c); -static void detachstack(Client *c); -static Monitor *dirtomon(int dir); -static void drawbar(Monitor *m); -static void drawbars(void); -static int drawstatusbar(Monitor *m, int bh, char* text); -static void enternotify(XEvent *e); -static void expose(XEvent *e); -static void focus(Client *c); -static void focusin(XEvent *e); -static void focusmon(const Arg *arg); -static void focusstack(const Arg *arg); -static Atom getatomprop(Client *c, Atom prop); -static int getrootptr(int *x, int *y); -static long getstate(Window w); -static unsigned int getsystraywidth(); -static int gettextprop(Window w, Atom atom, char *text, unsigned int size); -static void grabbuttons(Client *c, int focused); -static void grabkeys(void); -static void incnmaster(const Arg *arg); -static void keypress(XEvent *e); -static void killclient(const Arg *arg); -static void manage(Window w, XWindowAttributes *wa); -static void mappingnotify(XEvent *e); -static void maprequest(XEvent *e); -static void monocle(Monitor *m); -static void motionnotify(XEvent *e); -static void movemouse(const Arg *arg); -static Client *nexttiled(Client *c); -static void pop(Client *c); -static void propertynotify(XEvent *e); -static void quit(const Arg *arg); -static Monitor *recttomon(int x, int y, int w, int h); -static void removesystrayicon(Client *i); -static void resize(Client *c, int x, int y, int w, int h, int interact); -static void resizebarwin(Monitor *m); -static void resizeclient(Client *c, int x, int y, int w, int h); -static void resizemouse(const Arg *arg); -static void resizerequest(XEvent *e); -static void restack(Monitor *m); -static void run(void); -static void scan(void); -static int sendevent(Window w, Atom proto, int m, long d0, long d1, long d2, long d3, long d4); -static void sendmon(Client *c, Monitor *m); -static void setclientstate(Client *c, long state); -static void setfocus(Client *c); -static void setfullscreen(Client *c, int fullscreen); -static void setlayout(const Arg *arg); -static void setmfact(const Arg *arg); -static void setup(void); -static void seturgent(Client *c, int urg); -static void showhide(Client *c); -static void spawn(const Arg *arg); -static Monitor *systraytomon(Monitor *m); -static void tag(const Arg *arg); -static void tagmon(const Arg *arg); -static void tile(Monitor *m); -static void togglebar(const Arg *arg); -static void togglefloating(const Arg *arg); -static void toggletag(const Arg *arg); -static void toggleview(const Arg *arg); -static void unfocus(Client *c, int setfocus); -static void unmanage(Client *c, int destroyed); -static void unmapnotify(XEvent *e); -static void updatebarpos(Monitor *m); -static void updatebars(void); -static void updateclientlist(void); -static int updategeom(void); -static void updatenumlockmask(void); -static void updatesizehints(Client *c); -static void updatestatus(void); -static void updatesystray(void); -static void updatesystrayicongeom(Client *i, int w, int h); -static void updatesystrayiconstate(Client *i, XPropertyEvent *ev); -static void updatetitle(Client *c); -static void updatewindowtype(Client *c); -static void updatewmhints(Client *c); -static void view(const Arg *arg); -static Client *wintoclient(Window w); -static Monitor *wintomon(Window w); -static Client *wintosystrayicon(Window w); -static int xerror(Display *dpy, XErrorEvent *ee); -static int xerrordummy(Display *dpy, XErrorEvent *ee); -static int xerrorstart(Display *dpy, XErrorEvent *ee); -static void zoom(const Arg *arg); - -/* variables */ -static Systray *systray = NULL; -static const char broken[] = "broken"; -static char stext[1024]; -static int screen; -static int sw, sh; /* X display screen geometry width, height */ -static int bh; /* bar height */ -static int lrpad; /* sum of left and right padding for text */ -static int (*xerrorxlib)(Display *, XErrorEvent *); -static unsigned int numlockmask = 0; -static void (*handler[LASTEvent]) (XEvent *) = { - [ButtonPress] = buttonpress, - [ClientMessage] = clientmessage, - [ConfigureRequest] = configurerequest, - [ConfigureNotify] = configurenotify, - [DestroyNotify] = destroynotify, - [EnterNotify] = enternotify, - [Expose] = expose, - [FocusIn] = focusin, - [KeyPress] = keypress, - [MappingNotify] = mappingnotify, - [MapRequest] = maprequest, - [MotionNotify] = motionnotify, - [PropertyNotify] = propertynotify, - [ResizeRequest] = resizerequest, - [UnmapNotify] = unmapnotify -}; -static Atom wmatom[WMLast], netatom[NetLast], xatom[XLast]; -static int running = 1; -static Cur *cursor[CurLast]; -static Clr **scheme; -static Display *dpy; -static Drw *drw; -static Monitor *mons, *selmon; -static Window root, wmcheckwin; - -/* configuration, allows nested code to access above variables */ -#include "config.h" - -/* compile-time check if all tags fit into an unsigned int bit array. */ -struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; }; - -/* function implementations */ -void -applyrules(Client *c) -{ - const char *class, *instance; - unsigned int i; - const Rule *r; - Monitor *m; - XClassHint ch = { NULL, NULL }; - - /* rule matching */ - c->isfloating = 0; - c->tags = 0; - XGetClassHint(dpy, c->win, &ch); - class = ch.res_class ? ch.res_class : broken; - instance = ch.res_name ? ch.res_name : broken; - - for (i = 0; i < LENGTH(rules); i++) { - r = &rules[i]; - if ((!r->title || strstr(c->name, r->title)) - && (!r->class || strstr(class, r->class)) - && (!r->instance || strstr(instance, r->instance))) - { - c->isfloating = r->isfloating; - c->tags |= r->tags; - for (m = mons; m && m->num != r->monitor; m = m->next); - if (m) - c->mon = m; - } - } - if (ch.res_class) - XFree(ch.res_class); - if (ch.res_name) - XFree(ch.res_name); - c->tags = c->tags & TAGMASK ? c->tags & TAGMASK : c->mon->tagset[c->mon->seltags]; -} - -int -applysizehints(Client *c, int *x, int *y, int *w, int *h, int interact) -{ - int baseismin; - Monitor *m = c->mon; - - /* set minimum possible */ - *w = MAX(1, *w); - *h = MAX(1, *h); - if (interact) { - if (*x > sw) - *x = sw - WIDTH(c); - if (*y > sh) - *y = sh - HEIGHT(c); - if (*x + *w + 2 * c->bw < 0) - *x = 0; - if (*y + *h + 2 * c->bw < 0) - *y = 0; - } else { - if (*x >= m->wx + m->ww) - *x = m->wx + m->ww - WIDTH(c); - if (*y >= m->wy + m->wh) - *y = m->wy + m->wh - HEIGHT(c); - if (*x + *w + 2 * c->bw <= m->wx) - *x = m->wx; - if (*y + *h + 2 * c->bw <= m->wy) - *y = m->wy; - } - if (*h < bh) - *h = bh; - if (*w < bh) - *w = bh; - if (resizehints || c->isfloating || !c->mon->lt[c->mon->sellt]->arrange) { - if (!c->hintsvalid) - updatesizehints(c); - /* see last two sentences in ICCCM 4.1.2.3 */ - baseismin = c->basew == c->minw && c->baseh == c->minh; - if (!baseismin) { /* temporarily remove base dimensions */ - *w -= c->basew; - *h -= c->baseh; - } - /* adjust for aspect limits */ - if (c->mina > 0 && c->maxa > 0) { - if (c->maxa < (float)*w / *h) - *w = *h * c->maxa + 0.5; - else if (c->mina < (float)*h / *w) - *h = *w * c->mina + 0.5; - } - if (baseismin) { /* increment calculation requires this */ - *w -= c->basew; - *h -= c->baseh; - } - /* adjust for increment value */ - if (c->incw) - *w -= *w % c->incw; - if (c->inch) - *h -= *h % c->inch; - /* restore base dimensions */ - *w = MAX(*w + c->basew, c->minw); - *h = MAX(*h + c->baseh, c->minh); - if (c->maxw) - *w = MIN(*w, c->maxw); - if (c->maxh) - *h = MIN(*h, c->maxh); - } - return *x != c->x || *y != c->y || *w != c->w || *h != c->h; -} - -void -arrange(Monitor *m) -{ - if (m) - showhide(m->stack); - else for (m = mons; m; m = m->next) - showhide(m->stack); - if (m) { - arrangemon(m); - restack(m); - } else for (m = mons; m; m = m->next) - arrangemon(m); -} - -void -arrangemon(Monitor *m) -{ - strncpy(m->ltsymbol, m->lt[m->sellt]->symbol, sizeof m->ltsymbol); - if (m->lt[m->sellt]->arrange) - m->lt[m->sellt]->arrange(m); -} - -void -attach(Client *c) -{ - c->next = c->mon->clients; - c->mon->clients = c; -} - -void -attachstack(Client *c) -{ - c->snext = c->mon->stack; - c->mon->stack = c; -} - -void -buttonpress(XEvent *e) -{ - unsigned int i, x, click; - Arg arg = {0}; - Client *c; - Monitor *m; - XButtonPressedEvent *ev = &e->xbutton; - - click = ClkRootWin; - /* focus monitor if necessary */ - if ((m = wintomon(ev->window)) && m != selmon) { - unfocus(selmon->sel, 1); - selmon = m; - focus(NULL); - } - if (ev->window == selmon->barwin) { - i = x = 0; - do - x += TEXTW(tags[i]); - while (ev->x >= x && ++i < LENGTH(tags)); - if (i < LENGTH(tags)) { - click = ClkTagBar; - arg.ui = 1 << i; - } else if (ev->x < x + TEXTW(selmon->ltsymbol)) - click = ClkLtSymbol; - else if (ev->x > selmon->ww - (int)TEXTW(stext) - getsystraywidth()) - click = ClkStatusText; - else - click = ClkWinTitle; - } else if ((c = wintoclient(ev->window))) { - focus(c); - restack(selmon); - XAllowEvents(dpy, ReplayPointer, CurrentTime); - click = ClkClientWin; - } - for (i = 0; i < LENGTH(buttons); i++) - if (click == buttons[i].click && buttons[i].func && buttons[i].button == ev->button - && CLEANMASK(buttons[i].mask) == CLEANMASK(ev->state)) - buttons[i].func(click == ClkTagBar && buttons[i].arg.i == 0 ? &arg : &buttons[i].arg); -} - -void -checkotherwm(void) -{ - xerrorxlib = XSetErrorHandler(xerrorstart); - /* this causes an error if some other window manager is running */ - XSelectInput(dpy, DefaultRootWindow(dpy), SubstructureRedirectMask); - XSync(dpy, False); - XSetErrorHandler(xerror); - XSync(dpy, False); -} - -void -cleanup(void) -{ - Arg a = {.ui = ~0}; - Layout foo = { "", NULL }; - Monitor *m; - size_t i; - - view(&a); - selmon->lt[selmon->sellt] = &foo; - for (m = mons; m; m = m->next) - while (m->stack) - unmanage(m->stack, 0); - XUngrabKey(dpy, AnyKey, AnyModifier, root); - while (mons) - cleanupmon(mons); - - if (showsystray) { - XUnmapWindow(dpy, systray->win); - XDestroyWindow(dpy, systray->win); - free(systray); - } - - for (i = 0; i < CurLast; i++) - drw_cur_free(drw, cursor[i]); - for (i = 0; i < LENGTH(colors) + 1; i++) - free(scheme[i]); - free(scheme); - XDestroyWindow(dpy, wmcheckwin); - drw_free(drw); - XSync(dpy, False); - XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime); - XDeleteProperty(dpy, root, netatom[NetActiveWindow]); -} - -void -cleanupmon(Monitor *mon) -{ - Monitor *m; - - if (mon == mons) - mons = mons->next; - else { - for (m = mons; m && m->next != mon; m = m->next); - m->next = mon->next; - } - XUnmapWindow(dpy, mon->barwin); - XDestroyWindow(dpy, mon->barwin); - free(mon); -} - -void -clientmessage(XEvent *e) -{ - XWindowAttributes wa; - XSetWindowAttributes swa; - XClientMessageEvent *cme = &e->xclient; - Client *c = wintoclient(cme->window); - - if (showsystray && cme->window == systray->win && cme->message_type == netatom[NetSystemTrayOP]) { - /* add systray icons */ - if (cme->data.l[1] == SYSTEM_TRAY_REQUEST_DOCK) { - if (!(c = (Client *)calloc(1, sizeof(Client)))) - die("fatal: could not malloc() %u bytes\n", sizeof(Client)); - if (!(c->win = cme->data.l[2])) { - free(c); - return; - } - c->mon = selmon; - c->next = systray->icons; - systray->icons = c; - if (!XGetWindowAttributes(dpy, c->win, &wa)) { - /* use sane defaults */ - wa.width = bh; - wa.height = bh; - wa.border_width = 0; - } - c->x = c->oldx = c->y = c->oldy = 0; - c->w = c->oldw = wa.width; - c->h = c->oldh = wa.height; - c->oldbw = wa.border_width; - c->bw = 0; - c->isfloating = True; - /* reuse tags field as mapped status */ - c->tags = 1; - updatesizehints(c); - updatesystrayicongeom(c, wa.width, wa.height); - XAddToSaveSet(dpy, c->win); - XSelectInput(dpy, c->win, StructureNotifyMask | PropertyChangeMask | ResizeRedirectMask); - XReparentWindow(dpy, c->win, systray->win, 0, 0); - /* use parents background color */ - swa.background_pixel = scheme[SchemeNorm][ColBg].pixel; - XChangeWindowAttributes(dpy, c->win, CWBackPixel, &swa); - sendevent(c->win, netatom[Xembed], StructureNotifyMask, CurrentTime, XEMBED_EMBEDDED_NOTIFY, 0 , systray->win, XEMBED_EMBEDDED_VERSION); - /* FIXME not sure if I have to send these events, too */ - sendevent(c->win, netatom[Xembed], StructureNotifyMask, CurrentTime, XEMBED_FOCUS_IN, 0 , systray->win, XEMBED_EMBEDDED_VERSION); - sendevent(c->win, netatom[Xembed], StructureNotifyMask, CurrentTime, XEMBED_WINDOW_ACTIVATE, 0 , systray->win, XEMBED_EMBEDDED_VERSION); - sendevent(c->win, netatom[Xembed], StructureNotifyMask, CurrentTime, XEMBED_MODALITY_ON, 0 , systray->win, XEMBED_EMBEDDED_VERSION); - XSync(dpy, False); - resizebarwin(selmon); - updatesystray(); - setclientstate(c, NormalState); - } - return; - } - - if (!c) - return; - if (cme->message_type == netatom[NetWMState]) { - if (cme->data.l[1] == netatom[NetWMFullscreen] - || cme->data.l[2] == netatom[NetWMFullscreen]) - setfullscreen(c, (cme->data.l[0] == 1 /* _NET_WM_STATE_ADD */ - || (cme->data.l[0] == 2 /* _NET_WM_STATE_TOGGLE */ && !c->isfullscreen))); - } else if (cme->message_type == netatom[NetActiveWindow]) { - if (c != selmon->sel && !c->isurgent) - seturgent(c, 1); - } -} - -void -configure(Client *c) -{ - XConfigureEvent ce; - - ce.type = ConfigureNotify; - ce.display = dpy; - ce.event = c->win; - ce.window = c->win; - ce.x = c->x; - ce.y = c->y; - ce.width = c->w; - ce.height = c->h; - ce.border_width = c->bw; - ce.above = None; - ce.override_redirect = False; - XSendEvent(dpy, c->win, False, StructureNotifyMask, (XEvent *)&ce); -} - -void -configurenotify(XEvent *e) -{ - Monitor *m; - Client *c; - XConfigureEvent *ev = &e->xconfigure; - int dirty; - - /* TODO: updategeom handling sucks, needs to be simplified */ - if (ev->window == root) { - dirty = (sw != ev->width || sh != ev->height); - sw = ev->width; - sh = ev->height; - if (updategeom() || dirty) { - drw_resize(drw, sw, bh); - updatebars(); - for (m = mons; m; m = m->next) { - for (c = m->clients; c; c = c->next) - if (c->isfullscreen) - resizeclient(c, m->mx, m->my, m->mw, m->mh); - resizebarwin(m); - } - focus(NULL); - arrange(NULL); - } - } -} - -void -configurerequest(XEvent *e) -{ - Client *c; - Monitor *m; - XConfigureRequestEvent *ev = &e->xconfigurerequest; - XWindowChanges wc; - - if ((c = wintoclient(ev->window))) { - if (ev->value_mask & CWBorderWidth) - c->bw = ev->border_width; - else if (c->isfloating || !selmon->lt[selmon->sellt]->arrange) { - m = c->mon; - if (ev->value_mask & CWX) { - c->oldx = c->x; - c->x = m->mx + ev->x; - } - if (ev->value_mask & CWY) { - c->oldy = c->y; - c->y = m->my + ev->y; - } - if (ev->value_mask & CWWidth) { - c->oldw = c->w; - c->w = ev->width; - } - if (ev->value_mask & CWHeight) { - c->oldh = c->h; - c->h = ev->height; - } - if ((c->x + c->w) > m->mx + m->mw && c->isfloating) - c->x = m->mx + (m->mw / 2 - WIDTH(c) / 2); /* center in x direction */ - if ((c->y + c->h) > m->my + m->mh && c->isfloating) - c->y = m->my + (m->mh / 2 - HEIGHT(c) / 2); /* center in y direction */ - if ((ev->value_mask & (CWX|CWY)) && !(ev->value_mask & (CWWidth|CWHeight))) - configure(c); - if (ISVISIBLE(c)) - XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h); - } else - configure(c); - } else { - wc.x = ev->x; - wc.y = ev->y; - wc.width = ev->width; - wc.height = ev->height; - wc.border_width = ev->border_width; - wc.sibling = ev->above; - wc.stack_mode = ev->detail; - XConfigureWindow(dpy, ev->window, ev->value_mask, &wc); - } - XSync(dpy, False); -} - -Monitor * -createmon(void) -{ - Monitor *m; - - m = ecalloc(1, sizeof(Monitor)); - m->tagset[0] = m->tagset[1] = 1; - m->mfact = mfact; - m->nmaster = nmaster; - m->showbar = showbar; - m->topbar = topbar; - m->lt[0] = &layouts[0]; - m->lt[1] = &layouts[1 % LENGTH(layouts)]; - strncpy(m->ltsymbol, layouts[0].symbol, sizeof m->ltsymbol); - return m; -} - -void -destroynotify(XEvent *e) -{ - Client *c; - XDestroyWindowEvent *ev = &e->xdestroywindow; - - if ((c = wintoclient(ev->window))) - unmanage(c, 1); - else if ((c = wintosystrayicon(ev->window))) { - removesystrayicon(c); - resizebarwin(selmon); - updatesystray(); - } -} - -void -detach(Client *c) -{ - Client **tc; - - for (tc = &c->mon->clients; *tc && *tc != c; tc = &(*tc)->next); - *tc = c->next; -} - -void -detachstack(Client *c) -{ - Client **tc, *t; - - for (tc = &c->mon->stack; *tc && *tc != c; tc = &(*tc)->snext); - *tc = c->snext; - - if (c == c->mon->sel) { - for (t = c->mon->stack; t && !ISVISIBLE(t); t = t->snext); - c->mon->sel = t; - } -} - -Monitor * -dirtomon(int dir) -{ - Monitor *m = NULL; - - if (dir > 0) { - if (!(m = selmon->next)) - m = mons; - } else if (selmon == mons) - for (m = mons; m->next; m = m->next); - else - for (m = mons; m->next != selmon; m = m->next); - return m; -} - -int -drawstatusbar(Monitor *m, int bh, char* stext) { - int ret, i, w, x, len; - short isCode = 0; - char *text; - char *p; - - len = strlen(stext) + 1 ; - if (!(text = (char*) malloc(sizeof(char)*len))) - die("malloc"); - p = text; - memcpy(text, stext, len); - - /* compute width of the status text */ - w = 0; - i = -1; - while (text[++i]) { - if (text[i] == '^') { - if (!isCode) { - isCode = 1; - text[i] = '\0'; - w += TEXTW(text) - lrpad; - text[i] = '^'; - if (text[++i] == 'f') - w += atoi(text + ++i); - } else { - isCode = 0; - text = text + i + 1; - i = -1; - } - } - } - if (!isCode) - w += TEXTW(text) - lrpad; - else - isCode = 0; - text = p; - - w += 2; /* 1px padding on both sides */ - ret = m->ww - w; - x = m->ww - w - getsystraywidth(); - - drw_setscheme(drw, scheme[LENGTH(colors)]); - drw->scheme[ColFg] = scheme[SchemeNorm][ColFg]; - drw->scheme[ColBg] = scheme[SchemeNorm][ColBg]; - drw_rect(drw, x, 0, w, bh, 1, 1); - x++; - - /* process status text */ - i = -1; - while (text[++i]) { - if (text[i] == '^' && !isCode) { - isCode = 1; - - text[i] = '\0'; - w = TEXTW(text) - lrpad; - drw_text(drw, x, 0, w, bh, 0, text, 0); - - x += w; - - /* process code */ - while (text[++i] != '^') { - if (text[i] == 'c') { - char buf[8]; - memcpy(buf, (char*)text+i+1, 7); - buf[7] = '\0'; - drw_clr_create(drw, &drw->scheme[ColFg], buf); - i += 7; - } else if (text[i] == 'b') { - char buf[8]; - memcpy(buf, (char*)text+i+1, 7); - buf[7] = '\0'; - drw_clr_create(drw, &drw->scheme[ColBg], buf); - i += 7; - } else if (text[i] == 'd') { - drw->scheme[ColFg] = scheme[SchemeNorm][ColFg]; - drw->scheme[ColBg] = scheme[SchemeNorm][ColBg]; - } else if (text[i] == 'r') { - int rx = atoi(text + ++i); - while (text[++i] != ','); - int ry = atoi(text + ++i); - while (text[++i] != ','); - int rw = atoi(text + ++i); - while (text[++i] != ','); - int rh = atoi(text + ++i); - - drw_rect(drw, rx + x, ry, rw, rh, 1, 0); - } else if (text[i] == 'f') { - x += atoi(text + ++i); - } - } - - text = text + i + 1; - i=-1; - isCode = 0; - } - } - - if (!isCode) { - w = TEXTW(text) - lrpad; - drw_text(drw, x, 0, w, bh, 0, text, 0); - } - - drw_setscheme(drw, scheme[SchemeNorm]); - free(p); - - return ret; -} - -void -drawbar(Monitor *m) -{ - int x, w, tw = 0, stw = 0; - int boxs = drw->fonts->h / 9; - int boxw = drw->fonts->h / 6 + 2; - unsigned int i, occ = 0, urg = 0; - Client *c; - - if (!m->showbar) - return; - - if(showsystray && m == systraytomon(m) && !systrayonleft) - stw = getsystraywidth(); - - /* draw status first so it can be overdrawn by tags later */ - if (m == selmon) { /* status is only drawn on selected monitor */ - tw = m->ww - drawstatusbar(m, bh, stext); - } - - resizebarwin(m); - for (c = m->clients; c; c = c->next) { - occ |= c->tags; - if (c->isurgent) - urg |= c->tags; - } - x = 0; - for (i = 0; i < LENGTH(tags); i++) { - w = TEXTW(tags[i]); - drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]); - drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i); - if (occ & 1 << i) - drw_rect(drw, x + boxs, boxs, boxw, boxw, - m == selmon && selmon->sel && selmon->sel->tags & 1 << i, - urg & 1 << i); - x += w; - } - w = TEXTW(m->ltsymbol); - drw_setscheme(drw, scheme[SchemeNorm]); - x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0); - - if ((w = m->ww - tw - stw - x) > bh) { - if (m->sel) { - drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]); - drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0); - if (m->sel->isfloating) - drw_rect(drw, x + boxs, boxs, boxw, boxw, m->sel->isfixed, 0); - } else { - drw_setscheme(drw, scheme[SchemeNorm]); - drw_rect(drw, x, 0, w, bh, 1, 1); - } - } - drw_map(drw, m->barwin, 0, 0, m->ww - stw, bh); -} - -void -drawbars(void) -{ - Monitor *m; - - for (m = mons; m; m = m->next) - drawbar(m); -} - -void -enternotify(XEvent *e) -{ - Client *c; - Monitor *m; - XCrossingEvent *ev = &e->xcrossing; - - if ((ev->mode != NotifyNormal || ev->detail == NotifyInferior) && ev->window != root) - return; - c = wintoclient(ev->window); - m = c ? c->mon : wintomon(ev->window); - if (m != selmon) { - unfocus(selmon->sel, 1); - selmon = m; - } else if (!c || c == selmon->sel) - return; - focus(c); -} - -void -expose(XEvent *e) -{ - Monitor *m; - XExposeEvent *ev = &e->xexpose; - - if (ev->count == 0 && (m = wintomon(ev->window))) { - drawbar(m); - if (m == selmon) - updatesystray(); - } -} - -void -focus(Client *c) -{ - if (!c || !ISVISIBLE(c)) - for (c = selmon->stack; c && !ISVISIBLE(c); c = c->snext); - if (selmon->sel && selmon->sel != c) - unfocus(selmon->sel, 0); - if (c) { - if (c->mon != selmon) - selmon = c->mon; - if (c->isurgent) - seturgent(c, 0); - detachstack(c); - attachstack(c); - grabbuttons(c, 1); - XSetWindowBorder(dpy, c->win, scheme[SchemeSel][ColBorder].pixel); - setfocus(c); - } else { - XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); - XDeleteProperty(dpy, root, netatom[NetActiveWindow]); - } - selmon->sel = c; - drawbars(); -} - -/* there are some broken focus acquiring clients needing extra handling */ -void -focusin(XEvent *e) -{ - XFocusChangeEvent *ev = &e->xfocus; - - if (selmon->sel && ev->window != selmon->sel->win) - setfocus(selmon->sel); -} - -void -focusmon(const Arg *arg) -{ - Monitor *m; - - if (!mons->next) - return; - if ((m = dirtomon(arg->i)) == selmon) - return; - unfocus(selmon->sel, 0); - selmon = m; - focus(NULL); -} - -void -focusstack(const Arg *arg) -{ - Client *c = NULL, *i; - - if (!selmon->sel || (selmon->sel->isfullscreen && lockfullscreen)) - return; - if (arg->i > 0) { - for (c = selmon->sel->next; c && !ISVISIBLE(c); c = c->next); - if (!c) - for (c = selmon->clients; c && !ISVISIBLE(c); c = c->next); - } else { - for (i = selmon->clients; i != selmon->sel; i = i->next) - if (ISVISIBLE(i)) - c = i; - if (!c) - for (; i; i = i->next) - if (ISVISIBLE(i)) - c = i; - } - if (c) { - focus(c); - restack(selmon); - } -} - -Atom -getatomprop(Client *c, Atom prop) -{ - int di; - unsigned long dl; - unsigned char *p = NULL; - Atom da, atom = None; - - /* FIXME getatomprop should return the number of items and a pointer to - * the stored data instead of this workaround */ - Atom req = XA_ATOM; - if (prop == xatom[XembedInfo]) - req = xatom[XembedInfo]; - - if (XGetWindowProperty(dpy, c->win, prop, 0L, sizeof atom, False, req, - &da, &di, &dl, &dl, &p) == Success && p) { - atom = *(Atom *)p; - if (da == xatom[XembedInfo] && dl == 2) - atom = ((Atom *)p)[1]; - XFree(p); - } - return atom; -} - -int -getrootptr(int *x, int *y) -{ - int di; - unsigned int dui; - Window dummy; - - return XQueryPointer(dpy, root, &dummy, &dummy, x, y, &di, &di, &dui); -} - -long -getstate(Window w) -{ - int format; - long result = -1; - unsigned char *p = NULL; - unsigned long n, extra; - Atom real; - - if (XGetWindowProperty(dpy, w, wmatom[WMState], 0L, 2L, False, wmatom[WMState], - &real, &format, &n, &extra, (unsigned char **)&p) != Success) - return -1; - if (n != 0) - result = *p; - XFree(p); - return result; -} - -unsigned int -getsystraywidth() -{ - unsigned int w = 0; - Client *i; - if(showsystray) - for(i = systray->icons; i; w += i->w + systrayspacing, i = i->next) ; - return w ? w + systrayspacing : 1; -} - -int -gettextprop(Window w, Atom atom, char *text, unsigned int size) -{ - char **list = NULL; - int n; - XTextProperty name; - - if (!text || size == 0) - return 0; - text[0] = '\0'; - if (!XGetTextProperty(dpy, w, &name, atom) || !name.nitems) - return 0; - if (name.encoding == XA_STRING) { - strncpy(text, (char *)name.value, size - 1); - } else if (XmbTextPropertyToTextList(dpy, &name, &list, &n) >= Success && n > 0 && *list) { - strncpy(text, *list, size - 1); - XFreeStringList(list); - } - text[size - 1] = '\0'; - XFree(name.value); - return 1; -} - -void -grabbuttons(Client *c, int focused) -{ - updatenumlockmask(); - { - unsigned int i, j; - unsigned int modifiers[] = { 0, LockMask, numlockmask, numlockmask|LockMask }; - XUngrabButton(dpy, AnyButton, AnyModifier, c->win); - if (!focused) - XGrabButton(dpy, AnyButton, AnyModifier, c->win, False, - BUTTONMASK, GrabModeSync, GrabModeSync, None, None); - for (i = 0; i < LENGTH(buttons); i++) - if (buttons[i].click == ClkClientWin) - for (j = 0; j < LENGTH(modifiers); j++) - XGrabButton(dpy, buttons[i].button, - buttons[i].mask | modifiers[j], - c->win, False, BUTTONMASK, - GrabModeAsync, GrabModeSync, None, None); - } -} - -void -grabkeys(void) -{ - updatenumlockmask(); - { - unsigned int i, j, k; - unsigned int modifiers[] = { 0, LockMask, numlockmask, numlockmask|LockMask }; - int start, end, skip; - KeySym *syms; - - XUngrabKey(dpy, AnyKey, AnyModifier, root); - XDisplayKeycodes(dpy, &start, &end); - syms = XGetKeyboardMapping(dpy, start, end - start + 1, &skip); - if (!syms) - return; - for (k = start; k <= end; k++) - for (i = 0; i < LENGTH(keys); i++) - /* skip modifier codes, we do that ourselves */ - if (keys[i].keysym == syms[(k - start) * skip]) - for (j = 0; j < LENGTH(modifiers); j++) - XGrabKey(dpy, k, - keys[i].mod | modifiers[j], - root, True, - GrabModeAsync, GrabModeAsync); - XFree(syms); - } -} - -void -incnmaster(const Arg *arg) -{ - selmon->nmaster = MAX(selmon->nmaster + arg->i, 0); - arrange(selmon); -} - -#ifdef XINERAMA -static int -isuniquegeom(XineramaScreenInfo *unique, size_t n, XineramaScreenInfo *info) -{ - while (n--) - if (unique[n].x_org == info->x_org && unique[n].y_org == info->y_org - && unique[n].width == info->width && unique[n].height == info->height) - return 0; - return 1; -} -#endif /* XINERAMA */ - -void -keypress(XEvent *e) -{ - unsigned int i; - KeySym keysym; - XKeyEvent *ev; - - ev = &e->xkey; - keysym = XKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0); - for (i = 0; i < LENGTH(keys); i++) - if (keysym == keys[i].keysym - && CLEANMASK(keys[i].mod) == CLEANMASK(ev->state) - && keys[i].func) - keys[i].func(&(keys[i].arg)); -} - -void -killclient(const Arg *arg) -{ - if (!selmon->sel) - return; - - if (!sendevent(selmon->sel->win, wmatom[WMDelete], NoEventMask, wmatom[WMDelete], CurrentTime, 0 , 0, 0)) { - XGrabServer(dpy); - XSetErrorHandler(xerrordummy); - XSetCloseDownMode(dpy, DestroyAll); - XKillClient(dpy, selmon->sel->win); - XSync(dpy, False); - XSetErrorHandler(xerror); - XUngrabServer(dpy); - } -} - -void -manage(Window w, XWindowAttributes *wa) -{ - Client *c, *t = NULL; - Window trans = None; - XWindowChanges wc; - - c = ecalloc(1, sizeof(Client)); - c->win = w; - /* geometry */ - c->x = c->oldx = wa->x; - c->y = c->oldy = wa->y; - c->w = c->oldw = wa->width; - c->h = c->oldh = wa->height; - c->oldbw = wa->border_width; - - updatetitle(c); - if (XGetTransientForHint(dpy, w, &trans) && (t = wintoclient(trans))) { - c->mon = t->mon; - c->tags = t->tags; - } else { - c->mon = selmon; - applyrules(c); - } - - if (c->x + WIDTH(c) > c->mon->wx + c->mon->ww) - c->x = c->mon->wx + c->mon->ww - WIDTH(c); - if (c->y + HEIGHT(c) > c->mon->wy + c->mon->wh) - c->y = c->mon->wy + c->mon->wh - HEIGHT(c); - c->x = MAX(c->x, c->mon->wx); - c->y = MAX(c->y, c->mon->wy); - c->bw = borderpx; - - wc.border_width = c->bw; - XConfigureWindow(dpy, w, CWBorderWidth, &wc); - XSetWindowBorder(dpy, w, scheme[SchemeNorm][ColBorder].pixel); - configure(c); /* propagates border_width, if size doesn't change */ - updatewindowtype(c); - updatesizehints(c); - updatewmhints(c); - XSelectInput(dpy, w, EnterWindowMask|FocusChangeMask|PropertyChangeMask|StructureNotifyMask); - grabbuttons(c, 0); - if (!c->isfloating) - c->isfloating = c->oldstate = trans != None || c->isfixed; - if (c->isfloating) - XRaiseWindow(dpy, c->win); - attach(c); - attachstack(c); - XChangeProperty(dpy, root, netatom[NetClientList], XA_WINDOW, 32, PropModeAppend, - (unsigned char *) &(c->win), 1); - XMoveResizeWindow(dpy, c->win, c->x + 2 * sw, c->y, c->w, c->h); /* some windows require this */ - setclientstate(c, NormalState); - if (c->mon == selmon) - unfocus(selmon->sel, 0); - c->mon->sel = c; - arrange(c->mon); - XMapWindow(dpy, c->win); - focus(NULL); -} - -void -mappingnotify(XEvent *e) -{ - XMappingEvent *ev = &e->xmapping; - - XRefreshKeyboardMapping(ev); - if (ev->request == MappingKeyboard) - grabkeys(); -} - -void -maprequest(XEvent *e) -{ - static XWindowAttributes wa; - XMapRequestEvent *ev = &e->xmaprequest; - - Client *i; - if ((i = wintosystrayicon(ev->window))) { - sendevent(i->win, netatom[Xembed], StructureNotifyMask, CurrentTime, XEMBED_WINDOW_ACTIVATE, 0, systray->win, XEMBED_EMBEDDED_VERSION); - resizebarwin(selmon); - updatesystray(); - } - - - if (!XGetWindowAttributes(dpy, ev->window, &wa) || wa.override_redirect) - return; - if (!wintoclient(ev->window)) - manage(ev->window, &wa); -} - -void -monocle(Monitor *m) -{ - unsigned int n = 0; - Client *c; - - for (c = m->clients; c; c = c->next) - if (ISVISIBLE(c)) - n++; - if (n > 0) /* override layout symbol */ - snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n); - for (c = nexttiled(m->clients); c; c = nexttiled(c->next)) - resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, 0); -} - -void -motionnotify(XEvent *e) -{ - static Monitor *mon = NULL; - Monitor *m; - XMotionEvent *ev = &e->xmotion; - - if (ev->window != root) - return; - if ((m = recttomon(ev->x_root, ev->y_root, 1, 1)) != mon && mon) { - unfocus(selmon->sel, 1); - selmon = m; - focus(NULL); - } - mon = m; -} - -void -movemouse(const Arg *arg) -{ - int x, y, ocx, ocy, nx, ny; - Client *c; - Monitor *m; - XEvent ev; - Time lasttime = 0; - - if (!(c = selmon->sel)) - return; - if (c->isfullscreen) /* no support moving fullscreen windows by mouse */ - return; - restack(selmon); - ocx = c->x; - ocy = c->y; - if (XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync, - None, cursor[CurMove]->cursor, CurrentTime) != GrabSuccess) - return; - if (!getrootptr(&x, &y)) - return; - do { - XMaskEvent(dpy, MOUSEMASK|ExposureMask|SubstructureRedirectMask, &ev); - switch(ev.type) { - case ConfigureRequest: - case Expose: - case MapRequest: - handler[ev.type](&ev); - break; - case MotionNotify: - if ((ev.xmotion.time - lasttime) <= (1000 / 60)) - continue; - lasttime = ev.xmotion.time; - - nx = ocx + (ev.xmotion.x - x); - ny = ocy + (ev.xmotion.y - y); - if (abs(selmon->wx - nx) < snap) - nx = selmon->wx; - else if (abs((selmon->wx + selmon->ww) - (nx + WIDTH(c))) < snap) - nx = selmon->wx + selmon->ww - WIDTH(c); - if (abs(selmon->wy - ny) < snap) - ny = selmon->wy; - else if (abs((selmon->wy + selmon->wh) - (ny + HEIGHT(c))) < snap) - ny = selmon->wy + selmon->wh - HEIGHT(c); - if (!c->isfloating && selmon->lt[selmon->sellt]->arrange - && (abs(nx - c->x) > snap || abs(ny - c->y) > snap)) - togglefloating(NULL); - if (!selmon->lt[selmon->sellt]->arrange || c->isfloating) - resize(c, nx, ny, c->w, c->h, 1); - break; - } - } while (ev.type != ButtonRelease); - XUngrabPointer(dpy, CurrentTime); - if ((m = recttomon(c->x, c->y, c->w, c->h)) != selmon) { - sendmon(c, m); - selmon = m; - focus(NULL); - } -} - -Client * -nexttiled(Client *c) -{ - for (; c && (c->isfloating || !ISVISIBLE(c)); c = c->next); - return c; -} - -void -pop(Client *c) -{ - detach(c); - attach(c); - focus(c); - arrange(c->mon); -} - -void -propertynotify(XEvent *e) -{ - Client *c; - Window trans; - XPropertyEvent *ev = &e->xproperty; - - if ((c = wintosystrayicon(ev->window))) { - if (ev->atom == XA_WM_NORMAL_HINTS) { - updatesizehints(c); - updatesystrayicongeom(c, c->w, c->h); - } - else - updatesystrayiconstate(c, ev); - resizebarwin(selmon); - updatesystray(); - } - - if ((ev->window == root) && (ev->atom == XA_WM_NAME)) - updatestatus(); - else if (ev->state == PropertyDelete) - return; /* ignore */ - else if ((c = wintoclient(ev->window))) { - switch(ev->atom) { - default: break; - case XA_WM_TRANSIENT_FOR: - if (!c->isfloating && (XGetTransientForHint(dpy, c->win, &trans)) && - (c->isfloating = (wintoclient(trans)) != NULL)) - arrange(c->mon); - break; - case XA_WM_NORMAL_HINTS: - c->hintsvalid = 0; - break; - case XA_WM_HINTS: - updatewmhints(c); - drawbars(); - break; - } - if (ev->atom == XA_WM_NAME || ev->atom == netatom[NetWMName]) { - updatetitle(c); - if (c == c->mon->sel) - drawbar(c->mon); - } - if (ev->atom == netatom[NetWMWindowType]) - updatewindowtype(c); - } -} - -void -quit(const Arg *arg) -{ - running = 0; -} - -Monitor * -recttomon(int x, int y, int w, int h) -{ - Monitor *m, *r = selmon; - int a, area = 0; - - for (m = mons; m; m = m->next) - if ((a = INTERSECT(x, y, w, h, m)) > area) { - area = a; - r = m; - } - return r; -} - -void -removesystrayicon(Client *i) -{ - Client **ii; - - if (!showsystray || !i) - return; - for (ii = &systray->icons; *ii && *ii != i; ii = &(*ii)->next); - if (ii) - *ii = i->next; - free(i); -} - -void -resize(Client *c, int x, int y, int w, int h, int interact) -{ - if (applysizehints(c, &x, &y, &w, &h, interact)) - resizeclient(c, x, y, w, h); -} - -void -resizebarwin(Monitor *m) { - unsigned int w = m->ww; - if (showsystray && m == systraytomon(m) && !systrayonleft) - w -= getsystraywidth(); - XMoveResizeWindow(dpy, m->barwin, m->wx, m->by, w, bh); -} - -void -resizeclient(Client *c, int x, int y, int w, int h) -{ - XWindowChanges wc; - - c->oldx = c->x; c->x = wc.x = x; - c->oldy = c->y; c->y = wc.y = y; - c->oldw = c->w; c->w = wc.width = w; - c->oldh = c->h; c->h = wc.height = h; - wc.border_width = c->bw; - XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc); - configure(c); - XSync(dpy, False); -} - -void -resizemouse(const Arg *arg) -{ - int ocx, ocy, nw, nh; - Client *c; - Monitor *m; - XEvent ev; - Time lasttime = 0; - - if (!(c = selmon->sel)) - return; - if (c->isfullscreen) /* no support resizing fullscreen windows by mouse */ - return; - restack(selmon); - ocx = c->x; - ocy = c->y; - if (XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync, - None, cursor[CurResize]->cursor, CurrentTime) != GrabSuccess) - return; - XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w + c->bw - 1, c->h + c->bw - 1); - do { - XMaskEvent(dpy, MOUSEMASK|ExposureMask|SubstructureRedirectMask, &ev); - switch(ev.type) { - case ConfigureRequest: - case Expose: - case MapRequest: - handler[ev.type](&ev); - break; - case MotionNotify: - if ((ev.xmotion.time - lasttime) <= (1000 / 60)) - continue; - lasttime = ev.xmotion.time; - - nw = MAX(ev.xmotion.x - ocx - 2 * c->bw + 1, 1); - nh = MAX(ev.xmotion.y - ocy - 2 * c->bw + 1, 1); - if (c->mon->wx + nw >= selmon->wx && c->mon->wx + nw <= selmon->wx + selmon->ww - && c->mon->wy + nh >= selmon->wy && c->mon->wy + nh <= selmon->wy + selmon->wh) - { - if (!c->isfloating && selmon->lt[selmon->sellt]->arrange - && (abs(nw - c->w) > snap || abs(nh - c->h) > snap)) - togglefloating(NULL); - } - if (!selmon->lt[selmon->sellt]->arrange || c->isfloating) - resize(c, c->x, c->y, nw, nh, 1); - break; - } - } while (ev.type != ButtonRelease); - XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w + c->bw - 1, c->h + c->bw - 1); - XUngrabPointer(dpy, CurrentTime); - while (XCheckMaskEvent(dpy, EnterWindowMask, &ev)); - if ((m = recttomon(c->x, c->y, c->w, c->h)) != selmon) { - sendmon(c, m); - selmon = m; - focus(NULL); - } -} - -void -resizerequest(XEvent *e) -{ - XResizeRequestEvent *ev = &e->xresizerequest; - Client *i; - - if ((i = wintosystrayicon(ev->window))) { - updatesystrayicongeom(i, ev->width, ev->height); - resizebarwin(selmon); - updatesystray(); - } -} - -void -restack(Monitor *m) -{ - Client *c; - XEvent ev; - XWindowChanges wc; - - drawbar(m); - if (!m->sel) - return; - if (m->sel->isfloating || !m->lt[m->sellt]->arrange) - XRaiseWindow(dpy, m->sel->win); - if (m->lt[m->sellt]->arrange) { - wc.stack_mode = Below; - wc.sibling = m->barwin; - for (c = m->stack; c; c = c->snext) - if (!c->isfloating && ISVISIBLE(c)) { - XConfigureWindow(dpy, c->win, CWSibling|CWStackMode, &wc); - wc.sibling = c->win; - } - } - XSync(dpy, False); - while (XCheckMaskEvent(dpy, EnterWindowMask, &ev)); -} - -void -run(void) -{ - XEvent ev; - /* main event loop */ - XSync(dpy, False); - while (running && !XNextEvent(dpy, &ev)) - if (handler[ev.type]) - handler[ev.type](&ev); /* call handler */ -} - -void -scan(void) -{ - unsigned int i, num; - Window d1, d2, *wins = NULL; - XWindowAttributes wa; - - if (XQueryTree(dpy, root, &d1, &d2, &wins, &num)) { - for (i = 0; i < num; i++) { - if (!XGetWindowAttributes(dpy, wins[i], &wa) - || wa.override_redirect || XGetTransientForHint(dpy, wins[i], &d1)) - continue; - if (wa.map_state == IsViewable || getstate(wins[i]) == IconicState) - manage(wins[i], &wa); - } - for (i = 0; i < num; i++) { /* now the transients */ - if (!XGetWindowAttributes(dpy, wins[i], &wa)) - continue; - if (XGetTransientForHint(dpy, wins[i], &d1) - && (wa.map_state == IsViewable || getstate(wins[i]) == IconicState)) - manage(wins[i], &wa); - } - if (wins) - XFree(wins); - } -} - -void -sendmon(Client *c, Monitor *m) -{ - if (c->mon == m) - return; - unfocus(c, 1); - detach(c); - detachstack(c); - c->mon = m; - c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */ - attach(c); - attachstack(c); - focus(NULL); - arrange(NULL); -} - -void -setclientstate(Client *c, long state) -{ - long data[] = { state, None }; - - XChangeProperty(dpy, c->win, wmatom[WMState], wmatom[WMState], 32, - PropModeReplace, (unsigned char *)data, 2); -} - -int -sendevent(Window w, Atom proto, int mask, long d0, long d1, long d2, long d3, long d4) -{ - int n; - Atom *protocols, mt; - int exists = 0; - XEvent ev; - - if (proto == wmatom[WMTakeFocus] || proto == wmatom[WMDelete]) { - mt = wmatom[WMProtocols]; - if (XGetWMProtocols(dpy, w, &protocols, &n)) { - while (!exists && n--) - exists = protocols[n] == proto; - XFree(protocols); - } - } - else { - exists = True; - mt = proto; - } - - if (exists) { - ev.type = ClientMessage; - ev.xclient.window = w; - ev.xclient.message_type = mt; - ev.xclient.format = 32; - ev.xclient.data.l[0] = d0; - ev.xclient.data.l[1] = d1; - ev.xclient.data.l[2] = d2; - ev.xclient.data.l[3] = d3; - ev.xclient.data.l[4] = d4; - XSendEvent(dpy, w, False, mask, &ev); - } - return exists; -} - -void -setfocus(Client *c) -{ - if (!c->neverfocus) { - XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime); - XChangeProperty(dpy, root, netatom[NetActiveWindow], - XA_WINDOW, 32, PropModeReplace, - (unsigned char *) &(c->win), 1); - } - sendevent(c->win, wmatom[WMTakeFocus], NoEventMask, wmatom[WMTakeFocus], CurrentTime, 0, 0, 0); -} - -void -setfullscreen(Client *c, int fullscreen) -{ - if (fullscreen && !c->isfullscreen) { - XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32, - PropModeReplace, (unsigned char*)&netatom[NetWMFullscreen], 1); - c->isfullscreen = 1; - c->oldstate = c->isfloating; - c->oldbw = c->bw; - c->bw = 0; - c->isfloating = 1; - resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh); - XRaiseWindow(dpy, c->win); - } else if (!fullscreen && c->isfullscreen){ - XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32, - PropModeReplace, (unsigned char*)0, 0); - c->isfullscreen = 0; - c->isfloating = c->oldstate; - c->bw = c->oldbw; - c->x = c->oldx; - c->y = c->oldy; - c->w = c->oldw; - c->h = c->oldh; - resizeclient(c, c->x, c->y, c->w, c->h); - arrange(c->mon); - } -} - -void -setlayout(const Arg *arg) -{ - if (!arg || !arg->v || arg->v != selmon->lt[selmon->sellt]) - selmon->sellt ^= 1; - if (arg && arg->v) - selmon->lt[selmon->sellt] = (Layout *)arg->v; - strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol); - if (selmon->sel) - arrange(selmon); - else - drawbar(selmon); -} - -/* arg > 1.0 will set mfact absolutely */ -void -setmfact(const Arg *arg) -{ - float f; - - if (!arg || !selmon->lt[selmon->sellt]->arrange) - return; - f = arg->f < 1.0 ? arg->f + selmon->mfact : arg->f - 1.0; - if (f < 0.05 || f > 0.95) - return; - selmon->mfact = f; - arrange(selmon); -} - -void -setup(void) -{ - int i; - XSetWindowAttributes wa; - Atom utf8string; - struct sigaction sa; - - /* do not transform children into zombies when they terminate */ - sigemptyset(&sa.sa_mask); - sa.sa_flags = SA_NOCLDSTOP | SA_NOCLDWAIT | SA_RESTART; - sa.sa_handler = SIG_IGN; - sigaction(SIGCHLD, &sa, NULL); - - /* clean up any zombies (inherited from .xinitrc etc) immediately */ - while (waitpid(-1, NULL, WNOHANG) > 0); - - /* init screen */ - screen = DefaultScreen(dpy); - sw = DisplayWidth(dpy, screen); - sh = DisplayHeight(dpy, screen); - root = RootWindow(dpy, screen); - drw = drw_create(dpy, screen, root, sw, sh); - if (!drw_fontset_create(drw, fonts, LENGTH(fonts))) - die("no fonts could be loaded."); - lrpad = drw->fonts->h; - bh = drw->fonts->h + 2; - updategeom(); - /* init atoms */ - utf8string = XInternAtom(dpy, "UTF8_STRING", False); - wmatom[WMProtocols] = XInternAtom(dpy, "WM_PROTOCOLS", False); - wmatom[WMDelete] = XInternAtom(dpy, "WM_DELETE_WINDOW", False); - wmatom[WMState] = XInternAtom(dpy, "WM_STATE", False); - wmatom[WMTakeFocus] = XInternAtom(dpy, "WM_TAKE_FOCUS", False); - netatom[NetActiveWindow] = XInternAtom(dpy, "_NET_ACTIVE_WINDOW", False); - netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False); - netatom[NetSystemTray] = XInternAtom(dpy, "_NET_SYSTEM_TRAY_S0", False); - netatom[NetSystemTrayOP] = XInternAtom(dpy, "_NET_SYSTEM_TRAY_OPCODE", False); - netatom[NetSystemTrayOrientation] = XInternAtom(dpy, "_NET_SYSTEM_TRAY_ORIENTATION", False); - netatom[NetSystemTrayOrientationHorz] = XInternAtom(dpy, "_NET_SYSTEM_TRAY_ORIENTATION_HORZ", False); - netatom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False); - netatom[NetWMState] = XInternAtom(dpy, "_NET_WM_STATE", False); - netatom[NetWMCheck] = XInternAtom(dpy, "_NET_SUPPORTING_WM_CHECK", False); - netatom[NetWMFullscreen] = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", False); - netatom[NetWMWindowType] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE", False); - netatom[NetWMWindowTypeDialog] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DIALOG", False); - netatom[NetClientList] = XInternAtom(dpy, "_NET_CLIENT_LIST", False); - xatom[Manager] = XInternAtom(dpy, "MANAGER", False); - xatom[Xembed] = XInternAtom(dpy, "_XEMBED", False); - xatom[XembedInfo] = XInternAtom(dpy, "_XEMBED_INFO", False); - /* init cursors */ - cursor[CurNormal] = drw_cur_create(drw, XC_left_ptr); - cursor[CurResize] = drw_cur_create(drw, XC_sizing); - cursor[CurMove] = drw_cur_create(drw, XC_fleur); - /* init appearance */ - scheme = ecalloc(LENGTH(colors) + 1, sizeof(Clr *)); - scheme[LENGTH(colors)] = drw_scm_create(drw, colors[0], 3); - for (i = 0; i < LENGTH(colors); i++) - scheme[i] = drw_scm_create(drw, colors[i], 3); - /* init system tray */ - updatesystray(); - /* init bars */ - updatebars(); - updatestatus(); - /* supporting window for NetWMCheck */ - wmcheckwin = XCreateSimpleWindow(dpy, root, 0, 0, 1, 1, 0, 0, 0); - XChangeProperty(dpy, wmcheckwin, netatom[NetWMCheck], XA_WINDOW, 32, - PropModeReplace, (unsigned char *) &wmcheckwin, 1); - XChangeProperty(dpy, wmcheckwin, netatom[NetWMName], utf8string, 8, - PropModeReplace, (unsigned char *) "dwm", 3); - XChangeProperty(dpy, root, netatom[NetWMCheck], XA_WINDOW, 32, - PropModeReplace, (unsigned char *) &wmcheckwin, 1); - /* EWMH support per view */ - XChangeProperty(dpy, root, netatom[NetSupported], XA_ATOM, 32, - PropModeReplace, (unsigned char *) netatom, NetLast); - XDeleteProperty(dpy, root, netatom[NetClientList]); - /* select events */ - wa.cursor = cursor[CurNormal]->cursor; - wa.event_mask = SubstructureRedirectMask|SubstructureNotifyMask - |ButtonPressMask|PointerMotionMask|EnterWindowMask - |LeaveWindowMask|StructureNotifyMask|PropertyChangeMask; - XChangeWindowAttributes(dpy, root, CWEventMask|CWCursor, &wa); - XSelectInput(dpy, root, wa.event_mask); - grabkeys(); - focus(NULL); -} - -void -seturgent(Client *c, int urg) -{ - XWMHints *wmh; - - c->isurgent = urg; - if (!(wmh = XGetWMHints(dpy, c->win))) - return; - wmh->flags = urg ? (wmh->flags | XUrgencyHint) : (wmh->flags & ~XUrgencyHint); - XSetWMHints(dpy, c->win, wmh); - XFree(wmh); -} - -void -showhide(Client *c) -{ - if (!c) - return; - if (ISVISIBLE(c)) { - /* show clients top down */ - XMoveWindow(dpy, c->win, c->x, c->y); - if ((!c->mon->lt[c->mon->sellt]->arrange || c->isfloating) && !c->isfullscreen) - resize(c, c->x, c->y, c->w, c->h, 0); - showhide(c->snext); - } else { - /* hide clients bottom up */ - showhide(c->snext); - XMoveWindow(dpy, c->win, WIDTH(c) * -2, c->y); - } -} - -void -spawn(const Arg *arg) -{ - struct sigaction sa; - - if (arg->v == dmenucmd) - dmenumon[0] = '0' + selmon->num; - if (fork() == 0) { - if (dpy) - close(ConnectionNumber(dpy)); - setsid(); - - sigemptyset(&sa.sa_mask); - sa.sa_flags = 0; - sa.sa_handler = SIG_DFL; - sigaction(SIGCHLD, &sa, NULL); - - execvp(((char **)arg->v)[0], (char **)arg->v); - die("dwm: execvp '%s' failed:", ((char **)arg->v)[0]); - } -} - -void -tag(const Arg *arg) -{ - if (selmon->sel && arg->ui & TAGMASK) { - selmon->sel->tags = arg->ui & TAGMASK; - focus(NULL); - arrange(selmon); - } -} - -void -tagmon(const Arg *arg) -{ - if (!selmon->sel || !mons->next) - return; - sendmon(selmon->sel, dirtomon(arg->i)); -} - -void -tile(Monitor *m) -{ - unsigned int i, n, h, mw, my, ty; - Client *c; - - for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); - if (n == 0) - return; - - if (n > m->nmaster) - mw = m->nmaster ? m->ww * m->mfact : 0; - else - mw = m->ww; - for (i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) - if (i < m->nmaster) { - h = (m->wh - my) / (MIN(n, m->nmaster) - i); - resize(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw), 0); - if (my + HEIGHT(c) < m->wh) - my += HEIGHT(c); - } else { - h = (m->wh - ty) / (n - i); - resize(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw), 0); - if (ty + HEIGHT(c) < m->wh) - ty += HEIGHT(c); - } -} - -void -togglebar(const Arg *arg) -{ - selmon->showbar = !selmon->showbar; - updatebarpos(selmon); - resizebarwin(selmon); - if (showsystray) { - XWindowChanges wc; - if (!selmon->showbar) - wc.y = -bh; - else if (selmon->showbar) { - wc.y = 0; - if (!selmon->topbar) - wc.y = selmon->mh - bh; - } - XConfigureWindow(dpy, systray->win, CWY, &wc); - } - arrange(selmon); -} - -void -togglefloating(const Arg *arg) -{ - if (!selmon->sel) - return; - if (selmon->sel->isfullscreen) /* no support for fullscreen windows */ - return; - selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed; - if (selmon->sel->isfloating) - resize(selmon->sel, selmon->sel->x, selmon->sel->y, - selmon->sel->w, selmon->sel->h, 0); - arrange(selmon); -} - -void -toggletag(const Arg *arg) -{ - unsigned int newtags; - - if (!selmon->sel) - return; - newtags = selmon->sel->tags ^ (arg->ui & TAGMASK); - if (newtags) { - selmon->sel->tags = newtags; - focus(NULL); - arrange(selmon); - } -} - -void -toggleview(const Arg *arg) -{ - unsigned int newtagset = selmon->tagset[selmon->seltags] ^ (arg->ui & TAGMASK); - - if (newtagset) { - selmon->tagset[selmon->seltags] = newtagset; - focus(NULL); - arrange(selmon); - } -} - -void -unfocus(Client *c, int setfocus) -{ - if (!c) - return; - grabbuttons(c, 0); - XSetWindowBorder(dpy, c->win, scheme[SchemeNorm][ColBorder].pixel); - if (setfocus) { - XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); - XDeleteProperty(dpy, root, netatom[NetActiveWindow]); - } -} - -void -unmanage(Client *c, int destroyed) -{ - Monitor *m = c->mon; - XWindowChanges wc; - - detach(c); - detachstack(c); - if (!destroyed) { - wc.border_width = c->oldbw; - XGrabServer(dpy); /* avoid race conditions */ - XSetErrorHandler(xerrordummy); - XSelectInput(dpy, c->win, NoEventMask); - XConfigureWindow(dpy, c->win, CWBorderWidth, &wc); /* restore border */ - XUngrabButton(dpy, AnyButton, AnyModifier, c->win); - setclientstate(c, WithdrawnState); - XSync(dpy, False); - XSetErrorHandler(xerror); - XUngrabServer(dpy); - } - free(c); - focus(NULL); - updateclientlist(); - arrange(m); -} - -void -unmapnotify(XEvent *e) -{ - Client *c; - XUnmapEvent *ev = &e->xunmap; - - if ((c = wintoclient(ev->window))) { - if (ev->send_event) - setclientstate(c, WithdrawnState); - else - unmanage(c, 0); - } - else if ((c = wintosystrayicon(ev->window))) { - /* KLUDGE! sometimes icons occasionally unmap their windows, but do - * _not_ destroy them. We map those windows back */ - XMapRaised(dpy, c->win); - updatesystray(); - } -} - -void -updatebars(void) -{ - unsigned int w; - Monitor *m; - XSetWindowAttributes wa = { - .override_redirect = True, - .background_pixmap = ParentRelative, - .event_mask = ButtonPressMask|ExposureMask - }; - XClassHint ch = {"dwm", "dwm"}; - for (m = mons; m; m = m->next) { - if (m->barwin) - continue; - w = m->ww; - if (showsystray && m == systraytomon(m)) - w -= getsystraywidth(); - m->barwin = XCreateWindow(dpy, root, m->wx, m->by, w, bh, 0, DefaultDepth(dpy, screen), - CopyFromParent, DefaultVisual(dpy, screen), - CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa); - XDefineCursor(dpy, m->barwin, cursor[CurNormal]->cursor); - if (showsystray && m == systraytomon(m)) - XMapRaised(dpy, systray->win); - XMapRaised(dpy, m->barwin); - XSetClassHint(dpy, m->barwin, &ch); - } -} - -void -updatebarpos(Monitor *m) -{ - m->wy = m->my; - m->wh = m->mh; - if (m->showbar) { - m->wh -= bh; - m->by = m->topbar ? m->wy : m->wy + m->wh; - m->wy = m->topbar ? m->wy + bh : m->wy; - } else - m->by = -bh; -} - -void -updateclientlist() -{ - Client *c; - Monitor *m; - - XDeleteProperty(dpy, root, netatom[NetClientList]); - for (m = mons; m; m = m->next) - for (c = m->clients; c; c = c->next) - XChangeProperty(dpy, root, netatom[NetClientList], - XA_WINDOW, 32, PropModeAppend, - (unsigned char *) &(c->win), 1); -} - -int -updategeom(void) -{ - int dirty = 0; - -#ifdef XINERAMA - if (XineramaIsActive(dpy)) { - int i, j, n, nn; - Client *c; - Monitor *m; - XineramaScreenInfo *info = XineramaQueryScreens(dpy, &nn); - XineramaScreenInfo *unique = NULL; - - for (n = 0, m = mons; m; m = m->next, n++); - /* only consider unique geometries as separate screens */ - unique = ecalloc(nn, sizeof(XineramaScreenInfo)); - for (i = 0, j = 0; i < nn; i++) - if (isuniquegeom(unique, j, &info[i])) - memcpy(&unique[j++], &info[i], sizeof(XineramaScreenInfo)); - XFree(info); - nn = j; - - /* new monitors if nn > n */ - for (i = n; i < nn; i++) { - for (m = mons; m && m->next; m = m->next); - if (m) - m->next = createmon(); - else - mons = createmon(); - } - for (i = 0, m = mons; i < nn && m; m = m->next, i++) - if (i >= n - || unique[i].x_org != m->mx || unique[i].y_org != m->my - || unique[i].width != m->mw || unique[i].height != m->mh) - { - dirty = 1; - m->num = i; - m->mx = m->wx = unique[i].x_org; - m->my = m->wy = unique[i].y_org; - m->mw = m->ww = unique[i].width; - m->mh = m->wh = unique[i].height; - updatebarpos(m); - } - /* removed monitors if n > nn */ - for (i = nn; i < n; i++) { - for (m = mons; m && m->next; m = m->next); - while ((c = m->clients)) { - dirty = 1; - m->clients = c->next; - detachstack(c); - c->mon = mons; - attach(c); - attachstack(c); - } - if (m == selmon) - selmon = mons; - cleanupmon(m); - } - free(unique); - } else -#endif /* XINERAMA */ - { /* default monitor setup */ - if (!mons) - mons = createmon(); - if (mons->mw != sw || mons->mh != sh) { - dirty = 1; - mons->mw = mons->ww = sw; - mons->mh = mons->wh = sh; - updatebarpos(mons); - } - } - if (dirty) { - selmon = mons; - selmon = wintomon(root); - } - return dirty; -} - -void -updatenumlockmask(void) -{ - unsigned int i, j; - XModifierKeymap *modmap; - - numlockmask = 0; - modmap = XGetModifierMapping(dpy); - for (i = 0; i < 8; i++) - for (j = 0; j < modmap->max_keypermod; j++) - if (modmap->modifiermap[i * modmap->max_keypermod + j] - == XKeysymToKeycode(dpy, XK_Num_Lock)) - numlockmask = (1 << i); - XFreeModifiermap(modmap); -} - -void -updatesizehints(Client *c) -{ - long msize; - XSizeHints size; - - if (!XGetWMNormalHints(dpy, c->win, &size, &msize)) - /* size is uninitialized, ensure that size.flags aren't used */ - size.flags = PSize; - if (size.flags & PBaseSize) { - c->basew = size.base_width; - c->baseh = size.base_height; - } else if (size.flags & PMinSize) { - c->basew = size.min_width; - c->baseh = size.min_height; - } else - c->basew = c->baseh = 0; - if (size.flags & PResizeInc) { - c->incw = size.width_inc; - c->inch = size.height_inc; - } else - c->incw = c->inch = 0; - if (size.flags & PMaxSize) { - c->maxw = size.max_width; - c->maxh = size.max_height; - } else - c->maxw = c->maxh = 0; - if (size.flags & PMinSize) { - c->minw = size.min_width; - c->minh = size.min_height; - } else if (size.flags & PBaseSize) { - c->minw = size.base_width; - c->minh = size.base_height; - } else - c->minw = c->minh = 0; - if (size.flags & PAspect) { - c->mina = (float)size.min_aspect.y / size.min_aspect.x; - c->maxa = (float)size.max_aspect.x / size.max_aspect.y; - } else - c->maxa = c->mina = 0.0; - c->isfixed = (c->maxw && c->maxh && c->maxw == c->minw && c->maxh == c->minh); - c->hintsvalid = 1; -} - -void -updatestatus(void) -{ - if (!gettextprop(root, XA_WM_NAME, stext, sizeof(stext))) - strcpy(stext, "dwm-"VERSION); - drawbar(selmon); - updatesystray(); -} - - -void -updatesystrayicongeom(Client *i, int w, int h) -{ - if (i) { - i->h = bh; - if (w == h) - i->w = bh; - else if (h == bh) - i->w = w; - else - i->w = (int) ((float)bh * ((float)w / (float)h)); - applysizehints(i, &(i->x), &(i->y), &(i->w), &(i->h), False); - /* force icons into the systray dimensions if they don't want to */ - if (i->h > bh) { - if (i->w == i->h) - i->w = bh; - else - i->w = (int) ((float)bh * ((float)i->w / (float)i->h)); - i->h = bh; - } - } -} - -void -updatesystrayiconstate(Client *i, XPropertyEvent *ev) -{ - long flags; - int code = 0; - - if (!showsystray || !i || ev->atom != xatom[XembedInfo] || - !(flags = getatomprop(i, xatom[XembedInfo]))) - return; - - if (flags & XEMBED_MAPPED && !i->tags) { - i->tags = 1; - code = XEMBED_WINDOW_ACTIVATE; - XMapRaised(dpy, i->win); - setclientstate(i, NormalState); - } - else if (!(flags & XEMBED_MAPPED) && i->tags) { - i->tags = 0; - code = XEMBED_WINDOW_DEACTIVATE; - XUnmapWindow(dpy, i->win); - setclientstate(i, WithdrawnState); - } - else - return; - sendevent(i->win, xatom[Xembed], StructureNotifyMask, CurrentTime, code, 0, - systray->win, XEMBED_EMBEDDED_VERSION); -} - -void -updatesystray(void) -{ - XSetWindowAttributes wa; - XWindowChanges wc; - Client *i; - Monitor *m = systraytomon(NULL); - unsigned int x = m->mx + m->mw; - unsigned int sw = TEXTW(stext) - lrpad + systrayspacing; - unsigned int w = 1; - - if (!showsystray) - return; - if (systrayonleft) - x -= sw + lrpad / 2; - if (!systray) { - /* init systray */ - if (!(systray = (Systray *)calloc(1, sizeof(Systray)))) - die("fatal: could not malloc() %u bytes\n", sizeof(Systray)); - systray->win = XCreateSimpleWindow(dpy, root, x, m->by, w, bh, 0, 0, scheme[SchemeSel][ColBg].pixel); - wa.event_mask = ButtonPressMask | ExposureMask; - wa.override_redirect = True; - wa.background_pixel = scheme[SchemeNorm][ColBg].pixel; - XSelectInput(dpy, systray->win, SubstructureNotifyMask); - XChangeProperty(dpy, systray->win, netatom[NetSystemTrayOrientation], XA_CARDINAL, 32, - PropModeReplace, (unsigned char *)&netatom[NetSystemTrayOrientationHorz], 1); - XChangeWindowAttributes(dpy, systray->win, CWEventMask|CWOverrideRedirect|CWBackPixel, &wa); - XMapRaised(dpy, systray->win); - XSetSelectionOwner(dpy, netatom[NetSystemTray], systray->win, CurrentTime); - if (XGetSelectionOwner(dpy, netatom[NetSystemTray]) == systray->win) { - sendevent(root, xatom[Manager], StructureNotifyMask, CurrentTime, netatom[NetSystemTray], systray->win, 0, 0); - XSync(dpy, False); - } - else { - fprintf(stderr, "dwm: unable to obtain system tray.\n"); - free(systray); - systray = NULL; - return; - } - } - for (w = 0, i = systray->icons; i; i = i->next) { - /* make sure the background color stays the same */ - wa.background_pixel = scheme[SchemeNorm][ColBg].pixel; - XChangeWindowAttributes(dpy, i->win, CWBackPixel, &wa); - XMapRaised(dpy, i->win); - w += systrayspacing; - i->x = w; - XMoveResizeWindow(dpy, i->win, i->x, 0, i->w, i->h); - w += i->w; - if (i->mon != m) - i->mon = m; - } - w = w ? w + systrayspacing : 1; - x -= w; - XMoveResizeWindow(dpy, systray->win, x, m->by, w, bh); - wc.x = x; wc.y = m->by; wc.width = w; wc.height = bh; - wc.stack_mode = Above; wc.sibling = m->barwin; - XConfigureWindow(dpy, systray->win, CWX|CWY|CWWidth|CWHeight|CWSibling|CWStackMode, &wc); - XMapWindow(dpy, systray->win); - XMapSubwindows(dpy, systray->win); - /* redraw background */ - XSetForeground(dpy, drw->gc, scheme[SchemeNorm][ColBg].pixel); - XFillRectangle(dpy, systray->win, drw->gc, 0, 0, w, bh); - XSync(dpy, False); -} - -void -updatetitle(Client *c) -{ - if (!gettextprop(c->win, netatom[NetWMName], c->name, sizeof c->name)) - gettextprop(c->win, XA_WM_NAME, c->name, sizeof c->name); - if (c->name[0] == '\0') /* hack to mark broken clients */ - strcpy(c->name, broken); -} - -void -updatewindowtype(Client *c) -{ - Atom state = getatomprop(c, netatom[NetWMState]); - Atom wtype = getatomprop(c, netatom[NetWMWindowType]); - - if (state == netatom[NetWMFullscreen]) - setfullscreen(c, 1); - if (wtype == netatom[NetWMWindowTypeDialog]) - c->isfloating = 1; -} - -void -updatewmhints(Client *c) -{ - XWMHints *wmh; - - if ((wmh = XGetWMHints(dpy, c->win))) { - if (c == selmon->sel && wmh->flags & XUrgencyHint) { - wmh->flags &= ~XUrgencyHint; - XSetWMHints(dpy, c->win, wmh); - } else - c->isurgent = (wmh->flags & XUrgencyHint) ? 1 : 0; - if (wmh->flags & InputHint) - c->neverfocus = !wmh->input; - else - c->neverfocus = 0; - XFree(wmh); - } -} - -void -view(const Arg *arg) -{ - if ((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags]) - return; - selmon->seltags ^= 1; /* toggle sel tagset */ - if (arg->ui & TAGMASK) - selmon->tagset[selmon->seltags] = arg->ui & TAGMASK; - focus(NULL); - arrange(selmon); -} - -Client * -wintoclient(Window w) -{ - Client *c; - Monitor *m; - - for (m = mons; m; m = m->next) - for (c = m->clients; c; c = c->next) - if (c->win == w) - return c; - return NULL; -} - -Client * -wintosystrayicon(Window w) { - Client *i = NULL; - - if (!showsystray || !w) - return i; - for (i = systray->icons; i && i->win != w; i = i->next) ; - return i; -} - -Monitor * -wintomon(Window w) -{ - int x, y; - Client *c; - Monitor *m; - - if (w == root && getrootptr(&x, &y)) - return recttomon(x, y, 1, 1); - for (m = mons; m; m = m->next) - if (w == m->barwin) - return m; - if ((c = wintoclient(w))) - return c->mon; - return selmon; -} - -/* There's no way to check accesses to destroyed windows, thus those cases are - * ignored (especially on UnmapNotify's). Other types of errors call Xlibs - * default error handler, which may call exit. */ -int -xerror(Display *dpy, XErrorEvent *ee) -{ - if (ee->error_code == BadWindow - || (ee->request_code == X_SetInputFocus && ee->error_code == BadMatch) - || (ee->request_code == X_PolyText8 && ee->error_code == BadDrawable) - || (ee->request_code == X_PolyFillRectangle && ee->error_code == BadDrawable) - || (ee->request_code == X_PolySegment && ee->error_code == BadDrawable) - || (ee->request_code == X_ConfigureWindow && ee->error_code == BadMatch) - || (ee->request_code == X_GrabButton && ee->error_code == BadAccess) - || (ee->request_code == X_GrabKey && ee->error_code == BadAccess) - || (ee->request_code == X_CopyArea && ee->error_code == BadDrawable)) - return 0; - fprintf(stderr, "dwm: fatal error: request code=%d, error code=%d\n", - ee->request_code, ee->error_code); - return xerrorxlib(dpy, ee); /* may call exit */ -} - -int -xerrordummy(Display *dpy, XErrorEvent *ee) -{ - return 0; -} - -/* Startup Error handler to check if another window manager - * is already running. */ -int -xerrorstart(Display *dpy, XErrorEvent *ee) -{ - die("dwm: another window manager is already running"); - return -1; -} - -Monitor * -systraytomon(Monitor *m) { - Monitor *t; - int i, n; - if(!systraypinning) { - if(!m) - return selmon; - return m == selmon ? m : NULL; - } - for(n = 1, t = mons; t && t->next; n++, t = t->next) ; - for(i = 1, t = mons; t && t->next && i < systraypinning; i++, t = t->next) ; - if(systraypinningfailfirst && n < systraypinning) - return mons; - return t; -} - -void -zoom(const Arg *arg) -{ - Client *c = selmon->sel; - - if (!selmon->lt[selmon->sellt]->arrange || !c || c->isfloating) - return; - if (c == nexttiled(selmon->clients) && !(c = nexttiled(c->next))) - return; - pop(c); -} - -int -main(int argc, char *argv[]) -{ - if (argc == 2 && !strcmp("-v", argv[1])) - die("dwm-"VERSION); - else if (argc != 1) - die("usage: dwm [-v]"); - if (!setlocale(LC_CTYPE, "") || !XSupportsLocale()) - fputs("warning: no locale support\n", stderr); - if (!(dpy = XOpenDisplay(NULL))) - die("dwm: cannot open display"); - checkotherwm(); - setup(); -#ifdef __OpenBSD__ - if (pledge("stdio rpath proc exec", NULL) == -1) - die("pledge"); -#endif /* __OpenBSD__ */ - scan(); - run(); - cleanup(); - XCloseDisplay(dpy); - return EXIT_SUCCESS; -} diff --git a/config/dwm-old/dwm.c.rej b/config/dwm-old/dwm.c.rej deleted file mode 100644 index e018d7d3..00000000 --- a/config/dwm-old/dwm.c.rej +++ /dev/null @@ -1,29 +0,0 @@ ---- dwm.c -+++ dwm.c -@@ -1671,9 +1710,25 @@ showhide(Client *c) - void - sigchld(int unused) - { -+ pid_t pid; -+ - if (signal(SIGCHLD, sigchld) == SIG_ERR) - die("can't install SIGCHLD handler:"); -- while (0 < waitpid(-1, NULL, WNOHANG)); -+ while (0 < (pid = waitpid(-1, NULL, WNOHANG))) { -+ pid_t *p, *lim; -+ -+ if (!(p = autostart_pids)) -+ continue; -+ lim = &p[autostart_len]; -+ -+ for (; p < lim; p++) { -+ if (*p == pid) { -+ *p = -1; -+ break; -+ } -+ } -+ -+ } - } - - void diff --git a/config/dwm-old/dwm.png b/config/dwm-old/dwm.png deleted file mode 100644 index b1f9ba7e5f4cc7350ee2392ebcea5fcbe00fb49b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 373 zcmeAS@N?(olHy`uVBq!ia0vp^2Y@($g9*gC@m3f}u_bxCyDx`7I;J! zGca%iWx0hJ8D`Cq01C2~c>21sUt<^MF=V?Ztt9{yk}YwKC~?lu%}vcKVQ?-=O)N=G zQ7F$W$xsN%NL6t6^bL5QqM8R(c+=CxF{I+w+q;fj4F)_6j>`Z3pZ>_($QEQ&92OXP z%lpEKGwG8$G-U1H{@Y%;mx-mNK|p|siBVAj$Z~Mt-~h6K0!}~{PyozQ07(f5fTdVi zm=-zT`NweeJ#%S&{fequZGmkDDC*%x$$Sa*fAP=$`nJkhx1Y~k<8b2;Hq)FOdV=P$ q&oWzoxz_&nv&n0)xBzV8k*jsxheTIy&cCY600f?{elF{r5}E*x)opSB diff --git a/config/dwm-old/transient.c b/config/dwm-old/transient.c deleted file mode 100644 index 040adb5b..00000000 --- a/config/dwm-old/transient.c +++ /dev/null @@ -1,42 +0,0 @@ -/* cc transient.c -o transient -lX11 */ - -#include -#include -#include -#include - -int main(void) { - Display *d; - Window r, f, t = None; - XSizeHints h; - XEvent e; - - d = XOpenDisplay(NULL); - if (!d) - exit(1); - r = DefaultRootWindow(d); - - f = XCreateSimpleWindow(d, r, 100, 100, 400, 400, 0, 0, 0); - h.min_width = h.max_width = h.min_height = h.max_height = 400; - h.flags = PMinSize | PMaxSize; - XSetWMNormalHints(d, f, &h); - XStoreName(d, f, "floating"); - XMapWindow(d, f); - - XSelectInput(d, f, ExposureMask); - while (1) { - XNextEvent(d, &e); - - if (t == None) { - sleep(5); - t = XCreateSimpleWindow(d, r, 50, 50, 100, 100, 0, 0, 0); - XSetTransientForHint(d, t, f); - XStoreName(d, t, "transient"); - XMapWindow(d, t); - XSelectInput(d, t, ExposureMask); - } - } - - XCloseDisplay(d); - exit(0); -} diff --git a/config/dwm-old/util.c b/config/dwm-old/util.c deleted file mode 100644 index 96b82c98..00000000 --- a/config/dwm-old/util.c +++ /dev/null @@ -1,36 +0,0 @@ -/* See LICENSE file for copyright and license details. */ -#include -#include -#include -#include - -#include "util.h" - -void -die(const char *fmt, ...) -{ - va_list ap; - - va_start(ap, fmt); - vfprintf(stderr, fmt, ap); - va_end(ap); - - if (fmt[0] && fmt[strlen(fmt)-1] == ':') { - fputc(' ', stderr); - perror(NULL); - } else { - fputc('\n', stderr); - } - - exit(1); -} - -void * -ecalloc(size_t nmemb, size_t size) -{ - void *p; - - if (!(p = calloc(nmemb, size))) - die("calloc:"); - return p; -} diff --git a/config/dwm-old/util.h b/config/dwm-old/util.h deleted file mode 100644 index f633b517..00000000 --- a/config/dwm-old/util.h +++ /dev/null @@ -1,8 +0,0 @@ -/* See LICENSE file for copyright and license details. */ - -#define MAX(A, B) ((A) > (B) ? (A) : (B)) -#define MIN(A, B) ((A) < (B) ? (A) : (B)) -#define BETWEEN(X, A, B) ((A) <= (X) && (X) <= (B)) - -void die(const char *fmt, ...); -void *ecalloc(size_t nmemb, size_t size); diff --git a/config/dwmbar/bar.sh b/config/dwmbar/bar.sh deleted file mode 100755 index 8522b8fc..00000000 --- a/config/dwmbar/bar.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh - -blue=#0000ff - -battery() { - get_capacity="$(cat /sys/class/power_supply/BAT1/capacity)" - get_status="$(cat /sys/class/power_supply/BAT1/status)" - case "$get_status" in - Charging) printf "󰂄 $get_capacity" ;; - Discharging) printf "󰁹 $get_capacity" ;; - esac -} - -audio() { - get_vol=$(pamixer --get-volume-human) - if [ $get_vol = 'muted' ]; then - printf "󰕾 Muted" - else - printf "󰕾 $get_vol" - fi -} - -clock() { - printf "$(date '+%H:%M') " -} - -while true; do - xsetroot -name " $(clock) $(audio) $(battery) " - sleep 1 -done From eacc5c0dff1a27f9a6873875a5dbc43d335cfb12 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sat, 28 Sep 2024 12:54:57 +0400 Subject: [PATCH 102/319] game/tetrio: remove tetrio-plus --- modules/desktop/game/tetrio/default.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/desktop/game/tetrio/default.nix b/modules/desktop/game/tetrio/default.nix index f04913ab..5d6f6021 100644 --- a/modules/desktop/game/tetrio/default.nix +++ b/modules/desktop/game/tetrio/default.nix @@ -15,9 +15,10 @@ in { config = lib.mkIf cfg.enable { users.users.sako.packages = with pkgs; [ - (tetrio-desktop.override { - withTetrioPlus = true; - }) + # (tetrio-desktop.override { + # withTetrioPlus = true; + # }) + tetrio-desktop ]; }; } From 3b71749933ffbdde2061b08ac88e65f898dc9898 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sat, 28 Sep 2024 15:50:53 +0400 Subject: [PATCH 103/319] thing --- config/emacs/emacs.org | 7 ++++--- modules/dev/editors/emacs/default.nix | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 9f86a9c0..456182eb 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1330,9 +1330,10 @@ GNU patch review metho dor sometihng idk #+end_src ** Org-wild-notifier #+begin_src emacs-lisp -(use-package org-wild-notifier - :config - (org-wild-notifier-mode)) + (use-package org-wild-notifier + :config + (setq alert-default-style 'libnotify) + (org-wild-notifier-mode)) #+end_src ** Org-Pomodoro #+begin_src emacs-lisp diff --git a/modules/dev/editors/emacs/default.nix b/modules/dev/editors/emacs/default.nix index a7e3867c..5a66137f 100644 --- a/modules/dev/editors/emacs/default.nix +++ b/modules/dev/editors/emacs/default.nix @@ -126,6 +126,8 @@ in { emacs-lsp-booster # zenity-color-picker zenity + # org-wild-notifier + libnotify ]; systemd.services.hydroxide = { From 24fad69c9823be3b84c8a24ff10a5e83706e472a Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sat, 28 Sep 2024 21:16:59 +0400 Subject: [PATCH 104/319] config/emacs: shennanigans --- config/emacs/emacs.org | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 456182eb..9ccf4898 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1164,25 +1164,32 @@ GNU patch review metho dor sometihng idk (setq mu4e-get-mail-command "offlineimap") (setq mu4e-maildir "~/Mail") - (setq outlook-mail-address - (string-trim (shell-command-to-string "pass Microsoft | awk 'BEGIN {ORS=\"\"} FNR == 2{gsub(\"login: \", \"\"); gsub(/ /, \"\"); print}'"))) + (add-hook 'mu4e-update-pre-hook 'sakomacs/pull-email-address) - (defvar proton-mail-address nil) + (defun sakomacs/pull-email-address () - (defun get-proton-mail-address-from-pass (command) - "Execute COMMAND, concatenate its output with 'hello', and store it in my-greeting." - (let ((output (shell-command-to-string command))) - (setq output (string-trim output)) - (setq proton-mail-address (concat "@proton.me" output)))) + (setq outlook-mail-address + (string-trim (shell-command-to-string "pass Microsoft | awk 'BEGIN {ORS=\"\"} FNR == 2{gsub(\"login: \", \"\"); gsub(/ /, \"\"); print}'"))) - (get-proton-mail-address-from-pass "pass 'Proton Account' | awk 'BEGIN {ORS=\"\"} FNR == 2{gsub(\"login: \", \"\"); gsub(/ /, \"\"); print}'") + (defvar proton-mail-address nil) - (setq gmail-1-mail-address - (string-trim (shell-command-to-string "pass accounts.google.com/one | awk 'BEGIN {ORS=\"\"} FNR == 2{gsub(\"login: \", \"\"); gsub(/ /, \"\"); print}'"))) + (defun get-proton-mail-address-from-pass (command) + "Execute COMMAND, concatenate its output with 'hello', and store it in my-greeting." + (let ((output (shell-command-to-string command))) + (setq output (string-trim output)) + (setq proton-mail-address (concat output "@proton.me")))) - (setq gmail-2-mail-address - (string-trim (shell-command-to-string "pass accounts.google.com/two | awk 'BEGIN {ORS=\"\"} FNR == 2{gsub(\"login: \", \"\"); gsub(/ /, \"\"); print}'"))) + (get-proton-mail-address-from-pass "pass 'Proton Account' | awk 'BEGIN {ORS=\"\"} FNR == 2{gsub(\"login: \", \"\"); gsub(/ /, \"\"); print}'") + (setq gmail-1-mail-address + (string-trim (shell-command-to-string "pass accounts.google.com/one | awk 'BEGIN {ORS=\"\"} FNR == 2{gsub(\"login: \", \"\"); gsub(/ /, \"\"); print}'"))) + + (setq gmail-2-mail-address + (string-trim (shell-command-to-string "pass accounts.google.com/two | awk 'BEGIN {ORS=\"\"} FNR == 2{gsub(\"login: \", \"\"); gsub(/ /, \"\"); print}'"))) + + + ) + (setq mu4e-context-policy 'pick-first) (setq mu4e-compose-context-policy 'always-ask) (setq mu4e-contexts From 71b2b9ff7cac2df34918075a329d1cf01a41bfc1 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sat, 28 Sep 2024 21:19:15 +0400 Subject: [PATCH 105/319] config/emacs: epic fail --- config/emacs/emacs.org | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 9ccf4898..004356fa 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1189,6 +1189,11 @@ GNU patch review metho dor sometihng idk ) + + (defvar outlook-mail-address nil) + (defvar proton-mail-address nil) + (defvar gmail-1-mail-address nil) + (defvar gmail-2-mail-address nil) (setq mu4e-context-policy 'pick-first) (setq mu4e-compose-context-policy 'always-ask) From b86f0408bd194e9dc364fb802d0246240afc2494 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sat, 28 Sep 2024 21:27:19 +0400 Subject: [PATCH 106/319] config/emacs: lisp moment --- config/emacs/emacs.org | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 004356fa..d45c56bc 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1164,6 +1164,12 @@ GNU patch review metho dor sometihng idk (setq mu4e-get-mail-command "offlineimap") (setq mu4e-maildir "~/Mail") + + (defvar outlook-mail-address nil) + (defvar proton-mail-address nil) + (defvar gmail-1-mail-address nil) + (defvar gmail-2-mail-address nil) + (add-hook 'mu4e-update-pre-hook 'sakomacs/pull-email-address) (defun sakomacs/pull-email-address () @@ -1189,12 +1195,7 @@ GNU patch review metho dor sometihng idk ) - - (defvar outlook-mail-address nil) - (defvar proton-mail-address nil) - (defvar gmail-1-mail-address nil) - (defvar gmail-2-mail-address nil) - + (setq mu4e-context-policy 'pick-first) (setq mu4e-compose-context-policy 'always-ask) (setq mu4e-contexts From 2ed9d11c94010ba4f1b830a8636c0ede0a476034 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sat, 28 Sep 2024 21:48:36 +0400 Subject: [PATCH 107/319] config/emacs: we are so back --- config/emacs/emacs.org | 41 ++++++----------------------------------- 1 file changed, 6 insertions(+), 35 deletions(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index d45c56bc..b8d6bbb2 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1163,39 +1163,10 @@ GNU patch review metho dor sometihng idk (setq mu4e-update-interval (* 10 60)) (setq mu4e-get-mail-command "offlineimap") (setq mu4e-maildir "~/Mail") - - (defvar outlook-mail-address nil) - (defvar proton-mail-address nil) - (defvar gmail-1-mail-address nil) - (defvar gmail-2-mail-address nil) - - (add-hook 'mu4e-update-pre-hook 'sakomacs/pull-email-address) + ;; for mail accounts + (setq sakomacs-mail-accounts (json-read-file "~/Mail/accounts.json")) - (defun sakomacs/pull-email-address () - - (setq outlook-mail-address - (string-trim (shell-command-to-string "pass Microsoft | awk 'BEGIN {ORS=\"\"} FNR == 2{gsub(\"login: \", \"\"); gsub(/ /, \"\"); print}'"))) - - (defvar proton-mail-address nil) - - (defun get-proton-mail-address-from-pass (command) - "Execute COMMAND, concatenate its output with 'hello', and store it in my-greeting." - (let ((output (shell-command-to-string command))) - (setq output (string-trim output)) - (setq proton-mail-address (concat output "@proton.me")))) - - (get-proton-mail-address-from-pass "pass 'Proton Account' | awk 'BEGIN {ORS=\"\"} FNR == 2{gsub(\"login: \", \"\"); gsub(/ /, \"\"); print}'") - - (setq gmail-1-mail-address - (string-trim (shell-command-to-string "pass accounts.google.com/one | awk 'BEGIN {ORS=\"\"} FNR == 2{gsub(\"login: \", \"\"); gsub(/ /, \"\"); print}'"))) - - (setq gmail-2-mail-address - (string-trim (shell-command-to-string "pass accounts.google.com/two | awk 'BEGIN {ORS=\"\"} FNR == 2{gsub(\"login: \", \"\"); gsub(/ /, \"\"); print}'"))) - - - ) - (setq mu4e-context-policy 'pick-first) (setq mu4e-compose-context-policy 'always-ask) (setq mu4e-contexts @@ -1207,7 +1178,7 @@ GNU patch review metho dor sometihng idk (lambda (msg) (when msg (string-prefix-p "/Outlook" (mu4e-message-field msg :maildir)))) - :vars `((user-mail-address . ,outlook-mail-address) + :vars `((user-mail-address . (cdr (assoc 'outlook sakomacs-mail-accounts))) (user-full-name . "Sako") (mu4e-drafts-folder . "/Outlook/Drafts") (mu4e-sent-folder . "/Outlook/Sent") @@ -1221,7 +1192,7 @@ GNU patch review metho dor sometihng idk (lambda (msg) (when msg (string-prefix-p "/Proton" (mu4e-message-field msg :maildir)))) - :vars `((user-mail-address . ,proton-mail-address) + :vars `((user-mail-address . (cdr (assoc 'protonmail sakomacs-mail-accounts))) (user-full-name . "Sako") (mu4e-drafts-folder . "/Proton/Drafts") (mu4e-sent-folder . "/Proton/Sent") @@ -1235,7 +1206,7 @@ GNU patch review metho dor sometihng idk (lambda (msg) (when msg (string-prefix-p "/Gmail-Personal-1" (mu4e-message-field msg :maildir)))) - :vars `((user-mail-address . ,gmail-1-mail-address) + :vars `((user-mail-address . (cdr (assoc 'gmail-1 sakomacs-mail-accounts))) (user-full-name . "Sako") (mu4e-drafts-folder . "/Gmail-Personal-1/Drafts") (mu4e-sent-folder . "/Gmail-Personal-1/Sent Mail") @@ -1249,7 +1220,7 @@ GNU patch review metho dor sometihng idk (lambda (msg) (when msg (string-prefix-p "/Gmail-Personal-2" (mu4e-message-field msg :maildir)))) - :vars `((user-mail-address . ,gmail-2-mail-address) + :vars `((user-mail-address . (cdr (assoc 'gmail-2 sakomacs-mail-accounts))) (user-full-name . "Sako") (mu4e-drafts-folder . "/Gmail-Personal-2/Drafts") (mu4e-sent-folder . "/Gmail-Personal-2/Sent Mail") From cf679f47a6c174cab6e9de3eb71e01ce40ab6d31 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sat, 28 Sep 2024 22:00:50 +0400 Subject: [PATCH 108/319] config/emacs: epic fail --- config/emacs/emacs.org | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index b8d6bbb2..e1a4024f 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1178,7 +1178,7 @@ GNU patch review metho dor sometihng idk (lambda (msg) (when msg (string-prefix-p "/Outlook" (mu4e-message-field msg :maildir)))) - :vars `((user-mail-address . (cdr (assoc 'outlook sakomacs-mail-accounts))) + :vars `((user-mail-address . (lambda () (cdr (assoc 'outlook sakomacs-mail-accounts)))) (user-full-name . "Sako") (mu4e-drafts-folder . "/Outlook/Drafts") (mu4e-sent-folder . "/Outlook/Sent") @@ -1192,7 +1192,7 @@ GNU patch review metho dor sometihng idk (lambda (msg) (when msg (string-prefix-p "/Proton" (mu4e-message-field msg :maildir)))) - :vars `((user-mail-address . (cdr (assoc 'protonmail sakomacs-mail-accounts))) + :vars `((user-mail-address . (lambda () (cdr (assoc 'protonmail sakomacs-mail-accounts)))) (user-full-name . "Sako") (mu4e-drafts-folder . "/Proton/Drafts") (mu4e-sent-folder . "/Proton/Sent") @@ -1206,7 +1206,7 @@ GNU patch review metho dor sometihng idk (lambda (msg) (when msg (string-prefix-p "/Gmail-Personal-1" (mu4e-message-field msg :maildir)))) - :vars `((user-mail-address . (cdr (assoc 'gmail-1 sakomacs-mail-accounts))) + :vars `((user-mail-address . (lambda () (cdr (assoc 'gmail-1 sakomacs-mail-accounts)))) (user-full-name . "Sako") (mu4e-drafts-folder . "/Gmail-Personal-1/Drafts") (mu4e-sent-folder . "/Gmail-Personal-1/Sent Mail") @@ -1220,7 +1220,7 @@ GNU patch review metho dor sometihng idk (lambda (msg) (when msg (string-prefix-p "/Gmail-Personal-2" (mu4e-message-field msg :maildir)))) - :vars `((user-mail-address . (cdr (assoc 'gmail-2 sakomacs-mail-accounts))) + :vars `((user-mail-address . (lambda () (cdr (assoc 'gmail-2 sakomacs-mail-accounts)))) (user-full-name . "Sako") (mu4e-drafts-folder . "/Gmail-Personal-2/Drafts") (mu4e-sent-folder . "/Gmail-Personal-2/Sent Mail") From 563ec94ec40622bfdccd51702b38401933d6c3ca Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sat, 28 Sep 2024 22:07:24 +0400 Subject: [PATCH 109/319] config/emacs: kms --- config/emacs/emacs.org | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index e1a4024f..f595de7f 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1178,7 +1178,7 @@ GNU patch review metho dor sometihng idk (lambda (msg) (when msg (string-prefix-p "/Outlook" (mu4e-message-field msg :maildir)))) - :vars `((user-mail-address . (lambda () (cdr (assoc 'outlook sakomacs-mail-accounts)))) + :vars `((user-mail-address . ,(cdr (assoc 'outlook sakomacs-mail-accounts))) (user-full-name . "Sako") (mu4e-drafts-folder . "/Outlook/Drafts") (mu4e-sent-folder . "/Outlook/Sent") @@ -1192,7 +1192,7 @@ GNU patch review metho dor sometihng idk (lambda (msg) (when msg (string-prefix-p "/Proton" (mu4e-message-field msg :maildir)))) - :vars `((user-mail-address . (lambda () (cdr (assoc 'protonmail sakomacs-mail-accounts)))) + :vars `((user-mail-address . ,(cdr (assoc 'protonmail sakomacs-mail-accounts))) (user-full-name . "Sako") (mu4e-drafts-folder . "/Proton/Drafts") (mu4e-sent-folder . "/Proton/Sent") @@ -1206,7 +1206,7 @@ GNU patch review metho dor sometihng idk (lambda (msg) (when msg (string-prefix-p "/Gmail-Personal-1" (mu4e-message-field msg :maildir)))) - :vars `((user-mail-address . (lambda () (cdr (assoc 'gmail-1 sakomacs-mail-accounts)))) + :vars `((user-mail-address . ,(cdr (assoc 'gmail-1 sakomacs-mail-accounts))) (user-full-name . "Sako") (mu4e-drafts-folder . "/Gmail-Personal-1/Drafts") (mu4e-sent-folder . "/Gmail-Personal-1/Sent Mail") @@ -1220,7 +1220,7 @@ GNU patch review metho dor sometihng idk (lambda (msg) (when msg (string-prefix-p "/Gmail-Personal-2" (mu4e-message-field msg :maildir)))) - :vars `((user-mail-address . (lambda () (cdr (assoc 'gmail-2 sakomacs-mail-accounts)))) + :vars `((user-mail-address . ,(cdr (assoc 'gmail-2 sakomacs-mail-accounts))) (user-full-name . "Sako") (mu4e-drafts-folder . "/Gmail-Personal-2/Drafts") (mu4e-sent-folder . "/Gmail-Personal-2/Sent Mail") From 09646d7ceef1b4cc9692e2106ac46e578570c4da Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sat, 28 Sep 2024 23:06:18 +0400 Subject: [PATCH 110/319] flake.nix: remove agenix --- flake.lock | 138 ++++++++--------------------------------------------- flake.nix | 4 +- 2 files changed, 22 insertions(+), 120 deletions(-) diff --git a/flake.lock b/flake.lock index 61cabe3f..b4358281 100644 --- a/flake.lock +++ b/flake.lock @@ -22,33 +22,12 @@ "type": "github" } }, - "agenix": { - "inputs": { - "darwin": "darwin", - "home-manager": "home-manager", - "nixpkgs": "nixpkgs", - "systems": "systems_2" - }, - "locked": { - "lastModified": 1723293904, - "narHash": "sha256-b+uqzj+Wa6xgMS9aNbX4I+sXeb5biPDi39VgvSFqFvU=", - "owner": "ryantm", - "repo": "agenix", - "rev": "f6291c5935fdc4e0bef208cfc0dcab7e3f7a1c41", - "type": "github" - }, - "original": { - "owner": "ryantm", - "repo": "agenix", - "type": "github" - } - }, "ags": { "inputs": { "nixpkgs": [ "nixpkgs" ], - "systems": "systems_3" + "systems": "systems_2" }, "locked": { "lastModified": 1725841979, @@ -97,32 +76,10 @@ "type": "github" } }, - "darwin": { - "inputs": { - "nixpkgs": [ - "agenix", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1700795494, - "narHash": "sha256-gzGLZSiOhf155FW7262kdHo2YDeugp3VuIFb4/GGng0=", - "owner": "lnl7", - "repo": "nix-darwin", - "rev": "4b9b83d5a92e8c1fbfd8eb27eda375908c11ec4d", - "type": "github" - }, - "original": { - "owner": "lnl7", - "ref": "master", - "repo": "nix-darwin", - "type": "github" - } - }, "emacs-overlay": { "inputs": { "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs", "nixpkgs-stable": "nixpkgs-stable" }, "locked": { @@ -176,7 +133,7 @@ }, "flake-utils_2": { "inputs": { - "systems": "systems_4" + "systems": "systems_3" }, "locked": { "lastModified": 1710146030, @@ -193,27 +150,6 @@ } }, "home-manager": { - "inputs": { - "nixpkgs": [ - "agenix", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1703113217, - "narHash": "sha256-7ulcXOk63TIT2lVDSExj7XzFx09LpdSAPtvgtM7yQPE=", - "owner": "nix-community", - "repo": "home-manager", - "rev": "3bfaacf46133c037bb356193bd2f1765d9dc82c1", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "home-manager", - "type": "github" - } - }, - "home-manager_2": { "inputs": { "nixpkgs": [ "nixpkgs" @@ -269,8 +205,8 @@ "hyprlang": "hyprlang", "hyprutils": "hyprutils", "hyprwayland-scanner": "hyprwayland-scanner", - "nixpkgs": "nixpkgs_3", - "systems": "systems_5", + "nixpkgs": "nixpkgs_2", + "systems": "systems_4", "xdph": "xdph" }, "locked": { @@ -379,8 +315,8 @@ "hyprlang": "hyprlang_2", "hyprutils": "hyprutils_2", "hyprwayland-scanner": "hyprwayland-scanner_2", - "nixpkgs": "nixpkgs_4", - "systems": "systems_6" + "nixpkgs": "nixpkgs_3", + "systems": "systems_5" }, "locked": { "lastModified": 1725200438, @@ -498,11 +434,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1703013332, - "narHash": "sha256-+tFNwMvlXLbJZXiMHqYq77z/RfmpfpiI3yjL6o/Zo9M=", + "lastModified": 1725432240, + "narHash": "sha256-+yj+xgsfZaErbfYM3T+QvEE2hU7UuE+Jf0fJCJ8uPS0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "54aac082a4d9bb5bbc5c4e899603abfb76a3f6d6", + "rev": "ad416d066ca1222956472ab7d0555a6946746a80", "type": "github" }, "original": { @@ -561,22 +497,6 @@ } }, "nixpkgs_2": { - "locked": { - "lastModified": 1725432240, - "narHash": "sha256-+yj+xgsfZaErbfYM3T+QvEE2hU7UuE+Jf0fJCJ8uPS0=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "ad416d066ca1222956472ab7d0555a6946746a80", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_3": { "locked": { "lastModified": 1726755586, "narHash": "sha256-PmUr/2GQGvFTIJ6/Tvsins7Q43KTMvMFhvG6oaYK+Wk=", @@ -592,7 +512,7 @@ "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_3": { "locked": { "lastModified": 1725103162, "narHash": "sha256-Ym04C5+qovuQDYL/rKWSR+WESseQBbNAe5DsXNx5trY=", @@ -608,7 +528,7 @@ "type": "github" } }, - "nixpkgs_5": { + "nixpkgs_4": { "locked": { "lastModified": 1726937504, "narHash": "sha256-bvGoiQBvponpZh8ClUcmJ6QnsNKw0EMrCQJARK3bI1c=", @@ -627,13 +547,12 @@ "root": { "inputs": { "NixOS-WSL": "NixOS-WSL", - "agenix": "agenix", "ags": "ags", "emacs-overlay": "emacs-overlay", - "home-manager": "home-manager_2", + "home-manager": "home-manager", "hyprland": "hyprland", "hyprpaper": "hyprpaper", - "nixpkgs": "nixpkgs_5", + "nixpkgs": "nixpkgs_4", "nixpkgs-stable": "nixpkgs-stable_2", "sops-nix": "sops-nix" } @@ -676,35 +595,20 @@ }, "systems_2": { "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", "type": "github" }, "original": { "owner": "nix-systems", - "repo": "default", + "repo": "default-linux", "type": "github" } }, "systems_3": { - "locked": { - "lastModified": 1689347949, - "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", - "owner": "nix-systems", - "repo": "default-linux", - "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default-linux", - "type": "github" - } - }, - "systems_4": { "locked": { "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", @@ -719,7 +623,7 @@ "type": "github" } }, - "systems_5": { + "systems_4": { "locked": { "lastModified": 1689347949, "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", @@ -734,7 +638,7 @@ "type": "github" } }, - "systems_6": { + "systems_5": { "locked": { "lastModified": 1689347949, "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", diff --git a/flake.nix b/flake.nix index 5cc149d0..0fb426e7 100644 --- a/flake.nix +++ b/flake.nix @@ -20,7 +20,6 @@ url = "github:Mic92/sops-nix"; inputs.nixpkgs.follows = "nixpkgs"; }; - agenix.url = "github:ryantm/agenix"; emacs-overlay = { url = "github:nix-community/emacs-overlay/0442d57ffa83985ec2ffaec95db9c0fe742f5182"; }; @@ -42,7 +41,6 @@ hyprland, hyprpaper, ags, - agenix, ... } @ inputs: let inherit (self) outputs; @@ -78,7 +76,6 @@ ./default.nix ./hosts/sakotop/configuration.nix sops-nix.nixosModules.sops - agenix.nixosModules.default ]; }; sakopc = nixpkgs.lib.nixosSystem { @@ -86,6 +83,7 @@ modules = [ ./default.nix ./hosts/sakopc/configuration.nix + sops-nix.nixosModules.sops ]; }; #sakoserver = nixpkgs.lib.nixosSystem { From da546afa36b5e1b36cae66166afe6c3ac3bd8a7a Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sat, 28 Sep 2024 23:16:57 +0400 Subject: [PATCH 111/319] security/sops: am i stupid? --- modules/security/sops.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/security/sops.nix b/modules/security/sops.nix index 6ac09427..6d603871 100644 --- a/modules/security/sops.nix +++ b/modules/security/sops.nix @@ -7,7 +7,7 @@ ... }: let - cfg = config.modules.security.age; + cfg = config.modules.security.sops; in { options.modules.security.sops = { enable = lib.mkEnableOption false; From 8323c5b2354ce1c47686a3529057a3680f48660a Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sat, 28 Sep 2024 23:22:34 +0400 Subject: [PATCH 112/319] sops: remove old sops.yaml --- .sops.yaml | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 .sops.yaml diff --git a/.sops.yaml b/.sops.yaml deleted file mode 100644 index 8a9b32ca..00000000 --- a/.sops.yaml +++ /dev/null @@ -1,8 +0,0 @@ -keys: - - &host_sakotop age1nhj5fz9cakgd6rrkwpjkndra6fd4rqxgfvcrap5g0anwxgmh4yqspvf22y - -creation_rules: - - path_regex: hosts/sakotop/secrets/[^/]+\.(yaml|json|env|ini)$ - key_groups: - - age: - - *host_sakotop From fbd6ef7d87c94d22aa1899e2602d2e9be7e5df66 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sat, 28 Sep 2024 23:24:32 +0400 Subject: [PATCH 113/319] ???? --- .sops.yaml~ | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .sops.yaml~ diff --git a/.sops.yaml~ b/.sops.yaml~ deleted file mode 100644 index e69de29b..00000000 From 56652643e3c13a8a17cdaf2e1b65f71cae988bfc Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sat, 28 Sep 2024 23:29:08 +0400 Subject: [PATCH 114/319] sops.yaml: init --- .sops.yaml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .sops.yaml diff --git a/.sops.yaml b/.sops.yaml new file mode 100644 index 00000000..637f99e2 --- /dev/null +++ b/.sops.yaml @@ -0,0 +1,7 @@ +keys: + - &sakopc age1ac355av79sshqqkarxdtfs975mvr5mteen4h4y73x2nyn43esyqq0dl7kx +creation_rules: + - path_regex: secrets/secrets.yaml$ + key_groups: + - age: + - *sakopc From 11c0e6aa9707f07f2cf8811faf37906b500ab7d2 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sat, 28 Sep 2024 23:30:20 +0400 Subject: [PATCH 115/319] secrets: init --- secrets/secrets.yaml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 secrets/secrets.yaml diff --git a/secrets/secrets.yaml b/secrets/secrets.yaml new file mode 100644 index 00000000..fc149b09 --- /dev/null +++ b/secrets/secrets.yaml @@ -0,0 +1,24 @@ +example-key: ENC[AES256_GCM,data:/2eUilw6CzurLubgHw==,iv:DADrdgODnHGTg3FeQ5oGbY8eshcB+8pvu3droFyRg8s=,tag:0weIsYrnwQucjyZcCq9gtA==,type:str] +service: + subdir: + mysecret: ENC[AES256_GCM,data:NqQzZA==,iv:Aigsln7uc6OoZLyGdDh/uDZEeRcjkpg+ej0R9/LrY8g=,tag:cNb9MUzwXFAUdhRod33XbA==,type:str] +sops: + kms: [] + gcp_kms: [] + azure_kv: [] + hc_vault: [] + age: + - recipient: age1ac355av79sshqqkarxdtfs975mvr5mteen4h4y73x2nyn43esyqq0dl7kx + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBuSGI2V2hsTVlYaUdTYVpJ + V0RBSHYySVhFNzVubTk4N1J4L1V6YnBiMUhFClVLVHBJak9qQ0NSTEdOekFJV1N5 + Wm5sNGJiSWs5UFNZbFhodlkyM2FIKzAKLS0tIHJGSk9HZzc1aTRUY2twby9YMUph + RGFlYzNOdEJ2Mm9sUDA3MHpObE45RW8KPeFz/bZQHoj1cX2i/+vpEq43/hI0V9OY + djc9lwEqbkk1RdFjllXs7K/XU1oPqw8DudpI9CItE8XY8bx6iwa4YQ== + -----END AGE ENCRYPTED FILE----- + lastmodified: "2024-09-28T19:30:08Z" + mac: ENC[AES256_GCM,data:uO/W5F16ISp/KTrvWsgASU2u+fI0bUp5dwWV9tq32yPdApGPLqZlZvrlspSJsOLDINEcIv3GGhHi2Mtp8N/PHNl1jGAIPxDZEv3wAhA3DSVPryEm5fR/Krlmh5cQLTeEjk8/EkG8pCniW5HX8IPE8AEwIxVOLaeJTdeTFeptfgM=,iv:z0dS46g0crXnJRWbfgux2are8Ag5p3vIhNKT2GWk8hQ=,tag:LKuNlo7YBfg9CtWFyyLhKw==,type:str] + pgp: [] + unencrypted_suffix: _unencrypted + version: 3.9.0 From 95bcf452454ddb6bffcae52357e9cfdde9f44735 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sat, 28 Sep 2024 23:31:39 +0400 Subject: [PATCH 116/319] default.nix: import sops-nix --- default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/default.nix b/default.nix index 1b2c88fb..04729954 100644 --- a/default.nix +++ b/default.nix @@ -10,11 +10,11 @@ imports = [ # home manager inputs.home-manager.nixosModules.default - # modules + inputs.sops-nix.nixosModules.sops + # TODO:: GET RID OF THIS PLEASE + # my modules modules # import for each folder - # modules/desktop IMPORT - # modules/desktop/example DO NOT IMPORT, - # add entry to module's default.nix + # add entry to module category's default.nix outputs.nixosModules.desktop outputs.nixosModules.shell outputs.nixosModules.hardware From 049cea21916ea023d6f2f6a166b5c3366c3e15ee Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sat, 28 Sep 2024 23:34:19 +0400 Subject: [PATCH 117/319] sakopc: secrets test --- hosts/sakopc/configuration.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hosts/sakopc/configuration.nix b/hosts/sakopc/configuration.nix index 08bbab32..705f1fa1 100644 --- a/hosts/sakopc/configuration.nix +++ b/hosts/sakopc/configuration.nix @@ -114,6 +114,14 @@ }; }; + sops.defaultSopsFile = ../../secrets/secrets.yaml; + sops.defaultSopsFormat = "yaml"; + + sops.age.keyFile = "/home/sako/.config/sops/age/keys.txt"; + + sops.secrets.example-key = {}; + sops.secrets.service.subdir.mysecret = {}; + # fuck you AOC # my monitor only works on 240hz now services.xserver.displayManager.setupCommands = '' From 3f9745407794be25b16f6c2e330738deb3441eaa Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sat, 28 Sep 2024 23:36:38 +0400 Subject: [PATCH 118/319] default.nix: i am stupid --- default.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/default.nix b/default.nix index 04729954..fe6ddde4 100644 --- a/default.nix +++ b/default.nix @@ -10,7 +10,6 @@ imports = [ # home manager inputs.home-manager.nixosModules.default - inputs.sops-nix.nixosModules.sops # TODO:: GET RID OF THIS PLEASE # my modules modules # import for each folder From ec1a3d7289d4c14126212547a174e11eec3b27b0 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sat, 28 Sep 2024 23:37:09 +0400 Subject: [PATCH 119/319] sakopc: learning experience --- hosts/sakopc/configuration.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosts/sakopc/configuration.nix b/hosts/sakopc/configuration.nix index 705f1fa1..da3a0e97 100644 --- a/hosts/sakopc/configuration.nix +++ b/hosts/sakopc/configuration.nix @@ -120,7 +120,7 @@ sops.age.keyFile = "/home/sako/.config/sops/age/keys.txt"; sops.secrets.example-key = {}; - sops.secrets.service.subdir.mysecret = {}; + sops.secrets."service.subdir.mysecret" = {}; # fuck you AOC # my monitor only works on 240hz now From 6f529ef49c9c34967ad5ab7d6c5fe6b433aa4eb1 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sat, 28 Sep 2024 23:38:41 +0400 Subject: [PATCH 120/319] sakopc: learning experience 2 --- hosts/sakopc/configuration.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosts/sakopc/configuration.nix b/hosts/sakopc/configuration.nix index da3a0e97..9c6f76ae 100644 --- a/hosts/sakopc/configuration.nix +++ b/hosts/sakopc/configuration.nix @@ -120,7 +120,7 @@ sops.age.keyFile = "/home/sako/.config/sops/age/keys.txt"; sops.secrets.example-key = {}; - sops.secrets."service.subdir.mysecret" = {}; + sops.secrets."service/subdir/mysecret" = {}; # fuck you AOC # my monitor only works on 240hz now From 0e1d247674b512532f953cb59ea6f5863cad3109 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sat, 28 Sep 2024 23:41:51 +0400 Subject: [PATCH 121/319] sakopc: it works --- hosts/sakopc/configuration.nix | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/hosts/sakopc/configuration.nix b/hosts/sakopc/configuration.nix index 9c6f76ae..07ec5c51 100644 --- a/hosts/sakopc/configuration.nix +++ b/hosts/sakopc/configuration.nix @@ -114,14 +114,11 @@ }; }; + # sops setup :D sops.defaultSopsFile = ../../secrets/secrets.yaml; sops.defaultSopsFormat = "yaml"; - sops.age.keyFile = "/home/sako/.config/sops/age/keys.txt"; - sops.secrets.example-key = {}; - sops.secrets."service/subdir/mysecret" = {}; - # fuck you AOC # my monitor only works on 240hz now services.xserver.displayManager.setupCommands = '' From 21cfd6bfeb1b660086286f5ffebfa4a1abebaac0 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sat, 28 Sep 2024 23:42:31 +0400 Subject: [PATCH 122/319] sakopc: make sops automatically convert ssh key to age key --- hosts/sakopc/configuration.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hosts/sakopc/configuration.nix b/hosts/sakopc/configuration.nix index 07ec5c51..5438a124 100644 --- a/hosts/sakopc/configuration.nix +++ b/hosts/sakopc/configuration.nix @@ -117,7 +117,8 @@ # sops setup :D sops.defaultSopsFile = ../../secrets/secrets.yaml; sops.defaultSopsFormat = "yaml"; - sops.age.keyFile = "/home/sako/.config/sops/age/keys.txt"; + # sops.age.keyFile = "/home/sako/.config/sops/age/keys.txt"; + sops.age.sshKeyPaths = [ "/home/sako/.ssh/id_ed25519" ]; # fuck you AOC # my monitor only works on 240hz now From 4751c55e00e15dd7e21e1016b3e8d86f1e8e624d Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 29 Sep 2024 01:58:52 +0400 Subject: [PATCH 123/319] sops.yaml: add sakotop key --- .sops.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.sops.yaml b/.sops.yaml index 637f99e2..299465ad 100644 --- a/.sops.yaml +++ b/.sops.yaml @@ -1,7 +1,9 @@ keys: - &sakopc age1ac355av79sshqqkarxdtfs975mvr5mteen4h4y73x2nyn43esyqq0dl7kx + - &sakotop age1nhj5fz9cakgd6rrkwpjkndra6fd4rqxgfvcrap5g0anwxgmh4yqspvf22y creation_rules: - path_regex: secrets/secrets.yaml$ key_groups: - age: - *sakopc + - *sakotop From 69be92c525b3c806b571beb0189d740a07c1395d Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 29 Sep 2024 10:44:30 +0400 Subject: [PATCH 124/319] config/emacs: change org-wild-notifier time --- config/emacs/emacs.org | 1 + 1 file changed, 1 insertion(+) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index f595de7f..965d5d7c 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1317,6 +1317,7 @@ GNU patch review metho dor sometihng idk (use-package org-wild-notifier :config (setq alert-default-style 'libnotify) + (setq org-wild-notifier-alert-time 30) (org-wild-notifier-mode)) #+end_src ** Org-Pomodoro From 0e7160711de8be826212522942a620a04b99c9d8 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 29 Sep 2024 17:34:15 +0400 Subject: [PATCH 125/319] config/emacs: add editorconfig --- config/emacs/emacs.org | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 965d5d7c..b3c769ca 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -898,6 +898,13 @@ this should be useful later #+begin_src emacs-lisp (use-package zenity-color-picker) #+end_src +** editorconfig +people will probably get mad at me if i dont have this and i try to contribute +#+begin_src emacs-lisp +(use-package editorconfig + :config + (editorconfig-mode 1)) +#+end_src * Languages #+begin_src emacs-lisp (message "Reached languages") From 81cd97d0578db215253930bda33bb321fc332cca Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 29 Sep 2024 17:50:57 +0400 Subject: [PATCH 126/319] dev/nil & dev/nixd: add nixfmt --- modules/dev/nil.nix | 1 + modules/dev/nixd.nix | 1 + 2 files changed, 2 insertions(+) diff --git a/modules/dev/nil.nix b/modules/dev/nil.nix index d3432f95..e6048c00 100644 --- a/modules/dev/nil.nix +++ b/modules/dev/nil.nix @@ -11,6 +11,7 @@ in environment.systemPackages = with pkgs; [ nil alejandra + nixfmt ]; }; } diff --git a/modules/dev/nixd.nix b/modules/dev/nixd.nix index 6796ed31..588bb679 100644 --- a/modules/dev/nixd.nix +++ b/modules/dev/nixd.nix @@ -21,6 +21,7 @@ in { environment.systemPackages = with pkgs; [ unstable.nixd alejandra + nixfmt ]; }; } From a475f3ab1eda106a11ef3164bb443111adaef9ad Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Mon, 30 Sep 2024 07:14:38 +0400 Subject: [PATCH 127/319] config/emacs: add wakatime --- config/emacs/emacs.org | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index b3c769ca..e1070dd8 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -905,6 +905,13 @@ people will probably get mad at me if i dont have this and i try to contribute :config (editorconfig-mode 1)) #+end_src +** wakatime +the feds are watching +#+begin_src emacs-lisp + (use-package wakatime-mode + :config + (global-wakatime-mode)) +#+end_src * Languages #+begin_src emacs-lisp (message "Reached languages") From 081f6320bc502fd1d8af86f7c80d6dd5c81cb6bb Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Mon, 30 Sep 2024 07:15:20 +0400 Subject: [PATCH 128/319] dev/emacs: add wakatime-cli --- modules/dev/editors/emacs/default.nix | 105 ++++++++++++-------------- 1 file changed, 48 insertions(+), 57 deletions(-) diff --git a/modules/dev/editors/emacs/default.nix b/modules/dev/editors/emacs/default.nix index 5a66137f..066c7bac 100644 --- a/modules/dev/editors/emacs/default.nix +++ b/modules/dev/editors/emacs/default.nix @@ -1,21 +1,12 @@ -{ - outputs, - options, - config, - lib, - pkgs, - inputs, - ... -}: +{ outputs, options, config, lib, pkgs, inputs, ... }: let cfg = config.modules.dev.editors.emacs; # so we dont cry later on why texLive is MASSIVE tex = (pkgs.texlive.combine { - inherit (pkgs.texlive) scheme-basic - dvisvgm dvipng # for preview and export as html - wrapfig amsmath ulem hyperref capt-of fontspec inputenx graphics - etoolbox; + inherit (pkgs.texlive) + scheme-basic dvisvgm dvipng # for preview and export as html + wrapfig amsmath ulem hyperref capt-of fontspec inputenx graphics etoolbox; }); myEmacs = pkgs.emacsWithPackagesFromUsePackage { @@ -28,54 +19,54 @@ let epkgs.mu4e # TODO make this check if EXWM is enabled or not epkgs.exwm -# epkgs.sakomodules + # epkgs.sakomodules epkgs.eglot-booster epkgs.app-launcher ]; # add eglot-lsp-booster package - override = epkgs: epkgs // { - eglot-booster = epkgs.trivialBuild { - pname = "eglot-booster"; - version = "e19dd7ea81bada84c66e8bdd121408d9c0761fe6"; + override = epkgs: + epkgs // { + eglot-booster = epkgs.trivialBuild { + pname = "eglot-booster"; + version = "e19dd7ea81bada84c66e8bdd121408d9c0761fe6"; - packageRequires = with pkgs; [ emacs-lsp-booster ]; + packageRequires = with pkgs; [ emacs-lsp-booster ]; - src = pkgs.fetchFromGitHub { - owner = "jdtsmith"; - repo = "eglot-booster"; - rev = "e19dd7ea81bada84c66e8bdd121408d9c0761fe6"; - hash = "sha256-vF34ZoUUj8RENyH9OeKGSPk34G6KXZhEZozQKEcRNhs="; + src = pkgs.fetchFromGitHub { + owner = "jdtsmith"; + repo = "eglot-booster"; + rev = "e19dd7ea81bada84c66e8bdd121408d9c0761fe6"; + hash = "sha256-vF34ZoUUj8RENyH9OeKGSPk34G6KXZhEZozQKEcRNhs="; + }; + }; + app-launcher = epkgs.melpaBuild { + pname = "app-launcher"; + version = "1.0"; + + commit = "d5015e394b0a666a8c7c4d4bdf786266e773b145"; + + recipe = pkgs.writeText "recipe" '' + (app-launcher :repo "SebastienWae/app-launcher" :fetcher github) + ''; + + src = pkgs.fetchFromGitHub { + owner = "SebastienWae"; + repo = "app-launcher"; + rev = "d5015e394b0a666a8c7c4d4bdf786266e773b145"; + hash = "sha256-d0d5rkuxK/zKpSCa1UTdpV7o+RDDsEeab56rI7xUJ1E="; + }; + }; }; - }; - app-launcher = epkgs.melpaBuild { - pname = "app-launcher"; - version = "1.0"; - - - commit = "d5015e394b0a666a8c7c4d4bdf786266e773b145"; - - recipe = pkgs.writeText "recipe" '' - (app-launcher :repo "SebastienWae/app-launcher" :fetcher github) - ''; - - src = pkgs.fetchFromGitHub { - owner = "SebastienWae"; - repo = "app-launcher"; - rev = "d5015e394b0a666a8c7c4d4bdf786266e773b145"; - hash = "sha256-d0d5rkuxK/zKpSCa1UTdpV7o+RDDsEeab56rI7xUJ1E="; - }; - }; - }; # override for modules -# override = epkgs: epkgs // { -# sakomodules = epkgs.trivialBuild { -# pname = "sakomodules"; -# version = "lol"; + # override = epkgs: epkgs // { + # sakomodules = epkgs.trivialBuild { + # pname = "sakomodules"; + # version = "lol"; -# src = ../../../../config/emacs/modules; + # src = ../../../../config/emacs/modules; -# }; -# }; + # }; + # }; }; in { options.modules.dev.editors.emacs = { @@ -89,9 +80,7 @@ in { }; config = lib.mkIf cfg.enable { - nixpkgs.overlays = [ - inputs.emacs-overlay.overlay - ]; + nixpkgs.overlays = [ inputs.emacs-overlay.overlay ]; # ues daemon services.emacs = { enable = cfg.daemon; @@ -128,6 +117,8 @@ in { zenity # org-wild-notifier libnotify + # wakatime-mode + wakatime-cli ]; systemd.services.hydroxide = { @@ -149,9 +140,9 @@ in { # }; # }; - home-manager.users.sako = {lib, ...}: { + home-manager.users.sako = { lib, ... }: { home.file = { - ".emacs.d/init.el".source = pkgs.runCommand "init.el" {} '' + ".emacs.d/init.el".source = pkgs.runCommand "init.el" { } '' cp ${../../../../config/emacs/emacs.org} emacs.org ${myEmacs}/bin/emacs -Q --batch ./emacs.org -f org-babel-tangle mv init.el $out @@ -164,7 +155,7 @@ in { }; fonts.packages = with pkgs; [ - (nerdfonts.override {fonts = ["JetBrainsMono"];}) + (nerdfonts.override { fonts = [ "JetBrainsMono" ]; }) jetbrains-mono ]; }; From acd0b68e00c8095f05a003ccf7af4c64000c6c05 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Mon, 30 Sep 2024 15:56:33 +0400 Subject: [PATCH 129/319] media/ardour: add surge-XT --- modules/desktop/media/ardour/default.nix | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/modules/desktop/media/ardour/default.nix b/modules/desktop/media/ardour/default.nix index f47b9069..aad58008 100644 --- a/modules/desktop/media/ardour/default.nix +++ b/modules/desktop/media/ardour/default.nix @@ -1,15 +1,9 @@ -{ outputs, options, config, lib, pkgs, ...}: -let - cfg = config.modules.desktop.media.ardour; -in -{ - options.modules.desktop.media.ardour = { - enable = lib.mkEnableOption false; - }; +{ outputs, options, config, lib, pkgs, ... }: +let cfg = config.modules.desktop.media.ardour; +in { + options.modules.desktop.media.ardour = { enable = lib.mkEnableOption false; }; config = lib.mkIf cfg.enable { - users.users.sako.packages = with pkgs; [ - ardour - ]; + users.users.sako.packages = with pkgs; [ ardour surge-XT ]; }; } From 7fb669488b993227b70f950be2ecc4c03d3a335c Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Mon, 30 Sep 2024 15:58:56 +0400 Subject: [PATCH 130/319] Revert "media/ardour: add surge-XT" This reverts commit acd0b68e00c8095f05a003ccf7af4c64000c6c05. --- modules/desktop/media/ardour/default.nix | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/modules/desktop/media/ardour/default.nix b/modules/desktop/media/ardour/default.nix index aad58008..f47b9069 100644 --- a/modules/desktop/media/ardour/default.nix +++ b/modules/desktop/media/ardour/default.nix @@ -1,9 +1,15 @@ -{ outputs, options, config, lib, pkgs, ... }: -let cfg = config.modules.desktop.media.ardour; -in { - options.modules.desktop.media.ardour = { enable = lib.mkEnableOption false; }; +{ outputs, options, config, lib, pkgs, ...}: +let + cfg = config.modules.desktop.media.ardour; +in +{ + options.modules.desktop.media.ardour = { + enable = lib.mkEnableOption false; + }; config = lib.mkIf cfg.enable { - users.users.sako.packages = with pkgs; [ ardour surge-XT ]; + users.users.sako.packages = with pkgs; [ + ardour + ]; }; } From e770d038fbbc255ad40e09a7dd02c508284efe19 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Mon, 30 Sep 2024 20:58:35 +0400 Subject: [PATCH 131/319] config/emacs: add stmpmail and xoauth auth source --- config/emacs/emacs.org | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index e1070dd8..e37378e7 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1165,6 +1165,10 @@ its over the machines took over guys can i get my likes now ** mu4e GNU patch review metho dor sometihng idk #+begin_src emacs-lisp + + (use-package stmpmail) + (use-package auth-source-xoauth2) + (use-package mu4e :config From a8e92b98cecc32330767ad344980a78755e7d9ff Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Mon, 30 Sep 2024 21:24:56 +0400 Subject: [PATCH 132/319] config/emacs: add xoauth2 to smtp-mail-supported --- config/emacs/emacs.org | 1 + 1 file changed, 1 insertion(+) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index e37378e7..efcff5d4 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1177,6 +1177,7 @@ GNU patch review metho dor sometihng idk ;; sending mail (setq message-send-mail-function 'smtpmail-send-it) + (add-to-list 'smtpmail-auth-supported 'xoauth2) (setq mu4e-update-interval (* 10 60)) (setq mu4e-get-mail-command "offlineimap") From 9ec8e5c8bbba9ad060d1d5bbf94fc76a0c508133 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 1 Oct 2024 08:04:11 +0400 Subject: [PATCH 133/319] config/emacs: remove use package for stmpmail --- config/emacs/emacs.org | 2 -- 1 file changed, 2 deletions(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index efcff5d4..ec14e282 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1166,9 +1166,7 @@ its over the machines took over guys can i get my likes now GNU patch review metho dor sometihng idk #+begin_src emacs-lisp - (use-package stmpmail) (use-package auth-source-xoauth2) - (use-package mu4e :config From fba57e8ad92b358e86f90ab761cef660f88b932f Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 1 Oct 2024 09:23:36 +0400 Subject: [PATCH 134/319] default.nix: move useless packages to somewhere else --- default.nix | 32 +++++++-------------------- modules/hardware/pipewire/default.nix | 17 +++++++------- 2 files changed, 16 insertions(+), 33 deletions(-) diff --git a/default.nix b/default.nix index fe6ddde4..ed8ce493 100644 --- a/default.nix +++ b/default.nix @@ -1,12 +1,4 @@ -{ - config, - inputs, - outputs, - pkgs, - lib, - home-manager, - ... -}: { +{ config, inputs, outputs, pkgs, lib, home-manager, ... }: { imports = [ # home manager inputs.home-manager.nixosModules.default @@ -27,7 +19,7 @@ # nix settings that should 100% be global #nix.settings.experimental-features = ["nix-command" "flakes"]; nix.settings = { - experimental-features = ["nix-command" "flakes"]; + experimental-features = [ "nix-command" "flakes" ]; substituters = [ # garnix "https://cache.garnix.io" @@ -66,7 +58,7 @@ efiSysMountPoint = "/boot/efi"; }; grub = { - devices = ["nodev"]; + devices = [ "nodev" ]; efiSupport = true; enable = true; useOSProber = true; @@ -98,13 +90,13 @@ users.users.sako = { isNormalUser = true; - extraGroups = ["wheel" "networkmanager" "audio"]; + extraGroups = [ "wheel" "networkmanager" "audio" ]; }; home-manager.useUserPackages = true; - home-manager.users.sako = {pkgs, ...}: { + home-manager.users.sako = { pkgs, ... }: { # CHANGE THIS WHEN THE SYSTEM VERSION CHANGES TOO!!! - home.packages = []; + home.packages = [ ]; home.username = "sako"; home.homeDirectory = "/home/sako"; programs.bash.enable = true; @@ -117,11 +109,7 @@ enable = true; userName = "Sakooooo"; userEmail = "78461130+Sakooooo@users.noreply.github.com"; - includes = [ - { - path = "~/.config/git/config.local"; - } - ]; + includes = [{ path = "~/.config/git/config.local"; }]; extraConfig = { color.ui = "auto"; init.defaultBranch = "master"; @@ -133,12 +121,8 @@ # bare minimum environment.systemPackages = with pkgs; [ vim # backup - wget #double u get + wget # double u get killall # die processes - alsa-utils # unsupported application - pulseaudio # unsupported application - pamixer # unsupported application - feh # im different unzip # zip file gh # github htop # htop diff --git a/modules/hardware/pipewire/default.nix b/modules/hardware/pipewire/default.nix index ce680e42..24c3f47d 100644 --- a/modules/hardware/pipewire/default.nix +++ b/modules/hardware/pipewire/default.nix @@ -1,11 +1,7 @@ -{ outputs, options, config, lib, pkgs, ...}: -let - cfg = config.modules.hardware.pipewire; -in -{ - options.modules.hardware.pipewire = { - enable = lib.mkEnableOption false; - }; +{ outputs, options, config, lib, pkgs, ... }: +let cfg = config.modules.hardware.pipewire; +in { + options.modules.hardware.pipewire = { enable = lib.mkEnableOption false; }; config = lib.mkIf cfg.enable { # resolve racial conflict between @@ -26,7 +22,10 @@ in jack.enable = true; pulse.enable = true; }; - + + # unsupported apps that use these + environment.systemPackages = with pkgs; [ pulseaudio alsa-utils pamixer ]; + }; } From 92bb854c9e0f2e5042c29d2f61741f9db596834b Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 1 Oct 2024 09:42:46 +0400 Subject: [PATCH 135/319] default.nix: remove comments about stateversion --- default.nix | 5 ----- 1 file changed, 5 deletions(-) diff --git a/default.nix b/default.nix index ed8ce493..473d7a9e 100644 --- a/default.nix +++ b/default.nix @@ -95,7 +95,6 @@ home-manager.useUserPackages = true; home-manager.users.sako = { pkgs, ... }: { - # CHANGE THIS WHEN THE SYSTEM VERSION CHANGES TOO!!! home.packages = [ ]; home.username = "sako"; home.homeDirectory = "/home/sako"; @@ -146,8 +145,4 @@ # package = pkgs.gitFull; # }; - # read stable version patch notes and fix any issues - # then you can change this - #system.stateVersion = "23.05"; - # read comment you read the comment? } From da6c28e055eb78ec2b7bd8689c38b5020873ec18 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 1 Oct 2024 09:46:18 +0400 Subject: [PATCH 136/319] server: add sakotop key --- modules/server/default.nix | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/modules/server/default.nix b/modules/server/default.nix index 76a2a9f7..d82cf401 100644 --- a/modules/server/default.nix +++ b/modules/server/default.nix @@ -1,17 +1,10 @@ -{ - config, - lib, - ... -}: -with lib; let - cfg = config.modules.server; +{ config, lib, ... }: +with lib; +let cfg = config.modules.server; in { - imports = [ - ]; + imports = [ ]; - options.modules.server = { - isServer = mkEnableOption false; - }; + options.modules.server = { isServer = mkEnableOption false; }; config = mkIf cfg.isServer { # we need this if you say otherwise ill throw you @@ -23,11 +16,13 @@ in { PermitRootLogin = "no"; # its so easy to use keys your grandmother could use it PasswordAuthentication = false; - ports = [ - 69 - ]; + ports = [ 69 ]; openFirewall = true; }; }; + + users.users.sako.openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPGAwG2Fqs3xNF/6/9GdznH/jUIqxW3aTYvmteuq9odZ sako@sakotop" + ]; }; } From fd505af57eff33d71dcb5440b7c0ae1ea80ea1a5 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 2 Oct 2024 11:33:29 +0400 Subject: [PATCH 137/319] flake.nix: add agenix --- flake.nix | 134 +++++++++++++++++++++++++----------------------------- 1 file changed, 61 insertions(+), 73 deletions(-) diff --git a/flake.nix b/flake.nix index 0fb426e7..0ff44d19 100644 --- a/flake.nix +++ b/flake.nix @@ -3,8 +3,10 @@ description = "Sako's NixOS Configuration"; inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; # nixpkgs unstable branch - nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-24.05"; # nixpkgs stable branch because some things break + nixpkgs.url = + "github:NixOS/nixpkgs/nixos-unstable"; # nixpkgs unstable branch + nixpkgs-stable.url = + "github:nixos/nixpkgs/nixos-24.05"; # nixpkgs stable branch because some things break home-manager = { # this manages your dotfiles for the most part url = "github:nix-community/home-manager"; @@ -20,8 +22,10 @@ url = "github:Mic92/sops-nix"; inputs.nixpkgs.follows = "nixpkgs"; }; + agenix.url = "github:ryantm/agenix"; emacs-overlay = { - url = "github:nix-community/emacs-overlay/0442d57ffa83985ec2ffaec95db9c0fe742f5182"; + url = + "github:nix-community/emacs-overlay/0442d57ffa83985ec2ffaec95db9c0fe742f5182"; }; ags = { url = "github:Aylur/ags"; @@ -31,79 +35,63 @@ hyprpaper.url = "github:hyprwm/hyprpaper"; }; - outputs = { - self, - nixpkgs, - home-manager, - NixOS-WSL, - sops-nix, - emacs-overlay, - hyprland, - hyprpaper, - ags, - ... - } @ inputs: let - inherit (self) outputs; - forAllSystems = nixpkgs.lib.genAttrs [ - "x86_64-linux" - ]; - in rec { - # custom packages - packages = forAllSystems ( - system: let - pkgs = nixpkgs.legacyPackages.${system}; - in - import ./packages {inherit pkgs;} - ); - # dev shell for bootstrap - devShells = forAllSystems ( - system: let - pkgs = nixpkgs.legacyPackages.${system}; - in - import ./shell.nix {inherit pkgs;} - ); + outputs = { self, nixpkgs, home-manager, NixOS-WSL, sops-nix, agenix + , emacs-overlay, hyprland, hyprpaper, ags, ... }@inputs: + let + inherit (self) outputs; + forAllSystems = nixpkgs.lib.genAttrs [ "x86_64-linux" ]; + in rec { + # custom packages + packages = forAllSystems (system: + let pkgs = nixpkgs.legacyPackages.${system}; + in import ./packages { inherit pkgs; }); + # dev shell for bootstrap + devShells = forAllSystems (system: + let pkgs = nixpkgs.legacyPackages.${system}; + in import ./shell.nix { inherit pkgs; }); - # overlays here - overlays = import ./overlays {inherit inputs;}; + # overlays here + overlays = import ./overlays { inherit inputs; }; - # modules :D - nixosModules = import ./modules; + # modules :D + nixosModules = import ./modules; - nixosConfigurations = { - sakotop = nixpkgs.lib.nixosSystem { - specialArgs = {inherit inputs outputs;}; - modules = [ - ./default.nix - ./hosts/sakotop/configuration.nix - sops-nix.nixosModules.sops - ]; - }; - sakopc = nixpkgs.lib.nixosSystem { - specialArgs = {inherit inputs outputs;}; - modules = [ - ./default.nix - ./hosts/sakopc/configuration.nix - sops-nix.nixosModules.sops - ]; - }; - #sakoserver = nixpkgs.lib.nixosSystem { - # specialArgs = {inherit inputs outputs;}; - # modules = [ - # ./default.nix - # ./hosts/sakoserver/configuration.nix - # ]; - #}; - sakowsl = nixpkgs.lib.nixosSystem { - # because theres no hardware-configuration.nix - system = "x86_64-linux"; - specialArgs = {inherit inputs outputs;}; - modules = [ - {nix.registry.nixpkgs.flake = nixpkgs;} - ./hosts/sakowsl/configuration.nix - NixOS-WSL.nixosModules.wsl - sops-nix.nixosModules.sops - ]; + nixosConfigurations = { + sakotop = nixpkgs.lib.nixosSystem { + specialArgs = { inherit inputs outputs; }; + modules = [ + ./default.nix + ./hosts/sakotop/configuration.nix + sops-nix.nixosModules.sops + agenix.nixosModules.default + ]; + }; + sakopc = nixpkgs.lib.nixosSystem { + specialArgs = { inherit inputs outputs; }; + modules = [ + ./default.nix + ./hosts/sakopc/configuration.nix + sops-nix.nixosModules.sops + ]; + }; + #sakoserver = nixpkgs.lib.nixosSystem { + # specialArgs = {inherit inputs outputs;}; + # modules = [ + # ./default.nix + # ./hosts/sakoserver/configuration.nix + # ]; + #}; + sakowsl = nixpkgs.lib.nixosSystem { + # because theres no hardware-configuration.nix + system = "x86_64-linux"; + specialArgs = { inherit inputs outputs; }; + modules = [ + { nix.registry.nixpkgs.flake = nixpkgs; } + ./hosts/sakowsl/configuration.nix + NixOS-WSL.nixosModules.wsl + sops-nix.nixosModules.sops + ]; + }; }; }; - }; } From daa3579fc4ca3722a9175b849f7dc4bbbc5a122b Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 2 Oct 2024 11:43:58 +0400 Subject: [PATCH 138/319] flake.lock: add agenix --- flake.lock | 130 ++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 113 insertions(+), 17 deletions(-) diff --git a/flake.lock b/flake.lock index b4358281..61cabe3f 100644 --- a/flake.lock +++ b/flake.lock @@ -22,12 +22,33 @@ "type": "github" } }, + "agenix": { + "inputs": { + "darwin": "darwin", + "home-manager": "home-manager", + "nixpkgs": "nixpkgs", + "systems": "systems_2" + }, + "locked": { + "lastModified": 1723293904, + "narHash": "sha256-b+uqzj+Wa6xgMS9aNbX4I+sXeb5biPDi39VgvSFqFvU=", + "owner": "ryantm", + "repo": "agenix", + "rev": "f6291c5935fdc4e0bef208cfc0dcab7e3f7a1c41", + "type": "github" + }, + "original": { + "owner": "ryantm", + "repo": "agenix", + "type": "github" + } + }, "ags": { "inputs": { "nixpkgs": [ "nixpkgs" ], - "systems": "systems_2" + "systems": "systems_3" }, "locked": { "lastModified": 1725841979, @@ -76,10 +97,32 @@ "type": "github" } }, + "darwin": { + "inputs": { + "nixpkgs": [ + "agenix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1700795494, + "narHash": "sha256-gzGLZSiOhf155FW7262kdHo2YDeugp3VuIFb4/GGng0=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "4b9b83d5a92e8c1fbfd8eb27eda375908c11ec4d", + "type": "github" + }, + "original": { + "owner": "lnl7", + "ref": "master", + "repo": "nix-darwin", + "type": "github" + } + }, "emacs-overlay": { "inputs": { "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs", + "nixpkgs": "nixpkgs_2", "nixpkgs-stable": "nixpkgs-stable" }, "locked": { @@ -133,7 +176,7 @@ }, "flake-utils_2": { "inputs": { - "systems": "systems_3" + "systems": "systems_4" }, "locked": { "lastModified": 1710146030, @@ -150,6 +193,27 @@ } }, "home-manager": { + "inputs": { + "nixpkgs": [ + "agenix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1703113217, + "narHash": "sha256-7ulcXOk63TIT2lVDSExj7XzFx09LpdSAPtvgtM7yQPE=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "3bfaacf46133c037bb356193bd2f1765d9dc82c1", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "home-manager_2": { "inputs": { "nixpkgs": [ "nixpkgs" @@ -205,8 +269,8 @@ "hyprlang": "hyprlang", "hyprutils": "hyprutils", "hyprwayland-scanner": "hyprwayland-scanner", - "nixpkgs": "nixpkgs_2", - "systems": "systems_4", + "nixpkgs": "nixpkgs_3", + "systems": "systems_5", "xdph": "xdph" }, "locked": { @@ -315,8 +379,8 @@ "hyprlang": "hyprlang_2", "hyprutils": "hyprutils_2", "hyprwayland-scanner": "hyprwayland-scanner_2", - "nixpkgs": "nixpkgs_3", - "systems": "systems_5" + "nixpkgs": "nixpkgs_4", + "systems": "systems_6" }, "locked": { "lastModified": 1725200438, @@ -434,11 +498,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1725432240, - "narHash": "sha256-+yj+xgsfZaErbfYM3T+QvEE2hU7UuE+Jf0fJCJ8uPS0=", + "lastModified": 1703013332, + "narHash": "sha256-+tFNwMvlXLbJZXiMHqYq77z/RfmpfpiI3yjL6o/Zo9M=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "ad416d066ca1222956472ab7d0555a6946746a80", + "rev": "54aac082a4d9bb5bbc5c4e899603abfb76a3f6d6", "type": "github" }, "original": { @@ -497,6 +561,22 @@ } }, "nixpkgs_2": { + "locked": { + "lastModified": 1725432240, + "narHash": "sha256-+yj+xgsfZaErbfYM3T+QvEE2hU7UuE+Jf0fJCJ8uPS0=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "ad416d066ca1222956472ab7d0555a6946746a80", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1726755586, "narHash": "sha256-PmUr/2GQGvFTIJ6/Tvsins7Q43KTMvMFhvG6oaYK+Wk=", @@ -512,7 +592,7 @@ "type": "github" } }, - "nixpkgs_3": { + "nixpkgs_4": { "locked": { "lastModified": 1725103162, "narHash": "sha256-Ym04C5+qovuQDYL/rKWSR+WESseQBbNAe5DsXNx5trY=", @@ -528,7 +608,7 @@ "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_5": { "locked": { "lastModified": 1726937504, "narHash": "sha256-bvGoiQBvponpZh8ClUcmJ6QnsNKw0EMrCQJARK3bI1c=", @@ -547,12 +627,13 @@ "root": { "inputs": { "NixOS-WSL": "NixOS-WSL", + "agenix": "agenix", "ags": "ags", "emacs-overlay": "emacs-overlay", - "home-manager": "home-manager", + "home-manager": "home-manager_2", "hyprland": "hyprland", "hyprpaper": "hyprpaper", - "nixpkgs": "nixpkgs_4", + "nixpkgs": "nixpkgs_5", "nixpkgs-stable": "nixpkgs-stable_2", "sops-nix": "sops-nix" } @@ -594,6 +675,21 @@ } }, "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_3": { "locked": { "lastModified": 1689347949, "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", @@ -608,7 +704,7 @@ "type": "github" } }, - "systems_3": { + "systems_4": { "locked": { "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", @@ -623,7 +719,7 @@ "type": "github" } }, - "systems_4": { + "systems_5": { "locked": { "lastModified": 1689347949, "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", @@ -638,7 +734,7 @@ "type": "github" } }, - "systems_5": { + "systems_6": { "locked": { "lastModified": 1689347949, "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", From 15169189d80c72ff45a702dc68f2c9ea4d5d2570 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 2 Oct 2024 11:44:04 +0400 Subject: [PATCH 139/319] config/nvim: add wakatime --- config/nvim/lua/core/plugins.lua | 62 ++++++++++++++++---------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/config/nvim/lua/core/plugins.lua b/config/nvim/lua/core/plugins.lua index 97849178..520363c6 100644 --- a/config/nvim/lua/core/plugins.lua +++ b/config/nvim/lua/core/plugins.lua @@ -22,7 +22,7 @@ local plugins = { -- colorscheme -- { "bluz71/vim-moonfly-colors", name = "moonfly", lazy = false, priority = 1000 }, - "savq/melange-nvim", + "savq/melange-nvim", -- default bar only looks good on linux "nvim-lualine/lualine.nvim", @@ -32,24 +32,24 @@ local plugins = { "windwp/nvim-ts-autotag", -- org mode -{ - 'nvim-orgmode/orgmode', - event = 'VeryLazy', - config = function() - -- Setup orgmode - require('orgmode').setup({ - org_agenda_files = '~/orgfiles/**/*', - org_default_notes_file = '~/orgfiles/refile.org', - }) + { + "nvim-orgmode/orgmode", + event = "VeryLazy", + config = function() + -- Setup orgmode + require("orgmode").setup({ + org_agenda_files = "~/orgfiles/**/*", + org_default_notes_file = "~/orgfiles/refile.org", + }) - -- NOTE: If you are using nvim-treesitter with `ensure_installed = "all"` option - -- add `org` to ignore_install - -- require('nvim-treesitter.configs').setup({ - -- ensure_installed = 'all', - -- ignore_install = { 'org' }, - -- }) - end, -}, + -- NOTE: If you are using nvim-treesitter with `ensure_installed = "all"` option + -- add `org` to ignore_install + -- require('nvim-treesitter.configs').setup({ + -- ensure_installed = 'all', + -- ignore_install = { 'org' }, + -- }) + end, + }, -- like fzf but goofier { @@ -116,20 +116,20 @@ local plugins = { -- floating terminal, useful to mimic/be better than vscode "voldikss/vim-floaterm", - -- git client - { - "NeogitOrg/neogit", - dependencies = { - "nvim-lua/plenary.nvim", -- required - "sindrets/diffview.nvim", -- optional - Diff integration - - -- Only one of these is needed, not both. - "nvim-telescope/telescope.nvim", -- optional - "ibhagwan/fzf-lua", -- optional - }, - config = true - }, + -- git client + { + "NeogitOrg/neogit", + dependencies = { + "nvim-lua/plenary.nvim", -- required + "sindrets/diffview.nvim", -- optional - Diff integration + -- Only one of these is needed, not both. + "nvim-telescope/telescope.nvim", -- optional + "ibhagwan/fzf-lua", -- optional + }, + config = true, + }, + { "wakatime/vim-wakatime", lazy = false }, } require("lazy").setup(plugins, {}) From 439002e8f5ab8ee55607804de9d5ed63a9a3cf44 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 2 Oct 2024 11:56:18 +0400 Subject: [PATCH 140/319] config/nvim: barebones --- config/nvim/init.lua | 2 +- config/nvim/lua/core/plugins.lua | 110 ------------------------------- 2 files changed, 1 insertion(+), 111 deletions(-) diff --git a/config/nvim/init.lua b/config/nvim/init.lua index 819f7ab2..15efce21 100644 --- a/config/nvim/init.lua +++ b/config/nvim/init.lua @@ -1,3 +1,3 @@ require("core.keymaps") require("core.plugins") -require("core.plugin_config") +-- require("core.plugin_config") diff --git a/config/nvim/lua/core/plugins.lua b/config/nvim/lua/core/plugins.lua index 520363c6..035425f3 100644 --- a/config/nvim/lua/core/plugins.lua +++ b/config/nvim/lua/core/plugins.lua @@ -15,120 +15,10 @@ vim.opt.rtp:prepend(lazypath) vim.g.mapleader = " " local plugins = { - - -- whats an ide without a file explorer - "nvim-tree/nvim-tree.lua", - "nvim-tree/nvim-web-devicons", - - -- colorscheme - -- { "bluz71/vim-moonfly-colors", name = "moonfly", lazy = false, priority = 1000 }, - "savq/melange-nvim", - - -- default bar only looks good on linux - "nvim-lualine/lualine.nvim", - -- syntax highlighting apparently "nvim-treesitter/nvim-treesitter", "windwp/nvim-ts-autotag", - -- org mode - { - "nvim-orgmode/orgmode", - event = "VeryLazy", - config = function() - -- Setup orgmode - require("orgmode").setup({ - org_agenda_files = "~/orgfiles/**/*", - org_default_notes_file = "~/orgfiles/refile.org", - }) - - -- NOTE: If you are using nvim-treesitter with `ensure_installed = "all"` option - -- add `org` to ignore_install - -- require('nvim-treesitter.configs').setup({ - -- ensure_installed = 'all', - -- ignore_install = { 'org' }, - -- }) - end, - }, - - -- like fzf but goofier - { - "nvim-telescope/telescope.nvim", - version = "0.1.1", - dependencies = { { "nvim-lua/plenary.nvim" } }, - }, - -- lsp stuff - { - "williamboman/mason.nvim", - "williamboman/mason-lspconfig.nvim", - "neovim/nvim-lspconfig", - }, - - -- completion - "hrsh7th/nvim-cmp", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-path", - "hrsh7th/cmp-nvim-lsp", - "onsails/lspkind.nvim", - - -- snippet - "L3MON4D3/LuaSnip", - "saadparwaiz1/cmp_luasnip", - - -- auto close to prevent carpal tunnel : - "windwp/nvim-autopairs", - - -- git stuff lol - "lewis6991/gitsigns.nvim", - - -- flex - "andweeb/presence.nvim", - - -- color picker - "ziontee113/color-picker.nvim", - - -- startup - { - "glepnir/dashboard-nvim", - config = function() - require("dashboard").setup({ - theme = "doom", -- theme is doom and hyper default is hyper - config = { - -- todo https://github.com/nvimdev/dashboard-nvim - center = { - { - icon = " ", - icon_hl = "Title", - desc = "Find File ", - desc_hl = "String", - keymap = "SPC SPC", - key_hl = "Number", - action = "lua print(2)", - }, - }, - }, - }) - end, - event = "VimEnter", - dependencies = { { "nvim-tree/nvim-web-devicons" } }, - }, - - -- floating terminal, useful to mimic/be better than vscode - "voldikss/vim-floaterm", - - -- git client - { - "NeogitOrg/neogit", - dependencies = { - "nvim-lua/plenary.nvim", -- required - "sindrets/diffview.nvim", -- optional - Diff integration - - -- Only one of these is needed, not both. - "nvim-telescope/telescope.nvim", -- optional - "ibhagwan/fzf-lua", -- optional - }, - config = true, - }, { "wakatime/vim-wakatime", lazy = false }, } From 64d3295b78df52831f5537e7687d39f814678104 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 2 Oct 2024 12:35:57 +0400 Subject: [PATCH 141/319] flake.nix: remove agenix module import --- flake.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/flake.nix b/flake.nix index 0ff44d19..d5c51b6f 100644 --- a/flake.nix +++ b/flake.nix @@ -63,7 +63,6 @@ ./default.nix ./hosts/sakotop/configuration.nix sops-nix.nixosModules.sops - agenix.nixosModules.default ]; }; sakopc = nixpkgs.lib.nixosSystem { From 51582459ddbc850b9e63282c456305aca8e68005 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 2 Oct 2024 12:36:08 +0400 Subject: [PATCH 142/319] default.nix: import agenix --- default.nix | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/default.nix b/default.nix index 473d7a9e..a6fadd13 100644 --- a/default.nix +++ b/default.nix @@ -2,6 +2,7 @@ imports = [ # home manager inputs.home-manager.nixosModules.default + inputs.agenix.nixosModules.default # TODO:: GET RID OF THIS PLEASE # my modules modules # import for each folder @@ -118,16 +119,19 @@ }; # bare minimum - environment.systemPackages = with pkgs; [ - vim # backup - wget # double u get - killall # die processes - unzip # zip file - gh # github - htop # htop - tree # trees - ripgrep # better grep may help later - ]; + environment.systemPackages = with pkgs; + let forAllSsytems = lib.genAttrs [ "x86_64-linux" ]; + in [ + vim # backup + wget # double u get + killall # die processes + unzip # zip file + gh # github + htop # htop + tree # trees + ripgrep # better grep may help later + (forAllSystems (system: inputs.agenix.pacakges.${system}.default)) + ]; # you phisiclally cannot live without this # litearlly! ! ! ! ! ! programs.gnupg.agent = { From bff18504c320b474c56c9576cbe49bb4d9c92933 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 2 Oct 2024 12:37:42 +0400 Subject: [PATCH 143/319] default.nix: try adding agenix package --- default.nix | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/default.nix b/default.nix index a6fadd13..0d3e954f 100644 --- a/default.nix +++ b/default.nix @@ -119,19 +119,17 @@ }; # bare minimum - environment.systemPackages = with pkgs; - let forAllSsytems = lib.genAttrs [ "x86_64-linux" ]; - in [ - vim # backup - wget # double u get - killall # die processes - unzip # zip file - gh # github - htop # htop - tree # trees - ripgrep # better grep may help later - (forAllSystems (system: inputs.agenix.pacakges.${system}.default)) - ]; + environment.systemPackages = with pkgs; [ + vim # backup + wget # double u get + killall # die processes + unzip # zip file + gh # github + htop # htop + tree # trees + ripgrep # better grep may help later + inputs.agenix.packages.${system}.default + ]; # you phisiclally cannot live without this # litearlly! ! ! ! ! ! programs.gnupg.agent = { From 252992006ebcec3fe3d8e2fdd3bcb4424c2fe35e Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 2 Oct 2024 13:35:41 +0400 Subject: [PATCH 144/319] secrets: init secrets.nix file --- secrets/secrets.nix | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 secrets/secrets.nix diff --git a/secrets/secrets.nix b/secrets/secrets.nix new file mode 100644 index 00000000..20b3014b --- /dev/null +++ b/secrets/secrets.nix @@ -0,0 +1,9 @@ +let + sakotop = + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPGAwG2Fqs3xNF/6/9GdznH/jUIqxW3aTYvmteuq9odZ sako@sakotop"; + sakopc = + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDjPSt4TykAJgafU9Trk7sr9wzXhBZxawDIZir0CPyDN"; + + shared = [ sakotop sakopc ]; + +in { "test.age".publicKeys = shared; } From fa4606962c006494a8b5811983799dad4295f690 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 2 Oct 2024 13:36:02 +0400 Subject: [PATCH 145/319] secrets: add test secret --- secrets/test.age | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 secrets/test.age diff --git a/secrets/test.age b/secrets/test.age new file mode 100644 index 00000000..f1ab472c --- /dev/null +++ b/secrets/test.age @@ -0,0 +1,7 @@ +age-encryption.org/v1 +-> ssh-ed25519 Xmgz9A 9ejB46oRgGJTct3BwUlAZTQzEd+3ZulZxDZAWg424E8 +Mtn62GufHXmAfLj5j1ptSOniFJNKViKVJAFiZ/Txc78 +-> ssh-ed25519 g3PCMA AfGjNc/HXChIhQV9zIpnfCoTroJE9PaC58eCcPRJay8 +43cCyf5HtPCIyyYw5gx6VZhNdXkEtfcSUdn92x/UfOc +--- d1C03NmhTW2lF7F6YjAmW50J4G1YVhEWOJmwR1slfXQ +yǸ]C6 WCL?'̀1L2 \ No newline at end of file From 865240b9485a84cdece4ce4584d9a32faca35099 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 2 Oct 2024 13:36:44 +0400 Subject: [PATCH 146/319] hosts/sakotop: agenix test --- hosts/sakotop/configuration.nix | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/hosts/sakotop/configuration.nix b/hosts/sakotop/configuration.nix index 771b4849..bec53f43 100644 --- a/hosts/sakotop/configuration.nix +++ b/hosts/sakotop/configuration.nix @@ -1,13 +1,6 @@ # Edit this configuration file to define what should be installed on # your system. Help is available in the configuration.nix(5) man page and in the NixOS manual (accessible by running `nixos-help`). -{ - config, - pkgs, - lib, - inputs, - outputs, - ... -}: { +{ config, pkgs, lib, inputs, outputs, ... }: { imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix @@ -75,9 +68,7 @@ mpv.enable = true; jellyfin.enable = true; }; - security = { - wireshark.enable = true; - }; + security = { wireshark.enable = true; }; }; hardware = { nvidia = { @@ -141,24 +132,21 @@ sops.enable = true; certs.enable = true; }; - virtualization = { - waydroid.enable = true; - }; + virtualization = { waydroid.enable = true; }; }; # Enable CUPS to print documents. # services.printing.enable = true; - services.xserver.videoDrivers = ["nvidia"]; + services.xserver.videoDrivers = [ "nvidia" ]; # homelab sops = { # we need to setup wireguard with this soon - age.sshKeyPaths = ["/home/sako/.ssh/id_ed25519"]; + age.sshKeyPaths = [ "/home/sako/.ssh/id_ed25519" ]; }; - networking.wireguard.interfaces = { - }; + networking.wireguard.interfaces = { }; services.logind.extraConfig = '' # don’t shutdown when power button is short-pressed @@ -168,6 +156,8 @@ # set laptop dpi services.xserver.dpi = 100; + age.secrets.test.file = ../../secrets/test.age; + # Enable the OpenSSH daemon. # services.openssh.enable = true; From 08eb16ed77ad750d4b9e19cc99e6a39cd6dff6eb Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 2 Oct 2024 13:38:53 +0400 Subject: [PATCH 147/319] hosts/sakotop: agenix test 2 --- hosts/sakotop/configuration.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hosts/sakotop/configuration.nix b/hosts/sakotop/configuration.nix index bec53f43..eb83a967 100644 --- a/hosts/sakotop/configuration.nix +++ b/hosts/sakotop/configuration.nix @@ -156,6 +156,8 @@ # set laptop dpi services.xserver.dpi = 100; + age.identityPaths = [ "/home/sako/.ssh/id_ed25519" ]; + age.secrets.test.file = ../../secrets/test.age; # Enable the OpenSSH daemon. From 4ca5b8a47b15578cdbe135f7223526a1cd91b28b Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 2 Oct 2024 13:41:26 +0400 Subject: [PATCH 148/319] default.nix: change agenix secretsMountPoint to /run/secrets for consistency or whatever they call it --- default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/default.nix b/default.nix index 0d3e954f..86fb5c33 100644 --- a/default.nix +++ b/default.nix @@ -130,6 +130,9 @@ ripgrep # better grep may help later inputs.agenix.packages.${system}.default ]; + + age.secretsMountPoint = "/run/secrets"; + # you phisiclally cannot live without this # litearlly! ! ! ! ! ! programs.gnupg.agent = { From de22ee1a677e0c805340b35585b43c02a0ec098e Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 2 Oct 2024 13:44:03 +0400 Subject: [PATCH 149/319] default.nix: im stupid --- default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/default.nix b/default.nix index 86fb5c33..07bfa2be 100644 --- a/default.nix +++ b/default.nix @@ -131,7 +131,7 @@ inputs.agenix.packages.${system}.default ]; - age.secretsMountPoint = "/run/secrets"; + age.secretsDir = "/run/secrets"; # you phisiclally cannot live without this # litearlly! ! ! ! ! ! From 644fd115e0269169ee4bfbdff71bc3e83c8b7ccb Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 2 Oct 2024 13:52:51 +0400 Subject: [PATCH 150/319] config/emacs: replace direnv with envrc --- config/emacs/emacs.org | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index ec14e282..827f92d9 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -890,9 +890,9 @@ this should be useful later ** Direnv #+begin_src emacs-lisp (when (eq system-type 'gnu/linux) - (use-package direnv - :config - (direnv-mode))) + (use-package envrc + :hook (after-init . global-envrc-mode) + )) #+end_src ** Color Picker #+begin_src emacs-lisp From 61e6471c67da0600ba77f3c337ac4ccdd69b2103 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 2 Oct 2024 16:56:02 +0400 Subject: [PATCH 151/319] secrets/secrets.nix: uhhh --- secrets/secrets.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/secrets/secrets.nix b/secrets/secrets.nix index 20b3014b..6e9e5a68 100644 --- a/secrets/secrets.nix +++ b/secrets/secrets.nix @@ -2,7 +2,7 @@ let sakotop = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPGAwG2Fqs3xNF/6/9GdznH/jUIqxW3aTYvmteuq9odZ sako@sakotop"; sakopc = - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDjPSt4TykAJgafU9Trk7sr9wzXhBZxawDIZir0CPyDN"; + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDjPSt4TykAJgafU9Trk7sr9wzXhBZxawDIZir0CPyDN sako@sakopc"; shared = [ sakotop sakopc ]; From 3e2ab3a3a0326596c611e9b3c6b6fb148e55f250 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 2 Oct 2024 16:57:09 +0400 Subject: [PATCH 152/319] hosts/sakopc: test agenix --- hosts/sakopc/configuration.nix | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/hosts/sakopc/configuration.nix b/hosts/sakopc/configuration.nix index 5438a124..69a9c2dc 100644 --- a/hosts/sakopc/configuration.nix +++ b/hosts/sakopc/configuration.nix @@ -1,10 +1,4 @@ -{ - config, pkgs, - lib, - inputs, - outputs, - ... -}: { +{ config, pkgs, lib, inputs, outputs, ... }: { imports = [ # Hardware Configuration # TODO:: Add this back once generated!!!!!!! @@ -123,9 +117,14 @@ # fuck you AOC # my monitor only works on 240hz now services.xserver.displayManager.setupCommands = '' - ${pkgs.xorg.xrandr}/bin/xrandr --output DP-0 --mode 1920x1080 --rate 239.96 --primary --output HDMI-0 --mode 1920x1080 --left-of DP-0 + ${pkgs.xorg.xrandr}/bin/xrandr --output DP-0 --mode 1920x1080 --rate 239.96 --primary --output HDMI-0 --mode 1920x1080 --left-of DP-0 ''; + # secrets + age.identityPaths = [ "/home/sako/.ssh/id_ed25519" ]; + + age.secrets.test.file = ../../secrets/test.age; + # lol services.xserver.dpi = 100; From db4b60e33b813b3f5cd56170a448325ee05d3028 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 2 Oct 2024 16:58:28 +0400 Subject: [PATCH 153/319] secrets/test.age: rekey --- secrets/test.age | Bin 332 -> 332 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/secrets/test.age b/secrets/test.age index f1ab472cda68fe0bb4987ddf40fed3da2c5ec732..4858f02ba524b274c4960702eaec01e79ce9a721 100644 GIT binary patch delta 297 zcmV+^0oMM^0?Y!CEPqi&P;xn0M{RUfPBn09Q7bDkL~2V}OH)T}bx%((c{N2!b#8cL zR#icIV+v+CY1~XPHHktWo}1qO?qiiLN`oxXIMo?VODZRZ8SwyO$seO zAaiqQEoEdfH8n9gAZIgBLrp;-W=&#jZBk`vSxrG|L{C~_SbtVyb~#fuWjJ(4bTKk& zQh97yQdDYTQ(|{b3T9b#dUr&3QddrAb5=5COjlG_G&XuMMn^O>Vl_cAc4bCYH*RNY zM`Sf?3N0-yAZ}u0Hf%9#M@3FdNp?y&O;U4ZSaoboG-`80Nn>p@GfqQsbW$&GFK#ha v3Mz>YL73N`5h4iZSg+bNZeq;%Tz0bv%WT<5F+G(`orcl!<0U1Fl>nnUJuGI3 delta 297 zcmV+^0oMM^0?Y!CEPpv=YC<$NZ&GJRN>pQXGeUP&Y(ZL7QF=vWD>GVkY+86kT0vK5 zG%_?rI0{X4ZZ Date: Wed, 2 Oct 2024 17:45:39 +0400 Subject: [PATCH 154/319] hosts/sakopc: enable nixd --- hosts/sakopc/configuration.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/hosts/sakopc/configuration.nix b/hosts/sakopc/configuration.nix index 69a9c2dc..aa195282 100644 --- a/hosts/sakopc/configuration.nix +++ b/hosts/sakopc/configuration.nix @@ -75,6 +75,7 @@ python.enable = true; rust.enable = true; nil.enable = true; + nixd.enable = true; }; hardware = { bluetooth.enable = false; From 10cf42414fe3d19931543c8c1a110fae59c3cd2e Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 2 Oct 2024 17:51:09 +0400 Subject: [PATCH 155/319] dev/nixd: we are on unstable now lmao --- modules/dev/nixd.nix | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/modules/dev/nixd.nix b/modules/dev/nixd.nix index 588bb679..f088cd65 100644 --- a/modules/dev/nixd.nix +++ b/modules/dev/nixd.nix @@ -1,27 +1,13 @@ # nixd nix lsp using nix and nixpkgs # where has this been my whole life -{ - outputs, - options, - config, - lib, - pkgs, - ... -}: -let - cfg = config.modules.dev.nixd; +{ outputs, options, config, lib, pkgs, ... }: +let cfg = config.modules.dev.nixd; in { - options.modules.dev.nixd = { - enable = lib.mkEnableOption false; - }; + options.modules.dev.nixd = { enable = lib.mkEnableOption false; }; # TODO(sako):: figure out how .nixd.json works config = lib.mkIf cfg.enable { - environment.systemPackages = with pkgs; [ - unstable.nixd - alejandra - nixfmt - ]; + environment.systemPackages = with pkgs; [ nixd alejandra nixfmt ]; }; } From 7c7523f44f80802be01c8b5670c48cdaa0b2d52e Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 2 Oct 2024 17:53:16 +0400 Subject: [PATCH 156/319] hosts/sakopc: disable nil --- hosts/sakopc/configuration.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/hosts/sakopc/configuration.nix b/hosts/sakopc/configuration.nix index aa195282..4c90dd03 100644 --- a/hosts/sakopc/configuration.nix +++ b/hosts/sakopc/configuration.nix @@ -74,7 +74,6 @@ lua.enable = true; python.enable = true; rust.enable = true; - nil.enable = true; nixd.enable = true; }; hardware = { From 41cd66e103904ecf3057d64269a2bff9f5bc356e Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 2 Oct 2024 21:35:09 +0400 Subject: [PATCH 157/319] trigger rebuild because ???? --- config/emacs/emacs.org | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 827f92d9..cd1659f2 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -6,9 +6,9 @@ #+end_src * Package Setup #+begin_src emacs-lisp - (message "Reached package setup") + (message "Reached package setup") - (require `package) + (require `package) (setq package-archives `(("mepla" . "https://melpa.org/packages/") ("org" . "https://orgmode.org/elpa/") From 69a5298c582859e34b9a8da2bd838202bd53df3c Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 2 Oct 2024 21:47:14 +0400 Subject: [PATCH 158/319] config/emacs: worlds biggest user issue yet --- config/emacs/emacs.org | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index cd1659f2..063fba06 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -891,8 +891,7 @@ this should be useful later #+begin_src emacs-lisp (when (eq system-type 'gnu/linux) (use-package envrc - :hook (after-init . global-envrc-mode) - )) + :hook (after-init . envrc-global-mode))) #+end_src ** Color Picker #+begin_src emacs-lisp From 407181a7abab801969e01a203ee410fd993caa99 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 2 Oct 2024 22:23:06 +0400 Subject: [PATCH 159/319] secrets: add bridges --- secrets/secrets.nix | 6 +++++- secrets/shared/bridges.age | Bin 0 -> 641 bytes 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 secrets/shared/bridges.age diff --git a/secrets/secrets.nix b/secrets/secrets.nix index 6e9e5a68..31dc7d76 100644 --- a/secrets/secrets.nix +++ b/secrets/secrets.nix @@ -6,4 +6,8 @@ let shared = [ sakotop sakopc ]; -in { "test.age".publicKeys = shared; } +in { + "test.age".publicKeys = shared; + + "shared/bridges.age".publicKeys = shared; +} diff --git a/secrets/shared/bridges.age b/secrets/shared/bridges.age new file mode 100644 index 0000000000000000000000000000000000000000..aa41a1be06fa7525202635efa96179d00a478f88 GIT binary patch literal 641 zcmV-{0)G8rXJsvAZewzJaCB*JZZ2K$HdNk-|je!wB!l+>qz3I~`DvyR(`ov9>||jo+DGZK0gtvCUtD==zt#-jOyQ z0m9ACYTVj~*dghI5b2NDuME9D#;lmdulOm|$f4%G9)4NJW^>P2So{INabN;o)IaxH z@g;j7zBa3xg}#=mKR7W<@41m0==G`}+5LiD>2Ta|#94dc4yk=@n$5OVGw1(~va>#D zI+?B%!9r&Lq~P<4r?GJ1(1|01DJFrc`5ka=)@)-(zUts+?@D_~iAf713aBlg7cHj| b{G1|UUva}vXiP#8ToQod_RM^uW{^x+ts@sL literal 0 HcmV?d00001 From c29e1a9ff7f742a1c911193756a790e3674cee82 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 2 Oct 2024 22:35:16 +0400 Subject: [PATCH 160/319] hosts/sakotop: enable nixd --- hosts/sakotop/configuration.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosts/sakotop/configuration.nix b/hosts/sakotop/configuration.nix index eb83a967..1374d7d6 100644 --- a/hosts/sakotop/configuration.nix +++ b/hosts/sakotop/configuration.nix @@ -92,7 +92,7 @@ package = pkgs.emacs-unstable-pgtk; }; }; - nil.enable = true; + nixd.enable = true; cc.enable = true; csharp.enable = true; javascript.enable = true; From 1a46c478f086be14d75d46c8476454727fbc4ad8 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Thu, 3 Oct 2024 06:32:46 +0400 Subject: [PATCH 161/319] its so over --- secrets/secrets.nix | 2 -- secrets/shared/bridges.age | Bin 641 -> 0 bytes 2 files changed, 2 deletions(-) delete mode 100644 secrets/shared/bridges.age diff --git a/secrets/secrets.nix b/secrets/secrets.nix index 31dc7d76..0a47467a 100644 --- a/secrets/secrets.nix +++ b/secrets/secrets.nix @@ -8,6 +8,4 @@ let in { "test.age".publicKeys = shared; - - "shared/bridges.age".publicKeys = shared; } diff --git a/secrets/shared/bridges.age b/secrets/shared/bridges.age deleted file mode 100644 index aa41a1be06fa7525202635efa96179d00a478f88..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 641 zcmV-{0)G8rXJsvAZewzJaCB*JZZ2K$HdNk-|je!wB!l+>qz3I~`DvyR(`ov9>||jo+DGZK0gtvCUtD==zt#-jOyQ z0m9ACYTVj~*dghI5b2NDuME9D#;lmdulOm|$f4%G9)4NJW^>P2So{INabN;o)IaxH z@g;j7zBa3xg}#=mKR7W<@41m0==G`}+5LiD>2Ta|#94dc4yk=@n$5OVGw1(~va>#D zI+?B%!9r&Lq~P<4r?GJ1(1|01DJFrc`5ka=)@)-(zUts+?@D_~iAf713aBlg7cHj| b{G1|UUva}vXiP#8ToQod_RM^uW{^x+ts@sL From 9d15cede38337fe5bb9f7ed40924abc1b7badd62 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Thu, 3 Oct 2024 06:39:30 +0400 Subject: [PATCH 162/319] secrets: remove sops-nix --- .sops.yaml | 9 --------- flake.nix | 22 ++++++++-------------- hosts/sakopc/configuration.nix | 11 +---------- hosts/sakotop/configuration.nix | 7 ------- modules/security/default.nix | 8 +------- modules/security/sops.nix | 21 --------------------- secrets/secrets.yaml | 24 ------------------------ 7 files changed, 10 insertions(+), 92 deletions(-) delete mode 100644 .sops.yaml delete mode 100644 modules/security/sops.nix delete mode 100644 secrets/secrets.yaml diff --git a/.sops.yaml b/.sops.yaml deleted file mode 100644 index 299465ad..00000000 --- a/.sops.yaml +++ /dev/null @@ -1,9 +0,0 @@ -keys: - - &sakopc age1ac355av79sshqqkarxdtfs975mvr5mteen4h4y73x2nyn43esyqq0dl7kx - - &sakotop age1nhj5fz9cakgd6rrkwpjkndra6fd4rqxgfvcrap5g0anwxgmh4yqspvf22y -creation_rules: - - path_regex: secrets/secrets.yaml$ - key_groups: - - age: - - *sakopc - - *sakotop diff --git a/flake.nix b/flake.nix index d5c51b6f..b4c9a898 100644 --- a/flake.nix +++ b/flake.nix @@ -22,7 +22,10 @@ url = "github:Mic92/sops-nix"; inputs.nixpkgs.follows = "nixpkgs"; }; - agenix.url = "github:ryantm/agenix"; + agenix = { + url = "github:ryantm/agenix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; emacs-overlay = { url = "github:nix-community/emacs-overlay/0442d57ffa83985ec2ffaec95db9c0fe742f5182"; @@ -35,8 +38,8 @@ hyprpaper.url = "github:hyprwm/hyprpaper"; }; - outputs = { self, nixpkgs, home-manager, NixOS-WSL, sops-nix, agenix - , emacs-overlay, hyprland, hyprpaper, ags, ... }@inputs: + outputs = { self, nixpkgs, home-manager, NixOS-WSL, agenix, emacs-overlay + , hyprland, hyprpaper, ags, ... }@inputs: let inherit (self) outputs; forAllSystems = nixpkgs.lib.genAttrs [ "x86_64-linux" ]; @@ -59,19 +62,11 @@ nixosConfigurations = { sakotop = nixpkgs.lib.nixosSystem { specialArgs = { inherit inputs outputs; }; - modules = [ - ./default.nix - ./hosts/sakotop/configuration.nix - sops-nix.nixosModules.sops - ]; + modules = [ ./default.nix ./hosts/sakotop/configuration.nix ]; }; sakopc = nixpkgs.lib.nixosSystem { specialArgs = { inherit inputs outputs; }; - modules = [ - ./default.nix - ./hosts/sakopc/configuration.nix - sops-nix.nixosModules.sops - ]; + modules = [ ./default.nix ./hosts/sakopc/configuration.nix ]; }; #sakoserver = nixpkgs.lib.nixosSystem { # specialArgs = {inherit inputs outputs;}; @@ -88,7 +83,6 @@ { nix.registry.nixpkgs.flake = nixpkgs; } ./hosts/sakowsl/configuration.nix NixOS-WSL.nixosModules.wsl - sops-nix.nixosModules.sops ]; }; }; diff --git a/hosts/sakopc/configuration.nix b/hosts/sakopc/configuration.nix index 4c90dd03..99e079e9 100644 --- a/hosts/sakopc/configuration.nix +++ b/hosts/sakopc/configuration.nix @@ -102,18 +102,9 @@ libreoffice.enable = true; onlyoffice.enable = true; }; - security = { - sops.enable = true; - certs.enable = true; - }; + security = { certs.enable = true; }; }; - # sops setup :D - sops.defaultSopsFile = ../../secrets/secrets.yaml; - sops.defaultSopsFormat = "yaml"; - # sops.age.keyFile = "/home/sako/.config/sops/age/keys.txt"; - sops.age.sshKeyPaths = [ "/home/sako/.ssh/id_ed25519" ]; - # fuck you AOC # my monitor only works on 240hz now services.xserver.displayManager.setupCommands = '' diff --git a/hosts/sakotop/configuration.nix b/hosts/sakotop/configuration.nix index 1374d7d6..415ba3d2 100644 --- a/hosts/sakotop/configuration.nix +++ b/hosts/sakotop/configuration.nix @@ -129,7 +129,6 @@ }; security = { age.enable = true; - sops.enable = true; certs.enable = true; }; virtualization = { waydroid.enable = true; }; @@ -140,12 +139,6 @@ services.xserver.videoDrivers = [ "nvidia" ]; - # homelab - sops = { - # we need to setup wireguard with this soon - age.sshKeyPaths = [ "/home/sako/.ssh/id_ed25519" ]; - }; - networking.wireguard.interfaces = { }; services.logind.extraConfig = '' diff --git a/modules/security/default.nix b/modules/security/default.nix index eab72ed0..b6aae161 100644 --- a/modules/security/default.nix +++ b/modules/security/default.nix @@ -1,7 +1 @@ -{ - imports = [ - ./age.nix - ./sops.nix - ./certs - ]; -} +{ imports = [ ./age.nix ./certs ]; } diff --git a/modules/security/sops.nix b/modules/security/sops.nix deleted file mode 100644 index 6d603871..00000000 --- a/modules/security/sops.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ - outputs, - options, - config, - lib, - pkgs, - ... -}: -let - cfg = config.modules.security.sops; -in { - options.modules.security.sops = { - enable = lib.mkEnableOption false; - }; - - config = lib.mkIf cfg.enable { - environment.systemPackages = with pkgs; [ - sops - ]; - }; -} diff --git a/secrets/secrets.yaml b/secrets/secrets.yaml deleted file mode 100644 index fc149b09..00000000 --- a/secrets/secrets.yaml +++ /dev/null @@ -1,24 +0,0 @@ -example-key: ENC[AES256_GCM,data:/2eUilw6CzurLubgHw==,iv:DADrdgODnHGTg3FeQ5oGbY8eshcB+8pvu3droFyRg8s=,tag:0weIsYrnwQucjyZcCq9gtA==,type:str] -service: - subdir: - mysecret: ENC[AES256_GCM,data:NqQzZA==,iv:Aigsln7uc6OoZLyGdDh/uDZEeRcjkpg+ej0R9/LrY8g=,tag:cNb9MUzwXFAUdhRod33XbA==,type:str] -sops: - kms: [] - gcp_kms: [] - azure_kv: [] - hc_vault: [] - age: - - recipient: age1ac355av79sshqqkarxdtfs975mvr5mteen4h4y73x2nyn43esyqq0dl7kx - enc: | - -----BEGIN AGE ENCRYPTED FILE----- - YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBuSGI2V2hsTVlYaUdTYVpJ - V0RBSHYySVhFNzVubTk4N1J4L1V6YnBiMUhFClVLVHBJak9qQ0NSTEdOekFJV1N5 - Wm5sNGJiSWs5UFNZbFhodlkyM2FIKzAKLS0tIHJGSk9HZzc1aTRUY2twby9YMUph - RGFlYzNOdEJ2Mm9sUDA3MHpObE45RW8KPeFz/bZQHoj1cX2i/+vpEq43/hI0V9OY - djc9lwEqbkk1RdFjllXs7K/XU1oPqw8DudpI9CItE8XY8bx6iwa4YQ== - -----END AGE ENCRYPTED FILE----- - lastmodified: "2024-09-28T19:30:08Z" - mac: ENC[AES256_GCM,data:uO/W5F16ISp/KTrvWsgASU2u+fI0bUp5dwWV9tq32yPdApGPLqZlZvrlspSJsOLDINEcIv3GGhHi2Mtp8N/PHNl1jGAIPxDZEv3wAhA3DSVPryEm5fR/Krlmh5cQLTeEjk8/EkG8pCniW5HX8IPE8AEwIxVOLaeJTdeTFeptfgM=,iv:z0dS46g0crXnJRWbfgux2are8Ag5p3vIhNKT2GWk8hQ=,tag:LKuNlo7YBfg9CtWFyyLhKw==,type:str] - pgp: [] - unencrypted_suffix: _unencrypted - version: 3.9.0 From 26e3021ed1ede155aa685e4052f8452f2c000f21 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Thu, 3 Oct 2024 06:39:55 +0400 Subject: [PATCH 163/319] flake.lock: agenix follows nixpkgs now --- flake.lock | 38 ++++++++++++-------------------------- 1 file changed, 12 insertions(+), 26 deletions(-) diff --git a/flake.lock b/flake.lock index 61cabe3f..2546adb2 100644 --- a/flake.lock +++ b/flake.lock @@ -26,7 +26,9 @@ "inputs": { "darwin": "darwin", "home-manager": "home-manager", - "nixpkgs": "nixpkgs", + "nixpkgs": [ + "nixpkgs" + ], "systems": "systems_2" }, "locked": { @@ -122,7 +124,7 @@ "emacs-overlay": { "inputs": { "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs", "nixpkgs-stable": "nixpkgs-stable" }, "locked": { @@ -269,7 +271,7 @@ "hyprlang": "hyprlang", "hyprutils": "hyprutils", "hyprwayland-scanner": "hyprwayland-scanner", - "nixpkgs": "nixpkgs_3", + "nixpkgs": "nixpkgs_2", "systems": "systems_5", "xdph": "xdph" }, @@ -379,7 +381,7 @@ "hyprlang": "hyprlang_2", "hyprutils": "hyprutils_2", "hyprwayland-scanner": "hyprwayland-scanner_2", - "nixpkgs": "nixpkgs_4", + "nixpkgs": "nixpkgs_3", "systems": "systems_6" }, "locked": { @@ -498,11 +500,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1703013332, - "narHash": "sha256-+tFNwMvlXLbJZXiMHqYq77z/RfmpfpiI3yjL6o/Zo9M=", + "lastModified": 1725432240, + "narHash": "sha256-+yj+xgsfZaErbfYM3T+QvEE2hU7UuE+Jf0fJCJ8uPS0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "54aac082a4d9bb5bbc5c4e899603abfb76a3f6d6", + "rev": "ad416d066ca1222956472ab7d0555a6946746a80", "type": "github" }, "original": { @@ -561,22 +563,6 @@ } }, "nixpkgs_2": { - "locked": { - "lastModified": 1725432240, - "narHash": "sha256-+yj+xgsfZaErbfYM3T+QvEE2hU7UuE+Jf0fJCJ8uPS0=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "ad416d066ca1222956472ab7d0555a6946746a80", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_3": { "locked": { "lastModified": 1726755586, "narHash": "sha256-PmUr/2GQGvFTIJ6/Tvsins7Q43KTMvMFhvG6oaYK+Wk=", @@ -592,7 +578,7 @@ "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_3": { "locked": { "lastModified": 1725103162, "narHash": "sha256-Ym04C5+qovuQDYL/rKWSR+WESseQBbNAe5DsXNx5trY=", @@ -608,7 +594,7 @@ "type": "github" } }, - "nixpkgs_5": { + "nixpkgs_4": { "locked": { "lastModified": 1726937504, "narHash": "sha256-bvGoiQBvponpZh8ClUcmJ6QnsNKw0EMrCQJARK3bI1c=", @@ -633,7 +619,7 @@ "home-manager": "home-manager_2", "hyprland": "hyprland", "hyprpaper": "hyprpaper", - "nixpkgs": "nixpkgs_5", + "nixpkgs": "nixpkgs_4", "nixpkgs-stable": "nixpkgs-stable_2", "sops-nix": "sops-nix" } From 7e182c1b0f19ca90c23c12a39689275274e9584b Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Thu, 3 Oct 2024 08:44:56 +0400 Subject: [PATCH 164/319] desktop/game: init osu --- modules/desktop/game/default.nix | 10 ++-------- modules/desktop/game/osu/default.nix | 9 +++++++++ 2 files changed, 11 insertions(+), 8 deletions(-) create mode 100644 modules/desktop/game/osu/default.nix diff --git a/modules/desktop/game/default.nix b/modules/desktop/game/default.nix index 152ba717..1a840186 100644 --- a/modules/desktop/game/default.nix +++ b/modules/desktop/game/default.nix @@ -1,10 +1,4 @@ { - imports = [ - ./steam - ./lutris - ./wine - ./grapejuice - ./tetrio - ./prismlauncher - ]; + imports = + [ ./steam ./lutris ./wine ./grapejuice ./tetrio ./prismlauncher ./osu ]; } diff --git a/modules/desktop/game/osu/default.nix b/modules/desktop/game/osu/default.nix new file mode 100644 index 00000000..11287ac8 --- /dev/null +++ b/modules/desktop/game/osu/default.nix @@ -0,0 +1,9 @@ +{ outputs, options, config, lib, pkgs, ... }: +let cfg = config.modules.desktop.game.osu; +in { + options.modules.desktop.game.osu = { enable = lib.mkEnableOption false; }; + + config = lib.mkIf cfg.enable { + users.users.sako.packages = with pkgs; [ osu-lazer-bin ]; + }; +} From 3599cbea549ef68874b40bd3d5a5a0e61809f33f Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Thu, 3 Oct 2024 08:45:21 +0400 Subject: [PATCH 165/319] sakotop: enable osu --- hosts/sakotop/configuration.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/hosts/sakotop/configuration.nix b/hosts/sakotop/configuration.nix index 415ba3d2..2a0789bd 100644 --- a/hosts/sakotop/configuration.nix +++ b/hosts/sakotop/configuration.nix @@ -57,6 +57,7 @@ lutris.enable = true; steam.enable = true; tetrio.enable = true; + osu.enable = true; prismlauncher.enable = true; }; media = { From 49af0a49f50a3b48ceaceddd6d90081534cde435 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Fri, 4 Oct 2024 09:55:05 +0400 Subject: [PATCH 166/319] bleh --- config/emacs/emacs.org | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 063fba06..b2a5d753 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1080,12 +1080,11 @@ does NOT WORK ON WINDOWS (unless (eq system-type 'windows-nt) (use-package telega)) #+end_src -** IRC -Will configure later +** rcirc (irc) #+begin_src emacs-lisp -(use-package rcirc) + (require 'rcirc) #+end_src -** RSS +** elfeed (rss) Will configure later, (use elfeed protocol ok ty) #+begin_src emacs-lisp (use-package elfeed From f4646c68b5517efe85edfcf1489b4250f59e985a Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Fri, 4 Oct 2024 13:57:42 +0400 Subject: [PATCH 167/319] flake.nix: unpin emacs-overlay --- flake.nix | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/flake.nix b/flake.nix index b4c9a898..0f8c01d3 100644 --- a/flake.nix +++ b/flake.nix @@ -26,10 +26,7 @@ url = "github:ryantm/agenix"; inputs.nixpkgs.follows = "nixpkgs"; }; - emacs-overlay = { - url = - "github:nix-community/emacs-overlay/0442d57ffa83985ec2ffaec95db9c0fe742f5182"; - }; + emacs-overlay = { url = "github:nix-community/emacs-overlay"; }; ags = { url = "github:Aylur/ags"; inputs.nixpkgs.follows = "nixpkgs"; From 5f7ffce674def98f77be681c591751a485787993 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Fri, 4 Oct 2024 13:58:09 +0400 Subject: [PATCH 168/319] flake.lock: update emacs-overlay --- flake.lock | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index 2546adb2..0b4df4c3 100644 --- a/flake.lock +++ b/flake.lock @@ -128,17 +128,16 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1725674458, - "narHash": "sha256-AeemHTjtU56bXUCXJ4CrEJmIOfXfALkIR8Ix+AVlclg=", + "lastModified": 1728033118, + "narHash": "sha256-9LuPO6FZTm//3GdyVIL/XDsflej7Y0/dmFfMiErkqqc=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "0442d57ffa83985ec2ffaec95db9c0fe742f5182", + "rev": "f5e7cbe08abc8c4fba75084efae5173540accb43", "type": "github" }, "original": { "owner": "nix-community", "repo": "emacs-overlay", - "rev": "0442d57ffa83985ec2ffaec95db9c0fe742f5182", "type": "github" } }, From 5b0474b815689ab4da6a381d265e1e33be23e42d Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Fri, 4 Oct 2024 21:06:11 +0400 Subject: [PATCH 169/319] config/emacs: setup irc and add elcord thingies --- config/emacs/emacs.org | 44 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 38 insertions(+), 6 deletions(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index b2a5d753..21490a00 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1068,11 +1068,13 @@ the feds are watching #+end_src ** Elcord (Discord rich precense) #+begin_src emacs-lisp -(use-package elcord - :init - (setq elcord-display-buffer-details nil) - (setq elcord-use-major-mode-as-main-icon t) - ) + (use-package elcord + :init + (setq elcord-display-buffer-details nil) + (setq elcord-use-major-mode-as-main-icon t) + (setq elcord-quiet t) + :config + (elcord-mode)) #+end_src ** Telegram does NOT WORK ON WINDOWS @@ -1080,9 +1082,39 @@ does NOT WORK ON WINDOWS (unless (eq system-type 'windows-nt) (use-package telega)) #+end_src -** rcirc (irc) +** rcirc (irc) #+begin_src emacs-lisp (require 'rcirc) + + + (defvar *rcirc-last-message-time* nil) + (defvar *rcirc-last-message-time-file* "~/.emacs.d/.rcirc-last-message-time") + (defvar *rcirc-last-message-time-initial* nil) + + + (setq rcirc-id-string "Emacs rcirc") + + (setq rcirc-server-alist `(("znc.sako.box" + :port 7000 + :encryption tls + :nick "sako@emacs/Libera" + :user-name "sako@emacs/Libera" + :password ,(concat "sako@emacs/Libera:" (password-store-get "SelfHosted/ZNC"))))) + + (defun rcirc-detach-buffer () + (interactive) + (let ((buffer (current-buffer))) + (when (and (rcirc-buffer-process) + (eq (process-status (rcirc-buffer-process)) 'open)) + (with-rcirc-server-buffer + (setq rcirc-buffer-alist + (rassq-delete-all buffer rcirc-buffer-alist))) + (rcirc-update-short-buffer-names) + (if (rcirc-channel-p rcirc-target) + (rcirc-send-string (rcirc-buffer-process) + (concat "DETACH " rcirc-target)))) + (setq rcirc-target nil) + (kill-buffer buffer))) #+end_src ** elfeed (rss) Will configure later, (use elfeed protocol ok ty) From 9e97e1880f03ffa15647b105c5f4440caba93076 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Fri, 4 Oct 2024 23:22:18 +0400 Subject: [PATCH 170/319] config/emacs: make this unix encoding instead --- config/emacs/emacs.org | 3088 ++++++++++++++++++++-------------------- 1 file changed, 1544 insertions(+), 1544 deletions(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 21490a00..d4f587a9 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1,1544 +1,1544 @@ -#+title: EMACS 2 -#+PROPERTY: header-args:emacs-lisp :tangle yes :tangle init.el -* Welcome! -#+begin_src emacs-lisp -;; -*- lexical-binding: t; -*- -#+end_src -* Package Setup -#+begin_src emacs-lisp - (message "Reached package setup") - - (require `package) - - (setq package-archives `(("mepla" . "https://melpa.org/packages/") - ("org" . "https://orgmode.org/elpa/") - ("elpa" . "https://elpa.gnu.org/packages/"))) - (package-initialize) - (unless (package-installed-p 'use-package) - (progn - (package-refresh-contents) - (package-install 'use-package))) - - (require 'use-package) - (setq use-package-always-ensure t) - - ;; TODO add better detection to this - (when (eq system-type 'windows-nt) - (message "setting up straight.el") - (defvar bootstrap-version) - (let ((bootstrap-file - (expand-file-name - "straight/repos/straight.el/bootstrap.el" - (or (bound-and-true-p straight-base-dir) - user-emacs-directory))) - (bootstrap-version 7)) - (unless (file-exists-p bootstrap-file) - (with-current-buffer - (url-retrieve-synchronously - "https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el" - 'silent 'inhibit-cookies) - (goto-char (point-max)) - (eval-print-last-sexp))) - (load bootstrap-file nil 'nomessage)) - (setq straight-use-package-by-default t)) -#+end_src -* Make Emacs faster -#+begin_src emacs-lisp -(message "Speeding up") -#+end_src -** Avoid garbage collection at startup -#+begin_src emacs-lisp -(use-package gcmh - :init - (setq gcmh-idle-delay 5) - (setq gcmh-high-cons-threshold (* 16 1024 1024)) - :config - (gcmh-mode)) -#+end_src -** Set garbage collection to be further back -#+begin_src emacs-lisp -(setq gc-cons-threshold most-positive-fixnum) -#+end_src -** Unset file-name-handler-alist -#+begin_src emacs-lisp -(defvar sakomacs--file-name-handler-alist file-name-handler-alist) -(setq file-name-handler-alist nil) - -;; Alternatively, restore it even later: -(add-hook 'emacs-startup-hook - (lambda () - (setq file-name-handler-alist sakomacs--file-name-handler-alist))) -#+end_src -** Reset gc once init has finished -#+begin_src emacs-lisp - (defun doom-defer-garbage-collection-h () - "Disable garbage collection." - (setq gc-cons-threshold most-positive-fixnum)) - -(defun doom-restore-garbage-collection-h () - "Restore garbage collection." - (run-at-time - 1 nil (lambda () (setq gc-cons-threshold 16777216)))) - -(add-hook 'minibuffer-setup-hook #'doom-defer-garbage-collection-h) -(add-hook 'minibuffer-exit-hook #'doom-restore-garbage-collection-h) -#+end_src -** Read more -#+begin_src emacs-lisp -(setq read-process-output-max (* 1024 1024)) ;; 1mb -#+end_src -* Keybinds -Ill use this later eventually -#+begin_src emacs-lisp -(message "Got to keybinds") -#+end_src -** Make emacs more human -#+begin_src emacs-lisp -(global-set-key (kbd "") 'keyboard-escape-quit) -#+end_src -* Core -#+begin_src elisp - (message "Reached core.") -#+end_src -** Encoding -#+begin_src emacs-lisp -(setq utf-translate-cjk-mode nil) ; disable CJK coding/encoding (Chinese/Japanese/Korean characters) -(set-language-environment 'utf-8) -(set-keyboard-coding-system 'utf-8) ; For old Carbon emacs on OS X only -(setq locale-coding-system 'utf-8) -(set-default-coding-systems 'utf-8) -(set-terminal-coding-system 'utf-8) -(set-selection-coding-system - (if (eq system-type 'windows-nt) - 'utf-16-le ;; https://rufflewind.com/2014-07-20/pasting-unicode-in-emacs-on-windows - 'utf-8)) -(prefer-coding-system 'utf-8) -#+end_src -** Cleanup .emacs.d -#+begin_src emacs-lisp -(setq backup-directory-alist '(("." . "~/.emacs.d/backup")) -backup-by-copying t -version-control t -delete-old-versions t -kept-new-versions 20 -kept-old-versions 5) - -(use-package no-littering - :config - (setq custom-file (if (boundp 'server-socket-dir) - (expand-file-name "custom.el" server-socket-dir) - (no-littering-expand-etc-file-name "custom.el"))) - (when (file-exists-p custom-file) - (load custom-file t)) - - ;; Don't litter project folders with backup files - (let ((backup-dir (no-littering-expand-var-file-name "backup/"))) - (make-directory backup-dir t) - (setq backup-directory-alist - `(("\\`/tmp/" . nil) - ("\\`/dev/shm/" . nil) - ("." . ,backup-dir)))) - - (setq auto-save-default nil) - - ;; Tidy up auto-save files - (setq auto-save-default nil) - (let ((auto-save-dir (no-littering-expand-var-file-name "auto-save/"))) - (make-directory auto-save-dir t) - (setq auto-save-file-name-transforms - `(("\\`/[^/]*:\\([^/]*/\\)*\\([^/]*\\)\\'" - ,(concat temporary-file-directory "\\2") t) - ("\\`\\(/tmp\\|/dev/shm\\)\\([^/]*/\\)*\\(.*\\)\\'" "\\3") - ("." ,auto-save-dir t))))) - -;; no-littering doesn't set this by default so we must place -;; auto save files in the same path as it uses for sessions -(setq auto-save-file-name-transforms - `((".*" ,(no-littering-expand-var-file-name "auto-save/") t))) -#+end_src -** Native Compilation -#+begin_src emacs-lisp -(setq native-comp-async-report-warnings-errors nil) - -(add-to-list 'native-comp-eln-load-path (expand-file-name "eln-cache/" user-emacs-directory)) -#+end_src -** Emacs settings -#+begin_src emacs-lisp -(setq inhibit-startup-message t) - -;; make emacs look a little more cleaner -(scroll-bar-mode -1) -(tool-bar-mode -1) -(tooltip-mode -1) -(set-fringe-mode 10) -(menu-bar-mode -1) - -;; this is really annoying i hate it -(setq visible-bell nil) - -;; -- core keybinds and packages -- -(repeat-mode 1) - -(column-number-mode) - -(dolist (mode '(text-mode-hook - prog-mode-hook - conf-mode-hook)) - (add-hook mode (lambda () (display-line-numbers-mode 1)))) -#+end_src -** Core Keybinds -#+begin_src emacs-lisp -(repeat-mode 1) - -(column-number-mode) - -(dolist (mode '(text-mode-hook - prog-mode-hook - conf-mode-hook)) - (add-hook mode (lambda () (display-line-numbers-mode 1)))) -#+end_src -** Appearance -#+begin_src emacs-lisp - ;; (use-package doom-themes - ;; :config - ;; (load-theme 'doom-sourcerer t)) - - ;; (use-package grandshell-theme - ;; :config - ;; (load-theme 'grandshell t)) - - (use-package ef-themes - :config - (load-theme 'ef-dark t)) - - ;; emacsclient things - (setq frame-resize-pixelwise t) - ;; ui settings apparently go below - (setq default-frame-alist '((font . "JetBrainsMono NF") - '(vertical-scroll-bars . nil) - '(horizontal-scroll-bars . nil))) - - ;; GO AWAY - (defun my/disable-scroll-bars (frame) - (modify-frame-parameters frame - '((vertical-scroll-bars . nil) - (horizontal-scroll-bars . nil)))) - (add-hook 'after-make-frame-functions 'my/disable-scroll-bars) - - - ;; y/n is better than yes/no - (fset 'yes-or-no-p 'y-or-n-p) - - ;; font - (set-face-attribute 'default nil - :font "JetBrainsMono NF" - :weight 'light - :height 125) -#+end_src -** Emacs Client -#+begin_src emacs-lisp -(setq frame-resize-pixelwise t) -;; ui settings apparently go below -(setq default-frame-alist '((font . "JetBrainsMono NF") - '(vertical-scroll-bars . nil) - '(horizontal-scroll-bars . nil))) -#+end_src -** Modeline -#+begin_src emacs-lisp - ;; (use-package nerd-icons - ;; :custom - ;; (nerd-icons-font-family "JetBrainsMono NF")) - ;; (use-package doom-modeline - ;; :custom - ;; (doom-modeline-height 35) - ;; (doom-modeline-modal-modern-icon nil) - ;; :init (doom-modeline-mode 1)) -#+end_src -** Editor Configuration -#+begin_src emacs-lisp -(use-package super-save - :config - (super-save-mode +1) - (setq super-save-auto-save-when-idle t)) - -;; revert dired and other buffers -(setq global-auto-revert-non-file-buffers t) - -;; revert buffers when file has been changed -(global-auto-revert-mode 1) - -;; popups and stuff -(use-package popper - :bind (("C-M-'" . popper-toggle) - ("M-'" . popper-cycle) - ("C-M-\"" . popper-toggle-type)) - :custom - (popper-window-height 12) - (popper-reference-buffers '(eshell-mode - vterm-mode - geiser-repl-mode - help-mode - grep-mode - helpful-mode - compilation-mode)) - :config - (popper-mode 1)) -#+end_src -** Helpful -#+begin_src emacs-lisp -(use-package helpful - :custom - (counsel-describe-function-function #'helpful-callable) - (counsel-describe-variable-function #'helpful-variable) - :bind (([remap describe-function] . helpful-function) - ([remap describe-symbol] . helpful-symbol) - ([remap describe-variable] . helpful-variable) - ([remap describe-command] . helpful-command) - ([remap describe-key] . helpful-key))) -#+end_src -** Which Key -#+begin_src emacs-lisp -;; incase i get lost -(use-package which-key - :init (which-key-mode) - :diminish which-key-mode - :config - (setq which-key-idle-delay 1)) -#+end_src -** Alerts -#+begin_src emacs-lisp -(when (eq system-type 'windows-nt) - (use-package alert - :commands (alert) - :config (setq alert-default-style 'toast)) - - (use-package alert-toast - :after alert)) -#+end_src -** Daemon -#+begin_src emacs-lisp -(if (eq system-type 'windows-nt) - (setq server-socket-dir "~/.emacs.d/server")) -(server-start) -#+end_src -* Keys -#+begin_src emacs-lisp -(message "got to keys setup") -#+end_src -** General -#+begin_src emacs-lisp - (use-package general - :config - (general-create-definer sk/leader-keys - :keymaps '(normal insert visual emacs) - :prefix "SPC" - :global-prefix "C-SPC") - - (sk/leader-keys - ;; code - "c" '(:ignore c :which-key "code") - "cc" '(compile :which-key "compile") - "cC" '(recompile :which-key "compile") - "cX" '(lsp-treeemacs-errors-list :which-ley "list errors") - ;; toggles - "t" '(:ignore t :which-key "toggles") - "tt" '(counsel-load-theme :which-key "choose theme") - "ts" '(hydra-text-scale/body :which-key "scale text") - ;; search - "s" '(:ignore s :which-key "search") - "sb" '(swiper :which-key "search buffer") - ;; insert - "i" '(:ignore i :which-key "insert") - "ie" '(emoji-search :which-key "Emoji") - ;; project - "p" '(:ignore p :which-key "projects") - "pp" '(project-switch-project :which-key "open project") - "pk" '(project-kill-buffers :which-key "close project") - "pt" '(magit-todos-list :which-key "list project todos") - "po" '(project-find-file :which-key "find file") - "pc" '(project-compile :which-key "compile project") - ;; open - "o" '(:ignore o :which-key "open") - "op" '(treemacs :which-key "treemacs") - "oP" '(treemacs-find-file :which-key "treemacs find file") - "oe" '(eshell :which-key "eshell") - "ov" '(vterm :which-key "vterm") - "or" '(elfeed :which-key "rss") - ;; notes - "n" '(:ignore o :which-key "notes") - "na" '(org-agenda :which-key "agenda") - "nf" '(org-roam-node-find :which-key "find node") - "nc" '(org-capture :which-key "capture") - "np" '(org-pomodoro :which-key "pomodoro") - "ne" '(:ignore ne :which-key "export") - "nep" '(org-latex-export-to-pdf :which-key "pdf") - ;; quit - "q" '(:ignore q :which-key "quit") - "qq" '(delete-frame :which-key "close emacs") - "qK" '(kill-emacs :which-key "quit emacs") - ;; git - "g" '(:ignore g :which-key "git") - "gs" '(magit-status :which-key "status") - "gc" '(:ignore gc :which-key "create") - "gcr" '(magit-init :which-key "init repo") - "gcR" '(magit-clone :which-key "clone repo") - "gcc" '(magit-commit-create :which-key "commit") - "gci" '(forge-create-issue :which-key "issue") - "gcp" '(forge-create-pullreq :which-key "pull request") - ;; mail - "m" '(mu4e :which-key "mu4e"))) - -#+end_src -** Evil -#+begin_src emacs-lisp - - (use-package evil - :init - ;; Pre-load configuration - (setq evil-want-integration t) - (setq evil-want-keybinding nil) - (setq evil-want-C-u-scroll t) - (setq evil-want-C-i-jump nil) - (setq evil-respect-visual-line-mode t) - (setq evil-undo-system 'undo-tree) - :config - (evil-mode 1) - - ;; use emacs state for these mods - (dolist (mode '(custom-mode - eshell-mode - git-rebase-mode - erc-mode - circe-server-mode - circe-chat-mode - circe-query-mode - term-mode)) - (add-to-list 'evil-emacs-state-modes mode)) - - (defun sk/dont-arrow-me-bro () - (interactive) - (message "STOP USING THE ARROW KEYS!!!!!!!!!!!!!!!!!!!!!!!")) - - ;; Disable arrow keys in normal and visual modes - (define-key evil-normal-state-map (kbd "") 'sk/dont-arrow-me-bro) - (define-key evil-normal-state-map (kbd "") 'sk/dont-arrow-me-bro) - (define-key evil-normal-state-map (kbd "") 'sk/dont-arrow-me-bro) - (define-key evil-normal-state-map (kbd "") 'sk/dont-arrow-me-bro) - (evil-global-set-key 'motion (kbd "") 'sk/dont-arrow-me-bro) - (evil-global-set-key 'motion (kbd "") 'sk/dont-arrow-me-bro) - (evil-global-set-key 'motion (kbd "") 'sk/dont-arrow-me-bro) - (evil-global-set-key 'motion (kbd "") 'sk/dont-arrow-me-bro) - - (evil-set-initial-state 'messages-buffer-mode 'normal) - (evil-set-initial-state 'dashboard-mode 'normal)) - - (use-package evil-collection - :after evil - :custom - (evil-collection-outline-bind-tab-p nil) - :config - ;; Is this a bug in evil-collection? - (setq evil-collection-company-use-tng nil) - (delete 'lispy evil-collection-mode-list) - (delete 'org-present evil-collection-mode-list) - ;; (delete 'mu4e evil-collection-mode-list) - ;; (delete 'mu4e-conversation evil-collection-mode-list) - (evil-collection-init)) - - (use-package evil-org - :after (evil org) - :hook ((org-mode . evil-org-mode) - (org-agenda-mode . evil-org-mode)) - :config - (require 'evil-org-agenda) - (evil-org-set-key-theme '(navigation todo insert textobjects additional)) - (evil-org-agenda-set-keys)) - - (use-package evil-nerd-commenter - :bind ("M-/" . evilnc-comment-or-uncomment-lines)) - - (with-eval-after-load 'org - (evil-define-key '(normal insert visual) org-mode-map (kbd "C-j") 'org-next-visible-heading) - (evil-define-key '(normal insert visual) org-mode-map (kbd "C-k") 'org-previous-visible-heading) - (evil-define-key '(normal insert visual) org-mode-map (kbd "M-j") 'org-metadown) - (evil-define-key '(normal insert visual) org-mode-map (kbd "M-k") 'org-metaup)) -#+end_src -* Interface -#+begin_src emacs-lisp -(message "Got to interface") -#+end_src -** Hydra -#+begin_src emacs-lisp -(use-package hydra) -#+end_src -** Vertico -#+begin_src emacs-lisp - (use-package vertico - :bind (:map vertico-map - ("C-j" . vertico-next) - ("C-k" . vertico-previous) - ("C-f" . vertico-exit-input) - :map minibuffer-local-map - ("M-h" . vertico-directory-up)) - :custom - (vertico-cycle t) - - :hook (rfn-eshadow-update-overlay . vertico-directory-tidy) - :init - (require 'vertico-directory) - (vertico-mode)) -#+end_src -** Marginalia -#+begin_src emacs-lisp -(use-package marginalia - :after vertico - :ensure t - :custom - (marginalia-annotators '(marginalia-annotators-heavy marginalia-annotators-light nil)) - :init - (marginalia-mode)) -#+end_src -** Consult -#+begin_src emacs-lisp -(use-package consult - :bind (("C-s" . consult-line) - ("C-M-l" . consult-imenu) - ("C-M-j" . consult-buffer) - ("C-x C-b" . consult-buffer) - :map minibuffer-local-map - ("C-r" . consult-history))) - - -(use-package consult-dir - :bind (("C-x C-d" . consult-dir) - :map vertico-map - ("C-x C-d" . consult-dir) - ("C-x C-j" . consult-dir-jump-file)) - - :custom - (consult-dir-project-list-function nil)) -#+end_src -** Orderless -#+begin_src emacs-lisp -(use-package orderless - :config - (orderless-define-completion-style orderless+initialism - (orderless-matching-styles '(orderless-initialism - orderless-literal - orderless-regexp))) - - (setq completion-styles '(orderless) - completion-category-defaults nil - orderless-matching-styles '(orderless-literal orderless-regexp) - completion-category-overrides - '((file (styles partial-completion))))) -#+end_src -** Embark -#+begin_src emacs-lisp - (use-package embark - :after vertico - :bind (("C-." . embark-act) - ("M-." . embark-dwim) - :map minibuffer-local-map - ("C-d" . embark-act) - :map embark-region-map - ("D" . denote-region)) - - :config - ;; Remove the mixed indicator to prevent the popup from being displayed - ;; automatically - (delete #'embark-mixed-indicator embark-indicators) - (add-to-list 'embark-indicators 'embark-minimal-indicator) - - ;; Use Embark to show command prefix help - (setq prefix-help-command #'embark-prefix-help-command)) - - (use-package embark-consult - :after embark) - -#+end_src -** Corfu -#+begin_src emacs-lisp - (use-package corfu - :bind (:map corfu-map - ("C-j" . corfu-next) - ("C-k" . corfu-previous) - ("TAB" . corfu-insert) - ([tab] . corfu-insert) - ("C-f" . corfu-insert)) - :custom - (corfu-cycle t) - (corfu-auto t) - (corfu-preview-current nil) - (corfu-quit-at-boundary t) - (corfu-quit-no-match t) - (corfu-min-chars 3) - (corfu-auto-delay 0) - (corfu-auto-prefix 0) - :init - (global-corfu-mode) - - (defun corfu-enable-in-minibuffer () - "Enable Corfu in the minibuffer if `completion-at-point' is bound." - (when (where-is-internal #'completion-at-point (list (current-local-map))) - (setq-local corfu-auto nil) ;; Enable/disable auto completion - (setq-local corfu-echo-delay nil ;; Disable automatic echo and popup - corfu-popupinfo-delay nil) - (corfu-mode 1))) - - (add-hook 'minibuffer-setup-hook #'corfu-enable-in-minibuffer)) -#+end_src -** Dashboard -#+begin_src emacs-lisp - (use-package dashboard - :init - (setq initial-buffer-choice 'dashboard-open) - ;; Set the title - (setq dashboard-banner-logo-title "GET ME OUT GET ME OUT GET ME OUT") - (setq dashboard-image-banner-max-height 200) - ;; Set the banner - (setq dashboard-startup-banner '"~/.emacs.d/icon.png") - (setq dashboard-center-content t) - (setq dashboard-vertically-center-content t) - (setq dashboard-show-shortcuts nil) - - ;; nerd icons - (setq dashboard-display-icons-p t) ; display icons on both GUI and terminal - (setq dashboard-icon-type 'nerd-icons) ; use `nerd-icons' package - - ;; list stuff - (setq dashboard-items '((recents . 3) - (projects . 3) - (agenda . 3))) - :config - (dashboard-setup-startup-hook)) -#+end_src -* Auth -#+begin_src emacs-lisp -(message "Reached auth") -#+end_src -** Pinentry -#+begin_src emacs-lisp - (unless (eq system-type 'windows-nt) - (use-package pinentry - :config - (setq epa-pinentry-mode 'loopback)) - (pinentry-start)) -#+end_src -** Password-Store -#+begin_src emacs-lisp - (use-package password-store - :bind (("C-c p p" . password-store-copy) - ("C-c p i" . password-store-insert) - ("C-c p g" . password-store-generate)) - :config - (setq password-store-password-length 12)) - - (use-package auth-source-pass - :config - (auth-source-pass-enable)) -#+end_src -** OAuth2 -this should be useful later -#+begin_src emacs-lisp -(use-package oauth2 - :ensure t) -#+end_src -* Shell -#+begin_src emacs-lisp -(message "Reached shell") -#+end_src -** EShell -#+begin_src emacs-lisp -(defun sk/configure-eshell () - ;; Save command history when commands are entered - (add-hook 'eshell-pre-command-hook 'eshell-save-some-history) - - ;; Truncate buffer for performance - (add-to-list 'eshell-output-filter-functions 'eshell-truncate-buffer) - - ;; Bind some useful keys for evil-mode - (evil-define-key '(normal insert visual) eshell-mode-map (kbd "C-r") 'counsel-esh-history) - (evil-define-key '(normal insert visual) eshell-mode-map (kbd "") 'eshell-bol) - (evil-normalize-keymaps) - - (setq eshell-history-size 10000 - eshell-buffer-maximum-lines 10000 - eshell-hist-ignoredups t - eshell-scroll-to-bottom-on-input t)) - -(use-package eshell-git-prompt) - - - (add-hook 'eshell-first-time-mode 'sakomacs/configure-eshell) - - (with-eval-after-load 'esh-opt - (setq eshell-destroy-buffer-when-process-dies t) - (setq eshell-visual-commands '("htop" "zsh" "vim")) - - (eshell-git-prompt-use-theme 'powerline)) -#+end_src -** VTerm -#+begin_src emacs-lisp - (use-package vterm - :commands vterm - :config - (setq vterm-max-scrollback 10000)) -#+end_src -* Dev -#+begin_src emacs-lisp -(message "Reached dev") -#+end_src -** {} and () matching -#+begin_src emacs-lisp -(use-package smartparens - :hook (prog-mode . smartparens-mode) - :config - (sp-use-smartparens-bindings)) - -(use-package rainbow-delimiters - :hook (prog-mode . rainbow-delimiters-mode)) -#+end_src -** Compilation -#+begin_src emacs-lisp -(setq compilation-scroll-output t) - -(setq compilation-environment '("TERM=xterm-256color")) - -(defun sk/advice-compilation-filter (f proc string) - (funcall f proc (xterm-color-filter string))) - -(advice-add 'compilation-filter :around #'sk/advice-compilation-filter) - -(defun sk/auto-recompile-buffer () - (interactive) - (if (member #'recompile after-save-hook) - (remove-hook 'after-save-hook #'recompile t) - (add-hook 'after-save-hook #'recompile nil t))) -#+end_src -** Project.el -#+begin_src emacs-lisp -(setq project-switch-commands '((project-find-file "Find file" "f") (project-find-dir "Find dir" "d") (project-dired "Dired" "D") (consult-ripgrep "ripgrep" "g") (magit-project-status "Magit" "m"))) -#+end_src -** Eglot (LSP) -#+begin_src emacs-lisp - (use-package eglot - :bind (:map eglot-mode-map - ("C-c C-a" . eglot-code-actions) - ("C-c C-r" . eglot-rename)) - :config - (setq eglot-autoshutdown t - eglot-confirm-server-initiated-edits nil)) - - ;; this'll make it so i don't have to use vscode every now and then - ;; (when (eq system-type 'windows-nt) - ;; (use-package eglot-booster - ;; :straight (eglot-booster :type git :host github :repo "jdtsmith/eglot-booster") - ;; :after eglot - ;; :config (eglot-booster-mode)) - ;; ) - - (when (eq system-type 'gnu/linux) - (use-package eglot-booster - :ensure nil - :config (eglot-booster-mode))) -#+end_src -** Magit -#+begin_src emacs-lisp -(use-package magit - :bind ("C-M-;" . magit-status-here) - :custom - (magit-show-long-lines-warning nil) - (magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1)) - -(use-package magit-todos - :after magit - :config - (magit-todos-mode)) - -;; -- magit forge -- -(use-package forge - :after magit) -(setq auth-sources '("~/.authinfo")) - -(defhydra sk/smerge-panel () - "smerge" - ("k" (smerge-prev) "prev change" ) - ("j" (smerge-next) "next change") - ("u" (smerge-keep-upper) "keep upper") - ("l" (smerge-keep-lower) "keep lower") - ("q" nil "quit" :exit t)) -#+end_src -** Formatting -#+begin_src emacs-lisp -(use-package apheleia - :hook (prog-mode . apheleia-mode)) -#+end_src -** Flycheck (Syntax Checking) -#+begin_src emacs-lisp -(use-package flycheck - :config - (global-flycheck-mode +1)) -#+end_src -** Docker -#+begin_src emacs-lisp -(use-package docker - :ensure t - :bind ("C-c d" . docker)) -#+end_src -** Treemacs -#+begin_src emacs-lisp -(use-package treemacs - :defer t - :init - (with-eval-after-load 'winum - (define-key winum-keymap (kbd "M-0") #'treemacs-select-window)) - :config - (progn - (setq treemacs-collapse-dirs (if treemacs-python-executable 3 0) - treemacs-deferred-git-apply-delay 0.5 - treemacs-directory-name-transformer #'identity - treemacs-display-in-side-window t - treemacs-eldoc-display 'simple - treemacs-file-event-delay 2000 - treemacs-file-extension-regex treemacs-last-period-regex-value - treemacs-file-follow-delay 0.2 - treemacs-file-name-transformer #'identity - treemacs-follow-after-init t - treemacs-expand-after-init t - treemacs-find-workspace-method 'find-for-file-or-pick-first - treemacs-git-command-pipe "" - treemacs-goto-tag-strategy 'refetch-index - treemacs-header-scroll-indicators '(nil . "^^^^^^") - treemacs-hide-dot-git-directory t - treemacs-indentation 2 - treemacs-indentation-string " " - treemacs-is-never-other-window nil - treemacs-max-git-entries 5000 - treemacs-missing-project-action 'ask - treemacs-move-forward-on-expand nil - treemacs-no-png-images nil - treemacs-no-delete-other-windows t - treemacs-project-follow-cleanup nil - treemacs-persist-file (expand-file-name ".cache/treemacs-persist" user-emacs-directory) - treemacs-position 'left - treemacs-read-string-input 'from-child-frame - treemacs-recenter-distance 0.1 - treemacs-recenter-after-file-follow nil - treemacs-recenter-after-tag-follow nil - treemacs-recenter-after-project-jump 'always - treemacs-recenter-after-project-expand 'on-distance - treemacs-litter-directories '("/node_modules" "/.venv" "/.cask") - treemacs-project-follow-into-home nil - treemacs-show-cursor nil - treemacs-show-hidden-files t - treemacs-silent-filewatch nil - treemacs-silent-refresh nil - treemacs-sorting 'alphabetic-asc - treemacs-select-when-already-in-treemacs 'move-back - treemacs-space-between-root-nodes t - treemacs-tag-follow-cleanup t - treemacs-tag-follow-delay 1.5 - treemacs-text-scale nil - treemacs-user-mode-line-format nil - treemacs-user-header-line-format nil - treemacs-wide-toggle-width 70 - treemacs-width 35 - treemacs-width-increment 1 - treemacs-width-is-initially-locked t - treemacs-workspace-switch-cleanup nil) - - ;; The default width and height of the icons is 22 pixels. If you are - ;; using a Hi-DPI display, uncomment this to double the icon size. - ;;(treemacs-resize-icons 44) - - (treemacs-follow-mode t) - (treemacs-tag-follow-mode t) - (treemacs-project-follow-mode t) - (treemacs-filewatch-mode t) - (treemacs-fringe-indicator-mode 'always) - (when treemacs-python-executable - (treemacs-git-commit-diff-mode t)) - - (pcase (cons (not (null (executable-find "git"))) - (not (null treemacs-python-executable))) - (`(t . t) - (treemacs-git-mode 'deferred)) - (`(t . _) - (treemacs-git-mode 'simple))) - - (treemacs-hide-gitignored-files-mode nil)) - :bind - (:map global-map - ("M-0" . treemacs-select-window) - ("C-x t 1" . treemacs-delete-other-windows) - ("C-x t d" . treemacs-select-directory) - ("C-x t B" . treemacs-bookmark) - ("C-x t C-t" . treemacs-find-file) - ("C-x t M-t" . treemacs-find-tag))) - -(use-package treemacs-evil - :after (treemacs evil)) - -(use-package treemacs-magit - :after (treemacs magit)) - -(use-package treemacs-nerd-icons - :config - (treemacs-load-theme "nerd-icons")) -#+end_src -** Direnv -#+begin_src emacs-lisp - (when (eq system-type 'gnu/linux) - (use-package envrc - :hook (after-init . envrc-global-mode))) -#+end_src -** Color Picker -#+begin_src emacs-lisp - (use-package zenity-color-picker) -#+end_src -** editorconfig -people will probably get mad at me if i dont have this and i try to contribute -#+begin_src emacs-lisp -(use-package editorconfig - :config - (editorconfig-mode 1)) -#+end_src -** wakatime -the feds are watching -#+begin_src emacs-lisp - (use-package wakatime-mode - :config - (global-wakatime-mode)) -#+end_src -* Languages -#+begin_src emacs-lisp -(message "Reached languages") -#+end_src -** HTML/CSS -#+begin_src emacs-lisp -(use-package web-mode - :hook (web-mode . eglot-ensure) - :mode ("\\.html\\'" - "\\.css\\'")) -#+end_src -** Javascript -#+begin_src emacs-lisp -(use-package js2-mode -:mode ("\\.js\\'" - "\\.jsx\\'") -:hook (js2-mode . eglot-ensure) -:config -(setq web-mode-markup-indent-offset 2) ; HTML -(setq web-mode-css-indent-offset 2) ; CSS -(setq web-mode-code-indent-offset 2) ; JS/JSX/TS/TSX -(setq web-mode-content-types-alist '(("jsx" . "\\.js[x]?\\'")))) -#+end_src -** Typescript -#+begin_src emacs-lisp - - (add-to-list 'auto-mode-alist '(".*\\.ts" . typescript-ts-mode)) - (add-to-list 'auto-mode-alist '(".*\\.tsx" . tsx-ts-mode)) - - (add-hook 'typescript-ts-mode-hook 'eglot-ensure) - (add-hook 'tsx-ts-mode-hook 'eglot-ensure) - - (setq treesit-language-source-alist - '((typescript "https://github.com/tree-sitter/tree-sitter-typescript" "master" "typescript/src" nil nil) - (tsx "https://github.com/tree-sitter/tree-sitter-typescript" "master" "tsx/src" nil nil))) -#+end_src -** Astro -#+begin_src emacs-lisp - (define-derived-mode astro-mode web-mode "astro") - (setq auto-mode-alist - (append '((".*\\.astro\\'" . astro-mode)) - auto-mode-alist)) - - (add-to-list 'eglot-server-programs - '(astro-mode . ("astro-ls" "--stdio" - :initializationOptions - (:typescript (:tsdk "./node_modules/typescript/lib"))))) -#+end_src -** C/C++ -#+begin_src emacs-lisp -(add-hook 'c-mode-hook 'eglot-ensure) -(add-hook 'c++-mode-hook 'eglot-ensure) -#+end_src -** C# -#+begin_src emacs-lisp - (add-hook 'csharp-mode-hook 'eglot-ensure) - (when (eq system-type 'gnu/linux) - (add-to-list 'eglot-server-programs - `(csharp-mode . ("OmniSharp" "-lsp")))) - - (use-package csproj-mode - :mode ("\\.csproj\\'")) - - (use-package dotnet - :hook (dotnet-mode . csharp-mode)) -#+end_src -** CMake -#+begin_src emacs-lisp -(use-package cmake-mode - :mode "CMakeLists.txt" - :hook (cmake-mode . eglot-ensure)) -#+end_src -** Lua -#+begin_src emacs-lisp -(use-package lua-mode - :mode "\\.lua\\'" - :hook (lua-mode . eglot-ensure)) -#+end_src -** Python -#+begin_src emacs-lisp -(use-package python-mode - :mode "\\.py\\'" - :hook (python-mode . eglot-ensure)) - -(use-package elpy -:after python-mode - -:custom -(elpy-rpc-python-command "python3") - -:config -(elpy-enable)) - -(use-package poetry - :config - (poetry-tracking-mode 1)) -#+end_src -** Yaml -#+begin_src emacs-lisp - (use-package yaml-mode - :hook (yaml-mode. eglot-ensure) - :mode ("\\.yml\\'" - "\\.yaml\\'")) -#+end_src -** Nix -#+begin_src emacs-lisp -(use-package nix-mode - :hook (nix-mode . eglot-ensure) - :mode "\\.nix\\'") -#+end_src -** Dart -#+begin_src emacs-lisp -(use-package dart-mode - :hook (dart-mode . eglot-ensure) -:mode "\\.dart\\'" ) -#+end_src -** Markdown -#+begin_src emacs-lisp -(use-package markdown-mode - :hook (markdown-mode . visual-line-mode)) - -(use-package markdown-preview-mode) -#+end_src -** GDScript -#+begin_src emacs-lisp -(use-package gdscript-mode - :hook (gdscript-mode . eglot-ensure) - :mode "\\.gd\\'") -#+end_src -** Rust -#+begin_src emacs-lisp - (use-package rustic - :ensure t - :config - (setq rustic-format-on-save nil) - (setq rustic-lsp-client 'eglot) - :custom - (rustic-cargo-use-last-stored-arguments t)) -#+end_src -** Haskell -#+begin_src emacs-lisp - (use-package haskell-mode - :hook (haskell-mode . eglot-ensure) - :mode "\\.hs'") -#+end_src -** Go -#+begin_src emacs-lisp - (use-package go-mode - :mode "\\.go\\'" - :hook (go-mode . eglot-ensure)) -#+end_src -* Social -#+begin_src emacs-lisp -(message "Reached social") -#+end_src -** Elcord (Discord rich precense) -#+begin_src emacs-lisp - (use-package elcord - :init - (setq elcord-display-buffer-details nil) - (setq elcord-use-major-mode-as-main-icon t) - (setq elcord-quiet t) - :config - (elcord-mode)) -#+end_src -** Telegram -does NOT WORK ON WINDOWS -#+begin_src emacs-lisp -(unless (eq system-type 'windows-nt) - (use-package telega)) -#+end_src -** rcirc (irc) -#+begin_src emacs-lisp - (require 'rcirc) - - - (defvar *rcirc-last-message-time* nil) - (defvar *rcirc-last-message-time-file* "~/.emacs.d/.rcirc-last-message-time") - (defvar *rcirc-last-message-time-initial* nil) - - - (setq rcirc-id-string "Emacs rcirc") - - (setq rcirc-server-alist `(("znc.sako.box" - :port 7000 - :encryption tls - :nick "sako@emacs/Libera" - :user-name "sako@emacs/Libera" - :password ,(concat "sako@emacs/Libera:" (password-store-get "SelfHosted/ZNC"))))) - - (defun rcirc-detach-buffer () - (interactive) - (let ((buffer (current-buffer))) - (when (and (rcirc-buffer-process) - (eq (process-status (rcirc-buffer-process)) 'open)) - (with-rcirc-server-buffer - (setq rcirc-buffer-alist - (rassq-delete-all buffer rcirc-buffer-alist))) - (rcirc-update-short-buffer-names) - (if (rcirc-channel-p rcirc-target) - (rcirc-send-string (rcirc-buffer-process) - (concat "DETACH " rcirc-target)))) - (setq rcirc-target nil) - (kill-buffer buffer))) -#+end_src -** elfeed (rss) -Will configure later, (use elfeed protocol ok ty) -#+begin_src emacs-lisp - (use-package elfeed - :config - (setq elfeed-use-curl t) - (elfeed-set-timeout 36000) - ) - - (use-package elfeed-protocol - :config - ;; setup feeds - (setq elfeed-protocol-fever-update-unread-only nil) - (setq elfeed-protocol-fever-fetch-category-as-tag t) - (setq elfeed-protocol-feeds '(("fever+https://sako@rss.sako.box" - :api-url "https://rss.sako.box/fever/" - :password (password-store-get "SelfHosted/rss.sako.box/fever")))) - - ;; enable elfeed-protocol - (setq elfeed-protocol-enabled-protocols '(fever)) - (elfeed-protocol-enable)) -#+end_src -** Matrix -Ill set this up later as well -#+begin_src emacs-lisp - (use-package ement - :commands ement-connect - :custom - (ement-notify-dbus-p nil) ;; Turn off notifications - (ement-sessions-file "~/.cache/ement.el") - (ement-room-list-default-keys - '(;; Group all invitations (this group will appear first since the rooms are - ;; already sorted first). - ((membership :status 'invite)) - - ;; Group all left rooms (this group will appear last, because the rooms are already - ;; sorted last). - ((membership :status 'leave)) - - ;; Group all favorite rooms, which are already sorted first. - (favourite) - - ;; Group all low-priority rooms, which are already sorted last. - (low-priority) - - ;; Group other rooms which are unread. - (unread) - (people) - freshness))) -#+end_src -** Subsonic -#+begin_src emacs-lisp -(use-package subsonic) -#+end_src -** EMMS -Emacs music player lmfao -#+begin_src emacs-lisp - (use-package emms - :config - (emms-all) - (setq emms-player-list '(emms-player-mpd)) - (setq emms-info-functions '(emms-info-mod)) - (setq emms-source-file-default-directory "~/music") - ;; TODO Keybinds maybe - ) -#+end_src -** GPTel -its over the machines took over guys can i get my likes now -#+begin_src emacs-lisp - (use-package gptel - :config - (gptel-make-ollama "Ollama" - :host "localhost:11434" - :stream t - :models '("mistral:latest"))) -#+end_src -** mu4e -GNU patch review metho dor sometihng idk -#+begin_src emacs-lisp - - (use-package auth-source-xoauth2) - (use-package mu4e - :config - - ;; mu4e syncing issue with isync - (setq mu4e-change-filenames-when-moving t) - - ;; sending mail - (setq message-send-mail-function 'smtpmail-send-it) - (add-to-list 'smtpmail-auth-supported 'xoauth2) - - (setq mu4e-update-interval (* 10 60)) - (setq mu4e-get-mail-command "offlineimap") - (setq mu4e-maildir "~/Mail") - - ;; for mail accounts - (setq sakomacs-mail-accounts (json-read-file "~/Mail/accounts.json")) - - (setq mu4e-context-policy 'pick-first) - (setq mu4e-compose-context-policy 'always-ask) - (setq mu4e-contexts - (list - ;; outlook - (make-mu4e-context - :name "Outlook" - :match-func - (lambda (msg) - (when msg - (string-prefix-p "/Outlook" (mu4e-message-field msg :maildir)))) - :vars `((user-mail-address . ,(cdr (assoc 'outlook sakomacs-mail-accounts))) - (user-full-name . "Sako") - (mu4e-drafts-folder . "/Outlook/Drafts") - (mu4e-sent-folder . "/Outlook/Sent") - (mu4e-refile-folder . "/Outlook/Inbox") - (mu4e-trash-folder . "/Outlook/Deleted") - ;; todo stmpmail and compose signatures - )) - (make-mu4e-context - :name "Proton" - :match-func - (lambda (msg) - (when msg - (string-prefix-p "/Proton" (mu4e-message-field msg :maildir)))) - :vars `((user-mail-address . ,(cdr (assoc 'protonmail sakomacs-mail-accounts))) - (user-full-name . "Sako") - (mu4e-drafts-folder . "/Proton/Drafts") - (mu4e-sent-folder . "/Proton/Sent") - (mu4e-refile-folder . "/Proton/Inbox") - (mu4e-trash-folder . "/Proton/Trash")) - ;; todo stmpmail and compose signatures - ) - (make-mu4e-context - :name "Gmail Personal 1" - :match-func - (lambda (msg) - (when msg - (string-prefix-p "/Gmail-Personal-1" (mu4e-message-field msg :maildir)))) - :vars `((user-mail-address . ,(cdr (assoc 'gmail-1 sakomacs-mail-accounts))) - (user-full-name . "Sako") - (mu4e-drafts-folder . "/Gmail-Personal-1/Drafts") - (mu4e-sent-folder . "/Gmail-Personal-1/Sent Mail") - (mu4e-refile-folder . "/Gmail-Personal-1/Inbox") - (mu4e-trash-folder . "Gmail-Personal-1/Trash") - ;; todo stmpmail and compose signatures - )) - (make-mu4e-context - :name "Second Personal Gmail" - :match-func - (lambda (msg) - (when msg - (string-prefix-p "/Gmail-Personal-2" (mu4e-message-field msg :maildir)))) - :vars `((user-mail-address . ,(cdr (assoc 'gmail-2 sakomacs-mail-accounts))) - (user-full-name . "Sako") - (mu4e-drafts-folder . "/Gmail-Personal-2/Drafts") - (mu4e-sent-folder . "/Gmail-Personal-2/Sent Mail") - (mu4e-refile-folder . "/Gmail-Personal-2/Inbox") - (mu4e-trash-folder . "Gmail-Personal-2/Trash") - )) - - )) - ) -#+end_src -* Org -#+begin_src emacs-lisp -(message "Reached Org") -#+end_src -** Org mode configuration -#+begin_src emacs-lisp - (use-package org - :hook (org-mode . org-indent-mode) - :config - (setq org-ellipsis " ↓") - (setq org-agenda-start-with-log-mode t) - (setq org-log-done 'time) - (setq org-log-into-drawer t) - - ;; habits, useless for now though - ;; (require 'org-habit) - ;; (add-to-list 'org-modules 'org-habit) - ;; (setq org-habit-graph-column 60) - - ;; archive - (setq org-refile-targets - '(("archive.org" :maxlevel . 1))) - - ;; make sure to save everything after refiling - (advice-add 'org-refile :after 'org-save-all-org-buffers) - - ;; org agenda - (setq org-agenda-files - '("~/org/tasks.org" - "~/org/school.org" - "~/org/daily.org" - "~/org/irl.org" - "~/org/work.org")) - - ;; follow links - (setq org-return-follows-link t) - - ;; hide leading stars - (setq org-hide-leading-stars t) - (setq org-hide-emphasis-markers nil) - - ;; org latex pdf options - (setq org-latex-compiler "lualatex") - (setq org-preview-latex-default-process 'dvisvgm) - - ;; templates - (require 'org-tempo) - - ;; this'll come in handly later - (add-to-list 'org-structure-template-alist '("sh" . "src shell")) - (add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp")) - (add-to-list 'org-structure-template-alist '("py" . "src python")) - - ;; more options - (setq org-todo-keywords - '((sequence "TODO(t)" "NEXT(n)" "|" "DONE(d!)") - (sequence "BACKLOG(b)" "PLAN(p)" "READY(r)" "ACTIVE(a)" "REVIEW(v)" "WAIT(w@/!)" "HOLD(h)" "|" "COMPLETED(c)" "CANCELED(k@)"))) - - ;; this is really useful - (setq org-startup-with-inline-images t) - - ;; i hope i actually use this eventually - (setq org-capture-templates - `(("t" "Tasks") - ("tt" "Task" entry (file+olp "~/org/tasks.org" "captured") - "* TODO %?\n %U\n %a\n %i" :empty-lines1))) - ) - - -#+end_src -** Org Roam -#+begin_src emacs-lisp - (use-package org-roam - :custom - (org-roam-directory "~/org/notes") - :bind (("C-c n l" . org-roam-buffer-toggle) - ("C-c n f" . org-roam-node-find) - ("C-c n i" . org-roam-node-insert)) - :config - (org-roam-setup)) -#+end_src -** Org-wild-notifier -#+begin_src emacs-lisp - (use-package org-wild-notifier - :config - (setq alert-default-style 'libnotify) - (setq org-wild-notifier-alert-time 30) - (org-wild-notifier-mode)) -#+end_src -** Org-Pomodoro -#+begin_src emacs-lisp -(use-package org-pomodoro) -#+end_src -** PDF-Tools -Export and then view with emacs :) -#+begin_src emacs-lisp -(use-package pdf-tools) -#+end_src -* EXWM -I'm scared -#+begin_src emacs-lisp - - (defcustom is-exwm nil - "Toggle if EXWM is being used" - :type 'boolean) - - (when (eq system-type 'gnu/linux) - (when is-exwm - (use-package exwm - :config - (set-frame-parameter nil 'alpha '(90 . 90)) - (add-to-list 'default-frame-alist '(alpha . (90 . 90))) - - (defun sakomacs/exwm-init-hook () - ;; background - (call-process-shell-command "feh --bg-fill ~/background.png" nil 0) - ;; (set-frame-parameter nil 'alpha 90) - ;; (call-process-shell-command "~/.config/polybar/startpolybar" nil 0) - (call-process-shell-command "~/.config/picom/startpicom" nil 0) - ;; startup - (call-process-shell-command "nm-applet" nil 0) - (call-process-shell-command "blueman-applet" nil 0) - ;; (call-process-shell-command "nextcloud" nil 0) - ;; (call-process-shell-command "bitwarden" nil 0) - (call-process-shell-command "flameshot" nil 0) - - ;; battery - (display-battery-mode) - ;; show time on the modeline - (setq display-time-default-load-average nil) - (setq display-time-24hr-format t) - (display-time-mode t) - ;; shrink fringe to 1px - (fringe-mode 1) - ) - - ;; background - ;; todo turn this info a function - (add-hook 'exwm-init-hook 'sakomacs/exwm-init-hook) - ;; startup - ;; workspaces - (setq exwm-workspace-number 5) - - - (require 'exwm-systemtray) - (exwm-systemtray-enable) - - ;; polybar - (defvar sakomacs/polybar-process nil - "Holds the process of the running Polybar instance, if any") - - (server-start) - - (defun sakomacs/kill-panel () - (interactive) - (when sakomacs/polybar-process - (ignore-errors - (kill-process sakomacs/polybar-process))) - (setq sakomacs/polybar-process nil)) - - (defun sakomacs/start-panel () - (interactive) - (sakomacs/kill-panel) - (setq sakomacs/polybar-process (start-process-shell-command "polybar" nil "polybar panel"))) - - (defun sakomacs/send-polybar-hook (module-name hook-index) - (start-process-shell-command "polybar-msg" nil (format "polybar-msg hook %s %s" module-name hook-index))) - - (defun sakomacs/send-polybar-exwm-workspace () - (sakomacs/send-polybar-hook "exwm-workspace" 1)) - - ;; Update panel indicator when workspace changes - (add-hook 'exwm-workspace-switch-hook #'sakomacs/send-polybar-exwm-workspace) - - - ;; make the buffer names better - (add-hook 'exwm-update-class-hook - (lambda () - (unless (or (string-prefix-p "sun-awt-X11-" exwm-instance-name) - (string= "gimp" exwm-instance-name)) - (exwm-workspace-rename-buffer exwm-class-name)))) - (add-hook 'exwm-update-title-hook - (lambda () - (when (or (not exwm-instance-name) - (string-prefix-p "sun-awt-X11-" exwm-instance-name) - (string= "gimp" exwm-instance-name)) - (exwm-workspace-rename-buffer exwm-title)))) - - ;; always use these keys in emacs - (setq exwm-input-prefix-keys - '(?\C-x - ?\C-u - ?\C-h - ?\M-x - ?\M-` - ?\M-& - ?\M-: - ?\C-\M-j ;; Buffer list - ?\C-\ )) ;; Ctrl+Space - - (setq exwm-input-stimulation-keys - '( - ;; cut/paste. - ([?\C-w] . [?\C-x]) - ([?\M-w] . [?\C-c]) - ([?\C-y] . [?\C-v]))) - - - ;; Ctrl+/3Q will enable the next key to be sent directly - (define-key exwm-mode-map [?\C-q] 'exwm-input-send-next-key) - ;; app launcher and fullscreen - (exwm-input-set-key (kbd "s-SPC") 'app-launcher-run-app) - (exwm-input-set-key (kbd "s-f") 'exwm-layout-toggle-fullscreen) - (exwm-input-set-key (kbd "s-") 'vterm) - - ;; kill apps - (exwm-input-set-key (kbd "s-q") #'kill-current-buffer) - - ;; Set up global key bindings. These always work, no matter the input state! - ;; Keep in mind that changing this list after EXWM initializes has no effect. - (setq exwm-input-global-keys - `( - ;; Reset to line-mode (C-c C-k switches to char-mode via exwm-input-release-keyboard) - ([?\s-r] . exwm-reset) - - ;; Move between windows - ([s-left] . windmove-left) - ([s-right] . windmove-right) - ([s-up] . windmove-up) - ([s-down] . windmove-down) - - ;; Launch applications via shell command - ([?\s-&] . (lambda (command) - (interactive (list (read-shell-command "$ "))) - (start-process-shell-command command nil command))) - - ;; Switch workspace - ([?\s-w] . exwm-workspace-switch) - - ;; 's-N': Switch to certain workspace with Super (Win) plus a number key (0 - 9) - ,@(mapcar (lambda (i) - `(,(kbd (format "s-%d" i)) . - (lambda () - (interactive) - (exwm-workspace-switch-create ,i)))) - (number-sequence 0 9)))) - ) - - (use-package desktop-environment - :after exwm - :config (desktop-environment-mode) - :custom - (desktop-environment-brightness-small-increment "2%+") - (desktop-environment-brightness-small-decrement "2%-") - (desktop-environment-brightness-normal-increment "5%+") - (desktop-environment-brightness-normal-decrement "5%-")) - )) -#+end_src -* End -#+begin_src elisp - (message "Welcome to Emacs!") - - ;; EOF -#+end_src +#+title: EMACS 2 +#+PROPERTY: header-args:emacs-lisp :tangle yes :tangle init.el +* Welcome! +#+begin_src emacs-lisp +;; -*- lexical-binding: t; -*- +#+end_src +* Package Setup +#+begin_src emacs-lisp + (message "Reached package setup") + + (require `package) + + (setq package-archives `(("mepla" . "https://melpa.org/packages/") + ("org" . "https://orgmode.org/elpa/") + ("elpa" . "https://elpa.gnu.org/packages/"))) + (package-initialize) + (unless (package-installed-p 'use-package) + (progn + (package-refresh-contents) + (package-install 'use-package))) + + (require 'use-package) + (setq use-package-always-ensure t) + + ;; TODO add better detection to this + (when (eq system-type 'windows-nt) + (message "setting up straight.el") + (defvar bootstrap-version) + (let ((bootstrap-file + (expand-file-name + "straight/repos/straight.el/bootstrap.el" + (or (bound-and-true-p straight-base-dir) + user-emacs-directory))) + (bootstrap-version 7)) + (unless (file-exists-p bootstrap-file) + (with-current-buffer + (url-retrieve-synchronously + "https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el" + 'silent 'inhibit-cookies) + (goto-char (point-max)) + (eval-print-last-sexp))) + (load bootstrap-file nil 'nomessage)) + (setq straight-use-package-by-default t)) +#+end_src +* Make Emacs faster +#+begin_src emacs-lisp +(message "Speeding up") +#+end_src +** Avoid garbage collection at startup +#+begin_src emacs-lisp +(use-package gcmh + :init + (setq gcmh-idle-delay 5) + (setq gcmh-high-cons-threshold (* 16 1024 1024)) + :config + (gcmh-mode)) +#+end_src +** Set garbage collection to be further back +#+begin_src emacs-lisp +(setq gc-cons-threshold most-positive-fixnum) +#+end_src +** Unset file-name-handler-alist +#+begin_src emacs-lisp +(defvar sakomacs--file-name-handler-alist file-name-handler-alist) +(setq file-name-handler-alist nil) + +;; Alternatively, restore it even later: +(add-hook 'emacs-startup-hook + (lambda () + (setq file-name-handler-alist sakomacs--file-name-handler-alist))) +#+end_src +** Reset gc once init has finished +#+begin_src emacs-lisp + (defun doom-defer-garbage-collection-h () + "Disable garbage collection." + (setq gc-cons-threshold most-positive-fixnum)) + +(defun doom-restore-garbage-collection-h () + "Restore garbage collection." + (run-at-time + 1 nil (lambda () (setq gc-cons-threshold 16777216)))) + +(add-hook 'minibuffer-setup-hook #'doom-defer-garbage-collection-h) +(add-hook 'minibuffer-exit-hook #'doom-restore-garbage-collection-h) +#+end_src +** Read more +#+begin_src emacs-lisp +(setq read-process-output-max (* 1024 1024)) ;; 1mb +#+end_src +* Keybinds +Ill use this later eventually +#+begin_src emacs-lisp +(message "Got to keybinds") +#+end_src +** Make emacs more human +#+begin_src emacs-lisp +(global-set-key (kbd "") 'keyboard-escape-quit) +#+end_src +* Core +#+begin_src elisp + (message "Reached core.") +#+end_src +** Encoding +#+begin_src emacs-lisp +(setq utf-translate-cjk-mode nil) ; disable CJK coding/encoding (Chinese/Japanese/Korean characters) +(set-language-environment 'utf-8) +(set-keyboard-coding-system 'utf-8) ; For old Carbon emacs on OS X only +(setq locale-coding-system 'utf-8) +(set-default-coding-systems 'utf-8) +(set-terminal-coding-system 'utf-8) +(set-selection-coding-system + (if (eq system-type 'windows-nt) + 'utf-16-le ;; https://rufflewind.com/2014-07-20/pasting-unicode-in-emacs-on-windows + 'utf-8)) +(prefer-coding-system 'utf-8) +#+end_src +** Cleanup .emacs.d +#+begin_src emacs-lisp +(setq backup-directory-alist '(("." . "~/.emacs.d/backup")) +backup-by-copying t +version-control t +delete-old-versions t +kept-new-versions 20 +kept-old-versions 5) + +(use-package no-littering + :config + (setq custom-file (if (boundp 'server-socket-dir) + (expand-file-name "custom.el" server-socket-dir) + (no-littering-expand-etc-file-name "custom.el"))) + (when (file-exists-p custom-file) + (load custom-file t)) + + ;; Don't litter project folders with backup files + (let ((backup-dir (no-littering-expand-var-file-name "backup/"))) + (make-directory backup-dir t) + (setq backup-directory-alist + `(("\\`/tmp/" . nil) + ("\\`/dev/shm/" . nil) + ("." . ,backup-dir)))) + + (setq auto-save-default nil) + + ;; Tidy up auto-save files + (setq auto-save-default nil) + (let ((auto-save-dir (no-littering-expand-var-file-name "auto-save/"))) + (make-directory auto-save-dir t) + (setq auto-save-file-name-transforms + `(("\\`/[^/]*:\\([^/]*/\\)*\\([^/]*\\)\\'" + ,(concat temporary-file-directory "\\2") t) + ("\\`\\(/tmp\\|/dev/shm\\)\\([^/]*/\\)*\\(.*\\)\\'" "\\3") + ("." ,auto-save-dir t))))) + +;; no-littering doesn't set this by default so we must place +;; auto save files in the same path as it uses for sessions +(setq auto-save-file-name-transforms + `((".*" ,(no-littering-expand-var-file-name "auto-save/") t))) +#+end_src +** Native Compilation +#+begin_src emacs-lisp +(setq native-comp-async-report-warnings-errors nil) + +(add-to-list 'native-comp-eln-load-path (expand-file-name "eln-cache/" user-emacs-directory)) +#+end_src +** Emacs settings +#+begin_src emacs-lisp +(setq inhibit-startup-message t) + +;; make emacs look a little more cleaner +(scroll-bar-mode -1) +(tool-bar-mode -1) +(tooltip-mode -1) +(set-fringe-mode 10) +(menu-bar-mode -1) + +;; this is really annoying i hate it +(setq visible-bell nil) + +;; -- core keybinds and packages -- +(repeat-mode 1) + +(column-number-mode) + +(dolist (mode '(text-mode-hook + prog-mode-hook + conf-mode-hook)) + (add-hook mode (lambda () (display-line-numbers-mode 1)))) +#+end_src +** Core Keybinds +#+begin_src emacs-lisp +(repeat-mode 1) + +(column-number-mode) + +(dolist (mode '(text-mode-hook + prog-mode-hook + conf-mode-hook)) + (add-hook mode (lambda () (display-line-numbers-mode 1)))) +#+end_src +** Appearance +#+begin_src emacs-lisp + ;; (use-package doom-themes + ;; :config + ;; (load-theme 'doom-sourcerer t)) + + ;; (use-package grandshell-theme + ;; :config + ;; (load-theme 'grandshell t)) + + (use-package ef-themes + :config + (load-theme 'ef-dark t)) + + ;; emacsclient things + (setq frame-resize-pixelwise t) + ;; ui settings apparently go below + (setq default-frame-alist '((font . "JetBrainsMono NF") + '(vertical-scroll-bars . nil) + '(horizontal-scroll-bars . nil))) + + ;; GO AWAY + (defun my/disable-scroll-bars (frame) + (modify-frame-parameters frame + '((vertical-scroll-bars . nil) + (horizontal-scroll-bars . nil)))) + (add-hook 'after-make-frame-functions 'my/disable-scroll-bars) + + + ;; y/n is better than yes/no + (fset 'yes-or-no-p 'y-or-n-p) + + ;; font + (set-face-attribute 'default nil + :font "JetBrainsMono NF" + :weight 'light + :height 125) +#+end_src +** Emacs Client +#+begin_src emacs-lisp +(setq frame-resize-pixelwise t) +;; ui settings apparently go below +(setq default-frame-alist '((font . "JetBrainsMono NF") + '(vertical-scroll-bars . nil) + '(horizontal-scroll-bars . nil))) +#+end_src +** Modeline +#+begin_src emacs-lisp + ;; (use-package nerd-icons + ;; :custom + ;; (nerd-icons-font-family "JetBrainsMono NF")) + ;; (use-package doom-modeline + ;; :custom + ;; (doom-modeline-height 35) + ;; (doom-modeline-modal-modern-icon nil) + ;; :init (doom-modeline-mode 1)) +#+end_src +** Editor Configuration +#+begin_src emacs-lisp +(use-package super-save + :config + (super-save-mode +1) + (setq super-save-auto-save-when-idle t)) + +;; revert dired and other buffers +(setq global-auto-revert-non-file-buffers t) + +;; revert buffers when file has been changed +(global-auto-revert-mode 1) + +;; popups and stuff +(use-package popper + :bind (("C-M-'" . popper-toggle) + ("M-'" . popper-cycle) + ("C-M-\"" . popper-toggle-type)) + :custom + (popper-window-height 12) + (popper-reference-buffers '(eshell-mode + vterm-mode + geiser-repl-mode + help-mode + grep-mode + helpful-mode + compilation-mode)) + :config + (popper-mode 1)) +#+end_src +** Helpful +#+begin_src emacs-lisp +(use-package helpful + :custom + (counsel-describe-function-function #'helpful-callable) + (counsel-describe-variable-function #'helpful-variable) + :bind (([remap describe-function] . helpful-function) + ([remap describe-symbol] . helpful-symbol) + ([remap describe-variable] . helpful-variable) + ([remap describe-command] . helpful-command) + ([remap describe-key] . helpful-key))) +#+end_src +** Which Key +#+begin_src emacs-lisp +;; incase i get lost +(use-package which-key + :init (which-key-mode) + :diminish which-key-mode + :config + (setq which-key-idle-delay 1)) +#+end_src +** Alerts +#+begin_src emacs-lisp +(when (eq system-type 'windows-nt) + (use-package alert + :commands (alert) + :config (setq alert-default-style 'toast)) + + (use-package alert-toast + :after alert)) +#+end_src +** Daemon +#+begin_src emacs-lisp +(if (eq system-type 'windows-nt) + (setq server-socket-dir "~/.emacs.d/server")) +(server-start) +#+end_src +* Keys +#+begin_src emacs-lisp +(message "got to keys setup") +#+end_src +** General +#+begin_src emacs-lisp + (use-package general + :config + (general-create-definer sk/leader-keys + :keymaps '(normal insert visual emacs) + :prefix "SPC" + :global-prefix "C-SPC") + + (sk/leader-keys + ;; code + "c" '(:ignore c :which-key "code") + "cc" '(compile :which-key "compile") + "cC" '(recompile :which-key "compile") + "cX" '(lsp-treeemacs-errors-list :which-ley "list errors") + ;; toggles + "t" '(:ignore t :which-key "toggles") + "tt" '(counsel-load-theme :which-key "choose theme") + "ts" '(hydra-text-scale/body :which-key "scale text") + ;; search + "s" '(:ignore s :which-key "search") + "sb" '(swiper :which-key "search buffer") + ;; insert + "i" '(:ignore i :which-key "insert") + "ie" '(emoji-search :which-key "Emoji") + ;; project + "p" '(:ignore p :which-key "projects") + "pp" '(project-switch-project :which-key "open project") + "pk" '(project-kill-buffers :which-key "close project") + "pt" '(magit-todos-list :which-key "list project todos") + "po" '(project-find-file :which-key "find file") + "pc" '(project-compile :which-key "compile project") + ;; open + "o" '(:ignore o :which-key "open") + "op" '(treemacs :which-key "treemacs") + "oP" '(treemacs-find-file :which-key "treemacs find file") + "oe" '(eshell :which-key "eshell") + "ov" '(vterm :which-key "vterm") + "or" '(elfeed :which-key "rss") + ;; notes + "n" '(:ignore o :which-key "notes") + "na" '(org-agenda :which-key "agenda") + "nf" '(org-roam-node-find :which-key "find node") + "nc" '(org-capture :which-key "capture") + "np" '(org-pomodoro :which-key "pomodoro") + "ne" '(:ignore ne :which-key "export") + "nep" '(org-latex-export-to-pdf :which-key "pdf") + ;; quit + "q" '(:ignore q :which-key "quit") + "qq" '(delete-frame :which-key "close emacs") + "qK" '(kill-emacs :which-key "quit emacs") + ;; git + "g" '(:ignore g :which-key "git") + "gs" '(magit-status :which-key "status") + "gc" '(:ignore gc :which-key "create") + "gcr" '(magit-init :which-key "init repo") + "gcR" '(magit-clone :which-key "clone repo") + "gcc" '(magit-commit-create :which-key "commit") + "gci" '(forge-create-issue :which-key "issue") + "gcp" '(forge-create-pullreq :which-key "pull request") + ;; mail + "m" '(mu4e :which-key "mu4e"))) + +#+end_src +** Evil +#+begin_src emacs-lisp + + (use-package evil + :init + ;; Pre-load configuration + (setq evil-want-integration t) + (setq evil-want-keybinding nil) + (setq evil-want-C-u-scroll t) + (setq evil-want-C-i-jump nil) + (setq evil-respect-visual-line-mode t) + (setq evil-undo-system 'undo-tree) + :config + (evil-mode 1) + + ;; use emacs state for these mods + (dolist (mode '(custom-mode + eshell-mode + git-rebase-mode + erc-mode + circe-server-mode + circe-chat-mode + circe-query-mode + term-mode)) + (add-to-list 'evil-emacs-state-modes mode)) + + (defun sk/dont-arrow-me-bro () + (interactive) + (message "STOP USING THE ARROW KEYS!!!!!!!!!!!!!!!!!!!!!!!")) + + ;; Disable arrow keys in normal and visual modes + (define-key evil-normal-state-map (kbd "") 'sk/dont-arrow-me-bro) + (define-key evil-normal-state-map (kbd "") 'sk/dont-arrow-me-bro) + (define-key evil-normal-state-map (kbd "") 'sk/dont-arrow-me-bro) + (define-key evil-normal-state-map (kbd "") 'sk/dont-arrow-me-bro) + (evil-global-set-key 'motion (kbd "") 'sk/dont-arrow-me-bro) + (evil-global-set-key 'motion (kbd "") 'sk/dont-arrow-me-bro) + (evil-global-set-key 'motion (kbd "") 'sk/dont-arrow-me-bro) + (evil-global-set-key 'motion (kbd "") 'sk/dont-arrow-me-bro) + + (evil-set-initial-state 'messages-buffer-mode 'normal) + (evil-set-initial-state 'dashboard-mode 'normal)) + + (use-package evil-collection + :after evil + :custom + (evil-collection-outline-bind-tab-p nil) + :config + ;; Is this a bug in evil-collection? + (setq evil-collection-company-use-tng nil) + (delete 'lispy evil-collection-mode-list) + (delete 'org-present evil-collection-mode-list) + ;; (delete 'mu4e evil-collection-mode-list) + ;; (delete 'mu4e-conversation evil-collection-mode-list) + (evil-collection-init)) + + (use-package evil-org + :after (evil org) + :hook ((org-mode . evil-org-mode) + (org-agenda-mode . evil-org-mode)) + :config + (require 'evil-org-agenda) + (evil-org-set-key-theme '(navigation todo insert textobjects additional)) + (evil-org-agenda-set-keys)) + + (use-package evil-nerd-commenter + :bind ("M-/" . evilnc-comment-or-uncomment-lines)) + + (with-eval-after-load 'org + (evil-define-key '(normal insert visual) org-mode-map (kbd "C-j") 'org-next-visible-heading) + (evil-define-key '(normal insert visual) org-mode-map (kbd "C-k") 'org-previous-visible-heading) + (evil-define-key '(normal insert visual) org-mode-map (kbd "M-j") 'org-metadown) + (evil-define-key '(normal insert visual) org-mode-map (kbd "M-k") 'org-metaup)) +#+end_src +* Interface +#+begin_src emacs-lisp +(message "Got to interface") +#+end_src +** Hydra +#+begin_src emacs-lisp +(use-package hydra) +#+end_src +** Vertico +#+begin_src emacs-lisp + (use-package vertico + :bind (:map vertico-map + ("C-j" . vertico-next) + ("C-k" . vertico-previous) + ("C-f" . vertico-exit-input) + :map minibuffer-local-map + ("M-h" . vertico-directory-up)) + :custom + (vertico-cycle t) + + :hook (rfn-eshadow-update-overlay . vertico-directory-tidy) + :init + (require 'vertico-directory) + (vertico-mode)) +#+end_src +** Marginalia +#+begin_src emacs-lisp +(use-package marginalia + :after vertico + :ensure t + :custom + (marginalia-annotators '(marginalia-annotators-heavy marginalia-annotators-light nil)) + :init + (marginalia-mode)) +#+end_src +** Consult +#+begin_src emacs-lisp +(use-package consult + :bind (("C-s" . consult-line) + ("C-M-l" . consult-imenu) + ("C-M-j" . consult-buffer) + ("C-x C-b" . consult-buffer) + :map minibuffer-local-map + ("C-r" . consult-history))) + + +(use-package consult-dir + :bind (("C-x C-d" . consult-dir) + :map vertico-map + ("C-x C-d" . consult-dir) + ("C-x C-j" . consult-dir-jump-file)) + + :custom + (consult-dir-project-list-function nil)) +#+end_src +** Orderless +#+begin_src emacs-lisp +(use-package orderless + :config + (orderless-define-completion-style orderless+initialism + (orderless-matching-styles '(orderless-initialism + orderless-literal + orderless-regexp))) + + (setq completion-styles '(orderless) + completion-category-defaults nil + orderless-matching-styles '(orderless-literal orderless-regexp) + completion-category-overrides + '((file (styles partial-completion))))) +#+end_src +** Embark +#+begin_src emacs-lisp + (use-package embark + :after vertico + :bind (("C-." . embark-act) + ("M-." . embark-dwim) + :map minibuffer-local-map + ("C-d" . embark-act) + :map embark-region-map + ("D" . denote-region)) + + :config + ;; Remove the mixed indicator to prevent the popup from being displayed + ;; automatically + (delete #'embark-mixed-indicator embark-indicators) + (add-to-list 'embark-indicators 'embark-minimal-indicator) + + ;; Use Embark to show command prefix help + (setq prefix-help-command #'embark-prefix-help-command)) + + (use-package embark-consult + :after embark) + +#+end_src +** Corfu +#+begin_src emacs-lisp + (use-package corfu + :bind (:map corfu-map + ("C-j" . corfu-next) + ("C-k" . corfu-previous) + ("TAB" . corfu-insert) + ([tab] . corfu-insert) + ("C-f" . corfu-insert)) + :custom + (corfu-cycle t) + (corfu-auto t) + (corfu-preview-current nil) + (corfu-quit-at-boundary t) + (corfu-quit-no-match t) + (corfu-min-chars 3) + (corfu-auto-delay 0) + (corfu-auto-prefix 0) + :init + (global-corfu-mode) + + (defun corfu-enable-in-minibuffer () + "Enable Corfu in the minibuffer if `completion-at-point' is bound." + (when (where-is-internal #'completion-at-point (list (current-local-map))) + (setq-local corfu-auto nil) ;; Enable/disable auto completion + (setq-local corfu-echo-delay nil ;; Disable automatic echo and popup + corfu-popupinfo-delay nil) + (corfu-mode 1))) + + (add-hook 'minibuffer-setup-hook #'corfu-enable-in-minibuffer)) +#+end_src +** Dashboard +#+begin_src emacs-lisp + (use-package dashboard + :init + (setq initial-buffer-choice 'dashboard-open) + ;; Set the title + (setq dashboard-banner-logo-title "GET ME OUT GET ME OUT GET ME OUT") + (setq dashboard-image-banner-max-height 200) + ;; Set the banner + (setq dashboard-startup-banner '"~/.emacs.d/icon.png") + (setq dashboard-center-content t) + (setq dashboard-vertically-center-content t) + (setq dashboard-show-shortcuts nil) + + ;; nerd icons + (setq dashboard-display-icons-p t) ; display icons on both GUI and terminal + (setq dashboard-icon-type 'nerd-icons) ; use `nerd-icons' package + + ;; list stuff + (setq dashboard-items '((recents . 3) + (projects . 3) + (agenda . 3))) + :config + (dashboard-setup-startup-hook)) +#+end_src +* Auth +#+begin_src emacs-lisp +(message "Reached auth") +#+end_src +** Pinentry +#+begin_src emacs-lisp + (unless (eq system-type 'windows-nt) + (use-package pinentry + :config + (setq epa-pinentry-mode 'loopback)) + (pinentry-start)) +#+end_src +** Password-Store +#+begin_src emacs-lisp + (use-package password-store + :bind (("C-c p p" . password-store-copy) + ("C-c p i" . password-store-insert) + ("C-c p g" . password-store-generate)) + :config + (setq password-store-password-length 12)) + + (use-package auth-source-pass + :config + (auth-source-pass-enable)) +#+end_src +** OAuth2 +this should be useful later +#+begin_src emacs-lisp +(use-package oauth2 + :ensure t) +#+end_src +* Shell +#+begin_src emacs-lisp +(message "Reached shell") +#+end_src +** EShell +#+begin_src emacs-lisp +(defun sk/configure-eshell () + ;; Save command history when commands are entered + (add-hook 'eshell-pre-command-hook 'eshell-save-some-history) + + ;; Truncate buffer for performance + (add-to-list 'eshell-output-filter-functions 'eshell-truncate-buffer) + + ;; Bind some useful keys for evil-mode + (evil-define-key '(normal insert visual) eshell-mode-map (kbd "C-r") 'counsel-esh-history) + (evil-define-key '(normal insert visual) eshell-mode-map (kbd "") 'eshell-bol) + (evil-normalize-keymaps) + + (setq eshell-history-size 10000 + eshell-buffer-maximum-lines 10000 + eshell-hist-ignoredups t + eshell-scroll-to-bottom-on-input t)) + +(use-package eshell-git-prompt) + + + (add-hook 'eshell-first-time-mode 'sakomacs/configure-eshell) + + (with-eval-after-load 'esh-opt + (setq eshell-destroy-buffer-when-process-dies t) + (setq eshell-visual-commands '("htop" "zsh" "vim")) + + (eshell-git-prompt-use-theme 'powerline)) +#+end_src +** VTerm +#+begin_src emacs-lisp + (use-package vterm + :commands vterm + :config + (setq vterm-max-scrollback 10000)) +#+end_src +* Dev +#+begin_src emacs-lisp +(message "Reached dev") +#+end_src +** {} and () matching +#+begin_src emacs-lisp +(use-package smartparens + :hook (prog-mode . smartparens-mode) + :config + (sp-use-smartparens-bindings)) + +(use-package rainbow-delimiters + :hook (prog-mode . rainbow-delimiters-mode)) +#+end_src +** Compilation +#+begin_src emacs-lisp +(setq compilation-scroll-output t) + +(setq compilation-environment '("TERM=xterm-256color")) + +(defun sk/advice-compilation-filter (f proc string) + (funcall f proc (xterm-color-filter string))) + +(advice-add 'compilation-filter :around #'sk/advice-compilation-filter) + +(defun sk/auto-recompile-buffer () + (interactive) + (if (member #'recompile after-save-hook) + (remove-hook 'after-save-hook #'recompile t) + (add-hook 'after-save-hook #'recompile nil t))) +#+end_src +** Project.el +#+begin_src emacs-lisp +(setq project-switch-commands '((project-find-file "Find file" "f") (project-find-dir "Find dir" "d") (project-dired "Dired" "D") (consult-ripgrep "ripgrep" "g") (magit-project-status "Magit" "m"))) +#+end_src +** Eglot (LSP) +#+begin_src emacs-lisp + (use-package eglot + :bind (:map eglot-mode-map + ("C-c C-a" . eglot-code-actions) + ("C-c C-r" . eglot-rename)) + :config + (setq eglot-autoshutdown t + eglot-confirm-server-initiated-edits nil)) + + ;; this'll make it so i don't have to use vscode every now and then + ;; (when (eq system-type 'windows-nt) + ;; (use-package eglot-booster + ;; :straight (eglot-booster :type git :host github :repo "jdtsmith/eglot-booster") + ;; :after eglot + ;; :config (eglot-booster-mode)) + ;; ) + + (when (eq system-type 'gnu/linux) + (use-package eglot-booster + :ensure nil + :config (eglot-booster-mode))) +#+end_src +** Magit +#+begin_src emacs-lisp +(use-package magit + :bind ("C-M-;" . magit-status-here) + :custom + (magit-show-long-lines-warning nil) + (magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1)) + +(use-package magit-todos + :after magit + :config + (magit-todos-mode)) + +;; -- magit forge -- +(use-package forge + :after magit) +(setq auth-sources '("~/.authinfo")) + +(defhydra sk/smerge-panel () + "smerge" + ("k" (smerge-prev) "prev change" ) + ("j" (smerge-next) "next change") + ("u" (smerge-keep-upper) "keep upper") + ("l" (smerge-keep-lower) "keep lower") + ("q" nil "quit" :exit t)) +#+end_src +** Formatting +#+begin_src emacs-lisp +(use-package apheleia + :hook (prog-mode . apheleia-mode)) +#+end_src +** Flycheck (Syntax Checking) +#+begin_src emacs-lisp +(use-package flycheck + :config + (global-flycheck-mode +1)) +#+end_src +** Docker +#+begin_src emacs-lisp +(use-package docker + :ensure t + :bind ("C-c d" . docker)) +#+end_src +** Treemacs +#+begin_src emacs-lisp +(use-package treemacs + :defer t + :init + (with-eval-after-load 'winum + (define-key winum-keymap (kbd "M-0") #'treemacs-select-window)) + :config + (progn + (setq treemacs-collapse-dirs (if treemacs-python-executable 3 0) + treemacs-deferred-git-apply-delay 0.5 + treemacs-directory-name-transformer #'identity + treemacs-display-in-side-window t + treemacs-eldoc-display 'simple + treemacs-file-event-delay 2000 + treemacs-file-extension-regex treemacs-last-period-regex-value + treemacs-file-follow-delay 0.2 + treemacs-file-name-transformer #'identity + treemacs-follow-after-init t + treemacs-expand-after-init t + treemacs-find-workspace-method 'find-for-file-or-pick-first + treemacs-git-command-pipe "" + treemacs-goto-tag-strategy 'refetch-index + treemacs-header-scroll-indicators '(nil . "^^^^^^") + treemacs-hide-dot-git-directory t + treemacs-indentation 2 + treemacs-indentation-string " " + treemacs-is-never-other-window nil + treemacs-max-git-entries 5000 + treemacs-missing-project-action 'ask + treemacs-move-forward-on-expand nil + treemacs-no-png-images nil + treemacs-no-delete-other-windows t + treemacs-project-follow-cleanup nil + treemacs-persist-file (expand-file-name ".cache/treemacs-persist" user-emacs-directory) + treemacs-position 'left + treemacs-read-string-input 'from-child-frame + treemacs-recenter-distance 0.1 + treemacs-recenter-after-file-follow nil + treemacs-recenter-after-tag-follow nil + treemacs-recenter-after-project-jump 'always + treemacs-recenter-after-project-expand 'on-distance + treemacs-litter-directories '("/node_modules" "/.venv" "/.cask") + treemacs-project-follow-into-home nil + treemacs-show-cursor nil + treemacs-show-hidden-files t + treemacs-silent-filewatch nil + treemacs-silent-refresh nil + treemacs-sorting 'alphabetic-asc + treemacs-select-when-already-in-treemacs 'move-back + treemacs-space-between-root-nodes t + treemacs-tag-follow-cleanup t + treemacs-tag-follow-delay 1.5 + treemacs-text-scale nil + treemacs-user-mode-line-format nil + treemacs-user-header-line-format nil + treemacs-wide-toggle-width 70 + treemacs-width 35 + treemacs-width-increment 1 + treemacs-width-is-initially-locked t + treemacs-workspace-switch-cleanup nil) + + ;; The default width and height of the icons is 22 pixels. If you are + ;; using a Hi-DPI display, uncomment this to double the icon size. + ;;(treemacs-resize-icons 44) + + (treemacs-follow-mode t) + (treemacs-tag-follow-mode t) + (treemacs-project-follow-mode t) + (treemacs-filewatch-mode t) + (treemacs-fringe-indicator-mode 'always) + (when treemacs-python-executable + (treemacs-git-commit-diff-mode t)) + + (pcase (cons (not (null (executable-find "git"))) + (not (null treemacs-python-executable))) + (`(t . t) + (treemacs-git-mode 'deferred)) + (`(t . _) + (treemacs-git-mode 'simple))) + + (treemacs-hide-gitignored-files-mode nil)) + :bind + (:map global-map + ("M-0" . treemacs-select-window) + ("C-x t 1" . treemacs-delete-other-windows) + ("C-x t d" . treemacs-select-directory) + ("C-x t B" . treemacs-bookmark) + ("C-x t C-t" . treemacs-find-file) + ("C-x t M-t" . treemacs-find-tag))) + +(use-package treemacs-evil + :after (treemacs evil)) + +(use-package treemacs-magit + :after (treemacs magit)) + +(use-package treemacs-nerd-icons + :config + (treemacs-load-theme "nerd-icons")) +#+end_src +** Direnv +#+begin_src emacs-lisp + (when (eq system-type 'gnu/linux) + (use-package envrc + :hook (after-init . envrc-global-mode))) +#+end_src +** Color Picker +#+begin_src emacs-lisp + (use-package zenity-color-picker) +#+end_src +** editorconfig +people will probably get mad at me if i dont have this and i try to contribute +#+begin_src emacs-lisp +(use-package editorconfig + :config + (editorconfig-mode 1)) +#+end_src +** wakatime +the feds are watching +#+begin_src emacs-lisp + (use-package wakatime-mode + :config + (global-wakatime-mode)) +#+end_src +* Languages +#+begin_src emacs-lisp +(message "Reached languages") +#+end_src +** HTML/CSS +#+begin_src emacs-lisp +(use-package web-mode + :hook (web-mode . eglot-ensure) + :mode ("\\.html\\'" + "\\.css\\'")) +#+end_src +** Javascript +#+begin_src emacs-lisp +(use-package js2-mode +:mode ("\\.js\\'" + "\\.jsx\\'") +:hook (js2-mode . eglot-ensure) +:config +(setq web-mode-markup-indent-offset 2) ; HTML +(setq web-mode-css-indent-offset 2) ; CSS +(setq web-mode-code-indent-offset 2) ; JS/JSX/TS/TSX +(setq web-mode-content-types-alist '(("jsx" . "\\.js[x]?\\'")))) +#+end_src +** Typescript +#+begin_src emacs-lisp + + (add-to-list 'auto-mode-alist '(".*\\.ts" . typescript-ts-mode)) + (add-to-list 'auto-mode-alist '(".*\\.tsx" . tsx-ts-mode)) + + (add-hook 'typescript-ts-mode-hook 'eglot-ensure) + (add-hook 'tsx-ts-mode-hook 'eglot-ensure) + + (setq treesit-language-source-alist + '((typescript "https://github.com/tree-sitter/tree-sitter-typescript" "master" "typescript/src" nil nil) + (tsx "https://github.com/tree-sitter/tree-sitter-typescript" "master" "tsx/src" nil nil))) +#+end_src +** Astro +#+begin_src emacs-lisp + (define-derived-mode astro-mode web-mode "astro") + (setq auto-mode-alist + (append '((".*\\.astro\\'" . astro-mode)) + auto-mode-alist)) + + (add-to-list 'eglot-server-programs + '(astro-mode . ("astro-ls" "--stdio" + :initializationOptions + (:typescript (:tsdk "./node_modules/typescript/lib"))))) +#+end_src +** C/C++ +#+begin_src emacs-lisp +(add-hook 'c-mode-hook 'eglot-ensure) +(add-hook 'c++-mode-hook 'eglot-ensure) +#+end_src +** C# +#+begin_src emacs-lisp + (add-hook 'csharp-mode-hook 'eglot-ensure) + (when (eq system-type 'gnu/linux) + (add-to-list 'eglot-server-programs + `(csharp-mode . ("OmniSharp" "-lsp")))) + + (use-package csproj-mode + :mode ("\\.csproj\\'")) + + (use-package dotnet + :hook (dotnet-mode . csharp-mode)) +#+end_src +** CMake +#+begin_src emacs-lisp +(use-package cmake-mode + :mode "CMakeLists.txt" + :hook (cmake-mode . eglot-ensure)) +#+end_src +** Lua +#+begin_src emacs-lisp +(use-package lua-mode + :mode "\\.lua\\'" + :hook (lua-mode . eglot-ensure)) +#+end_src +** Python +#+begin_src emacs-lisp +(use-package python-mode + :mode "\\.py\\'" + :hook (python-mode . eglot-ensure)) + +(use-package elpy +:after python-mode + +:custom +(elpy-rpc-python-command "python3") + +:config +(elpy-enable)) + +(use-package poetry + :config + (poetry-tracking-mode 1)) +#+end_src +** Yaml +#+begin_src emacs-lisp + (use-package yaml-mode + :hook (yaml-mode. eglot-ensure) + :mode ("\\.yml\\'" + "\\.yaml\\'")) +#+end_src +** Nix +#+begin_src emacs-lisp +(use-package nix-mode + :hook (nix-mode . eglot-ensure) + :mode "\\.nix\\'") +#+end_src +** Dart +#+begin_src emacs-lisp +(use-package dart-mode + :hook (dart-mode . eglot-ensure) +:mode "\\.dart\\'" ) +#+end_src +** Markdown +#+begin_src emacs-lisp +(use-package markdown-mode + :hook (markdown-mode . visual-line-mode)) + +(use-package markdown-preview-mode) +#+end_src +** GDScript +#+begin_src emacs-lisp +(use-package gdscript-mode + :hook (gdscript-mode . eglot-ensure) + :mode "\\.gd\\'") +#+end_src +** Rust +#+begin_src emacs-lisp + (use-package rustic + :ensure t + :config + (setq rustic-format-on-save nil) + (setq rustic-lsp-client 'eglot) + :custom + (rustic-cargo-use-last-stored-arguments t)) +#+end_src +** Haskell +#+begin_src emacs-lisp + (use-package haskell-mode + :hook (haskell-mode . eglot-ensure) + :mode "\\.hs'") +#+end_src +** Go +#+begin_src emacs-lisp + (use-package go-mode + :mode "\\.go\\'" + :hook (go-mode . eglot-ensure)) +#+end_src +* Social +#+begin_src emacs-lisp +(message "Reached social") +#+end_src +** Elcord (Discord rich precense) +#+begin_src emacs-lisp + (use-package elcord + :init + (setq elcord-display-buffer-details nil) + (setq elcord-use-major-mode-as-main-icon t) + (setq elcord-quiet t) + :config + (elcord-mode)) +#+end_src +** Telegram +does NOT WORK ON WINDOWS +#+begin_src emacs-lisp +(unless (eq system-type 'windows-nt) + (use-package telega)) +#+end_src +** rcirc (irc) +#+begin_src emacs-lisp + (require 'rcirc) + + + (defvar *rcirc-last-message-time* nil) + (defvar *rcirc-last-message-time-file* "~/.emacs.d/.rcirc-last-message-time") + (defvar *rcirc-last-message-time-initial* nil) + + + (setq rcirc-id-string "Emacs rcirc") + + (setq rcirc-server-alist `(("znc.sako.box" + :port 7000 + :encryption tls + :nick "sako@emacs/Libera" + :user-name "sako@emacs/Libera" + :password ,(concat "sako@emacs/Libera:" (password-store-get "SelfHosted/ZNC"))))) + + (defun rcirc-detach-buffer () + (interactive) + (let ((buffer (current-buffer))) + (when (and (rcirc-buffer-process) + (eq (process-status (rcirc-buffer-process)) 'open)) + (with-rcirc-server-buffer + (setq rcirc-buffer-alist + (rassq-delete-all buffer rcirc-buffer-alist))) + (rcirc-update-short-buffer-names) + (if (rcirc-channel-p rcirc-target) + (rcirc-send-string (rcirc-buffer-process) + (concat "DETACH " rcirc-target)))) + (setq rcirc-target nil) + (kill-buffer buffer))) +#+end_src +** elfeed (rss) +Will configure later, (use elfeed protocol ok ty) +#+begin_src emacs-lisp + (use-package elfeed + :config + (setq elfeed-use-curl t) + (elfeed-set-timeout 36000) + ) + + (use-package elfeed-protocol + :config + ;; setup feeds + (setq elfeed-protocol-fever-update-unread-only nil) + (setq elfeed-protocol-fever-fetch-category-as-tag t) + (setq elfeed-protocol-feeds '(("fever+https://sako@rss.sako.box" + :api-url "https://rss.sako.box/fever/" + :password (password-store-get "SelfHosted/rss.sako.box/fever")))) + + ;; enable elfeed-protocol + (setq elfeed-protocol-enabled-protocols '(fever)) + (elfeed-protocol-enable)) +#+end_src +** Matrix +Ill set this up later as well +#+begin_src emacs-lisp + (use-package ement + :commands ement-connect + :custom + (ement-notify-dbus-p nil) ;; Turn off notifications + (ement-sessions-file "~/.cache/ement.el") + (ement-room-list-default-keys + '(;; Group all invitations (this group will appear first since the rooms are + ;; already sorted first). + ((membership :status 'invite)) + + ;; Group all left rooms (this group will appear last, because the rooms are already + ;; sorted last). + ((membership :status 'leave)) + + ;; Group all favorite rooms, which are already sorted first. + (favourite) + + ;; Group all low-priority rooms, which are already sorted last. + (low-priority) + + ;; Group other rooms which are unread. + (unread) + (people) + freshness))) +#+end_src +** Subsonic +#+begin_src emacs-lisp +(use-package subsonic) +#+end_src +** EMMS +Emacs music player lmfao +#+begin_src emacs-lisp + (use-package emms + :config + (emms-all) + (setq emms-player-list '(emms-player-mpd)) + (setq emms-info-functions '(emms-info-mod)) + (setq emms-source-file-default-directory "~/music") + ;; TODO Keybinds maybe + ) +#+end_src +** GPTel +its over the machines took over guys can i get my likes now +#+begin_src emacs-lisp + (use-package gptel + :config + (gptel-make-ollama "Ollama" + :host "localhost:11434" + :stream t + :models '("mistral:latest"))) +#+end_src +** mu4e +GNU patch review metho dor sometihng idk +#+begin_src emacs-lisp + + (use-package auth-source-xoauth2) + (use-package mu4e + :config + + ;; mu4e syncing issue with isync + (setq mu4e-change-filenames-when-moving t) + + ;; sending mail + (setq message-send-mail-function 'smtpmail-send-it) + (add-to-list 'smtpmail-auth-supported 'xoauth2) + + (setq mu4e-update-interval (* 10 60)) + (setq mu4e-get-mail-command "offlineimap") + (setq mu4e-maildir "~/Mail") + + ;; for mail accounts + (setq sakomacs-mail-accounts (json-read-file "~/Mail/accounts.json")) + + (setq mu4e-context-policy 'pick-first) + (setq mu4e-compose-context-policy 'always-ask) + (setq mu4e-contexts + (list + ;; outlook + (make-mu4e-context + :name "Outlook" + :match-func + (lambda (msg) + (when msg + (string-prefix-p "/Outlook" (mu4e-message-field msg :maildir)))) + :vars `((user-mail-address . ,(cdr (assoc 'outlook sakomacs-mail-accounts))) + (user-full-name . "Sako") + (mu4e-drafts-folder . "/Outlook/Drafts") + (mu4e-sent-folder . "/Outlook/Sent") + (mu4e-refile-folder . "/Outlook/Inbox") + (mu4e-trash-folder . "/Outlook/Deleted") + ;; todo stmpmail and compose signatures + )) + (make-mu4e-context + :name "Proton" + :match-func + (lambda (msg) + (when msg + (string-prefix-p "/Proton" (mu4e-message-field msg :maildir)))) + :vars `((user-mail-address . ,(cdr (assoc 'protonmail sakomacs-mail-accounts))) + (user-full-name . "Sako") + (mu4e-drafts-folder . "/Proton/Drafts") + (mu4e-sent-folder . "/Proton/Sent") + (mu4e-refile-folder . "/Proton/Inbox") + (mu4e-trash-folder . "/Proton/Trash")) + ;; todo stmpmail and compose signatures + ) + (make-mu4e-context + :name "Gmail Personal 1" + :match-func + (lambda (msg) + (when msg + (string-prefix-p "/Gmail-Personal-1" (mu4e-message-field msg :maildir)))) + :vars `((user-mail-address . ,(cdr (assoc 'gmail-1 sakomacs-mail-accounts))) + (user-full-name . "Sako") + (mu4e-drafts-folder . "/Gmail-Personal-1/Drafts") + (mu4e-sent-folder . "/Gmail-Personal-1/Sent Mail") + (mu4e-refile-folder . "/Gmail-Personal-1/Inbox") + (mu4e-trash-folder . "Gmail-Personal-1/Trash") + ;; todo stmpmail and compose signatures + )) + (make-mu4e-context + :name "Second Personal Gmail" + :match-func + (lambda (msg) + (when msg + (string-prefix-p "/Gmail-Personal-2" (mu4e-message-field msg :maildir)))) + :vars `((user-mail-address . ,(cdr (assoc 'gmail-2 sakomacs-mail-accounts))) + (user-full-name . "Sako") + (mu4e-drafts-folder . "/Gmail-Personal-2/Drafts") + (mu4e-sent-folder . "/Gmail-Personal-2/Sent Mail") + (mu4e-refile-folder . "/Gmail-Personal-2/Inbox") + (mu4e-trash-folder . "Gmail-Personal-2/Trash") + )) + + )) + ) +#+end_src +* Org +#+begin_src emacs-lisp +(message "Reached Org") +#+end_src +** Org mode configuration +#+begin_src emacs-lisp + (use-package org + :hook (org-mode . org-indent-mode) + :config + (setq org-ellipsis " ↓") + (setq org-agenda-start-with-log-mode t) + (setq org-log-done 'time) + (setq org-log-into-drawer t) + + ;; habits, useless for now though + ;; (require 'org-habit) + ;; (add-to-list 'org-modules 'org-habit) + ;; (setq org-habit-graph-column 60) + + ;; archive + (setq org-refile-targets + '(("archive.org" :maxlevel . 1))) + + ;; make sure to save everything after refiling + (advice-add 'org-refile :after 'org-save-all-org-buffers) + + ;; org agenda + (setq org-agenda-files + '("~/org/tasks.org" + "~/org/school.org" + "~/org/daily.org" + "~/org/irl.org" + "~/org/work.org")) + + ;; follow links + (setq org-return-follows-link t) + + ;; hide leading stars + (setq org-hide-leading-stars t) + (setq org-hide-emphasis-markers nil) + + ;; org latex pdf options + (setq org-latex-compiler "lualatex") + (setq org-preview-latex-default-process 'dvisvgm) + + ;; templates + (require 'org-tempo) + + ;; this'll come in handly later + (add-to-list 'org-structure-template-alist '("sh" . "src shell")) + (add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp")) + (add-to-list 'org-structure-template-alist '("py" . "src python")) + + ;; more options + (setq org-todo-keywords + '((sequence "TODO(t)" "NEXT(n)" "|" "DONE(d!)") + (sequence "BACKLOG(b)" "PLAN(p)" "READY(r)" "ACTIVE(a)" "REVIEW(v)" "WAIT(w@/!)" "HOLD(h)" "|" "COMPLETED(c)" "CANCELED(k@)"))) + + ;; this is really useful + (setq org-startup-with-inline-images t) + + ;; i hope i actually use this eventually + (setq org-capture-templates + `(("t" "Tasks") + ("tt" "Task" entry (file+olp "~/org/tasks.org" "captured") + "* TODO %?\n %U\n %a\n %i" :empty-lines1))) + ) + + +#+end_src +** Org Roam +#+begin_src emacs-lisp + (use-package org-roam + :custom + (org-roam-directory "~/org/notes") + :bind (("C-c n l" . org-roam-buffer-toggle) + ("C-c n f" . org-roam-node-find) + ("C-c n i" . org-roam-node-insert)) + :config + (org-roam-setup)) +#+end_src +** Org-wild-notifier +#+begin_src emacs-lisp + (use-package org-wild-notifier + :config + (setq alert-default-style 'libnotify) + (setq org-wild-notifier-alert-time 30) + (org-wild-notifier-mode)) +#+end_src +** Org-Pomodoro +#+begin_src emacs-lisp +(use-package org-pomodoro) +#+end_src +** PDF-Tools +Export and then view with emacs :) +#+begin_src emacs-lisp +(use-package pdf-tools) +#+end_src +* EXWM +I'm scared +#+begin_src emacs-lisp + + (defcustom is-exwm nil + "Toggle if EXWM is being used" + :type 'boolean) + + (when (eq system-type 'gnu/linux) + (when is-exwm + (use-package exwm + :config + (set-frame-parameter nil 'alpha '(90 . 90)) + (add-to-list 'default-frame-alist '(alpha . (90 . 90))) + + (defun sakomacs/exwm-init-hook () + ;; background + (call-process-shell-command "feh --bg-fill ~/background.png" nil 0) + ;; (set-frame-parameter nil 'alpha 90) + ;; (call-process-shell-command "~/.config/polybar/startpolybar" nil 0) + (call-process-shell-command "~/.config/picom/startpicom" nil 0) + ;; startup + (call-process-shell-command "nm-applet" nil 0) + (call-process-shell-command "blueman-applet" nil 0) + ;; (call-process-shell-command "nextcloud" nil 0) + ;; (call-process-shell-command "bitwarden" nil 0) + (call-process-shell-command "flameshot" nil 0) + + ;; battery + (display-battery-mode) + ;; show time on the modeline + (setq display-time-default-load-average nil) + (setq display-time-24hr-format t) + (display-time-mode t) + ;; shrink fringe to 1px + (fringe-mode 1) + ) + + ;; background + ;; todo turn this info a function + (add-hook 'exwm-init-hook 'sakomacs/exwm-init-hook) + ;; startup + ;; workspaces + (setq exwm-workspace-number 5) + + + (require 'exwm-systemtray) + (exwm-systemtray-enable) + + ;; polybar + (defvar sakomacs/polybar-process nil + "Holds the process of the running Polybar instance, if any") + + (server-start) + + (defun sakomacs/kill-panel () + (interactive) + (when sakomacs/polybar-process + (ignore-errors + (kill-process sakomacs/polybar-process))) + (setq sakomacs/polybar-process nil)) + + (defun sakomacs/start-panel () + (interactive) + (sakomacs/kill-panel) + (setq sakomacs/polybar-process (start-process-shell-command "polybar" nil "polybar panel"))) + + (defun sakomacs/send-polybar-hook (module-name hook-index) + (start-process-shell-command "polybar-msg" nil (format "polybar-msg hook %s %s" module-name hook-index))) + + (defun sakomacs/send-polybar-exwm-workspace () + (sakomacs/send-polybar-hook "exwm-workspace" 1)) + + ;; Update panel indicator when workspace changes + (add-hook 'exwm-workspace-switch-hook #'sakomacs/send-polybar-exwm-workspace) + + + ;; make the buffer names better + (add-hook 'exwm-update-class-hook + (lambda () + (unless (or (string-prefix-p "sun-awt-X11-" exwm-instance-name) + (string= "gimp" exwm-instance-name)) + (exwm-workspace-rename-buffer exwm-class-name)))) + (add-hook 'exwm-update-title-hook + (lambda () + (when (or (not exwm-instance-name) + (string-prefix-p "sun-awt-X11-" exwm-instance-name) + (string= "gimp" exwm-instance-name)) + (exwm-workspace-rename-buffer exwm-title)))) + + ;; always use these keys in emacs + (setq exwm-input-prefix-keys + '(?\C-x + ?\C-u + ?\C-h + ?\M-x + ?\M-` + ?\M-& + ?\M-: + ?\C-\M-j ;; Buffer list + ?\C-\ )) ;; Ctrl+Space + + (setq exwm-input-stimulation-keys + '( + ;; cut/paste. + ([?\C-w] . [?\C-x]) + ([?\M-w] . [?\C-c]) + ([?\C-y] . [?\C-v]))) + + + ;; Ctrl+/3Q will enable the next key to be sent directly + (define-key exwm-mode-map [?\C-q] 'exwm-input-send-next-key) + ;; app launcher and fullscreen + (exwm-input-set-key (kbd "s-SPC") 'app-launcher-run-app) + (exwm-input-set-key (kbd "s-f") 'exwm-layout-toggle-fullscreen) + (exwm-input-set-key (kbd "s-") 'vterm) + + ;; kill apps + (exwm-input-set-key (kbd "s-q") #'kill-current-buffer) + + ;; Set up global key bindings. These always work, no matter the input state! + ;; Keep in mind that changing this list after EXWM initializes has no effect. + (setq exwm-input-global-keys + `( + ;; Reset to line-mode (C-c C-k switches to char-mode via exwm-input-release-keyboard) + ([?\s-r] . exwm-reset) + + ;; Move between windows + ([s-left] . windmove-left) + ([s-right] . windmove-right) + ([s-up] . windmove-up) + ([s-down] . windmove-down) + + ;; Launch applications via shell command + ([?\s-&] . (lambda (command) + (interactive (list (read-shell-command "$ "))) + (start-process-shell-command command nil command))) + + ;; Switch workspace + ([?\s-w] . exwm-workspace-switch) + + ;; 's-N': Switch to certain workspace with Super (Win) plus a number key (0 - 9) + ,@(mapcar (lambda (i) + `(,(kbd (format "s-%d" i)) . + (lambda () + (interactive) + (exwm-workspace-switch-create ,i)))) + (number-sequence 0 9)))) + ) + + (use-package desktop-environment + :after exwm + :config (desktop-environment-mode) + :custom + (desktop-environment-brightness-small-increment "2%+") + (desktop-environment-brightness-small-decrement "2%-") + (desktop-environment-brightness-normal-increment "5%+") + (desktop-environment-brightness-normal-decrement "5%-")) + )) +#+end_src +* End +#+begin_src elisp + (message "Welcome to Emacs!") + + ;; EOF +#+end_src From 7feb3094b58fd7fc53c294e84193b199a3dfd79d Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Fri, 4 Oct 2024 23:48:16 +0400 Subject: [PATCH 171/319] config/emacs: test --- config/emacs/emacs.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index d4f587a9..4df623ab 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1099,7 +1099,7 @@ does NOT WORK ON WINDOWS :encryption tls :nick "sako@emacs/Libera" :user-name "sako@emacs/Libera" - :password ,(concat "sako@emacs/Libera:" (password-store-get "SelfHosted/ZNC"))))) + :password ,(concat "sako@emacs/Libera:" (decode-coding-string (password-store-get "SelfHosted/ZNC")))))) (defun rcirc-detach-buffer () (interactive) From 2c44f1108990e203f363cd2d8fe684988251f956 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Fri, 4 Oct 2024 23:50:24 +0400 Subject: [PATCH 172/319] config/emacs: test 2 --- config/emacs/emacs.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 4df623ab..aedf8baf 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1099,7 +1099,7 @@ does NOT WORK ON WINDOWS :encryption tls :nick "sako@emacs/Libera" :user-name "sako@emacs/Libera" - :password ,(concat "sako@emacs/Libera:" (decode-coding-string (password-store-get "SelfHosted/ZNC")))))) + :password ,(concat "sako@emacs/Libera:" (decode-coding-string (password-store-get "SelfHosted/ZNC") 'utf-8))))) (defun rcirc-detach-buffer () (interactive) From 3d45414f8a88c420f2a5536b944cea5b8b78d9f0 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sat, 5 Oct 2024 00:01:35 +0400 Subject: [PATCH 173/319] config/emacs: test three --- config/emacs/emacs.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index aedf8baf..95e30e64 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1099,7 +1099,7 @@ does NOT WORK ON WINDOWS :encryption tls :nick "sako@emacs/Libera" :user-name "sako@emacs/Libera" - :password ,(concat "sako@emacs/Libera:" (decode-coding-string (password-store-get "SelfHosted/ZNC") 'utf-8))))) + :password ,(concat "sako@emacs/Libera:" (format "%s" (password-store-get "SelfHosted/ZNC")))))) (defun rcirc-detach-buffer () (interactive) From 2b8250a7608d2744ae2c32169d25b6f5aa2667cd Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sat, 5 Oct 2024 00:04:41 +0400 Subject: [PATCH 174/319] config/emacs: last try --- config/emacs/emacs.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 95e30e64..ef8243fb 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1099,7 +1099,7 @@ does NOT WORK ON WINDOWS :encryption tls :nick "sako@emacs/Libera" :user-name "sako@emacs/Libera" - :password ,(concat "sako@emacs/Libera:" (format "%s" (password-store-get "SelfHosted/ZNC")))))) + :password ,(concat "sako@emacs/Libera:" (string-trim (password-store-get "SelfHosted/ZNC")))))) (defun rcirc-detach-buffer () (interactive) From 829c25252d1f709cbc22ace54e495650fd530388 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sat, 5 Oct 2024 00:06:56 +0400 Subject: [PATCH 175/319] config/emacs: its over --- config/emacs/emacs.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index ef8243fb..c46144c2 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1099,7 +1099,7 @@ does NOT WORK ON WINDOWS :encryption tls :nick "sako@emacs/Libera" :user-name "sako@emacs/Libera" - :password ,(concat "sako@emacs/Libera:" (string-trim (password-store-get "SelfHosted/ZNC")))))) + :password ,(concat "sako@emacs/Libera:" password-store-get "SelfHosted/ZNC")))) (defun rcirc-detach-buffer () (interactive) From 8281bdd71f9594d789ca695c9a1293cfdb6268d5 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sat, 5 Oct 2024 11:06:34 +0400 Subject: [PATCH 176/319] config/emacs: missing paren --- config/emacs/emacs.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index c46144c2..d4f587a9 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1099,7 +1099,7 @@ does NOT WORK ON WINDOWS :encryption tls :nick "sako@emacs/Libera" :user-name "sako@emacs/Libera" - :password ,(concat "sako@emacs/Libera:" password-store-get "SelfHosted/ZNC")))) + :password ,(concat "sako@emacs/Libera:" (password-store-get "SelfHosted/ZNC"))))) (defun rcirc-detach-buffer () (interactive) From f378f028cf391e5f556be95d238e0506b8ab1c00 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sat, 5 Oct 2024 11:35:11 +0400 Subject: [PATCH 177/319] config/emacs: weird attempt --- config/emacs/emacs.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index d4f587a9..2a3438b9 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1099,7 +1099,7 @@ does NOT WORK ON WINDOWS :encryption tls :nick "sako@emacs/Libera" :user-name "sako@emacs/Libera" - :password ,(concat "sako@emacs/Libera:" (password-store-get "SelfHosted/ZNC"))))) + :password ,(concat "sako@emacs/Libera:" (shell-command-to-string "pass show SelfHosted/ZNC | head -n 1"))))) (defun rcirc-detach-buffer () (interactive) From ebb1cf832c0ab9088d4ec626c7d68aaba06dbe4c Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sat, 5 Oct 2024 11:36:44 +0400 Subject: [PATCH 178/319] config/emacs: horror --- config/emacs/emacs.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 2a3438b9..7839245e 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1099,7 +1099,7 @@ does NOT WORK ON WINDOWS :encryption tls :nick "sako@emacs/Libera" :user-name "sako@emacs/Libera" - :password ,(concat "sako@emacs/Libera:" (shell-command-to-string "pass show SelfHosted/ZNC | head -n 1"))))) + :password ,(concat "sako@emacs/Libera:" (string-trim (shell-command-to-string "pass show SelfHosted/ZNC | head -n 1")))))) (defun rcirc-detach-buffer () (interactive) From 46db94d4e8c7511be8061688d389fff9d56262e4 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sat, 5 Oct 2024 12:16:56 +0400 Subject: [PATCH 179/319] config/emacs: try enlight to replace dashboard.el --- config/emacs/emacs.org | 58 +++++++++++++++++++++++++++--------------- 1 file changed, 38 insertions(+), 20 deletions(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 7839245e..a4aa0250 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -590,28 +590,46 @@ kept-old-versions 5) #+end_src ** Dashboard #+begin_src emacs-lisp - (use-package dashboard - :init - (setq initial-buffer-choice 'dashboard-open) - ;; Set the title - (setq dashboard-banner-logo-title "GET ME OUT GET ME OUT GET ME OUT") - (setq dashboard-image-banner-max-height 200) - ;; Set the banner - (setq dashboard-startup-banner '"~/.emacs.d/icon.png") - (setq dashboard-center-content t) - (setq dashboard-vertically-center-content t) - (setq dashboard-show-shortcuts nil) + ;; (use-package dashboard + ;; :init + ;; (setq initial-buffer-choice 'dashboard-open) + ;; ;; Set the title + ;; (setq dashboard-banner-logo-title "GET ME OUT GET ME OUT GET ME OUT") + ;; (setq dashboard-image-banner-max-height 200) + ;; ;; Set the banner + ;; (setq dashboard-startup-banner '"~/.emacs.d/icon.png") + ;; (setq dashboard-center-content t) + ;; (setq dashboard-vertically-center-content t) + ;; (setq dashboard-show-shortcuts nil) - ;; nerd icons - (setq dashboard-display-icons-p t) ; display icons on both GUI and terminal - (setq dashboard-icon-type 'nerd-icons) ; use `nerd-icons' package + ;; ;; nerd icons + ;; (setq dashboard-display-icons-p t) ; display icons on both GUI and terminal + ;; (setq dashboard-icon-type 'nerd-icons) ; use `nerd-icons' package - ;; list stuff - (setq dashboard-items '((recents . 3) - (projects . 3) - (agenda . 3))) - :config - (dashboard-setup-startup-hook)) + ;; ;; list stuff + ;; (setq dashboard-items '((recents . 3) + ;; (projects . 3) + ;; (agenda . 3))) + ;; :config + ;; (dashboard-setup-startup-hook)) +#+end_src +** Enlight +#+begin_src emacs-lisp + (use-package enlight + :config + (setopt initial-buffer-choice #'enlight) + :custom + (enlight-content + (concat + (propertize "MENU" 'face 'highlight) + "\n" + (enlight-menu + '(("Org Mode" + ("Org-Agenda (current day)" (org-agenda nil "a") "a")) + ("Hi" + ("mu4e" mu4e "m")) + ("Other" + ("Projects" project-switch-project "p"))))))) #+end_src * Auth #+begin_src emacs-lisp From 832638aee02f8adc42dbb0dad7639dfa09269828 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sat, 5 Oct 2024 12:19:48 +0400 Subject: [PATCH 180/319] config/emacs: nvm --- config/emacs/emacs.org | 58 +++++++++++++++--------------------------- 1 file changed, 20 insertions(+), 38 deletions(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index a4aa0250..7839245e 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -590,46 +590,28 @@ kept-old-versions 5) #+end_src ** Dashboard #+begin_src emacs-lisp - ;; (use-package dashboard - ;; :init - ;; (setq initial-buffer-choice 'dashboard-open) - ;; ;; Set the title - ;; (setq dashboard-banner-logo-title "GET ME OUT GET ME OUT GET ME OUT") - ;; (setq dashboard-image-banner-max-height 200) - ;; ;; Set the banner - ;; (setq dashboard-startup-banner '"~/.emacs.d/icon.png") - ;; (setq dashboard-center-content t) - ;; (setq dashboard-vertically-center-content t) - ;; (setq dashboard-show-shortcuts nil) + (use-package dashboard + :init + (setq initial-buffer-choice 'dashboard-open) + ;; Set the title + (setq dashboard-banner-logo-title "GET ME OUT GET ME OUT GET ME OUT") + (setq dashboard-image-banner-max-height 200) + ;; Set the banner + (setq dashboard-startup-banner '"~/.emacs.d/icon.png") + (setq dashboard-center-content t) + (setq dashboard-vertically-center-content t) + (setq dashboard-show-shortcuts nil) - ;; ;; nerd icons - ;; (setq dashboard-display-icons-p t) ; display icons on both GUI and terminal - ;; (setq dashboard-icon-type 'nerd-icons) ; use `nerd-icons' package + ;; nerd icons + (setq dashboard-display-icons-p t) ; display icons on both GUI and terminal + (setq dashboard-icon-type 'nerd-icons) ; use `nerd-icons' package - ;; ;; list stuff - ;; (setq dashboard-items '((recents . 3) - ;; (projects . 3) - ;; (agenda . 3))) - ;; :config - ;; (dashboard-setup-startup-hook)) -#+end_src -** Enlight -#+begin_src emacs-lisp - (use-package enlight - :config - (setopt initial-buffer-choice #'enlight) - :custom - (enlight-content - (concat - (propertize "MENU" 'face 'highlight) - "\n" - (enlight-menu - '(("Org Mode" - ("Org-Agenda (current day)" (org-agenda nil "a") "a")) - ("Hi" - ("mu4e" mu4e "m")) - ("Other" - ("Projects" project-switch-project "p"))))))) + ;; list stuff + (setq dashboard-items '((recents . 3) + (projects . 3) + (agenda . 3))) + :config + (dashboard-setup-startup-hook)) #+end_src * Auth #+begin_src emacs-lisp From e8a58008941956be03153cb8590438af7936f9b7 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sat, 5 Oct 2024 12:26:35 +0400 Subject: [PATCH 181/319] config/hyprland: use both control keys instead to switch layouts --- config/hyprland/hyprland.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/hyprland/hyprland.conf b/config/hyprland/hyprland.conf index 06d36be3..a921b744 100644 --- a/config/hyprland/hyprland.conf +++ b/config/hyprland/hyprland.conf @@ -56,7 +56,7 @@ input { kb_layout = us, ara kb_variant = kb_model = - kb_options = grp:alt_shift_toggle, ctrl:nocaps + kb_options = grp:ctrls-toggle, ctrl:nocaps kb_rules = # no mouse acceleration pls :) From b6f7aaf8474a352ea8c73a6a495a5d6bbf0b0d37 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sat, 5 Oct 2024 12:28:56 +0400 Subject: [PATCH 182/319] config/hyprland: im an idiot --- config/hyprland/hyprland.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/hyprland/hyprland.conf b/config/hyprland/hyprland.conf index a921b744..b61f777c 100644 --- a/config/hyprland/hyprland.conf +++ b/config/hyprland/hyprland.conf @@ -56,7 +56,7 @@ input { kb_layout = us, ara kb_variant = kb_model = - kb_options = grp:ctrls-toggle, ctrl:nocaps + kb_options = grp:ctrls_toggle, ctrl:nocaps kb_rules = # no mouse acceleration pls :) From be30c61b7897c0cd3d7322f96d21be5289c28153 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sat, 5 Oct 2024 12:39:41 +0400 Subject: [PATCH 183/319] config/emacs: change a few things on dashboard --- config/emacs/emacs.org | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 7839245e..23d33661 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -594,8 +594,8 @@ kept-old-versions 5) :init (setq initial-buffer-choice 'dashboard-open) ;; Set the title - (setq dashboard-banner-logo-title "GET ME OUT GET ME OUT GET ME OUT") - (setq dashboard-image-banner-max-height 200) + (setq dashboard-banner-logo-title "Welcome to Emacs!") + (setq dashboard-image-banner-max-height 100) ;; Set the banner (setq dashboard-startup-banner '"~/.emacs.d/icon.png") (setq dashboard-center-content t) @@ -607,9 +607,7 @@ kept-old-versions 5) (setq dashboard-icon-type 'nerd-icons) ; use `nerd-icons' package ;; list stuff - (setq dashboard-items '((recents . 3) - (projects . 3) - (agenda . 3))) + (setq dashboard-items '((projects . 3))) :config (dashboard-setup-startup-hook)) #+end_src From f9ad9f200a8cd32e97c7d6539ab8f1d8e26ca8de Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 6 Oct 2024 16:59:43 +0400 Subject: [PATCH 184/319] config/emacs: sigma skibidi toilet --- config/emacs/emacs.org | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 23d33661..ba158bb0 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -632,9 +632,7 @@ kept-old-versions 5) :config (setq password-store-password-length 12)) - (use-package auth-source-pass - :config - (auth-source-pass-enable)) + (auth-source-pass-enable) #+end_src ** OAuth2 this should be useful later @@ -1097,7 +1095,7 @@ does NOT WORK ON WINDOWS :encryption tls :nick "sako@emacs/Libera" :user-name "sako@emacs/Libera" - :password ,(concat "sako@emacs/Libera:" (string-trim (shell-command-to-string "pass show SelfHosted/ZNC | head -n 1")))))) + :password ,(concat "sako@emacs/Libera:" (password-store-get "SelfHosted/ZNC"))))) (defun rcirc-detach-buffer () (interactive) From 737cbe2712aad3d884df6b2f381a721acd438cdc Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 6 Oct 2024 17:00:41 +0400 Subject: [PATCH 185/319] config/emacs: add pass major mode --- config/emacs/emacs.org | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index ba158bb0..c45b74b0 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -632,6 +632,8 @@ kept-old-versions 5) :config (setq password-store-password-length 12)) + (use-package pass) + (auth-source-pass-enable) #+end_src ** OAuth2 From cacee6e28083d18470f38a1d8608e1f492d3ebad Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 6 Oct 2024 17:08:58 +0400 Subject: [PATCH 186/319] config/emacs: shennanigan test --- config/emacs/emacs.org | 58 ++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 30 deletions(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index c45b74b0..fd017bd2 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1082,37 +1082,35 @@ does NOT WORK ON WINDOWS #+end_src ** rcirc (irc) #+begin_src emacs-lisp - (require 'rcirc) + ;; (require 'rcirc) - - (defvar *rcirc-last-message-time* nil) - (defvar *rcirc-last-message-time-file* "~/.emacs.d/.rcirc-last-message-time") - (defvar *rcirc-last-message-time-initial* nil) - - - (setq rcirc-id-string "Emacs rcirc") - - (setq rcirc-server-alist `(("znc.sako.box" - :port 7000 - :encryption tls - :nick "sako@emacs/Libera" - :user-name "sako@emacs/Libera" - :password ,(concat "sako@emacs/Libera:" (password-store-get "SelfHosted/ZNC"))))) - - (defun rcirc-detach-buffer () - (interactive) - (let ((buffer (current-buffer))) - (when (and (rcirc-buffer-process) - (eq (process-status (rcirc-buffer-process)) 'open)) - (with-rcirc-server-buffer - (setq rcirc-buffer-alist - (rassq-delete-all buffer rcirc-buffer-alist))) - (rcirc-update-short-buffer-names) - (if (rcirc-channel-p rcirc-target) - (rcirc-send-string (rcirc-buffer-process) - (concat "DETACH " rcirc-target)))) - (setq rcirc-target nil) - (kill-buffer buffer))) + (use-package rcirc + :ensure nil + :custom + (rcirc-id-string "Emacs rcirc") + (rcirc-server-alist `(("znc.sako.box" + :port 7000 + :encryption tls + :nick "sako@emacs/Libera" + :user-name "sako@emacs/Libera" + :password ,(concat "sako@emacs/Libera:" (password-store-get "SelfHosted/ZNC"))))) + (rcirc-fill-column 120) + (rcirc-reconnect-delay 5) + :config + (defun rcirc-detach-buffer () + (interactive) + (let ((buffer (current-buffer))) + (when (and (rcirc-buffer-process) + (eq (process-status (rcirc-buffer-process)) 'open)) + (with-rcirc-server-buffer + (setq rcirc-buffer-alist + (rassq-delete-all buffer rcirc-buffer-alist))) + (rcirc-update-short-buffer-names) + (if (rcirc-channel-p rcirc-target) + (rcirc-send-string (rcirc-buffer-process) + (concat "DETACH " rcirc-target)))) + (setq rcirc-target nil) + (kill-buffer buffer)))) #+end_src ** elfeed (rss) Will configure later, (use elfeed protocol ok ty) From 90545fffc2ff9f54af445a3c64ac14a068724071 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 6 Oct 2024 18:40:25 +0400 Subject: [PATCH 187/319] config/emacs: test --- config/emacs/emacs.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index fd017bd2..3a4930d9 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1093,7 +1093,7 @@ does NOT WORK ON WINDOWS :encryption tls :nick "sako@emacs/Libera" :user-name "sako@emacs/Libera" - :password ,(concat "sako@emacs/Libera:" (password-store-get "SelfHosted/ZNC"))))) + :password ,(format "%s%s" "sako@emacs/Libera:" (password-store-get "SelfHosted/ZNC")))))) (rcirc-fill-column 120) (rcirc-reconnect-delay 5) :config From 7f979e3062fae2cff89eb8e6bbf15bc5df6e2525 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 6 Oct 2024 18:41:36 +0400 Subject: [PATCH 188/319] config/emacs: missing paren --- config/emacs/emacs.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 3a4930d9..a7d62fda 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1093,7 +1093,7 @@ does NOT WORK ON WINDOWS :encryption tls :nick "sako@emacs/Libera" :user-name "sako@emacs/Libera" - :password ,(format "%s%s" "sako@emacs/Libera:" (password-store-get "SelfHosted/ZNC")))))) + :password ,(format "%s%s" "sako@emacs/Libera:" (password-store-get "SelfHosted/ZNC"))))) (rcirc-fill-column 120) (rcirc-reconnect-delay 5) :config From 713852091e20231f1161a401f42a10df1e5a7b13 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 6 Oct 2024 19:06:44 +0400 Subject: [PATCH 189/319] hi --- config/emacs/emacs.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index a7d62fda..8c0c1b67 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1093,7 +1093,7 @@ does NOT WORK ON WINDOWS :encryption tls :nick "sako@emacs/Libera" :user-name "sako@emacs/Libera" - :password ,(format "%s%s" "sako@emacs/Libera:" (password-store-get "SelfHosted/ZNC"))))) + :password ,(concat "sako@emacs/Libera:" (password-store-get "SelfHosted/ZNC"))))) (rcirc-fill-column 120) (rcirc-reconnect-delay 5) :config From f2eb88ad8ffaaf75a945915133f38438a8e83a13 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 6 Oct 2024 19:35:38 +0400 Subject: [PATCH 190/319] config/emacs: nvm --- config/emacs/emacs.org | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 8c0c1b67..bdc9ef29 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1080,38 +1080,6 @@ does NOT WORK ON WINDOWS (unless (eq system-type 'windows-nt) (use-package telega)) #+end_src -** rcirc (irc) -#+begin_src emacs-lisp - ;; (require 'rcirc) - - (use-package rcirc - :ensure nil - :custom - (rcirc-id-string "Emacs rcirc") - (rcirc-server-alist `(("znc.sako.box" - :port 7000 - :encryption tls - :nick "sako@emacs/Libera" - :user-name "sako@emacs/Libera" - :password ,(concat "sako@emacs/Libera:" (password-store-get "SelfHosted/ZNC"))))) - (rcirc-fill-column 120) - (rcirc-reconnect-delay 5) - :config - (defun rcirc-detach-buffer () - (interactive) - (let ((buffer (current-buffer))) - (when (and (rcirc-buffer-process) - (eq (process-status (rcirc-buffer-process)) 'open)) - (with-rcirc-server-buffer - (setq rcirc-buffer-alist - (rassq-delete-all buffer rcirc-buffer-alist))) - (rcirc-update-short-buffer-names) - (if (rcirc-channel-p rcirc-target) - (rcirc-send-string (rcirc-buffer-process) - (concat "DETACH " rcirc-target)))) - (setq rcirc-target nil) - (kill-buffer buffer)))) -#+end_src ** elfeed (rss) Will configure later, (use elfeed protocol ok ty) #+begin_src emacs-lisp From 299110e45691e37701365a2806a9caff320053f7 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Mon, 7 Oct 2024 14:13:22 +0400 Subject: [PATCH 191/319] config/hyprland: add numlock by default --- config/hyprland/hyprland.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/hyprland/hyprland.conf b/config/hyprland/hyprland.conf index b61f777c..c29335df 100644 --- a/config/hyprland/hyprland.conf +++ b/config/hyprland/hyprland.conf @@ -59,6 +59,8 @@ input { kb_options = grp:ctrls_toggle, ctrl:nocaps kb_rules = + numlock_by_default = true + # no mouse acceleration pls :) accel_profile = flat From 50ec18ee92b9a90da96876c83b4a563c447ce7dc Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Mon, 7 Oct 2024 22:03:49 +0400 Subject: [PATCH 192/319] config/emacs: irc attempt 2 --- config/emacs/emacs.org | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index bdc9ef29..972a3241 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1102,6 +1102,29 @@ Will configure later, (use elfeed protocol ok ty) (setq elfeed-protocol-enabled-protocols '(fever)) (elfeed-protocol-enable)) #+end_src +** IRC (erc) +#+begin_src emacs-lisp + (require 'erc) + + (setq erc-server "znc.sako.box") + (setq erc-port "7000") + (setq erc-prompt "(^w^)->") + + (defun sakomacs/erc-znc-detach-channel () + (when (erc-server-process-alive) + (let ((tgt (erc-default-target))) + (erc-server-send (format "DETACH %s" tgt) + nil tgt)))) + + (add-hook 'erc-kill-channel-hook (sakomacs/erc-znc-detach-channel)) + + (defun sakomacs/begin-irc () + (interactive) + (erc-tls :server "znc.sako.box" :port "7000" :nick "sako" :password (concat "sako@emacs/Libera:" (password-store-get "SelfHosted/ZNC")))) + + (advice-add 'irc :override + (sakomacs/begin-irc)) +#+end_src ** Matrix Ill set this up later as well #+begin_src emacs-lisp From 788b17bb5ceb3509bbd6c619cff49b842e174ad2 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Mon, 7 Oct 2024 22:39:16 +0400 Subject: [PATCH 193/319] shut up --- config/emacs/emacs.org | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 972a3241..17faa1c4 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1122,8 +1122,8 @@ Will configure later, (use elfeed protocol ok ty) (interactive) (erc-tls :server "znc.sako.box" :port "7000" :nick "sako" :password (concat "sako@emacs/Libera:" (password-store-get "SelfHosted/ZNC")))) - (advice-add 'irc :override - (sakomacs/begin-irc)) + ;; (advice-add 'irc :override + ;; (sakomacs/begin-irc)) #+end_src ** Matrix Ill set this up later as well From d7b68928a7d79604432b30617b81dc173082d188 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 8 Oct 2024 20:16:03 +0400 Subject: [PATCH 194/319] desktop/chat: gajim init --- modules/desktop/chat/default.nix | 1 + modules/desktop/chat/gajim/default.nix | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100644 modules/desktop/chat/gajim/default.nix diff --git a/modules/desktop/chat/default.nix b/modules/desktop/chat/default.nix index 923077b5..75d157af 100644 --- a/modules/desktop/chat/default.nix +++ b/modules/desktop/chat/default.nix @@ -8,5 +8,6 @@ ./signal ./cinny ./element + ./gajim ]; } diff --git a/modules/desktop/chat/gajim/default.nix b/modules/desktop/chat/gajim/default.nix new file mode 100644 index 00000000..5e83e76f --- /dev/null +++ b/modules/desktop/chat/gajim/default.nix @@ -0,0 +1,10 @@ +{ outputs, options, config, lib, pkgs, ... }: +let cfg = config.modules.desktop.chat.gajim; +in { + options.modules.desktop.chat.gajim = { enable = lib.mkEnableOption false; }; + + config = lib.mkIf cfg.enable { + users.users.sako.packages = with pkgs; [ gajim ]; + + }; +} From c3f4f060547b6b88f5e3673ecd46463e1521f7b1 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 8 Oct 2024 20:16:26 +0400 Subject: [PATCH 195/319] sigma sigma on the wall, i hear them in my head again the voices are back the voices are back the voices are back the voices are back the voices are back the voices are back the voices are back the voices are back the voices are back the voices are back the voices are back the voices are back --- modules/security/default.nix | 2 +- modules/security/tor.nix | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 modules/security/tor.nix diff --git a/modules/security/default.nix b/modules/security/default.nix index b6aae161..d6b784c6 100644 --- a/modules/security/default.nix +++ b/modules/security/default.nix @@ -1 +1 @@ -{ imports = [ ./age.nix ./certs ]; } +{ imports = [ ./age.nix ./certs ./tor.nix ]; } diff --git a/modules/security/tor.nix b/modules/security/tor.nix new file mode 100644 index 00000000..c7481111 --- /dev/null +++ b/modules/security/tor.nix @@ -0,0 +1,13 @@ +{ outputs, options, config, lib, pkgs, ... }: +let cfg = config.modules.security.tor; +in { + options.modules.security.tor = { enable = lib.mkEnableOption false; }; + + config = lib.mkIf cfg.enable { + services.tor = { + enable = true; + torsocks.enable = true; + client = { enable = true; }; + }; + }; +} From 5e9e75eb0bfc9b9ebbfc3fa997ef268e0d0fb81a Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 8 Oct 2024 20:16:51 +0400 Subject: [PATCH 196/319] save get out of my skin get out of my skin get out of my skin get out of my skin get out of my skin get out of my skin get out of my skin get out of my skin get out of my skin get out of my skin get out of my skin --- hosts/sakopc/configuration.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hosts/sakopc/configuration.nix b/hosts/sakopc/configuration.nix index 99e079e9..a7051985 100644 --- a/hosts/sakopc/configuration.nix +++ b/hosts/sakopc/configuration.nix @@ -102,7 +102,10 @@ libreoffice.enable = true; onlyoffice.enable = true; }; - security = { certs.enable = true; }; + security = { + certs.enable = true; + tor.enable = true; + }; }; # fuck you AOC From 11c620a3a1ad6bc00687654d36212dd403a4ace2 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 8 Oct 2024 20:17:17 +0400 Subject: [PATCH 197/319] hosts/sakopc: enable gajim --- hosts/sakopc/configuration.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/hosts/sakopc/configuration.nix b/hosts/sakopc/configuration.nix index a7051985..cb472345 100644 --- a/hosts/sakopc/configuration.nix +++ b/hosts/sakopc/configuration.nix @@ -44,6 +44,7 @@ weechat.enable = true; signal.enable = true; element.enable = true; + gajim.enable = true; }; game = { lutris.enable = true; From 4d1b42e922cf3764cbe69c93f853ec80b76ad9f0 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 8 Oct 2024 20:18:16 +0400 Subject: [PATCH 198/319] akjlsdf --- modules/security/tor.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/security/tor.nix b/modules/security/tor.nix index c7481111..13240e7f 100644 --- a/modules/security/tor.nix +++ b/modules/security/tor.nix @@ -4,6 +4,9 @@ in { options.modules.security.tor = { enable = lib.mkEnableOption false; }; config = lib.mkIf cfg.enable { + + users.users.sako.packages = with pkgs; [ tor-browser ]; + services.tor = { enable = true; torsocks.enable = true; From 534005255adfdd575c76bbf73debda7427b11298 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 9 Oct 2024 06:29:41 +0400 Subject: [PATCH 199/319] uhhhhhh a number 9 --- secrets/secrets.nix | 1 + secrets/shared/torrc.age | Bin 0 -> 1269 bytes 2 files changed, 1 insertion(+) create mode 100644 secrets/shared/torrc.age diff --git a/secrets/secrets.nix b/secrets/secrets.nix index 0a47467a..72b73147 100644 --- a/secrets/secrets.nix +++ b/secrets/secrets.nix @@ -8,4 +8,5 @@ let in { "test.age".publicKeys = shared; + "shared/torrc.age".publicKeys = shared; } diff --git a/secrets/shared/torrc.age b/secrets/shared/torrc.age new file mode 100644 index 0000000000000000000000000000000000000000..df575782c2b25511be9dfea77044e7bbf800fcf7 GIT binary patch literal 1269 zcmVkYbW=HDO>|jdXgEx7Ok+uKbaM(VJ|J^*Xf0)AGBq_ZIUr{< zP(w{YAT&ZbFDrF5cSmkEVs=q^Xn8MgWJWV9YjI3%D@9Ijb7xOaH)KO&LUvep3Rz29 zNKRNqK{97KYguzoZ#HInST`|HMOSDsZ%a*7YBNfBR#`WAb#ib?3N0-yAVq9aa%)LS zNJ3|IN@iUT5mC9S~qA{c};3(Q$%k=Mr%k?aYk%S3U|`;hVX^6d8D2C)CLu> z1O9{p7d*i0>y3G4z^UT6jy+>^GvkW}=ba`f?FqC)FVuLxNViK%%u3T0`FQG@7x~VJ;zx^6i4&)+P z2F;1QJQ`-oFg0B_HckS?xnN-fZfz5}P&;=E>QA5lMtIV7V^#w&70B#A?VME53|vt6 z7fmb~`iFU`@l-Q*e#sp%`$@97MBQBtH|?_-R55_XzmsGo+K+ zNol%&u-g35po{z~afD(Tt#GCDuz6n2u6&4a8>+B&j=U;`p=xj`0O3q$N+Wpz%FX-6 zsnTZ*^UJql;UqTHVLaKEzT&n*Fjg;s+=yMCFEAPC-_3OfWAWw13hM_l8|r&W6e9#u z;ihYKxHR?6nHuTkU1Vtgbeui{UNg?@7=Bdaoejy3x8GKX+A^0fm$E!%@K=Twnsr7w z_Etf+YWU8lA?Gf(paLsJvzT-DC5J&TO!~|91e*vNJUWW1i)JkBCju-N-Ym1u_~Q_~%-MpC;{EjE+R5r@{Z;m` z9X+zG<&@SC4OBx()%I0 z9$AfGfq&G!V~?h7f^FhPUGJ1X1j@r+=R9w$8BiXR2OaitE|26ULfQjqp#nygR)iaUGVTP;mx8qbl7A zr)l*XV0-xL{opz=PhS}f=%$4~Ez-c^HOs}DS8sV5mSyg&4UX=V0|fsdxR7^@fK@6w zwI^C2${mLpNM?oD+BRIYu3)U$Ry`Vjd^o^<&>XI=PU$#2($+$D&G9Bvpd+-vF zRV6|^=cT2>ky3;>z>wt<1!>SMK`~j|Z|zM+r%XfPs86C@G|QlUxipaxb@ep;_>?BR zR{rrK*i>SM*k?zoN31ao#~Ad0+aWm3A8)3#! Date: Wed, 9 Oct 2024 06:29:58 +0400 Subject: [PATCH 200/319] number 6 with extra cheese please --- modules/security/tor.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/security/tor.nix b/modules/security/tor.nix index 13240e7f..33b3be70 100644 --- a/modules/security/tor.nix +++ b/modules/security/tor.nix @@ -5,6 +5,12 @@ in { config = lib.mkIf cfg.enable { + age.secrets.torrc = { + file = ../../secrets/shared/torrc.age; + owner = "tor"; + group = "tor"; + }; + users.users.sako.packages = with pkgs; [ tor-browser ]; services.tor = { @@ -12,5 +18,8 @@ in { torsocks.enable = true; client = { enable = true; }; }; + + environment.etc = { "tor/torrc".source = config.age.secrets.torrc.path; }; + }; } From 45f277fe7a5be9eadfec68b3f4916e30bcc8c4cc Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 9 Oct 2024 06:30:05 +0400 Subject: [PATCH 201/319] and a large soda --- hosts/sakotop/configuration.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/hosts/sakotop/configuration.nix b/hosts/sakotop/configuration.nix index 2a0789bd..43f4e518 100644 --- a/hosts/sakotop/configuration.nix +++ b/hosts/sakotop/configuration.nix @@ -131,6 +131,7 @@ security = { age.enable = true; certs.enable = true; + tor.enable = true; }; virtualization = { waydroid.enable = true; }; }; From 64198f12434425c91ad947eb1a454f8cad561048 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 9 Oct 2024 06:40:29 +0400 Subject: [PATCH 202/319] hosts/sakotop: enable gajim --- hosts/sakotop/configuration.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/hosts/sakotop/configuration.nix b/hosts/sakotop/configuration.nix index 43f4e518..a8f41934 100644 --- a/hosts/sakotop/configuration.nix +++ b/hosts/sakotop/configuration.nix @@ -39,6 +39,7 @@ telegram.enable = true; weechat.enable = true; element.enable = true; + gajim.enable = true; }; apps = { nemo.enable = true; From 87ac22b77023b0ab01689689df51bf1e02fb176c Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 9 Oct 2024 18:48:38 +0400 Subject: [PATCH 203/319] config/emacs: found new theme --- config/emacs/emacs.org | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 17faa1c4..f223d6b5 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -207,9 +207,13 @@ kept-old-versions 5) ;; :config ;; (load-theme 'grandshell t)) - (use-package ef-themes + ;; (use-package ef-themes + ;; :config + ;; (load-theme 'ef-dark t)) + + (use-package tao-theme :config - (load-theme 'ef-dark t)) + (load-theme 'yin t)) ;; emacsclient things (setq frame-resize-pixelwise t) From 22d30b88514fe77c6a1174cb3bc70ab5143c405e Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 9 Oct 2024 18:50:27 +0400 Subject: [PATCH 204/319] lmao --- config/emacs/emacs.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index f223d6b5..f9a138f9 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -213,7 +213,7 @@ kept-old-versions 5) (use-package tao-theme :config - (load-theme 'yin t)) + (load-theme 'tao-yin t)) ;; emacsclient things (setq frame-resize-pixelwise t) From 891e7ce623f75137d3870e7ee15c49bcffc9ecb4 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 9 Oct 2024 19:06:47 +0400 Subject: [PATCH 205/319] config/emacs: nvm --- config/emacs/emacs.org | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index f9a138f9..17faa1c4 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -207,13 +207,9 @@ kept-old-versions 5) ;; :config ;; (load-theme 'grandshell t)) - ;; (use-package ef-themes - ;; :config - ;; (load-theme 'ef-dark t)) - - (use-package tao-theme + (use-package ef-themes :config - (load-theme 'tao-yin t)) + (load-theme 'ef-dark t)) ;; emacsclient things (setq frame-resize-pixelwise t) From 4aad8660f75687f2d4de5540dc5ff95a0b0fa5bd Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 9 Oct 2024 19:27:32 +0400 Subject: [PATCH 206/319] c --- config/emacs/.offlineimap.py | 6 ++++++ config/emacs/.offlineimaprc | 21 ++++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/config/emacs/.offlineimap.py b/config/emacs/.offlineimap.py index b53741ba..fed1df0b 100644 --- a/config/emacs/.offlineimap.py +++ b/config/emacs/.offlineimap.py @@ -13,6 +13,12 @@ def get_user(account): return re.search(rb"login: (.*)", usercmd, flags=0).group(1).decode("utf-8") +def get_host(account): + usercmd = check_output("pass " + account, shell=True) + + return re.search(rb"host: (.*)", usercmd, flags=0).group(1).decode("utf-8") + + def hydroxide(path): file = open(path, "r") diff --git a/config/emacs/.offlineimaprc b/config/emacs/.offlineimaprc index ffec3266..d2fce051 100644 --- a/config/emacs/.offlineimaprc +++ b/config/emacs/.offlineimaprc @@ -90,4 +90,23 @@ oauth2_client_id_eval = get_client_id("email/oauth/gmail") oauth2_client_secret_eval = get_client_secret("email/oauth/gmail") oauth2_refresh_token_eval = get_client_refresh_token("accounts.google.com/two") # Google IMAP weirdness -nametrans = lambda f: f.replace('[Gmail]/', '') if f.startswith('[Gmail]/') else f \ No newline at end of file +nametrans = lambda f: f.replace('[Gmail]/', '') if f.startswith('[Gmail]/') else f + +[Account li] +localrepository = li-local +remoterepository = li-remote +proxy = SOCKS5:localhost:9050 + +[Repository li-local] +type = Maildir +localfolders = ~/Mail/li + +[Repository li-remote] +type = IMAP +ssl = yes +sslcacertfile = /etc/ssl/certs/ca-certificates.crt +remotehosteval = get_host("email/li") +remoteport = 993 +remoteusereval = get_user("email/li") +remotepasseval = get_pass("email/li") + From 33ae529c6ab659c6f612e1ca5f0589593bab4419 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 9 Oct 2024 20:33:25 +0400 Subject: [PATCH 207/319] s --- config/emacs/emacs.org | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 17faa1c4..2ef4f017 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1261,6 +1261,18 @@ GNU patch review metho dor sometihng idk (mu4e-refile-folder . "/Gmail-Personal-2/Inbox") (mu4e-trash-folder . "Gmail-Personal-2/Trash") )) + (make-mu4e-context + :name "li" + :match-func + (lambda (msg) + (when msg + (string-prefix-p "/li" (mu4e-message-field msg :maildir)))) + :vars `((user-mail-address . ,(cdr (assoc 'li sakomacs-mail-accounts))) + (user-full-name . "user") + (mu4e-sent-folder . "/li/Sent Mail") + (mu4e-refile-folder . "/li/INBOX") + (mu4e-trash-folder . "/li/Trash") + )) )) ) From 9750b11eba4cad6e7246834ea10ff811b6fcf0ed Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 9 Oct 2024 21:00:09 +0400 Subject: [PATCH 208/319] pidgin --- hosts/sakopc/configuration.nix | 1 + modules/desktop/chat/default.nix | 1 + modules/desktop/chat/pidgin/default.nix | 10 ++++++++++ 3 files changed, 12 insertions(+) create mode 100644 modules/desktop/chat/pidgin/default.nix diff --git a/hosts/sakopc/configuration.nix b/hosts/sakopc/configuration.nix index cb472345..1000e9db 100644 --- a/hosts/sakopc/configuration.nix +++ b/hosts/sakopc/configuration.nix @@ -45,6 +45,7 @@ signal.enable = true; element.enable = true; gajim.enable = true; + pidgin.enable = true; }; game = { lutris.enable = true; diff --git a/modules/desktop/chat/default.nix b/modules/desktop/chat/default.nix index 75d157af..cb5feba1 100644 --- a/modules/desktop/chat/default.nix +++ b/modules/desktop/chat/default.nix @@ -9,5 +9,6 @@ ./cinny ./element ./gajim + ./pidgin ]; } diff --git a/modules/desktop/chat/pidgin/default.nix b/modules/desktop/chat/pidgin/default.nix new file mode 100644 index 00000000..ba3846b1 --- /dev/null +++ b/modules/desktop/chat/pidgin/default.nix @@ -0,0 +1,10 @@ +{ outputs, options, config, lib, pkgs, ... }: +let cfg = config.modules.desktop.chat.pidgin; +in { + options.modules.desktop.chat.pidgin = { enable = lib.mkEnableOption false; }; + + config = lib.mkIf cfg.enable { + users.users.sako.packages = with pkgs; + [ (pidgin-with-plugins.override { plugins = [ pidgin-otr ]; }) ]; + }; +} From ad5c906e4b0057675c003b72d9565e11dd5ab44c Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 9 Oct 2024 21:00:23 +0400 Subject: [PATCH 209/319] nixfmt --- overlays/default.nix | 40 +++++++++++++--------------------------- 1 file changed, 13 insertions(+), 27 deletions(-) diff --git a/overlays/default.nix b/overlays/default.nix index 7eefd3a1..512cd3d9 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -1,10 +1,8 @@ -{inputs, ...}: { +{ inputs, ... }: { # This one brings our custom packages from the 'pkgs' directory - additions = final: _prev: import ../packages {pkgs = final;}; + additions = final: _prev: import ../packages { pkgs = final; }; - nixpkgs.overlays = [ - inputs.emacs-overlay - ]; + nixpkgs.overlays = [ inputs.emacs-overlay ]; # This one contains whatever you want to overlay # You can change versions, add patches, set compilation flags, anything really. # https://nixos.wiki/wiki/Overlays @@ -12,35 +10,23 @@ # example = prev.example.overrideAttrs (oldAttrs: rec { # ... # }); - polybar = prev.polybar.override { - pulseSupport = true; - }; - qutebrowser = prev.qutebrowser.override { - enableWideVine = true; - }; - vimix-gtk-themes = prev.vimix-gtk-themes.override { - themeVariants = ["ruby"]; - }; + polybar = prev.polybar.override { pulseSupport = true; }; + qutebrowser = prev.qutebrowser.override { enableWideVine = true; }; + vimix-gtk-themes = + prev.vimix-gtk-themes.override { themeVariants = [ "ruby" ]; }; fluent-gtk-theme = prev.fluent-gtk-theme.override { colorVariants = [ "dark" ]; themeVariants = [ "red" ]; tweaks = [ "square" ]; }; - fluent-icon-theme = prev.fluent-icon-theme.override { - colorVariants = [ "red" ]; - }; - dwm = prev.dwm.overrideAttrs (old: { - src = ../config/dwm; - }); + fluent-icon-theme = + prev.fluent-icon-theme.override { colorVariants = [ "red" ]; }; + dwm = prev.dwm.overrideAttrs (old: { src = ../config/dwm; }); ags = prev.ags.overrideAttrs (old: { - buildInputs = old.buildInputs ++ [ inputs.nixpkgs.legacyPackages.x86_64-linux.libdbusmenu-gtk3 ]; + buildInputs = old.buildInputs + ++ [ inputs.nixpkgs.legacyPackages.x86_64-linux.libdbusmenu-gtk3 ]; }); - isync = prev.isync.overrideAttrs (old: { - withCyrusSaslXoauth2 = true; - }); - # blender = prev.blender.overrideAttrs (old: { - # nativeBuildInputs = (old.nativeBuildInputs or []) ++ [ inputs.nixpkgs.legacyPackages.x86_64-linux.pkg-config inputs.nixpkgs.legacyPackages.x86_64-linux.wayland-scanner ]; - # }); + isync = prev.isync.overrideAttrs (old: { withCyrusSaslXoauth2 = true; }); }; # incase something breaks From d8c4fd104a5bb75be44f05bf2a755f949680f1a2 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 9 Oct 2024 21:01:15 +0400 Subject: [PATCH 210/319] uhhh --- modules/desktop/chat/pidgin/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/desktop/chat/pidgin/default.nix b/modules/desktop/chat/pidgin/default.nix index ba3846b1..20aaee4d 100644 --- a/modules/desktop/chat/pidgin/default.nix +++ b/modules/desktop/chat/pidgin/default.nix @@ -5,6 +5,6 @@ in { config = lib.mkIf cfg.enable { users.users.sako.packages = with pkgs; - [ (pidgin-with-plugins.override { plugins = [ pidgin-otr ]; }) ]; + [ (pidgin.override { plugins = [ pidginPackages.pidgin-otr ]; }) ]; }; } From 916ea5e50af4e295b6dbc947271df4e29654ea98 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 9 Oct 2024 21:31:20 +0400 Subject: [PATCH 211/319] wayland isseu --- modules/desktop/chat/pidgin/default.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/desktop/chat/pidgin/default.nix b/modules/desktop/chat/pidgin/default.nix index 20aaee4d..e1596c9b 100644 --- a/modules/desktop/chat/pidgin/default.nix +++ b/modules/desktop/chat/pidgin/default.nix @@ -5,6 +5,11 @@ in { config = lib.mkIf cfg.enable { users.users.sako.packages = with pkgs; - [ (pidgin.override { plugins = [ pidginPackages.pidgin-otr ]; }) ]; + [ + (pidgin.override { + plugins = + [ pidginPackages.pidgin-otr pidginPackages.pidgin-indicator ]; + }) + ]; }; } From b85573d24039238bcc47564e6b0983e5324e20fb Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 9 Oct 2024 21:45:54 +0400 Subject: [PATCH 212/319] nvm --- hosts/sakopc/configuration.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/hosts/sakopc/configuration.nix b/hosts/sakopc/configuration.nix index 1000e9db..cb472345 100644 --- a/hosts/sakopc/configuration.nix +++ b/hosts/sakopc/configuration.nix @@ -45,7 +45,6 @@ signal.enable = true; element.enable = true; gajim.enable = true; - pidgin.enable = true; }; game = { lutris.enable = true; From e96645957088b1f193d34c192cda169e7b86657e Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Thu, 10 Oct 2024 14:09:34 +0400 Subject: [PATCH 213/319] config/hyprland: no gaps --- config/hyprland/hyprland.conf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/hyprland/hyprland.conf b/config/hyprland/hyprland.conf index c29335df..038f2e31 100644 --- a/config/hyprland/hyprland.conf +++ b/config/hyprland/hyprland.conf @@ -77,9 +77,9 @@ input { general { # See https://wiki.hyprland.org/Configuring/Variables/ for more - gaps_in = 10 - gaps_out = 10 - border_size = 1 + gaps_in = 0 + gaps_out = 0 + border_size = 2 col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg col.inactive_border = rgba(595959aa) From a4f643e84b223477aa80261111a423c26e7469bc Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Thu, 10 Oct 2024 14:15:12 +0400 Subject: [PATCH 214/319] border --- config/hyprland/hyprland.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/hyprland/hyprland.conf b/config/hyprland/hyprland.conf index 038f2e31..b9f2e8f1 100644 --- a/config/hyprland/hyprland.conf +++ b/config/hyprland/hyprland.conf @@ -79,7 +79,7 @@ general { gaps_in = 0 gaps_out = 0 - border_size = 2 + border_size = 1 col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg col.inactive_border = rgba(595959aa) From c431bafcb0d5828433cb0e6fd0206b669aa4a6b2 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Fri, 11 Oct 2024 20:38:44 +0400 Subject: [PATCH 215/319] fix --- secrets/shared/torrc.age | Bin 1269 -> 1615 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/secrets/shared/torrc.age b/secrets/shared/torrc.age index df575782c2b25511be9dfea77044e7bbf800fcf7..191ed9343545a27bfcc0fc233b150da74a229bd2 100644 GIT binary patch delta 1590 zcmV-62FdyL3C|3WEPrfja%gf(HaKNeYei9EIZ91bbuw@_V zQd&4hNeV|uY(s2RI7(?YXhBA7c57I3bV5lsW<)kPRYFg6YfE`DPHRk1cvx9hO$seO zAaiqQEoEdfH8n9gAZIgBLrp;-Gd6lpIAeB4I88AxG%q$*L4QqDdQx^dM^ZU;ZbNT! zPeE!=FIY%VOLJ;L3OGZ0Pb)@RL^nY~NkUm`OmTW*WHDGaYB^_kX;W!6FhWH_PH$RP zFM4E23N0-yAUAI`cyCEEc1A-oXKr|984 zc$ip9tL1vuyO3zzLZ_3>WT-O!$h2c{Y99~{JcGyZCznu2oCy2v60O%KS0-Ix+&4x<$#2*y@kLrOs?hwEb3h zghHY){NrpS>C?%7@57C2vD#YK&kO#SzoVKfWGNEi&8@|`lb{ePwtzWhTn#zot-NbSyt(P=eE9VCskC(1%K_Ld6r(S_Y1>!l`MpXC*~d2|0YpB95F0n zSEt=G@;Ie~xPFiS-Zu0- z83$7{d@Euc6Umi6+-*a*Zf`o%syZdQGE%WBVj4AGq-D zy2#34<+>>xHL$gJB2NpuqA{@m#xFkAFf*{EZ4~ zDSjVjr*n6S);JJFx;!n9X+QPRX2?^eyqULnBjdu^^ec=#>iGh7e(p2RGkTyS6RNEG zpn?l%XAnLcjIin8O0oEr%qGf9QCYEm>igkw(oAf5^Orr?K^RYIQ63|mr*n0qNuyTY zuF>qaZgNR;%bDp`QeUEM>VFDsY-)W@x6y}*;lPH`dHuOc*q3oD-KZ1tWbN(jd%oCF zarF3vbnrdVdd%BXp+^|E+M2tL-K?TAmqFqsc8LcF0d@3AlvDE#{%~L%>d!KCQ|L*C ztO1+sUm6#hQ6^J9(^?QjwW-6}X_`0cQ=(9TBs+5g7DyM+jW>VtX)irD?H8>(*_&1v80bP~NbvOZSxZJpcdz delta 1241 zcmV;~1Sb2>4D|_+EPrlEXJ~0PYG*NVZgFl=S#U#kFGFK8az#=_XK+V!Yf@%(X+&y5 zcSd3`V+uiSHfT3xVQX(_O;dL{Pj`1vYBWl3Vo+6dQ#oNxbXj3&I81L$V@Ysya|$g! zAaiqQEoEdfH8n9gAZIgBLrp;-G(tHqD|Iz@M{YJ^c2Rj~d4Df%WJWV9YjI3%D@9Ij zb7xOaH)KO&LUvep3Rz29NKRNqK{97KYguzoZ#HInST`|HMOSDsZ%a*7YBNfBR#`WA zb#ib?3N0-yAVq9aa%)LSNJ3|IN@iUT5mC9S~qA{c};3(Q$%k=Mr%k?aYk%S z3U|`;hVX^6d4Hsx`qTy$umk>t0v9~M>+6kqX27Z9xQ;zzbTi|N2Irk7DD4TfLod{L zzDT!AOU&#!@$+v?wTNv0>tckwIWLMriqjy}Rru0mByG15Ho!ytVFPY$6S+`3cMIxIpZ`X9 z(sg52127fH>_6?CRL~4uQ1=&2EE)QTd8zSKGj@K-9Wnb!vbjXvT@5$wvl&z|fW^O) zWF^{rBY6SJ&HKiw(q|0w%eP|TBsSDxJlU4M;jyF$>U&8PBLq_6rfYS$H1*Ay8h`2KU1Vtgbeui{UNg?@7=Bdaoejy3 zx8GKX+A^0fm$E!%@K=Twnsr7w_Etf+YWU8lA?Gf(paLsJvzT-DC5J&TO!~|91e*vN zJUWW1i)JkBCju-N-Ym1u z_w>c(B}u~LIVEd^&C$BFm Date: Sat, 12 Oct 2024 11:22:45 +0400 Subject: [PATCH 216/319] desktop/chat: add psi-plus --- modules/desktop/chat/default.nix | 1 + modules/desktop/chat/psiplus/default.nix | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 modules/desktop/chat/psiplus/default.nix diff --git a/modules/desktop/chat/default.nix b/modules/desktop/chat/default.nix index cb5feba1..b9bfc569 100644 --- a/modules/desktop/chat/default.nix +++ b/modules/desktop/chat/default.nix @@ -10,5 +10,6 @@ ./element ./gajim ./pidgin + ./psiplus ]; } diff --git a/modules/desktop/chat/psiplus/default.nix b/modules/desktop/chat/psiplus/default.nix new file mode 100644 index 00000000..0e8bfc70 --- /dev/null +++ b/modules/desktop/chat/psiplus/default.nix @@ -0,0 +1,12 @@ +{ outputs, options, config, lib, pkgs, ... }: +let cfg = config.modules.desktop.chat.psi-plus; +in { + options.modules.desktop.chat.psi-plus = { + enable = lib.mkEnableOption false; + }; + + config = lib.mkIf cfg.enable { + users.users.sako.packages = with pkgs; [ psi-plus ]; + + }; +} From f6ab3dd7e52c498545b6241c1c75da800b8c437c Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sat, 12 Oct 2024 11:23:13 +0400 Subject: [PATCH 217/319] hosts/sakopc: enable psi-plus --- hosts/sakopc/configuration.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/hosts/sakopc/configuration.nix b/hosts/sakopc/configuration.nix index cb472345..8e647c49 100644 --- a/hosts/sakopc/configuration.nix +++ b/hosts/sakopc/configuration.nix @@ -45,6 +45,7 @@ signal.enable = true; element.enable = true; gajim.enable = true; + psi-plus.enable = true; }; game = { lutris.enable = true; From 161bbe7f41e821d77ad016bf4e66db55acd87868 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sat, 12 Oct 2024 11:23:32 +0400 Subject: [PATCH 218/319] hosts/sakotop: enable psi-plus --- hosts/sakotop/configuration.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/hosts/sakotop/configuration.nix b/hosts/sakotop/configuration.nix index a8f41934..1b83efef 100644 --- a/hosts/sakotop/configuration.nix +++ b/hosts/sakotop/configuration.nix @@ -40,6 +40,7 @@ weechat.enable = true; element.enable = true; gajim.enable = true; + psi-plus.enable = true; }; apps = { nemo.enable = true; From 56d7b587058dc8bab17d0dbbfa41fdcf2775ac8a Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sat, 12 Oct 2024 22:42:23 +0400 Subject: [PATCH 219/319] hosts/sakowsl: shuT UP --- hosts/sakowsl/configuration.nix | 55 ++++++++++----------------------- 1 file changed, 16 insertions(+), 39 deletions(-) diff --git a/hosts/sakowsl/configuration.nix b/hosts/sakowsl/configuration.nix index a90ac5dd..cd9aa25f 100644 --- a/hosts/sakowsl/configuration.nix +++ b/hosts/sakowsl/configuration.nix @@ -1,12 +1,4 @@ -{ - lib, - pkgs, - config, - modulesPath, - inputs, - outputs, - ... -}: { +{ lib, pkgs, config, modulesPath, inputs, outputs, ... }: { imports = [ inputs.home-manager.nixosModules.default "${modulesPath}/profiles/minimal.nix" @@ -49,38 +41,31 @@ nix.extraOptions = '' experimental-features = nix-command flakes ''; -# nix.settings.experimental-features = ["nix-command" "flakes"]; + # nix.settings.experimental-features = ["nix-command" "flakes"]; nix.settings = { - experimental-features = ["nix-command" "flakes"]; - substituters = [ - "https://cache.garnix.io" - "https://nix-community.cachix.org" - ]; + experimental-features = [ "nix-command" "flakes" ]; + substituters = + [ "https://cache.garnix.io" "https://nix-community.cachix.org" ]; trusted-public-keys = [ "cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" ]; }; - # Home manager setup home-manager.useUserPackages = true; - home-manager.users.sako = {pkgs, ...}: { + home-manager.users.sako = { pkgs, ... }: { home.stateVersion = "22.05"; - home.packages = []; + home.packages = [ ]; home.username = "sako"; home.homeDirectory = "/home/sako"; - xdg.configFile.git = { - source = ../../config/git; - }; + xdg.configFile.git = { source = ../../config/git; }; # cure my sanity home.pointerCursor = { name = "Catppuccin-Mocha-Dark"; size = 16; - x11 = { - enable = true; - }; + x11 = { enable = true; }; gtk.enable = true; package = pkgs.catppuccin-cursors.mochaDark; }; @@ -97,16 +82,16 @@ programs.gnupg.agent = { enable = true; #pinentryPackage = null; - settings = { - # pinentry-program = "/mnt/c/Program Files (x86)/Gpg4win/bin/pinentry.exe"; + settings = { + # pinentry-program = "/mnt/c/Program Files (x86)/Gpg4win/bin/pinentry.exe"; allow-emacs-pinentry = ""; allow-loopback-pinentry = ""; - }; + }; }; # bare minimum environment.systemPackages = with pkgs; [ vim # backup - wget #double u get + wget # double u get killall # die processes unzip # zip file gh # github @@ -115,8 +100,6 @@ wsl-open # wsl-open ]; - environment.noXlibs = lib.mkForce false; - programs.git = { enable = true; package = pkgs.gitFull; @@ -128,9 +111,7 @@ nextcloud.enable = true; pass.enable = true; }; - chat = { - weechat.enable = true; - }; + chat = { weechat.enable = true; }; }; dev = { editors = { @@ -157,17 +138,13 @@ search.enable = true; }; }; - security = { - certs.enable = true; - }; + security = { certs.enable = true; }; }; services.gnome.gnome-keyring.enable = true; # for wsl-open - environment.sessionVariables = rec { - BROWSER = "wsl-open"; - }; + environment.sessionVariables = rec { BROWSER = "wsl-open"; }; security.sudo.wheelNeedsPassword = true; From 5ce50e0ddb630660729e88c5928963c5d90abb27 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 12 Oct 2024 18:45:58 +0000 Subject: [PATCH 220/319] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'NixOS-WSL': 'github:nix-community/NixOS-WSL/1fcec53c692c15091ca5bb9eaf86a2cac6c53278?narHash=sha256-n36Vtdtx7tTTKFI9aoWxdNIlJ2dwxoitFDwcPXrS%2BJk%3D' (2024-09-23) → 'github:nix-community/NixOS-WSL/0fc8d9bb51cc46b31d950513df6d088905c8fe55?narHash=sha256-P1j%2BNf%2BpzxPYK2Qe7lF2yB0vR3YvW8Td5sD0ZvrKIq8%3D' (2024-10-10) • Updated input 'ags': 'github:Aylur/ags/aaef50bb2c80ef4b4a359329d72669a95e7c4796?narHash=sha256-SXYqzpHPuXFR6w/cUKo3VN8XRn6XA2mGbdRXs9oLk6k%3D' (2024-09-09) → 'github:Aylur/ags/60180a184cfb32b61a1d871c058b31a3b9b0743d?narHash=sha256-tV1ABHuA1HItMdCTuNdA8fMB%2Bqw7LpjvI945VwMSABI%3D' (2024-10-07) • Updated input 'emacs-overlay': 'github:nix-community/emacs-overlay/f5e7cbe08abc8c4fba75084efae5173540accb43?narHash=sha256-9LuPO6FZTm//3GdyVIL/XDsflej7Y0/dmFfMiErkqqc%3D' (2024-10-04) → 'github:nix-community/emacs-overlay/5921ff72aa8019353091f0e63b3e34db28fa757f?narHash=sha256-OgpebVl9jecLspSckK9xeYk804z9GM2ROClCJbmPpac%3D' (2024-10-12) • Updated input 'emacs-overlay/flake-utils': 'github:numtide/flake-utils/b1d9ab70662946ef0850d488da1c9019f3a9752a?narHash=sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ%3D' (2024-03-11) → 'github:numtide/flake-utils/c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a?narHash=sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ%3D' (2024-09-17) • Updated input 'emacs-overlay/nixpkgs': 'github:NixOS/nixpkgs/ad416d066ca1222956472ab7d0555a6946746a80?narHash=sha256-%2Byj%2BxgsfZaErbfYM3T%2BQvEE2hU7UuE%2BJf0fJCJ8uPS0%3D' (2024-09-04) → 'github:NixOS/nixpkgs/5633bcff0c6162b9e4b5f1264264611e950c8ec7?narHash=sha256-9UTxR8eukdg%2BXZeHgxW5hQA9fIKHsKCdOIUycTryeVw%3D' (2024-10-09) • Updated input 'emacs-overlay/nixpkgs-stable': 'github:NixOS/nixpkgs/6f6c45b5134a8ee2e465164811e451dcb5ad86e3?narHash=sha256-tiN5Rlg/jiY0tyky%2BsoJZoRzLKbPyIdlQ77xVgREDNM%3D' (2024-09-03) → 'github:NixOS/nixpkgs/c505ebf777526041d792a49d5f6dd4095ea391a7?narHash=sha256-r%2BSF9AnHrTg%2Bbk6YszoKfV9lgyw%2ByaFUQe0dOjI0Z2o%3D' (2024-10-11) • Updated input 'home-manager': 'github:nix-community/home-manager/1e22ef1518fb175d762006f9cae7f6312b8caedb?narHash=sha256-TcUaKtya339Asu%2Bg6KTJ8h7KiKcKXKp2V%2BAt%2B7tksyY%3D' (2024-09-25) → 'github:nix-community/home-manager/d57112db877f07387ce7104b5ac346ede556d2d7?narHash=sha256-8ZWr1HpciQsrFjvPMvZl0W%2Bb0dilZOqXPoKa2Ux36bc%3D' (2024-10-12) • Updated input 'hyprland': 'git+https://github.com/hyprwm/Hyprland?ref=refs/heads/main&rev=8b86ee8bf08eaf8b57d0a7f12af876216323cc3d&submodules=1' (2024-09-25) → 'git+https://github.com/hyprwm/Hyprland?ref=refs/heads/main&rev=1822707c7e7394ce8c7572f2fe890763a307f499&submodules=1' (2024-10-12) • Updated input 'hyprland/aquamarine': 'github:hyprwm/aquamarine/752d0fbd141fabb5a1e7f865199b80e6e76f8d8e?narHash=sha256-rEzEZtd3iyVo5RJ1OGujOlnywNf3gsrOnjAn1NLciD4%3D' (2024-09-18) → 'github:hyprwm/aquamarine/65dd97b5d21e917295159bbef1d52e06963f4eb0?narHash=sha256-dQXAj%2B4d6neY7ldCiH6gNym3upP49PVxRzEPxXlD9Aw%3D' (2024-10-07) • Updated input 'hyprland/hyprcursor': 'github:hyprwm/hyprcursor/912d56025f03d41b1ad29510c423757b4379eb1c?narHash=sha256-sLADpVgebpCBFXkA1FlCXtvEPu1tdEsTfqK1hfeHySE%3D' (2024-08-02) → 'github:hyprwm/hyprcursor/d60e1e01e6e6633ef1c87148b9137cc1dd39263d?narHash=sha256-hNw5J6xatedqytYowx0mJKgctjA4lQARZFdgnzM2RpM%3D' (2024-10-01) • Added input 'hyprland/hyprland-protocols': 'github:hyprwm/hyprland-protocols/a7c183800e74f337753de186522b9017a07a8cee?narHash=sha256-xGbkc7U/Roe0/Cv3iKlzijIaFBNguasI31ynL2IlEoM%3D' (2024-10-07) • Added input 'hyprland/hyprland-protocols/nixpkgs': follows 'hyprland/nixpkgs' • Added input 'hyprland/hyprland-protocols/systems': follows 'hyprland/systems' • Updated input 'hyprland/hyprlang': 'github:hyprwm/hyprlang/dfeb5811dd6485490cce18d6cc1e38a055eea876?narHash=sha256-d/rZ/fHR5l1n7PeyLw0StWMNLXVU9c4HFyfskw568so%3D' (2024-09-10) → 'github:hyprwm/hyprlang/f054f2e44d6a0b74607a6bc0f52dba337a3db38e?narHash=sha256-AnB1KfiXINmuiW7BALYrKqcjCnsLZPifhb/7BsfPbns%3D' (2024-10-05) • Updated input 'hyprland/hyprutils': 'github:hyprwm/hyprutils/db956287d3aa194dda91d05c8eb286de2a569edf?narHash=sha256-wmT%2BJpnDk6EjgASU2VGfS0nnu6oKA4Cw25o5fzpDD/Q%3D' (2024-09-24) → 'github:hyprwm/hyprutils/3f5293432b6dc6a99f26aca2eba3876d2660665c?narHash=sha256-OvAtVLaSRPnbXzOwlR1fVqCXR7i%2BICRX3aPMCdIiv%2Bc%3D' (2024-09-25) • Updated input 'hyprland/hyprwayland-scanner': 'github:hyprwm/hyprwayland-scanner/b68dab23fc922eae99306988133ee80a40b39ca5?narHash=sha256-HIPEXyRRVZoqD6U%2BlFS1B0tsIU7p83FaB9m7KT/x6mQ%3D' (2024-09-20) → 'github:hyprwm/hyprwayland-scanner/500c81a9e1a76760371049a8d99e008ea77aa59e?narHash=sha256-VKR0sf0PSNCB0wPHVKSAn41mCNVCnegWmgkrneKDhHM%3D' (2024-09-20) • Updated input 'hyprland/nixpkgs': 'github:NixOS/nixpkgs/c04d5652cfa9742b1d519688f65d1bbccea9eb7e?narHash=sha256-PmUr/2GQGvFTIJ6/Tvsins7Q43KTMvMFhvG6oaYK%2BWk%3D' (2024-09-19) → 'github:NixOS/nixpkgs/bc947f541ae55e999ffdb4013441347d83b00feb?narHash=sha256-NOiTvBbRLIOe5F6RbHaAh6%2B%2BBNjsb149fGZd1T4%2BKBg%3D' (2024-10-04) • Added input 'hyprland/pre-commit-hooks': 'github:cachix/git-hooks.nix/1211305a5b237771e13fcca0c51e60ad47326a9a?narHash=sha256-eMeCTJZ5xBeQ0f9Os7K8DThNVSo9gy4umZLDfF5q6OM%3D' (2024-10-05) • Added input 'hyprland/pre-commit-hooks/flake-compat': 'github:edolstra/flake-compat/0f9255e01c2351cc7d116c072cb317785dd33b33?narHash=sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U%3D' (2023-10-04) • Added input 'hyprland/pre-commit-hooks/gitignore': 'github:hercules-ci/gitignore.nix/637db329424fd7e46cf4185293b9cc8c88c95394?narHash=sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs%3D' (2024-02-28) • Added input 'hyprland/pre-commit-hooks/gitignore/nixpkgs': follows 'hyprland/pre-commit-hooks/nixpkgs' • Added input 'hyprland/pre-commit-hooks/nixpkgs': follows 'hyprland/nixpkgs' • Added input 'hyprland/pre-commit-hooks/nixpkgs-stable': 'github:NixOS/nixpkgs/194846768975b7ad2c4988bdb82572c00222c0d7?narHash=sha256-NGKVY4PjzwAa4upkGtAMz1npHGoRzWotlSnVlqI40mo%3D' (2024-07-07) • Updated input 'hyprland/xdph': 'github:hyprwm/xdg-desktop-portal-hyprland/4adb6c4c41ee5014bfe608123bfeddb26e5f5cea?narHash=sha256-1PFckA8Im7wMSl26okwOKqBZeCFLD3LvZZFaxswDhbY%3D' (2024-09-23) → 'github:hyprwm/xdg-desktop-portal-hyprland/fb9c8d665af0588bb087f97d0f673ddf0d501787?narHash=sha256-w6dVTguAn9zJ%2B7aPOhBQgDz8bn6YZ7b56cY8Kg5HJRI%3D' (2024-10-05) • Updated input 'hyprland/xdph/hyprland-protocols': 'github:hyprwm/hyprland-protocols/5a11232266bf1a1f5952d5b179c3f4b2facaaa84?narHash=sha256-zCu4R0CSHEactW9JqYki26gy8h9f6rHmSwj4XJmlHgg%3D' (2024-07-18) → follows 'hyprland/hyprland-protocols' • Removed input 'hyprland/xdph/hyprland-protocols/nixpkgs' • Removed input 'hyprland/xdph/hyprland-protocols/systems' • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/9357f4f23713673f310988025d9dc261c20e70c6?narHash=sha256-bvGoiQBvponpZh8ClUcmJ6QnsNKw0EMrCQJARK3bI1c%3D' (2024-09-21) → 'github:NixOS/nixpkgs/5633bcff0c6162b9e4b5f1264264611e950c8ec7?narHash=sha256-9UTxR8eukdg%2BXZeHgxW5hQA9fIKHsKCdOIUycTryeVw%3D' (2024-10-09) • Updated input 'nixpkgs-stable': 'github:nixos/nixpkgs/babc25a577c3310cce57c72d5bed70f4c3c3843a?narHash=sha256-nPyrcFm6FSk7CxzVW4x2hu62aLDghNcv9dX6DF3dXw8%3D' (2024-09-23) → 'github:nixos/nixpkgs/c505ebf777526041d792a49d5f6dd4095ea391a7?narHash=sha256-r%2BSF9AnHrTg%2Bbk6YszoKfV9lgyw%2ByaFUQe0dOjI0Z2o%3D' (2024-10-11) • Updated input 'sops-nix': 'github:Mic92/sops-nix/e2d404a7ea599a013189aa42947f66cede0645c8?narHash=sha256-qis6BtOOBBEAfUl7FMHqqTwRLB61OL5OFzIsOmRz2J4%3D' (2024-09-16) → 'github:Mic92/sops-nix/06535d0e3d0201e6a8080dd32dbfde339b94f01b?narHash=sha256-lpunY1%2Bbf90ts%2BsA2/FgxVNIegPDKCpEoWwOPu4ITTQ%3D' (2024-10-08) • Updated input 'sops-nix/nixpkgs-stable': 'github:NixOS/nixpkgs/dc454045f5b5d814e5862a6d057e7bb5c29edc05?narHash=sha256-vNv%2BaJUW5/YurRy1ocfvs4q/48yVESwlC/yHzjkZSP8%3D' (2024-09-08) → 'github:NixOS/nixpkgs/17ae88b569bb15590549ff478bab6494dde4a907?narHash=sha256-uogSvuAp%2B1BYtdu6UWuObjHqSbBohpyARXDWqgI12Ss%3D' (2024-10-05) --- flake.lock | 215 ++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 148 insertions(+), 67 deletions(-) diff --git a/flake.lock b/flake.lock index 0b4df4c3..6477ec8b 100644 --- a/flake.lock +++ b/flake.lock @@ -9,11 +9,11 @@ ] }, "locked": { - "lastModified": 1727091786, - "narHash": "sha256-n36Vtdtx7tTTKFI9aoWxdNIlJ2dwxoitFDwcPXrS+Jk=", + "lastModified": 1728588346, + "narHash": "sha256-P1j+Nf+pzxPYK2Qe7lF2yB0vR3YvW8Td5sD0ZvrKIq8=", "owner": "nix-community", "repo": "NixOS-WSL", - "rev": "1fcec53c692c15091ca5bb9eaf86a2cac6c53278", + "rev": "0fc8d9bb51cc46b31d950513df6d088905c8fe55", "type": "github" }, "original": { @@ -53,11 +53,11 @@ "systems": "systems_3" }, "locked": { - "lastModified": 1725841979, - "narHash": "sha256-SXYqzpHPuXFR6w/cUKo3VN8XRn6XA2mGbdRXs9oLk6k=", + "lastModified": 1728326430, + "narHash": "sha256-tV1ABHuA1HItMdCTuNdA8fMB+qw7LpjvI945VwMSABI=", "owner": "Aylur", "repo": "ags", - "rev": "aaef50bb2c80ef4b4a359329d72669a95e7c4796", + "rev": "60180a184cfb32b61a1d871c058b31a3b9b0743d", "type": "github" }, "original": { @@ -86,11 +86,11 @@ ] }, "locked": { - "lastModified": 1726665257, - "narHash": "sha256-rEzEZtd3iyVo5RJ1OGujOlnywNf3gsrOnjAn1NLciD4=", + "lastModified": 1728326504, + "narHash": "sha256-dQXAj+4d6neY7ldCiH6gNym3upP49PVxRzEPxXlD9Aw=", "owner": "hyprwm", "repo": "aquamarine", - "rev": "752d0fbd141fabb5a1e7f865199b80e6e76f8d8e", + "rev": "65dd97b5d21e917295159bbef1d52e06963f4eb0", "type": "github" }, "original": { @@ -128,11 +128,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1728033118, - "narHash": "sha256-9LuPO6FZTm//3GdyVIL/XDsflej7Y0/dmFfMiErkqqc=", + "lastModified": 1728753084, + "narHash": "sha256-OgpebVl9jecLspSckK9xeYk804z9GM2ROClCJbmPpac=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "f5e7cbe08abc8c4fba75084efae5173540accb43", + "rev": "5921ff72aa8019353091f0e63b3e34db28fa757f", "type": "github" }, "original": { @@ -157,6 +157,22 @@ "type": "github" } }, + "flake-compat_2": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-utils": { "inputs": { "systems": "systems" @@ -180,11 +196,11 @@ "systems": "systems_4" }, "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", "type": "github" }, "original": { @@ -193,6 +209,28 @@ "type": "github" } }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "hyprland", + "pre-commit-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -221,11 +259,11 @@ ] }, "locked": { - "lastModified": 1727246346, - "narHash": "sha256-TcUaKtya339Asu+g6KTJ8h7KiKcKXKp2V+At+7tksyY=", + "lastModified": 1728726232, + "narHash": "sha256-8ZWr1HpciQsrFjvPMvZl0W+b0dilZOqXPoKa2Ux36bc=", "owner": "nix-community", "repo": "home-manager", - "rev": "1e22ef1518fb175d762006f9cae7f6312b8caedb", + "rev": "d57112db877f07387ce7104b5ac346ede556d2d7", "type": "github" }, "original": { @@ -250,11 +288,11 @@ ] }, "locked": { - "lastModified": 1722623071, - "narHash": "sha256-sLADpVgebpCBFXkA1FlCXtvEPu1tdEsTfqK1hfeHySE=", + "lastModified": 1727821604, + "narHash": "sha256-hNw5J6xatedqytYowx0mJKgctjA4lQARZFdgnzM2RpM=", "owner": "hyprwm", "repo": "hyprcursor", - "rev": "912d56025f03d41b1ad29510c423757b4379eb1c", + "rev": "d60e1e01e6e6633ef1c87148b9137cc1dd39263d", "type": "github" }, "original": { @@ -267,19 +305,21 @@ "inputs": { "aquamarine": "aquamarine", "hyprcursor": "hyprcursor", + "hyprland-protocols": "hyprland-protocols", "hyprlang": "hyprlang", "hyprutils": "hyprutils", "hyprwayland-scanner": "hyprwayland-scanner", "nixpkgs": "nixpkgs_2", + "pre-commit-hooks": "pre-commit-hooks", "systems": "systems_5", "xdph": "xdph" }, "locked": { - "lastModified": 1727257173, - "narHash": "sha256-J4VU76LLWEILNTZ8osUaUxSny+cTUH/wCKcV+Lqr3Bw=", + "lastModified": 1728752206, + "narHash": "sha256-r5xU/LqU4TrUOIouhYqrTZc1VY1zLQOOzbLsFCDlfpI=", "ref": "refs/heads/main", - "rev": "8b86ee8bf08eaf8b57d0a7f12af876216323cc3d", - "revCount": 5257, + "rev": "1822707c7e7394ce8c7572f2fe890763a307f499", + "revCount": 5332, "submodules": true, "type": "git", "url": "https://github.com/hyprwm/Hyprland" @@ -294,21 +334,19 @@ "inputs": { "nixpkgs": [ "hyprland", - "xdph", "nixpkgs" ], "systems": [ "hyprland", - "xdph", "systems" ] }, "locked": { - "lastModified": 1721326555, - "narHash": "sha256-zCu4R0CSHEactW9JqYki26gy8h9f6rHmSwj4XJmlHgg=", + "lastModified": 1728345020, + "narHash": "sha256-xGbkc7U/Roe0/Cv3iKlzijIaFBNguasI31ynL2IlEoM=", "owner": "hyprwm", "repo": "hyprland-protocols", - "rev": "5a11232266bf1a1f5952d5b179c3f4b2facaaa84", + "rev": "a7c183800e74f337753de186522b9017a07a8cee", "type": "github" }, "original": { @@ -333,11 +371,11 @@ ] }, "locked": { - "lastModified": 1725997860, - "narHash": "sha256-d/rZ/fHR5l1n7PeyLw0StWMNLXVU9c4HFyfskw568so=", + "lastModified": 1728168612, + "narHash": "sha256-AnB1KfiXINmuiW7BALYrKqcjCnsLZPifhb/7BsfPbns=", "owner": "hyprwm", "repo": "hyprlang", - "rev": "dfeb5811dd6485490cce18d6cc1e38a055eea876", + "rev": "f054f2e44d6a0b74607a6bc0f52dba337a3db38e", "type": "github" }, "original": { @@ -409,11 +447,11 @@ ] }, "locked": { - "lastModified": 1727219120, - "narHash": "sha256-wmT+JpnDk6EjgASU2VGfS0nnu6oKA4Cw25o5fzpDD/Q=", + "lastModified": 1727300645, + "narHash": "sha256-OvAtVLaSRPnbXzOwlR1fVqCXR7i+ICRX3aPMCdIiv+c=", "owner": "hyprwm", "repo": "hyprutils", - "rev": "db956287d3aa194dda91d05c8eb286de2a569edf", + "rev": "3f5293432b6dc6a99f26aca2eba3876d2660665c", "type": "github" }, "original": { @@ -459,11 +497,11 @@ ] }, "locked": { - "lastModified": 1726840673, - "narHash": "sha256-HIPEXyRRVZoqD6U+lFS1B0tsIU7p83FaB9m7KT/x6mQ=", + "lastModified": 1726874836, + "narHash": "sha256-VKR0sf0PSNCB0wPHVKSAn41mCNVCnegWmgkrneKDhHM=", "owner": "hyprwm", "repo": "hyprwayland-scanner", - "rev": "b68dab23fc922eae99306988133ee80a40b39ca5", + "rev": "500c81a9e1a76760371049a8d99e008ea77aa59e", "type": "github" }, "original": { @@ -499,11 +537,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1725432240, - "narHash": "sha256-+yj+xgsfZaErbfYM3T+QvEE2hU7UuE+Jf0fJCJ8uPS0=", + "lastModified": 1728492678, + "narHash": "sha256-9UTxR8eukdg+XZeHgxW5hQA9fIKHsKCdOIUycTryeVw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "ad416d066ca1222956472ab7d0555a6946746a80", + "rev": "5633bcff0c6162b9e4b5f1264264611e950c8ec7", "type": "github" }, "original": { @@ -515,11 +553,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1725407940, - "narHash": "sha256-tiN5Rlg/jiY0tyky+soJZoRzLKbPyIdlQ77xVgREDNM=", + "lastModified": 1728627514, + "narHash": "sha256-r+SF9AnHrTg+bk6YszoKfV9lgyw+yaFUQe0dOjI0Z2o=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "6f6c45b5134a8ee2e465164811e451dcb5ad86e3", + "rev": "c505ebf777526041d792a49d5f6dd4095ea391a7", "type": "github" }, "original": { @@ -531,11 +569,27 @@ }, "nixpkgs-stable_2": { "locked": { - "lastModified": 1727129439, - "narHash": "sha256-nPyrcFm6FSk7CxzVW4x2hu62aLDghNcv9dX6DF3dXw8=", + "lastModified": 1720386169, + "narHash": "sha256-NGKVY4PjzwAa4upkGtAMz1npHGoRzWotlSnVlqI40mo=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "194846768975b7ad2c4988bdb82572c00222c0d7", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable_3": { + "locked": { + "lastModified": 1728627514, + "narHash": "sha256-r+SF9AnHrTg+bk6YszoKfV9lgyw+yaFUQe0dOjI0Z2o=", "owner": "nixos", "repo": "nixpkgs", - "rev": "babc25a577c3310cce57c72d5bed70f4c3c3843a", + "rev": "c505ebf777526041d792a49d5f6dd4095ea391a7", "type": "github" }, "original": { @@ -545,13 +599,13 @@ "type": "github" } }, - "nixpkgs-stable_3": { + "nixpkgs-stable_4": { "locked": { - "lastModified": 1725762081, - "narHash": "sha256-vNv+aJUW5/YurRy1ocfvs4q/48yVESwlC/yHzjkZSP8=", + "lastModified": 1728156290, + "narHash": "sha256-uogSvuAp+1BYtdu6UWuObjHqSbBohpyARXDWqgI12Ss=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "dc454045f5b5d814e5862a6d057e7bb5c29edc05", + "rev": "17ae88b569bb15590549ff478bab6494dde4a907", "type": "github" }, "original": { @@ -563,11 +617,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1726755586, - "narHash": "sha256-PmUr/2GQGvFTIJ6/Tvsins7Q43KTMvMFhvG6oaYK+Wk=", + "lastModified": 1728018373, + "narHash": "sha256-NOiTvBbRLIOe5F6RbHaAh6++BNjsb149fGZd1T4+KBg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c04d5652cfa9742b1d519688f65d1bbccea9eb7e", + "rev": "bc947f541ae55e999ffdb4013441347d83b00feb", "type": "github" }, "original": { @@ -595,11 +649,11 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1726937504, - "narHash": "sha256-bvGoiQBvponpZh8ClUcmJ6QnsNKw0EMrCQJARK3bI1c=", + "lastModified": 1728492678, + "narHash": "sha256-9UTxR8eukdg+XZeHgxW5hQA9fIKHsKCdOIUycTryeVw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9357f4f23713673f310988025d9dc261c20e70c6", + "rev": "5633bcff0c6162b9e4b5f1264264611e950c8ec7", "type": "github" }, "original": { @@ -609,6 +663,30 @@ "type": "github" } }, + "pre-commit-hooks": { + "inputs": { + "flake-compat": "flake-compat_2", + "gitignore": "gitignore", + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "nixpkgs-stable": "nixpkgs-stable_2" + }, + "locked": { + "lastModified": 1728092656, + "narHash": "sha256-eMeCTJZ5xBeQ0f9Os7K8DThNVSo9gy4umZLDfF5q6OM=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "1211305a5b237771e13fcca0c51e60ad47326a9a", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, "root": { "inputs": { "NixOS-WSL": "NixOS-WSL", @@ -619,7 +697,7 @@ "hyprland": "hyprland", "hyprpaper": "hyprpaper", "nixpkgs": "nixpkgs_4", - "nixpkgs-stable": "nixpkgs-stable_2", + "nixpkgs-stable": "nixpkgs-stable_3", "sops-nix": "sops-nix" } }, @@ -628,14 +706,14 @@ "nixpkgs": [ "nixpkgs" ], - "nixpkgs-stable": "nixpkgs-stable_3" + "nixpkgs-stable": "nixpkgs-stable_4" }, "locked": { - "lastModified": 1726524647, - "narHash": "sha256-qis6BtOOBBEAfUl7FMHqqTwRLB61OL5OFzIsOmRz2J4=", + "lastModified": 1728345710, + "narHash": "sha256-lpunY1+bf90ts+sA2/FgxVNIegPDKCpEoWwOPu4ITTQ=", "owner": "Mic92", "repo": "sops-nix", - "rev": "e2d404a7ea599a013189aa42947f66cede0645c8", + "rev": "06535d0e3d0201e6a8080dd32dbfde339b94f01b", "type": "github" }, "original": { @@ -736,7 +814,10 @@ }, "xdph": { "inputs": { - "hyprland-protocols": "hyprland-protocols", + "hyprland-protocols": [ + "hyprland", + "hyprland-protocols" + ], "hyprlang": [ "hyprland", "hyprlang" @@ -759,11 +840,11 @@ ] }, "locked": { - "lastModified": 1727109343, - "narHash": "sha256-1PFckA8Im7wMSl26okwOKqBZeCFLD3LvZZFaxswDhbY=", + "lastModified": 1728166987, + "narHash": "sha256-w6dVTguAn9zJ+7aPOhBQgDz8bn6YZ7b56cY8Kg5HJRI=", "owner": "hyprwm", "repo": "xdg-desktop-portal-hyprland", - "rev": "4adb6c4c41ee5014bfe608123bfeddb26e5f5cea", + "rev": "fb9c8d665af0588bb087f97d0f673ddf0d501787", "type": "github" }, "original": { From 6c39055c6eaf7dea797e56143b1a17f06a875e99 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 13 Oct 2024 14:25:47 +0400 Subject: [PATCH 221/319] editors/emacs: make pinentry be emacs --- modules/dev/editors/emacs/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/dev/editors/emacs/default.nix b/modules/dev/editors/emacs/default.nix index 066c7bac..13c9ff24 100644 --- a/modules/dev/editors/emacs/default.nix +++ b/modules/dev/editors/emacs/default.nix @@ -154,6 +154,8 @@ in { }; }; + programs.gnupg.agent = { pinentryPackage = pkgs.pinentry-emacs; }; + fonts.packages = with pkgs; [ (nerdfonts.override { fonts = [ "JetBrainsMono" ]; }) jetbrains-mono From c514b653d390b66d683757843ea177f956209580 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 13 Oct 2024 14:29:15 +0400 Subject: [PATCH 222/319] editor/emacs: mkforce --- modules/dev/editors/emacs/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/dev/editors/emacs/default.nix b/modules/dev/editors/emacs/default.nix index 13c9ff24..04b66e3f 100644 --- a/modules/dev/editors/emacs/default.nix +++ b/modules/dev/editors/emacs/default.nix @@ -2,6 +2,8 @@ let cfg = config.modules.dev.editors.emacs; + inherit (lib) mkForce; + # so we dont cry later on why texLive is MASSIVE tex = (pkgs.texlive.combine { inherit (pkgs.texlive) @@ -154,7 +156,7 @@ in { }; }; - programs.gnupg.agent = { pinentryPackage = pkgs.pinentry-emacs; }; + programs.gnupg.agent = { pinentryPackage = mkForce pkgs.pinentry-emacs; }; fonts.packages = with pkgs; [ (nerdfonts.override { fonts = [ "JetBrainsMono" ]; }) From 67ce8ffdd6dd9e2f56d94d32d0e7c950025dbe41 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 13 Oct 2024 14:31:48 +0400 Subject: [PATCH 223/319] config/emacs: pinentry --- config/emacs/emacs.org | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 2ef4f017..dd63c9a3 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -621,7 +621,11 @@ kept-old-versions 5) (use-package pinentry :config (setq epa-pinentry-mode 'loopback)) - (pinentry-start)) + (pinentry-start) + (defun pinentry-emacs (desc prompt ok error) + (let ((str (read-passwd (concat (replace-regexp-in-string "%22" "\"" (replace-regexp-in-string "%0A" "\n" desc)) prompt ": ")))) + str)) + ) #+end_src ** Password-Store #+begin_src emacs-lisp From 9afedc9be7dbeee78d359ea2e20dc61a013bb5b9 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 13 Oct 2024 14:43:00 +0400 Subject: [PATCH 224/319] its so over --- config/emacs/emacs.org | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index dd63c9a3..4b733d2d 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -620,11 +620,8 @@ kept-old-versions 5) (unless (eq system-type 'windows-nt) (use-package pinentry :config - (setq epa-pinentry-mode 'loopback)) - (pinentry-start) - (defun pinentry-emacs (desc prompt ok error) - (let ((str (read-passwd (concat (replace-regexp-in-string "%22" "\"" (replace-regexp-in-string "%0A" "\n" desc)) prompt ": ")))) - str)) + (setq epa-pinentry-mode 'loopback) + (pinentry-start)) ) #+end_src ** Password-Store From b3d94854f9fe6b0f78bd341e83f06cc4ba68fa47 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 13 Oct 2024 14:43:19 +0400 Subject: [PATCH 225/319] its so over 2 --- modules/dev/editors/emacs/default.nix | 4 ---- 1 file changed, 4 deletions(-) diff --git a/modules/dev/editors/emacs/default.nix b/modules/dev/editors/emacs/default.nix index 04b66e3f..066c7bac 100644 --- a/modules/dev/editors/emacs/default.nix +++ b/modules/dev/editors/emacs/default.nix @@ -2,8 +2,6 @@ let cfg = config.modules.dev.editors.emacs; - inherit (lib) mkForce; - # so we dont cry later on why texLive is MASSIVE tex = (pkgs.texlive.combine { inherit (pkgs.texlive) @@ -156,8 +154,6 @@ in { }; }; - programs.gnupg.agent = { pinentryPackage = mkForce pkgs.pinentry-emacs; }; - fonts.packages = with pkgs; [ (nerdfonts.override { fonts = [ "JetBrainsMono" ]; }) jetbrains-mono From bd9f48d1b8a21f36d04477f3d5cb12da391abef6 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 13 Oct 2024 14:43:57 +0400 Subject: [PATCH 226/319] default.nix: change cache-ttl --- default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/default.nix b/default.nix index 07bfa2be..b6d0acb5 100644 --- a/default.nix +++ b/default.nix @@ -141,6 +141,8 @@ settings = { allow-emacs-pinentry = ""; allow-loopback-pinentry = ""; + default-cache-ttl = "28800"; + max-cache-ttl = "28800"; }; # enableSSHSupport = true; }; From 3f63d2f1e2c1baef39977068660fb98839dba500 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 13 Oct 2024 14:46:37 +0400 Subject: [PATCH 227/319] okay i will try this again --- modules/dev/editors/emacs/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/dev/editors/emacs/default.nix b/modules/dev/editors/emacs/default.nix index 066c7bac..99bf3f32 100644 --- a/modules/dev/editors/emacs/default.nix +++ b/modules/dev/editors/emacs/default.nix @@ -2,6 +2,8 @@ let cfg = config.modules.dev.editors.emacs; + inherit (lib) mkForce; + # so we dont cry later on why texLive is MASSIVE tex = (pkgs.texlive.combine { inherit (pkgs.texlive) @@ -154,6 +156,8 @@ in { }; }; + programs.gnupg.agent.pinentryPackage = mkForce pkgs.pinentry-emacs; + fonts.packages = with pkgs; [ (nerdfonts.override { fonts = [ "JetBrainsMono" ]; }) jetbrains-mono From 7521dc778f1000e6823424de7e837f2aa8ce682e Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 13 Oct 2024 14:58:04 +0400 Subject: [PATCH 228/319] config/emacs: ask for password IN emacs --- config/emacs/emacs.org | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 4b733d2d..728ad136 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1196,7 +1196,8 @@ GNU patch review metho dor sometihng idk (add-to-list 'smtpmail-auth-supported 'xoauth2) (setq mu4e-update-interval (* 10 60)) - (setq mu4e-get-mail-command "offlineimap") + (setq mu4e-get-mail-command (format "INSIDE_EMACS=%s offlineimap" emacs-version) + epa-pinentry-mode 'ask) (setq mu4e-maildir "~/Mail") ;; for mail accounts From 71db3ae767800bfaddf4ebf1d67803db7a19c01e Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 13 Oct 2024 15:33:17 +0400 Subject: [PATCH 229/319] config/emacs: add mu4e-alert --- config/emacs/emacs.org | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 728ad136..74e067ac 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1278,6 +1278,12 @@ GNU patch review metho dor sometihng idk )) ) + + (use-package mu4e-alert + :after mu4e + :config + (setq mu4e-alert-notify-repeated-mails nil) + (mu4e-alert-enable-notifications)) #+end_src * Org #+begin_src emacs-lisp From 3cb8bf5e315d92b8acaa68071e0a7df9e133d0fc Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 13 Oct 2024 15:37:25 +0400 Subject: [PATCH 230/319] config/emacs: kill message buffers --- config/emacs/emacs.org | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 74e067ac..7c9493c1 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1203,6 +1203,9 @@ GNU patch review metho dor sometihng idk ;; for mail accounts (setq sakomacs-mail-accounts (json-read-file "~/Mail/accounts.json")) + ;; kill message buffers + (setq message-kill-buffer-on-exit t) + (setq mu4e-context-policy 'pick-first) (setq mu4e-compose-context-policy 'always-ask) (setq mu4e-contexts From 4240382b391c9319f0de5e9c907331b49b8f64bb Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 13 Oct 2024 15:59:46 +0400 Subject: [PATCH 231/319] a --- config/emacs/.offlineimaprc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/emacs/.offlineimaprc b/config/emacs/.offlineimaprc index d2fce051..39745dd2 100644 --- a/config/emacs/.offlineimaprc +++ b/config/emacs/.offlineimaprc @@ -1,6 +1,6 @@ [general] pythonfile = ~/.offlineimap.py -accounts = Proton, Outlook, Gmail-personal-1, Gmail-personal-2 +accounts = Proton, Outlook, Gmail-personal-1, Gmail-personal-2, li socktimeout = 60 [Account Proton] From b84b76df6acf4ab38832ad4c7f81399f1264ef18 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 13 Oct 2024 17:36:50 +0400 Subject: [PATCH 232/319] editors/emacs: add msmtp --- modules/dev/editors/emacs/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/dev/editors/emacs/default.nix b/modules/dev/editors/emacs/default.nix index 99bf3f32..1ead9887 100644 --- a/modules/dev/editors/emacs/default.nix +++ b/modules/dev/editors/emacs/default.nix @@ -109,6 +109,8 @@ in { offlineimap # protonmail hydroxide + # send mail + msmtp # doc-view unoconv # org to pdf From 5d4795557c99000997d1b8a06643504afb44d326 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 13 Oct 2024 20:05:47 +0400 Subject: [PATCH 233/319] config/emacs: use kanagawa theme --- config/emacs/emacs.org | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 7c9493c1..3fe09836 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -207,9 +207,13 @@ kept-old-versions 5) ;; :config ;; (load-theme 'grandshell t)) - (use-package ef-themes - :config - (load-theme 'ef-dark t)) + ;; (use-package ef-themes + ;; :config + ;; (load-theme 'ef-dark t)) + + (use-package kanagawa-themes + :config + (load-theme 'kanagawa-dragon t)) ;; emacsclient things (setq frame-resize-pixelwise t) @@ -1192,8 +1196,10 @@ GNU patch review metho dor sometihng idk (setq mu4e-change-filenames-when-moving t) ;; sending mail - (setq message-send-mail-function 'smtpmail-send-it) - (add-to-list 'smtpmail-auth-supported 'xoauth2) + ;; (setq message-send-mail-function 'smtpmail-send-it) + ;; (add-to-list 'smtpmail-auth-supported 'xoauth2) + (setq send-mail-function 'sendmail-send-it + sendmail-program "msmtp") (setq mu4e-update-interval (* 10 60)) (setq mu4e-get-mail-command (format "INSIDE_EMACS=%s offlineimap" emacs-version) From 60f3c421b42d4bc0346f853badbe5d163bbfe5b3 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 13 Oct 2024 20:11:08 +0400 Subject: [PATCH 234/319] config/emacs: again --- config/emacs/emacs.org | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 3fe09836..e00d68e3 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -211,9 +211,13 @@ kept-old-versions 5) ;; :config ;; (load-theme 'ef-dark t)) - (use-package kanagawa-themes - :config - (load-theme 'kanagawa-dragon t)) + ;; (use-package kanagawa-themes + ;; :config + ;; (load-theme 'kanagawa-dragon t)) + + (use-package klere-theme + :config + (load-theme 'klere t)) ;; emacsclient things (setq frame-resize-pixelwise t) From 128445ce1390915dacc6546ce434c4166394d0eb Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 13 Oct 2024 20:43:45 +0400 Subject: [PATCH 235/319] config/emacs: ok --- config/emacs/emacs.org | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index e00d68e3..38bfb2ea 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -215,9 +215,14 @@ kept-old-versions 5) ;; :config ;; (load-theme 'kanagawa-dragon t)) - (use-package klere-theme + ;; (use-package klere-theme + ;; :config + ;; (load-theme 'klere t)) + + (use-package kaolin-themes :config - (load-theme 'klere t)) + (load-theme 'kaolin-shiva t) + (kaolin-treemacs-theme)) ;; emacsclient things (setq frame-resize-pixelwise t) From 1df6c599d4a6b464a558e6669f2484d4537950f6 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Mon, 14 Oct 2024 06:35:02 +0400 Subject: [PATCH 236/319] editors/emacs: add oama --- modules/dev/editors/emacs/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/dev/editors/emacs/default.nix b/modules/dev/editors/emacs/default.nix index 1ead9887..2676a439 100644 --- a/modules/dev/editors/emacs/default.nix +++ b/modules/dev/editors/emacs/default.nix @@ -107,6 +107,8 @@ in { mu # email sync offlineimap + # oauth + oama # protonmail hydroxide # send mail From 530bfa36da5b6ecd1cbdc36d21c6410ab2540b64 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Mon, 14 Oct 2024 07:12:53 +0400 Subject: [PATCH 237/319] config/emacs: more breakage yay --- config/emacs/emacs.org | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 38bfb2ea..ed233209 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -221,8 +221,7 @@ kept-old-versions 5) (use-package kaolin-themes :config - (load-theme 'kaolin-shiva t) - (kaolin-treemacs-theme)) + (load-theme 'kaolin-shiva t)) ;; emacsclient things (setq frame-resize-pixelwise t) From a7f5f4b2b05ead59126f7a215840ae9b58eabe32 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Mon, 14 Oct 2024 07:13:00 +0400 Subject: [PATCH 238/319] this works lmao --- modules/dev/editors/emacs/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/dev/editors/emacs/default.nix b/modules/dev/editors/emacs/default.nix index 2676a439..9b15409a 100644 --- a/modules/dev/editors/emacs/default.nix +++ b/modules/dev/editors/emacs/default.nix @@ -107,6 +107,7 @@ in { mu # email sync offlineimap + (isync.override { withCyrusSaslXoauth2 = true; }) # oauth oama # protonmail From 0053184f5117acff98c42e78bfd64e133f992a94 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Mon, 14 Oct 2024 10:37:34 +0400 Subject: [PATCH 239/319] dev/emacs: add oauth2ms --- modules/dev/editors/emacs/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/dev/editors/emacs/default.nix b/modules/dev/editors/emacs/default.nix index 9b15409a..19d060d6 100644 --- a/modules/dev/editors/emacs/default.nix +++ b/modules/dev/editors/emacs/default.nix @@ -110,6 +110,7 @@ in { (isync.override { withCyrusSaslXoauth2 = true; }) # oauth oama + oauth2ms # protonmail hydroxide # send mail From a70bea9dcdded21ff2e102a63d85a98747269586 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Mon, 14 Oct 2024 14:11:23 +0400 Subject: [PATCH 240/319] dev/emacs: remove oauth2ms --- modules/dev/editors/emacs/default.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/dev/editors/emacs/default.nix b/modules/dev/editors/emacs/default.nix index 19d060d6..9b15409a 100644 --- a/modules/dev/editors/emacs/default.nix +++ b/modules/dev/editors/emacs/default.nix @@ -110,7 +110,6 @@ in { (isync.override { withCyrusSaslXoauth2 = true; }) # oauth oama - oauth2ms # protonmail hydroxide # send mail From b0a54ef08a82aa3924f286b0e71cecea6716f78b Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Mon, 14 Oct 2024 15:55:22 +0400 Subject: [PATCH 241/319] config/emacs: lmao mbsync works with oauth now --- config/emacs/.mbsyncrc | 80 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 76 insertions(+), 4 deletions(-) diff --git a/config/emacs/.mbsyncrc b/config/emacs/.mbsyncrc index adbabf4c..531085b2 100644 --- a/config/emacs/.mbsyncrc +++ b/config/emacs/.mbsyncrc @@ -1,9 +1,10 @@ IMAPAccount outlook +AuthMechs XOAUTH2 Host outlook.office365.com Port 993 -UserCmd "pass Microsoft | awk 'BEGIN {ORS=\"\"} FNR == 2{gsub(\"login: \", \"\"); gsub(/ /, \"\"); print}'" -PassCmd "pass Microsoft" -SSLType IMAPS +UserCmd "pass Microsoft | grep 'login:' | sed 's/login: //'" +PassCmd "oama access $(pass Microsoft | grep 'login:' | sed 's/login: //')" +TLSType IMAPS IMAPStore outlook-remote Account outlook @@ -21,10 +22,58 @@ Create Both Expunge Both SyncState * +IMAPAccount gmail-1 +AuthMechs XOAUTH2 +Host imap.gmail.com +Port 993 +UserCmd "pass accounts.google.com/one | grep 'login:' | sed 's/login: //'" +PassCmd "oama access $(pass accounts.google.com/one | grep 'login:' | sed 's/login: //')" +TLSType IMAPS + +IMAPStore gmail-1-remote +Account gmail-1 + +MaildirStore gmail-1-local +Subfolders Verbatim +Path ~/Mail/gmail-one/ +Inbox ~/Mail/gmail-one/Inbox + +Channel gmail-1 +Far :gmail-1-remote: +Near :gmail-1-local: +Patterns * !"[Gmail]/All Mail" !"[Gmail]/Important" !"[Gmail]/Starred" !"[Gmail]/Bin" +Create Both +Expunge Both +SyncState * + +IMAPAccount gmail-2 +AuthMechs XOAUTH2 +Host imap.gmail.com +Port 993 +UserCmd "pass accounts.google.com/two| grep 'login:' | sed 's/login: //'" +PassCmd "oama access $(pass accounts.google.com/two | grep 'login:' | sed 's/login: //')" +TLSType IMAPS + +IMAPStore gmail-2-remote +Account gmail-2 + +MaildirStore gmail-2-local +Subfolders Verbatim +Path ~/Mail/gmail-two/ +Inbox ~/Mail/gmail-two/Inbox + +Channel gmail-2 +Far :gmail-2-remote: +Near :gmail-2-local: +Patterns * !"[Gmail]/All Mail" !"[Gmail]/Important" !"[Gmail]/Starred" !"[Gmail]/Bin" +Create Both +Expunge Both +SyncState * + IMAPAccount proton Host 127.0.0.1 Port 1143 -UserCmd "pass 'Proton Account' | awk 'BEGIN {ORS=\"\"} FNR == 2{gsub(\"login: \", \"\"); gsub(/ /, \"\"); print}'" +UserCmd "pass 'Proton Account' | grep 'login:' | sed 's/login: //'" PassCmd "cat ~/.hydroxide-bridge-pass" SSLType none @@ -43,3 +92,26 @@ Patterns * Create Both Expunge Both SyncState * + +IMAPAccount li +Host 127.0.0.1 +Port 993 +UserCmd "pass show email/li | grep 'login: ' | sed 's/login: //'" +PassCmd "cat ~/.hydroxide-bridge-pass" +SSLType none + +IMAPStore li-remote +Account li + +MailDirStore li-local +SubFolders Verbatim +Path ~/Mail/Proton/ +Inbox ~/Mail/Proton/Inbox + +Channel li +Far :li-remote: +Near :li-local: +Patterns * +Create Both +Expunge Both +SyncState * \ No newline at end of file From 58c067690ba772425c5a5009a06e09ccbf852470 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 13 Oct 2024 21:09:08 +0400 Subject: [PATCH 242/319] config/emacs: ill try smtpmail again --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index e5477ee1..11daeab8 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ + # My Dotfiles! [![built with nix](https://builtwithnix.org/badge.svg)](https://builtwithnix.org) From df5610702481f4c0b1d48deacebd681d51cc0cd5 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 13 Oct 2024 21:09:08 +0400 Subject: [PATCH 243/319] config/emacs: ill try smtpmail again --- config/emacs/emacs.org | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index ed233209..86f408e9 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1204,11 +1204,9 @@ GNU patch review metho dor sometihng idk (setq mu4e-change-filenames-when-moving t) ;; sending mail - ;; (setq message-send-mail-function 'smtpmail-send-it) - ;; (add-to-list 'smtpmail-auth-supported 'xoauth2) - (setq send-mail-function 'sendmail-send-it - sendmail-program "msmtp") - + (setq message-send-mail-function 'smtpmail-send-it) + (add-to-list 'smtpmail-auth-supported 'xoauth2) + (setq mu4e-update-interval (* 10 60)) (setq mu4e-get-mail-command (format "INSIDE_EMACS=%s offlineimap" emacs-version) epa-pinentry-mode 'ask) From 2c097b425093cd3e87b8f2495ffdd2d6ddc8fc3e Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Mon, 14 Oct 2024 19:28:52 +0400 Subject: [PATCH 244/319] it broke --- config/emacs/.mbsyncrc | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/config/emacs/.mbsyncrc b/config/emacs/.mbsyncrc index 531085b2..a8e5f73a 100644 --- a/config/emacs/.mbsyncrc +++ b/config/emacs/.mbsyncrc @@ -75,15 +75,15 @@ Host 127.0.0.1 Port 1143 UserCmd "pass 'Proton Account' | grep 'login:' | sed 's/login: //'" PassCmd "cat ~/.hydroxide-bridge-pass" -SSLType none +TLSType None IMAPStore proton-remote Account proton MailDirStore proton-local SubFolders Verbatim -Path ~/Mail/Proton/ -Inbox ~/Mail/Proton/Inbox +Path ~/.mail/proton/ +Inbox ~/.mail/proton/Inbox Channel proton Far :proton-remote: @@ -94,19 +94,18 @@ Expunge Both SyncState * IMAPAccount li -Host 127.0.0.1 -Port 993 +AuthMechs * UserCmd "pass show email/li | grep 'login: ' | sed 's/login: //'" -PassCmd "cat ~/.hydroxide-bridge-pass" -SSLType none +PassCmd "pass show email/li" +Tunnel "nc -T protocols=all -T ciphers=compat -X 5 -x " IMAPStore li-remote Account li MailDirStore li-local SubFolders Verbatim -Path ~/Mail/Proton/ -Inbox ~/Mail/Proton/Inbox +Path ~/.mail/li/ +Inbox ~/.mail/li/Inbox Channel li Far :li-remote: @@ -114,4 +113,4 @@ Near :li-local: Patterns * Create Both Expunge Both -SyncState * \ No newline at end of file +SyncState * From a2f9efe1ce4ed5b8a02f56769f3910a3c94babdc Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Mon, 14 Oct 2024 19:53:43 +0400 Subject: [PATCH 245/319] config/emacs: freaky --- config/emacs/.offlineimaprc | 10 ++++----- config/emacs/emacs.org | 44 ++++++++++++++++++------------------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/config/emacs/.offlineimaprc b/config/emacs/.offlineimaprc index 39745dd2..b02de929 100644 --- a/config/emacs/.offlineimaprc +++ b/config/emacs/.offlineimaprc @@ -9,7 +9,7 @@ remoterepository = Proton-remote [Repository Proton-local] type = Maildir -localfolders = ~/Mail/Proton +localfolders = ~/.mail/protonmail [Repository Proton-remote] type = IMAP @@ -26,7 +26,7 @@ remoterepository = Outlook-remote [Repository Outlook-local] type = Maildir -localfolders = ~/Mail/Outlook +localfolders = ~/.mail/outlook [Repository Outlook-remote] ssl = yes @@ -50,7 +50,7 @@ remoterepository = Gmail-personal-1-remote [Repository Gmail-personal-1-local] type = GmailMaildir -localfolders = ~/Mail/Gmail-Personal-1 +localfolders = ~/.mail/gmail1 # Google IMAP weirdness nametrans = lambda f: '[Gmail]/' + f if f in ['Drafts', 'Starred', 'Important', 'Spam', 'Trash', 'All Mail', 'Sent Mail'] else f @@ -74,7 +74,7 @@ remoterepository = Gmail-personal-2-remote [Repository Gmail-personal-2-local] type = GmailMaildir -localfolders = ~/Mail/Gmail-Personal-2 +localfolders = ~/.mail/gmail2 # Google IMAP weirdness nametrans = lambda f: '[Gmail]/' + f if f in ['Drafts', 'Starred', 'Important', 'Spam', 'Trash', 'All Mail', 'Sent Mail'] else f @@ -99,7 +99,7 @@ proxy = SOCKS5:localhost:9050 [Repository li-local] type = Maildir -localfolders = ~/Mail/li +localfolders = ~/.mail/li [Repository li-remote] type = IMAP diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 86f408e9..afda47c5 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1210,10 +1210,10 @@ GNU patch review metho dor sometihng idk (setq mu4e-update-interval (* 10 60)) (setq mu4e-get-mail-command (format "INSIDE_EMACS=%s offlineimap" emacs-version) epa-pinentry-mode 'ask) - (setq mu4e-maildir "~/Mail") + (setq mu4e-maildir "~/.mail") ;; for mail accounts - (setq sakomacs-mail-accounts (json-read-file "~/Mail/accounts.json")) + (setq sakomacs-mail-accounts (json-read-file "~/.mail/accounts.json")) ;; kill message buffers (setq message-kill-buffer-on-exit t) @@ -1228,13 +1228,13 @@ GNU patch review metho dor sometihng idk :match-func (lambda (msg) (when msg - (string-prefix-p "/Outlook" (mu4e-message-field msg :maildir)))) + (string-prefix-p "/outlook" (mu4e-message-field msg :maildir)))) :vars `((user-mail-address . ,(cdr (assoc 'outlook sakomacs-mail-accounts))) (user-full-name . "Sako") - (mu4e-drafts-folder . "/Outlook/Drafts") - (mu4e-sent-folder . "/Outlook/Sent") - (mu4e-refile-folder . "/Outlook/Inbox") - (mu4e-trash-folder . "/Outlook/Deleted") + (mu4e-drafts-folder . "/outlook/Drafts") + (mu4e-sent-folder . "/outlook/Sent") + (mu4e-refile-folder . "/outlook/Inbox") + (mu4e-trash-folder . "/outlook/Deleted") ;; todo stmpmail and compose signatures )) (make-mu4e-context @@ -1242,13 +1242,13 @@ GNU patch review metho dor sometihng idk :match-func (lambda (msg) (when msg - (string-prefix-p "/Proton" (mu4e-message-field msg :maildir)))) + (string-prefix-p "/protonmail" (mu4e-message-field msg :maildir)))) :vars `((user-mail-address . ,(cdr (assoc 'protonmail sakomacs-mail-accounts))) (user-full-name . "Sako") - (mu4e-drafts-folder . "/Proton/Drafts") - (mu4e-sent-folder . "/Proton/Sent") - (mu4e-refile-folder . "/Proton/Inbox") - (mu4e-trash-folder . "/Proton/Trash")) + (mu4e-drafts-folder . "/protonmail/Drafts") + (mu4e-sent-folder . "/protonmail/Sent") + (mu4e-refile-folder . "/protonmail/Inbox") + (mu4e-trash-folder . "/protonmail/Trash")) ;; todo stmpmail and compose signatures ) (make-mu4e-context @@ -1256,13 +1256,13 @@ GNU patch review metho dor sometihng idk :match-func (lambda (msg) (when msg - (string-prefix-p "/Gmail-Personal-1" (mu4e-message-field msg :maildir)))) + (string-prefix-p "/gmail1" (mu4e-message-field msg :maildir)))) :vars `((user-mail-address . ,(cdr (assoc 'gmail-1 sakomacs-mail-accounts))) (user-full-name . "Sako") - (mu4e-drafts-folder . "/Gmail-Personal-1/Drafts") - (mu4e-sent-folder . "/Gmail-Personal-1/Sent Mail") - (mu4e-refile-folder . "/Gmail-Personal-1/Inbox") - (mu4e-trash-folder . "Gmail-Personal-1/Trash") + (mu4e-drafts-folder . "/gmail1/Drafts") + (mu4e-sent-folder . "/gmail1/Sent Mail") + (mu4e-refile-folder . "/gmail1/Inbox") + (mu4e-trash-folder . "gmail1/Trash") ;; todo stmpmail and compose signatures )) (make-mu4e-context @@ -1270,13 +1270,13 @@ GNU patch review metho dor sometihng idk :match-func (lambda (msg) (when msg - (string-prefix-p "/Gmail-Personal-2" (mu4e-message-field msg :maildir)))) + (string-prefix-p "/gmail2" (mu4e-message-field msg :maildir)))) :vars `((user-mail-address . ,(cdr (assoc 'gmail-2 sakomacs-mail-accounts))) (user-full-name . "Sako") - (mu4e-drafts-folder . "/Gmail-Personal-2/Drafts") - (mu4e-sent-folder . "/Gmail-Personal-2/Sent Mail") - (mu4e-refile-folder . "/Gmail-Personal-2/Inbox") - (mu4e-trash-folder . "Gmail-Personal-2/Trash") + (mu4e-drafts-folder . "/gmail2/Drafts") + (mu4e-sent-folder . "/gmail2/Sent Mail") + (mu4e-refile-folder . "/gmail2/Inbox") + (mu4e-trash-folder . "gmail2/Trash") )) (make-mu4e-context :name "li" From aeb60f6bd02969d527c6e7834816b2a86a8ca880 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Mon, 14 Oct 2024 22:06:09 +0400 Subject: [PATCH 246/319] config/ags: move bar to bottom --- config/ags/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/ags/config.js b/config/ags/config.js index 1f87cf1e..6fde77d0 100644 --- a/config/ags/config.js +++ b/config/ags/config.js @@ -234,7 +234,7 @@ function Bar(monitor = 0) { name: `bar-${monitor}`, // name has to be unique class_name: "bar", monitor, - anchor: ["top", "left", "right"], + anchor: ["bottom", "left", "right"], // margins: [5, 10, 0, 10], margins: [0, 0, 0, 0], exclusivity: "exclusive", From 9cd028f912aaaa02107d41bbab1f01bb8571b846 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Mon, 14 Oct 2024 22:10:42 +0400 Subject: [PATCH 247/319] config/hyprland: change active border color --- config/hyprland/hyprland.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/hyprland/hyprland.conf b/config/hyprland/hyprland.conf index b9f2e8f1..68d2a834 100644 --- a/config/hyprland/hyprland.conf +++ b/config/hyprland/hyprland.conf @@ -80,8 +80,8 @@ general { gaps_in = 0 gaps_out = 0 border_size = 1 - col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg - col.inactive_border = rgba(595959aa) + col.active_border = rgba(8b008bee) rgba(9400d3ee) 45deg + col.inactive_border = rgb(595959aa) layout = dwindle } From 2d8bfcd092c1cf273ec8ddb3569de2b70ae0d45b Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Mon, 14 Oct 2024 22:16:35 +0400 Subject: [PATCH 248/319] config/hyprland: change inactive border color --- config/hyprland/hyprland.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/hyprland/hyprland.conf b/config/hyprland/hyprland.conf index 68d2a834..b702016f 100644 --- a/config/hyprland/hyprland.conf +++ b/config/hyprland/hyprland.conf @@ -81,7 +81,7 @@ general { gaps_out = 0 border_size = 1 col.active_border = rgba(8b008bee) rgba(9400d3ee) 45deg - col.inactive_border = rgb(595959aa) + col.inactive_border = rgb(3F273F) rgb(410E41) 45deg layout = dwindle } From d42241beea7b9b09b7c4904e18d4f5069c818def Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Mon, 14 Oct 2024 22:46:07 +0400 Subject: [PATCH 249/319] config/background: change wallpaper --- config/background.png | Bin 8568 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 config/background.png diff --git a/config/background.png b/config/background.png deleted file mode 100644 index 3c363c58bbed07e2a0b8156af156ea0ed13f4c42..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8568 zcmeH~`8U+-AHYAdwph9eWf(0|!WCWIGDDUaWg9hwu~f(m*~Y%i;7TRi$hBpQxpJo= z)o78VhOs0nVg|_;HEE);O@{mV=$`ure1H3%GtW75&OFcaexCRH{dzB-^IUPTvy$Gl za}xjn(kN>SGyq7F06@%0Y6H09SBH@Y0Fh*Wb8`ojxw%?!XppaefDZud&yLSVSidlZ zwRk#FEDy>^?;p!5Kfc!6EPZnorA# znV8;Cxgn3OWUQ&DC>&CSEshU2GKY_n@R;pgpHV>J#iD{!=(b7cl%9jnFW-b4gLmkC zv^XR^G8>)=xN*m{I@g9u&zWkwY?70^yzQzto1x6mFRE{jD$RH9Alt;*8GFAGzXC7N ziCt-ZIHAYXi`FkH(D-;I1+CbLy?xy_J*v>?FWiyIu-`LJx4K=Uh@3>W(ib(R{vzBnHoJCTniq}$m z*2(tVq{ENSZjCaj2;~B71t17c|9oAuRT)8>BuH>m~pF;qLa$mv(<< z_qyWV&^uabEEQSpI-GKmucvQ>NvXL^k?#V_PfxA{8Am(@+9e!90zv{p0zv{p0zv{p z0zv{p0{=4sQ_l{65x}&{(($l?fq|YLdcS;}D%;yp6zCBI+{unr`m}(% zQ&f%?f#woedCPVMg8qly=063tJl5U9)jJuToHh9s#>@LxOlr)?u3jtS+)tTrvTj2M zJVvxIKXniX&sK&Sj_2y10_R!&(b@oTA+4^iPToV4105)+x7`c??6c?3?@h_;h^e0W z#q#yQz(8A@b-9C7l9!KYupbUy|M9V4alBG?yzVgpC{;mI>;bXVK_-=OtiD@3UQ zMl(0UHvC|&ja6)JIhxCwn3(W2>71CToRR`fJ0Wox=#ky0q2U?xiPEsbj9vH=Etv0z zM^9w$vC6n#cWH8Ra^0JYHgzsTb?2B%OG}BOlBx+yqg|^@>7L~as~AWXz>1JRjC2-A}TsFx203csnI=ZAB3=#n6vLB%R*q0<>5Ot=j&UTA#uxdlQE4Y z1k+k1`1%3S?+z@unXotpY19y0$1Y zN5j6JT6xMciDz4#DhprzOsysBkj11SAyHbo#wT^u+^eJ9`_wzvVOIwXDGF&VGM0hX zqtHHZu~vIond3@(SD^35&OHz!n>_s0zEt1wGlOCAW^=Ah%N_|xESWR(D6Cj&Ezo(v zOx`kb$K9b;!NeEx#+2n zAIa|zkt6_8eH&OBS&scR*ulow$W)z#F~$`rHXNLzd^$L;U6bFGq9%pGVE)X@>zoX& zK4s(P?1cWz*GwIjIiwXc>Jy^k7Ccdubq zoqym;8)s%VtVd9Hy2i6fC#53j5AXa+QwlodS4c7G1E;p>E6-?dFsP|->g&VMNt^Df z?)jME_8e&2R8Fkl(-tb^IfTW4YUamiwX-ro9#=c4P@}aJb0@c zUs6&M@$+8d(p=}SM-hbq21TtsDs!_;c$GKb*wApw1H5%`@;;a>qIo*lm~YLJ4d0IA z@%S!Z{k%?f6uEPF#Yr=-lkQ53LlQatYEr8|&XV^UCQP(uj>KdSK8+eY=-HGI9~d~3 z=b5lPnhNh&4@h5Qeqo`e{H7m^+z~pye_>|uLEvD0v(>Aq@0_)=R3v}8B3V*4CIhmY zG${4rjz_JA=qENE9|Bv9JNje#b;SsAE&d+srMsxczJ12)@9$^FZ|=8|aG_y1eIha5 zN+l*lWSXs;yStV`T8Rqi0BkD^FkQ2{mHmBE}dxhIA& zdLP5legx{yGSCChC)D4+Px$uXSp0OXhJ8ug@?_pTsQXPT)B>k;JfA*^WngN@ZAYE(QP z%$nQ5Qo8_Mm-oaq!RY9y6+E8MU4nR=t*v2qBWkuq5pq?}0(4dP;h2$3k{5wMn0i%w zH1cb2R(;?O zCd`ht#5Asg_TjC&f7_WJHub7;`D0P-lQ|m-`Zd_Z+jfHq2&`eW6e7P2%&vUz22)rd zi{SNux(va@>mD&~{2fJh*NGhGbT!=yeT1Rrc25Nfc8WC=Ylp&HcW-(&J#F zCB3pdRciQWA(xk}oPM0z=j!Up2Uj{L?><}a+N2Dy*gFW9|Z3x|+^kidTg zR{B(7zd$o7{u*0ZSS0^}5&jVp5E2j)5E2j)5EA(RAYiv4W8cz#M?KUuWG~9n&Z5T5 GE9oDow>P)| From a8216fb2d0dd0ea7174624365eb52cc308764232 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Mon, 14 Oct 2024 22:46:21 +0400 Subject: [PATCH 250/319] moVE --- config/background5.png | Bin 0 -> 8568 bytes config/wallpaper.png | Bin 0 -> 70651 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 config/background5.png create mode 100644 config/wallpaper.png diff --git a/config/background5.png b/config/background5.png new file mode 100644 index 0000000000000000000000000000000000000000..3c363c58bbed07e2a0b8156af156ea0ed13f4c42 GIT binary patch literal 8568 zcmeH~`8U+-AHYAdwph9eWf(0|!WCWIGDDUaWg9hwu~f(m*~Y%i;7TRi$hBpQxpJo= z)o78VhOs0nVg|_;HEE);O@{mV=$`ure1H3%GtW75&OFcaexCRH{dzB-^IUPTvy$Gl za}xjn(kN>SGyq7F06@%0Y6H09SBH@Y0Fh*Wb8`ojxw%?!XppaefDZud&yLSVSidlZ zwRk#FEDy>^?;p!5Kfc!6EPZnorA# znV8;Cxgn3OWUQ&DC>&CSEshU2GKY_n@R;pgpHV>J#iD{!=(b7cl%9jnFW-b4gLmkC zv^XR^G8>)=xN*m{I@g9u&zWkwY?70^yzQzto1x6mFRE{jD$RH9Alt;*8GFAGzXC7N ziCt-ZIHAYXi`FkH(D-;I1+CbLy?xy_J*v>?FWiyIu-`LJx4K=Uh@3>W(ib(R{vzBnHoJCTniq}$m z*2(tVq{ENSZjCaj2;~B71t17c|9oAuRT)8>BuH>m~pF;qLa$mv(<< z_qyWV&^uabEEQSpI-GKmucvQ>NvXL^k?#V_PfxA{8Am(@+9e!90zv{p0zv{p0zv{p z0zv{p0{=4sQ_l{65x}&{(($l?fq|YLdcS;}D%;yp6zCBI+{unr`m}(% zQ&f%?f#woedCPVMg8qly=063tJl5U9)jJuToHh9s#>@LxOlr)?u3jtS+)tTrvTj2M zJVvxIKXniX&sK&Sj_2y10_R!&(b@oTA+4^iPToV4105)+x7`c??6c?3?@h_;h^e0W z#q#yQz(8A@b-9C7l9!KYupbUy|M9V4alBG?yzVgpC{;mI>;bXVK_-=OtiD@3UQ zMl(0UHvC|&ja6)JIhxCwn3(W2>71CToRR`fJ0Wox=#ky0q2U?xiPEsbj9vH=Etv0z zM^9w$vC6n#cWH8Ra^0JYHgzsTb?2B%OG}BOlBx+yqg|^@>7L~as~AWXz>1JRjC2-A}TsFx203csnI=ZAB3=#n6vLB%R*q0<>5Ot=j&UTA#uxdlQE4Y z1k+k1`1%3S?+z@unXotpY19y0$1Y zN5j6JT6xMciDz4#DhprzOsysBkj11SAyHbo#wT^u+^eJ9`_wzvVOIwXDGF&VGM0hX zqtHHZu~vIond3@(SD^35&OHz!n>_s0zEt1wGlOCAW^=Ah%N_|xESWR(D6Cj&Ezo(v zOx`kb$K9b;!NeEx#+2n zAIa|zkt6_8eH&OBS&scR*ulow$W)z#F~$`rHXNLzd^$L;U6bFGq9%pGVE)X@>zoX& zK4s(P?1cWz*GwIjIiwXc>Jy^k7Ccdubq zoqym;8)s%VtVd9Hy2i6fC#53j5AXa+QwlodS4c7G1E;p>E6-?dFsP|->g&VMNt^Df z?)jME_8e&2R8Fkl(-tb^IfTW4YUamiwX-ro9#=c4P@}aJb0@c zUs6&M@$+8d(p=}SM-hbq21TtsDs!_;c$GKb*wApw1H5%`@;;a>qIo*lm~YLJ4d0IA z@%S!Z{k%?f6uEPF#Yr=-lkQ53LlQatYEr8|&XV^UCQP(uj>KdSK8+eY=-HGI9~d~3 z=b5lPnhNh&4@h5Qeqo`e{H7m^+z~pye_>|uLEvD0v(>Aq@0_)=R3v}8B3V*4CIhmY zG${4rjz_JA=qENE9|Bv9JNje#b;SsAE&d+srMsxczJ12)@9$^FZ|=8|aG_y1eIha5 zN+l*lWSXs;yStV`T8Rqi0BkD^FkQ2{mHmBE}dxhIA& zdLP5legx{yGSCChC)D4+Px$uXSp0OXhJ8ug@?_pTsQXPT)B>k;JfA*^WngN@ZAYE(QP z%$nQ5Qo8_Mm-oaq!RY9y6+E8MU4nR=t*v2qBWkuq5pq?}0(4dP;h2$3k{5wMn0i%w zH1cb2R(;?O zCd`ht#5Asg_TjC&f7_WJHub7;`D0P-lQ|m-`Zd_Z+jfHq2&`eW6e7P2%&vUz22)rd zi{SNux(va@>mD&~{2fJh*NGhGbT!=yeT1Rrc25Nfc8WC=Ylp&HcW-(&J#F zCB3pdRciQWA(xk}oPM0z=j!Up2Uj{L?><}a+N2Dy*gFW9|Z3x|+^kidTg zR{B(7zd$o7{u*0ZSS0^}5&jVp5E2j)5E2j)5EA(RAYiv4W8cz#M?KUuWG~9n&Z5T5 GE9oDow>P)| literal 0 HcmV?d00001 diff --git a/config/wallpaper.png b/config/wallpaper.png new file mode 100644 index 0000000000000000000000000000000000000000..2e06a508853c965d3951467adc59766e5ed0cb99 GIT binary patch literal 70651 zcmeFacU)6R`!*h$4G~>bT$MycWnC0>5fKQ471vlmWRYGK6#*%VlmH>Ht73!LDAFP# zpj44w6DvrS8mU2g4}^pgNb;Mot1riuxcYs*zvumYUjE{cGntt)XYTvH?rW}@Tsw9Y zEwW_o5*Q37a_Hdx-(j$Y-Y}Tp-bD+*Cq32A)nTv=utWQQJ?>^U&}?fDR}9?oE?Mf) z+r{rT2%fzV@-F}W;?2i&?`KTxJ$3Ft!UAT{j~)K$?M0U#4l;@4eg=mE z8XlkO?jP)L-(*zCPWD!PRzRG*pY=yi$_@?PNN##LSH7$X)o0IL)FcsTbS(wUEAXXO?rXjmtdgfuV1MH<< zn25=R+at%MIDOx!<-N_HmbCvVkoAn1+@dO zI?ettj&Ig!9mlU9p-3H?!l>LS6dK-UZrqC7cyW32oyU>_nVYX_a(;M+uJe8H<+0&4 zsD+c*38@FEO82hte%6;@M0|UZ2YHX%b}+hz*n{f4OPv6vUS5Q6=J}@70=

6I8$U zKA(b8CzM2g_|okE)Qb&ANJ5T!h^jBz$fr^k2CY59t<>=fawEBLxWwbBo*E)OA~m8f4sZAOXcaAY??FEii2 zX!5+O8uBD#drjf$t}b$v!(N}({EN>@k z!@QagOTwt+^0uH>Mc^d})#(abc$s!<7r(kVDW1(_#9vsuM04r#s}U)%nLa=?#WP>l4m!3-=2>b1~`6u%T?vXYS_SF_yiR z-u`o@?$nvy+E_#G9e1Au3H|KE28AQZs%6|eb;73xvx@C%3k=;E)_UMhrr8GDLS6g# zv9hXotyJzE2EU;)yWFmae{VnID{cqogAy`_vp7{pbTKV0glkykyd`(ZaNkYR1&Y^ij2a9OnSp#y$w(@$F-lPM-F|A9H z`0b;o`eJFH05C7~`x-)d$C!0sOdVditmF+H^p<47%%0df@P;AhRyy+Kt!UK#|8v09 zfP4B2(pYv*y%`Fh7`k@fWmPcu5B)=TZIVN4tWznvF7vS{c6xVeu9wP)u}0}5e8T-& zUsV^Z04lt_Tle4I#nxsTxbx-x+#%DE8y#uz@QdzfG zZ}1`h=eHqPx^}xk`VG~%&9-BeXg|wZ8Rp|V3H4}%yuWU4Pt@UOXAsz$?<;(i`ci0E zl=8e+i0s*=nA;;6djoa1=X;%8Y=y6|1wb8Q(W2P(TW+lyqf>4@+udE=W7+cb!b0qE zn{sM29`mwTg0B5Ukr<@fB_i$m4jtV!ZN>~%NND;M5fC!!(fifHvE#tWv)4Tp;5|7v z0gQ~U*&xWfR2P`&73&&&c$>otU^J38%m3hAY7~^}78(4a-F@nX&mv%^E94jb%G*pa zpw#FU7oJ$kTkR5X3|H4);$4cAM?%SX6DcTj2Xn-zvO~j%w7mT7vH28h45L!|RysS4 zItV_oBaC^)cGjYk)#{kl1)0^fu?%d(RCu61BA?%|Uu&x6Xh~z^m^Iba$P7zgaw-uu z=%KvB!J+ZrRHQQH#a`f;oW}ON!X1nxJnE2feN4hI&fZy%6tnKX7svgOB+3$b6Q)AjLd|?a#NIXf57&+xW%LB=5 zLu^fG`M_iRkNHe1hPH!JYLx03dLN+{o!?vP&kU}N$LS%yuW-H2lp~)BXUF^7ygf?L zqAXa!rRGT92Ju*Yf(+0y1CNsOJN9<@dfIzsW2u1h7@Tps%KA0J`i9U&tHa z+}h$eAoP@YC4#Z>`)4{g9@$y@=fmthRN_CG?iVj+va^cbhESeasG}3`t_rg6`+4H7 z|3+Otg{CkZ5m(SsplWZ{ub3Q*Pe`JFC!7e0E%Oy_HTT46O)XDa`%Q)d&mxa;}sJ{2Qy&y)doRm|iT zH#JFe$Nz6t6*NT45^kmM>yYFbLrIT8*wa?5;Q98{HfR8cWw5c0w|BHS4yN(rum2gkgnu`~du^RlVQAzld@7@m5cP%!U z&QiVpt5jxn;bx1GcIHnD!kdmF?s~t*_kUMmc18PnaZ-A+l>%=Rjzoh8b;=ow;pt17 zOhBnJ;W2lfrI2WgdZDMdc;$Y{DxOpz6y5%F9{*C61uO44fmwor1&O&zJiyB&b>3j4 zgk|-^uoutoFi*gDzA|0d6LrIO@+5Y<)R2-I!qlWhyx&ssJeiN#(`Hm)fGD|^yX+lW zoJ@PoG&tJi?5&!U6)0O*c%dyxfL{4J-7`fs@b9Wm-v9wq_K0We8`ZIds_!)`E*DA! zutC&QIA5S9*K0#n6rz_gXv#U;$kmXs&z&yG<;mNPr9{2{gb?JZd_6<+`&_kodQnj=Y(49jStwG)Q@d;FI1oP_Thhg-sH0mzELMQ#jLO=8J>QhIs zM~8;CO)xOlsANE1+y6ygzoa6(IPX=2yf{TGIM_RB1hOQ?1V*5x3$exbEv(#eP3afM zBY(W7%kp7QVHbS|LI|Vy;`o)~)vb9y>(1?9M1srzml%%(G9%K;2Fpptr#0cc$c~&<;Um1 zR2hM)EXlQHvHvTq^lZjkB?XT*g(Xj(8#v56wOb01pg4W_70TL?&uR4bcW}<%L}xo% zfzir5&ZPJbY@hgptUPoOdrCLv+t-Tz@_hqgAd?ioNK9=NHlt=qGH&bM|6X!4)k*cF zthei?Q?-Qq2M~t&-<^|nMaAIX3%7=lQ-yh3P=sVF|AeBchYnBEwwKv?kuR?=**v*n zyi1~hOBd@SEcuy57pi?#-v~a7Fk(m~e>1n7#3i!>&9EU{);UqUsNp=9%>GuIo7!|m z#yiza>nm<&`GgKh=qZ)wJmlk7Sdmo*G9`Ef<2T^nzrM;kC$!>3bnOu*Nm-P9Wr6U& zKm-Ro;NSF73-Dhch5xT*(f5B!`t%AM23oFBBZ953O!F@Z!q5# zYRTpHlf{UyUuiIlLJYwo4OwBhTG7kw^uN8UkG&BMmVEXN?JHV zM_wC@sy4sj2`!Guwj)lee&0(=f0@H}b_Wi>o5-ikI}P2i4eVZMuylX@d&eO4q-rr(dc9QAhLZMEea8HL<^+8PaT;*w z$@+vh3r+r$wDcT=w@NyInGDJw61+K9(gbE6~yiCgUbh*K(ZWp^b{c1Z^GF} zBfs|r1>>ja9~@v-&fC74t^vZP8gq+xl48hTXa<|I?J-2$`QEoYqk?-E*aaYP208UQ z@AkNv+H_b_{x+UAp#Z$A=jb2#aGs_98+ExgeOzU4?@EstbqAj2@b`KeOaq9=?APPt zX`&zEcAfjL^3eZ|9q*OF=faN4?pNg<&~5^e1Uz7LJK+B)#`C8RPi9F#nZWS(kSl9OPdDQqe;CslRR_b(7~VX>s2aO+KYVC=Af<9G4T z-$rd`xPgHA?A1d10n3V?HNV%afH-%;7@$T{<~wDz|6P{(KSX+aO@gytMjTj`Nt8Rzr_2nU_|7E~1{7R{u33|BW*?=H=8tiajr<{!5uM zFQ=ZDQ_pcg$h@3-)=`P`a_V_G^}L)K3TwZ%-ECe@{poB~Ufc_0yTrVldR|WbNg4|z z(DQQYc{%mx$@8q`$JTxGa%u=~Ie$9!XGea|pHBVBeCAK5{&?{9f9Q1TgboeHM=iko zN!8zU*!~P4oIk00{-o-E{1n6dN!46g(FA9pS>#@fm7&yxa;B1H4Z&HPE~&c+ zgj?_nZme#9to-8Cnu@EWCGj`+pGIF53BTBS^@o*GhonR{_9UHbU7GuJLA~6v;M@1* zem=8N;NZJQLQ?Dhe5k(rspm!2+&I+FB|3Jxak=q*Sk<8^Oma6C=Ug7P^~qE=wV%x* z#G8(_C2sob9Kpj&*1&>l(iP_1%rg^U+*j^|4Sn^r?4Pz-z)XH8x9~ofp+}np%R+zc zc<~31)E@H<7npifjpgSaX;BzxSwV%T#1!z~bQ`}a|Mn$CADb@_RbGimY55IPWO=+| zjKR7}J^3o6V@14G=SF-%i;s5q#MIAqxj%_wZuZp|6d*=SZyMZ1o@68-J1WV_JNwq- z%wM~UgRE9Ky_ymDg z19FLuU(g=BWs+&f?IXWbsM3nsgKfnz9d}Ao@krX*_%fPB=Jc9Y?s?;nYYNP zBFXPAu3qsH=Jv{CC*6BAuj@RhFKm0<;f`7Y#2Q$EK8|2w|O1z-@~M{*F4 z3__aYZ=+pbhA9_G#-16^@2G6v*}aTb^rRjui@B&!n*As8f{hF12)tRuX=npJETnn- z&ex0E_F&e)TyYBrJ{@oQ#S5S1{0m4MPagZq0opmjpfZKDuN=m`Z_yf<@6}&dd}Y4M zSiqW^zjh|cqKy`?^_v#_2Epr}a@~&?4|2Wv99`AFcJ9h0Q0nTMm0vlHdx&3ZsrUF` z!`%#Ob2GL(!exz7zNX<77h+_sG(LturA~AZyAFI*4R2sw(Mv{#EO}*wN*lL3%h;po zadsTsqMiMDxh?BmOJ-zkNMYfRatI7%acFr$yX23 z{uvC>?lq^sa-PT&@bEgj`gtGgu>3d)w)gDL;=jGv9H+{t>F^1(#(edhlgFg@3rJHg zgNGW&hn5xpf<66KQm>143%%XPpteU8^XiAIx_<0$`nN|)RG`%>>?Pshhm*f;{;n$i zZV&H8Thj>3BJ?X>{y2#~L4L?ZwdBrK0u~(GKMZ8kkR24$RPwGaYzVYAR zz}O!CLFc$H5oURL$N!-B8csNk*RZ{H{TVLu)zg~}lpchq{C?XPd2;cqxC6K%$w0LP z8~V5Wdzg;S;B&mzc5*~Cel6xz@e%mB_z5bIk8I{K~HR-W5Ax5fKT^_aN4? zc8LkyRLj(}&7Z^87a^pDLGCWPi6+6^kV8iyKTG4Yfxp|c!qEDqy6}zK_4RvFrwQ>m zcDO#(WO}^Y9H)EBCg3v%T_?U1Hg*LP0Z99W!zN!9M&HjyS5s7m6D@}(!(*|9Z75t1 z)#3g8R;DS6^W|?jE zi*pR~Kdal+CM;1?F%1R_Na;_uLnfEcE)Wgzim*b+aZhThK02ADF*!tPL&>K@n)s25h->hokBjM|tkWk<`3Irg<~IY~~<&iiv0*ElETCK<~|B=wuPN>o+?FcIbVFyZl33)xh>(@Z@v zid#1{ymT*jeVXh2S#u`*!0fqX?|Ds z7_AV6NOm13vt{z9S=12E;|kD;@_g|cn5fJzLXe3HBBiBG&)mh2ma>V2{x)#C9EEKJ*(mu}b+BUiqGL2U*U!(wQ$+XpKC~$T4 ziEnu3=Z$Q59N=*P-g&NZU^{+~O=rYyv|{5P<&r2rqim}V?edJWa@yG_y`dj5_fqXr zoq~`|Hl13<+KPcSZNcxE^f-g%!@P1=p9}P2MnQ|^9xAyI3_{wyD6b<=xH^^A1(3xv&;5znm4mRJ!z&z4z{a|8K?gVkM;kj|}_Ja!H?VC7us zUOm@%%tX(S^J9fZL}52}f=Dk(F%-Qo{CuO&ZCiiyr@LWZotI_zeyA7q8X9{u)#+ss zhUq9M**qYHH`rD@hf6=%aRRnp(zi|bY*yPVzh$@3l1XhhI<>>HD*0$Nu*ZCbO6My+TGVt)gmAmiZMyYC0=F5hKeP$1XF)Sqg6sWDsoa~W#Rsr0k=*`a zTTcH_Zo}=v<~0nAFSq6`o1WIeCWd?EdLxB1*2@(& z6D|8gqu zc(?rr13Q>!$Gy8%e~OpM1YYcua4L!3!OE?*X&!#JPl@3)+WTBMb2~e$CpuX~6gOq1 zNS@A_vc(0NvDvP*CU!qUY-M?ov;{1TTx}0AWJEWo)%BU($ z+tJc#XjNJ4?`~)8H-?YhpEPQ0^57^`-=H{|CZ@0ctoJ{F-fuZRcnH$_eBp%YmBa3+ zE=>N5qf_)sttAzusF1+1$D}`9DBA==LdycX~8&{-~$- zyy+v-GNzPRcNbQ%WRc9=KjJx_Rkzc}F&0B=IUUXVnaV{vkUG>hq>}cFeoQ38@0YsR z33XKJC6zkSerj)U(Z{3(NRNggi?cGCb>ViM#YidqFG+T;0chjwUn<^4-L!2s)t{0e z*`b8;8t(UFmrP9eC&w9g)g)CTQXU5JK=+5mRAByB65)`zQ6xKjjcgu%G*pFY-5g+! zw?9}yXd86zJLHSdjHP(d3)K;v)37F8@+jmXZs~xWB{n7>5;PyU`qZkja*yvv5cre4 zILQ>&KL=HwJE&_Rb?rRsLq!fMR~34VX~wslI8kz_*XM?nGKHF^RS|uE5>0L@jP+I) zYlOT|!Cw|9D8nMg2!`-Mc4gmN`m(x~tqrWGTAg*jRKGYoj@Q%L+SSmwKNpwgZliw2 zXw6KiS0)~zGxzL@G=!s?QAR5FgKZtexc8oj+_yfFHieG2S~)7muDn}K&2#ULE2(3y z9Dd?j8of|?PMcLgB=@xv7^%?JZs-daH2Fh`yrH98PuDG;(@T zkHL>|&>y8$T9h~3W)*Et?9i1Oc-j!_t$<|}wdJU5y?1=U)KNtd_FydsfpL+_DOenH zLIqbDX@rOVCXdfFu+~Yv8?R?fWdupQH%2!5m7{Cx03wAWw`O_O0-s1|3Z|j z$HbI0^lZr(U?px!POi4IO->`6WU6nL>DCQUMV9AycI-JLc11kveK)6ljC04UoydM( zW0(y^ZcFt+MOpPvpn25VMcYNZOIkusR}VW%oW2jyn2r@NfHF)nZkY) z+e75&Q)qU!=%zWSZu-Z^P>XV3{&)cigyD@6s+L>Br(dg=NU73pYL;+3*$jQgv1^hL zWA|25^!fFZ8#6sxSnem-QF%3f;v{CJl>J3-XJ1a6j7P8beJ;&Os9OV5xPAh2{w}g1y!FXee%jfGx?YLM;&lp&zrr=sijxD- znD(twMN!xECevv@IW%<$Vs=;lOw@x%`7Km|!LgtHhOb44keS;^YE`m1EzWWgT-Cve z3wACJm-_YIlU=WIgp=31PT0DeT7be%M-YS0{Nf6kAU-}IsUt6a#|e3`^|)3^N2S=s zGRqEavAEdNw4TK|UAt(H7uQz*f}snVj;_JfT)4ZAgRBmqAYfyY}1{i1ydI8!w>6cVmYp0fJHSj^ElO5 z+9o$X&B#A7^l16)dAoeWF|feEYOZ^> zceScY<}|^o3!y1&eDtuW=~KlWrR9(AXJ3Ae3MvS!Q*|5}Xd}8$YMF))O*JSKI^AEa zs*8KIM1Kx+$1S_xA5RYGx4G*{h`~wZ!I@#CkuB} zN{<)4?AUeZFHh)neNn& z_JynNtn#S&!}_h|J@tFk63N3qp!;vl5u-I6zzei2GJEOAhYgpUb2(&;uTTT63%kk2l-v}nM?7pK~9z$b)-E8Im}y+~MBBq?px zUDh#E9NTpQ7ABwL9?JO9G5>muM*#9&xuqjK@%Zr{#IxrwXoUye(ai0V-Ed%mYZ7u?N@4HWQ(e(b9OH@?i5X)@ab#|z|D zCJ*6dU3`}1*}WulzzgR-~{G#UFyF{17n5 zkaoP49DwbuU<~YoxVpRBk1^3GeRay^`umoPIP7>zaL&fz%|!K~1GCEc91;U*ecJwJ z$Qi0Sn;b_qbE~Tf?qde_q3z>*_-IF8NKhla5>8tS3t~<BBu<4r+?O+(9uh)nxo55ayq5t*IJEjXc5j?jX94p7PESg4mYEO>e&8SNnT6&4zoyaGyH@ ztvT1FDA=7U-Pfi2WHKQPoZuq*rk%S0jVVg)#6H1ZMcU{vo*jed?*(pX zD{wNV9_3cGtddA=9;r0M}O)rFD3_r^JlDu0*YKxRV*&E#c8Kq_V~dDqNVM) zrt-kk_No$PtF=W@#me?WalS8sGlS*blaJHYv1hQ+c^TD zo){uUc($=vTo8;yaPsK7BHjoPl9lL}MEqpjio3h3Usg0#_1xFKA>xf*JgEw4m<~wV zrl2$@=-8%`MnD4olBJyC(vsP~U;)WgNCk=#vjN0&I@AC$XTj?ru8T{#KoaRiOHBYk zYUTTxF#F@`&CAcjkaC%~WH7zu*4Lk#&VD+z4Nt*3TC3x|*&c+Czi>&ydKh7>H+#1n zr{_IR@S<*EDy6{qICOM3T>8=iq_d#jGH)%V>9cWHlE;aTc|?JU=f3bmK?QA^&c&Hf zpt@+K_#*j_+@2Cgzj|i%zD;68bm9Iy53oxAff_%vMBjrqpgu%)?25CRVtT!D-E~rv zcC|K@wkEuA1jX;p@gG@+i!XICamU2=Y+^SrPl-8NBm(#6Y5?Rn45saFYnH65S)Bd+ zZ+@*cmo}&js>Dx zC76uvDFLY?`iqJr>-sl*G3@xUgA0)M`JD|H`!enZ$-+CuNTv%(Tkg~#wj6JyZo`kc zY>BvsUR*ooQ5=FZD&|h!M!Xk zcWcYjl5;f3T>xan8&398q66fdgso4woJk;G-3x?e;8F!I)A)bUn2D^Sa<0y${4}&Puy%=_6Xp^X9j<2 z@hiADuam7q_`SWZx&i+%&rcx;ZTak>Xi?Np4((-~mB9%;0<@os8{M2RySGX+y^+^x zds;lX+5!dtCIQGS-?_|(8_se%ia596ITj^*{mmJrHn2QgVcl!$k1*eBzipgdKG+8E zcu)K(owKcM=Te_c&WqE%ce)+4YDtWD?N(JUE7o(CPu#1hh}EPR7_5isb0!}um?|#S z(4FmPyurfI8kp9_Jek?Yg!{Z*Zop&_Yhe?&t8Vu)#4H?7Q-?6#^ zt!3j9M=OW}ewI&Oe)bc*7SX`Njzc}{3t?_f_G|wemT-wWrH>GFqA2)}e2h+gkg? zNVVju*xT_quc4zTekJ;iM|)?7M2%|z4BQhO44M7-YvQ;OHJ%wyNzVnDU)6IdI|H@~ zsXb3$w?eYp-fa7c!ssA;>Pjof3JJ{THy^Q23Ih1jig$f>OO(^5L=w#~yH{OJ_c}{$ z1RsTry&Fg`)+o;&Su zbaHyS4NPINJ(nEg`Y;psjaS>gRe>!#|0`6}LTUw3YoYl4KW4w4of7=wSh7yFhxtgV zHOD`(M7$-7bCApM(%%W8eUpxu*Ah{l2RP~<0=n7Lp$>;#*^?^OEBuWiHlbz!Ozdgp zPmo{jtKQ*A4j@NM#)jR4=bd%=v8_hAYc+0q^tPQ`Ve4^@S7%N^hd+uO>pgYH75YO3 z3EUae44pBz_;F)_DuB;JtYho_R$jW}QMIZZt~BfRcpeb z%e(zxam)h+iSZl4NcXioO_;+R_K_RTiR+(6{2f^r3$*r85UA}#?Y|ciY++4+3W9vm zLd7RV}Q1|9ql2~H~&un(r;gY(mg^8TYc;K4vE<=UHMfMlt#6P&` zn&Rz|+eFU85>T7+e#O_$6~nk8#Vc+XY^YFidK;Vn=BnFYPJWn{ZkXc&t+fT^e?c-o z$K2?grQVW{b`7kZ#;%e^&5>uLQJ9-{u%-$|*uGhL3m?DwN&{QifEY<#L#J%ExovnC zOFF*Po0Ytn=^1^1umxXv0Go6RO=yU!xKnsGN>#roN^7vv>aAs(HbJ_hGIp#dwPRPq z-4dBme1ubPhjhWe_*eEA#+4k4+l zg<`TlY%1WVT@ASYg|T_yAy4GU=|}5ux}{=4vL?1C^uF;yu#8_oMhKXOV?1}%9?N37 zx3<+=+U$mzp>Q~JXDa?1lyV_m$e5F`Cf2H6D_?7`6;mthU9KZTFac&e@KrC$#)8mt z$yM>4+D2LRY}(l_UH5e4VPSmRo*ru#F71B^nQJoiIV4=D`GM^=Q+1^Iau>eN4oU|S^*M{a6H$@=UC2k z>b{+tVcm2D$bsfsA$V0P*$AXV44QtsQ2DnhZw~hQ+a_y?qMS+=XT^GYdDY?wsLPhF zCQ7co6-5HARjb=u%yBoBeJm^HYP?9&7a-tezj;8pD?J~r=4t=5^PCrL5w&>Fq=Gnv za6X6=?kpDZNYF?A&bqgvb^%EjTan#%Jz?1%Nhq(Y2@tNz6Mr z5@s`Ogw=gXzDsmFyB(wuS-HEfCfOJQL{>XKUD9IE^o9>&L~6jB=q@Cwn!)>{d5fza z(hK{&nC8)hz0|2HA18k=rfaWlA|l_!=zNL(ve?N~{IZAf$#MRZse8hXQG8Lf!d|jh zKgCK~>M*=sX7{ik;MmmWu>Hc0jt^p_lxN4GKYHY8+**rbKcrttWgiLw0p1#f`>KH; z(H(3>fVI+O6xv3n^qjZXx=b4?%j6@+N5(!IuXHe8wmODTLLR%M2?$9_2+x|`E1swA zRK9zrYxU8In!)0bIOjr~&0cg_A=OyKTNG(my^FBKOsNpI*EdTA;({L}k}SZWU1`}v z`)e7i(X{j5t$Nv402GFfNU@%Dh3Tu412|1~Br5dT+f-dJZ4Ie5R=p0Rp|;| zPaC@gJd6N!s4*v0HsEK({Wt*2YGEWm*Zd=w02lnHR>Mp}OXV}O>rqO|IDa`&+Z1P21GqA(+(MpSq|Oj#G)p)k88|JE94%}#04ZSbu4N+{Qg)L zT{ELuk=Tc+B~sitfABf>!UmuzuOE1u>+WJ^RR*9UbNNJd{5XL4A*QNvYhft24}lj? zHEJLV@yK=%?F0L#N{GzEIRi8mNkR(rtBdZf-U*Z0aSk^d+ATl3#j(VL5)v`}s8ALK z=7D$y01sIcDUpuxesU_iLCU=P41QS@Yoc4@amL2k_UTg&GMDhhcC$a@Ww9XT-yf?qUXNj7Lc;C81uZX1VQBjR0hR|%TWTo4Y+IlV_^FG}2oizu>n zG7ykg&;eH7$|KK;LgquyZySoGyyGbxW2}nf$hl9Li;38r(N=da6W>})w48Hlx5|{>T2*5Gm*KR@-WTq z!|RH}L}nnN+-xEy8F7d!6-k_S8pZm~_<|wByGU3aqTW39=(^%4G4nCs&fDQ>)mLae zuYy=7FsGyj(;|^dBd2i&@cKi_c0b{dde$QX(PmYS0*S!!rm(1BcBc6BF)kSk(x1rPZ96PhNid zFr*4|Dc|kg3lLV<%<%?+Y-y>tWyi6+B_jG?l~B=sI@;6&!|ZPRxgZOVjMHj1%jx&6 z3QS&q6o}8x(XALDE!N4ebpq*_sx5ZMAd!}B!xABKZeQ%W3nzFDX0oy8t7R6_Z=-{l zF@uJfSBFjJh+8Wp@h1gZ*N|^$Uk*|^ub{r1rL(iz3YO{98P`Hw- z)mtb>q%H7219d8W*`D`1!{tJ{uE zOe9C2xWJ&sbMk2YfUerkZl5HZ%U7LjpsiVa2lFdeuq79yJklu7ZNH6A&ipC2{re^1 z6N5ADk9gmgea~&bwDah+%S`)jq*C#7-1fUJNO|SX$g_|ZUBY`n4XRezfL;6i7sT?H zG@T!0^nS3iKg317WvF<*k!|LCgTdPJXd9uH99f9kvnVOTfyRhcprm9?i*P=0&e4L? zXWQNewFlzB1DXX(Kr^^4g7&$LnAdg+Lnvl@NPO~3t8;t12td4bvBzVAUU;QI)b!oC zp4_x?0&CJdCfvcx^;-PWVMI zbo+-Hmpx|>2{!vk#tDvzkQFa5~z~Sl~p2pG>)8t-~e#4iL zGuUyl>O&OaePRK;*{y09$J6sNS05$z5=f?cAK@ley%;B2?AgJZ>ckeXSbbuzYl*nO zC17~!GXWJtfJ%?fVcpyf5)?Kys}@K0)4S(B+tC6dPRFP3F3GCN#bPoAq;&An3fn;i zo91FF0mstSEO{0Ied~0fkZqFAdfJDh8?h?T->KAjmvak zl;OtM{Z%;j+xXuZ%2<74^F&4Vj|8@eSo%IlcPu1)oEMU+*>WW_8Z4}<9#{Ex_U-({rY{7ebR3yx5yZWE4Lg|oAq zgTPuY(WBM4S6OSy|22vVqR{O|SrxepCnAN^OC_a#o6%;)I)~@aXtSJ`Iwf73QC+1a zrRsC<#rmHpm!A=7h1EHaUFY7b*;Sf7qbR#uol|Z$b5H4tA{i*kW~5mKD=v@Qh&g_^ z6XWiId3D|Vi?22$a;)%^m@Fr_5O*iDOb#0>UxQ@2^z|b#^ev{;^_Uu`KHC5!^G=eh zKeA7ek$xDCJw#SU!x>>rqb>M?NB!ZFc=w~&M4P+52)<^0rE(~QHWRexkd&)4a+f7x z>TFQOn3`B`0JY5?IxT{lBNwW9pB0AqgR7E`h3VuO?mYcLIB|+iAMs$fU7{u`z`Q2% z%6g~FSXcInA72cqX}JN|!12Bx%GZf)8Rk0eqwKawT`IlNcP!f0VcH^!Zy1oe2f4ZV zwO=m$2x&Xm1kA0sWp!n@cR}>JvA${2J1qre$13GaAqh|S?zQxn~Dz~&aaqmXyLBsl93;{N=!`7 z>Cb#)9@jTAT$Lczomy=`tiFd_Q_ldbZV_#hrH%I(Z zhqtc|2AYAalyE37&?$65l$&8yZINv@EO3;X4dcCGK1;!r{c(Ay{RiCSKlA2i1)8ow zXq}X2U`Ewt_6~tvt$Hr`$YSQ6X6)Kg(9^uSovyuTwd5|3hS=_^R7ym*7^ylKUG17t z!Jzf%c+d@LYwT*emtg2mRG8Z_H}~{8T}Co%;MhRqfpv`ReQ>M|UiApj@i9#*t$-#9 zyLC#`it*#{nk0oRNwDSMmoJY~ObV(Fs1ShQ^&$`~hA*#j2V~xe4Qfx0W)*0DU2Fl^ z-C|zF0K3gqVhi-%M#=WNcNaxP=$OZMR0dtlck0ltc#^D3>p7CsqDXt(T|UF zrE6Dp)BjEDAaTh5^LG6GH(>MXDIbIM-Y>2+YZ6#1TwqO7`w}KB^(65I*>gepto8HQLbCqX%sIA9<1cG1P zc?)FHKHl-p24>RNP6k?{#9i+$M>icFR6f?#a60IMbh^Xf4Uvl{wq^c4wd`KDOFj3V z@zhBHQ-k8fngW5-Nv1B`dvyix)x-lqajM#V+aOc!y>!_<+^Q}NO~vX{4*~F*8#jE# zcXgGpdCKS|DwY`TKUo=~n+t`);r3S~j7iaR^ixRmqCxy)?-#nbTXs=bb*X1_9afRIK^a$g4KF2o= z=YE3{UeA{NO}(8naIUa(EsqtZT1 zAn0P)79WO}Ae~DJP{#Wd60WDWI4vNx$U+8q&2`eNrQTR1vQAp+i__=h&gk_NM8C)d zEv|&Ke3d@Xu-tq{(HA;zd~OGR^;sdrZS=2AtBp&dgp8h}JG7T)zOJL4_0bz%fm!*= zE+rjl^k9|eet3NQ(Nb7eYpx|kpuBv|Es~W()<%^JLtVPkEnM*wpuw~H#_K%FrMwr? z`F{$S4LNmW!0hRi_3od&Mr%T>6dr;Ejblf_Zr-rO za7c9)8vM2*PFj=Go;f|5`fFkMZQ_NqIV^8A3_we?H%Fm!Dnh6ZNCld3oAXwar|zHR&aJte(!5)wtd@8ldF*4Z`IjQ19PJ!selbuwVWFh zr)Vgb_!-fWIrZ09x#)yLaCSjozr-46fA&>|4A?jq<(`pDMSF@%)@{Zcs7T}gO6z)S z?4$^4?o}Vq)hPCDf_XrWdskY0VsE8iEl$^Kz!qo^#QnCmQAAeQ{=D|Z^)ks86(E-? z8Xwm+4^%9_HX(B$VVkdWxXLE(=g!-m60UJ|Qk_qeQqkOAJn=v6FF&J`S`TuHtK56F zDWxefHO;BZypOE9FW|U#{1!T)W=@u6&6cMPQtoKh-tOF_JefgC3L`l2h^RNZIjU@& zfnJw>p`s`%%q}#%v+_VlJV#C`x1W8=SQ)FCbBhU%}w@J9_Ho!gJ+2t}iu6uKRVBB2#WpF$R z0M3gvMS@11`wN1QIqSNbeuXQ_=Tf)ehps5P-a;QO8}fJ?m3yLGqT{ws>XaF+$3EC; zA*Q27!#bUB*qtblrPK`D>##u4wHooSzBll9Gbgx;BfQ(XD{#m1Ae9$pw5zvXSjx{8 zSZQ77yTlMds`P?*eEmhRr_7XA6>bYZ1q)O7Gc33F-yWgz*NH1T>3}eFDi9f)y^I6% zIX1JIy*Hm)&=(w1Hx*t`DC(`1Zz+SN*5;}=AKC?R2w+7KEFe)A&W^u}G!jUD6_{#!hCuIhKVD*k*7m>~5ECcu2j{A2?Y}7ljq34>6UIEeLp}Kco9Y3LYU)7P z3^zL2Hyd=rd>VjR{$nruV($L_TN_OOgjnFwl@lKjZuah@>&()p{kXc(i_bH0o9SQ) z&QUihD9rUlgLAW%49dP5ssiHA~tY2O@j-l#xtnS+~d!};FM_z2od z)Ns>lsw`HwpHq!sAL_b(4ocby7K5dmpwx8eHVnZPZd0-*fif8OSf>q$XtIe@uVTk` zBqg&wOOjjGcdRakggrj~C=lk+>psgi1;n%d!eyiHW4*{TwM;5d(y|Jeqva@~Rcod` z6b)^kC9#YYhI~C)A-KJc3=5T5Zm*)nCmq0kLvA$A)z}hQ%?#Y}=_Od)bVJw0%2ddFZX zixjLwFnON+Lca@gTU7Z6txCs~P2lXQFP;~p;RwtAPT;;3-rC$SychclWBXlJ|i`nF;2 z-LcC|MmA&zxF3c`pK2VG2E{cAYr(lY){%9PfrR<&;RjNz>Nd;T<*vPeI~X0AlHjlc zDl!xsj1qAXbB-7Hh#nnAVP*l&Wkigq%7+=2u*B> zI(oP8r${fNEZ!?09ljN>y^rN(4rjUJmF$dWwq7ZpneeFJK|Mru>+ZbqvUO(G1?wf5 zuU#w4%5Gq4mpc5_lmPA9IG-$%ALJN znsnr*kN|+&wm64Uci_9uY$4o2A8PLMD2d88d@I$V{d?wQ3+=4E9&It^UX5KrCNd;6 z!1LrbAeCyp^ZLO1M&b1vFBjU(jZ6a7*fuh5b&9>f4@m7`W!Eh(OwR4ejR12V*f9HF#P{m7pAIzISYpynN{`(_Ua!n(Fn}k%zpkX)JF9Dt61|sXoFWM_0!39dWfLlh36O>@^zQX&)iN>;%l5HNYdTi6pc#(dtb|lF|qd0p;GO{x0eDlm3mp+ilyo*MYO7SIe+qFUdas;W=W^0Q0&(bJ5}XxLdiK znqCOFsPHTmgZ^87!T8~SGFksR3-7q)Uq{nS{QFHQypF7yrMEDEzyAN)yYjfEt}Gm| zs1+3*D_EonG}S69mQhL-2ncGb0v44`77-UjDxe4$APCip8$78Zt|&&?7g>a00Mnv| z0HAa=E18 z9WO86*iNajoiF3OXQgLM;YWI^e_JD&N%JDYIDtdF1U1KVx$1zIFnWI*HH<1MKhhqK zD+*c2dC(U2*!jKyST-xo=9elP27Ko4$XH2!!K1agnwck(fW5CB!- z093V`d!)}zsi=x}fZcu5_j&`XO28fx)^0PoKsB$WVy%bxmB z_`V$>(@BF?g{vZPPVcHtDZU7(><3XFe;iLT12!uR2G4Bjr&tuA4FM79F&> zrCFX6L@-3}v#e-ShEk5~3%Q8@vMhy?LyEP$+E{1w^Z_%j^T0CGhBbsshYwMrfp~bo zd)hD;V1oY|L~xYv0<}=*t7T7N>wW$ke4n74RswZ^Qwm`n$L+tH+E9+qA$@PWQo6oK z+J&iCXLLO(_}9*+U(1y@KI-qtJ3GE6lcmHFRKCdPS5CyQOsD7~wA$i_u z_KwJ2a&cxtcc0Z=Edu6Y^PFj zXf(qg#Dr0in$a8bjUpUl{R|Wv{d{6Kihd23K;Tx1bZ`N&cfzV=q?w52(hK5 z{JLlIvwjzimU$ubTFa*;tc1AK^AY z$CqGyDQIcWsE>TQ(N#MPq3&?rgL9fkHZ{D$qX`Nw%&#HK-v~W{cr?wD zl8p`C8$zrLoUHh*(8k>;%{N*LJg5Zgt{=d7hO)+sKH@Q+6%J&fUV@wj4?OY-(4V}u za8PF3@@H)&*`t-ShRagptbW18)p!LZ%A+Z6!hwnZiq3SP`*T#6{32Rk=|HO~3(Mh~ zI)rpz3FJL`k8e*Gt<^_CucS7|1JguHodh()*>g{PE%YNWH&AE=+yEu?E74MObU~uH ze&$*J2N!-`9e2L%;BA>MTQz3JR)sC++v@GtlQ|1qvX^0c>qVQQ4Ww*iG35i_Cwp8E z)0*(UaS?;j+1@yb${m#+qNnIHfKJSoKc6W2;R`{}eRAX#0S2?6tDOExyZrOj9;WTP znwbb#X)a^J)Z+<0<0>tTD`1Va*%_u*ApP`ho_po2#Qj0Fbun^dH8dRVNH4CN{ny|G zg+*tUMrG~tN%-UPC=qnLef7iAw81`OumZK9Tm$=zvHJlJA#$wx^mtOJMI5kQm%RRP zLZ6?pKj_}INF-TE%&7{{6~f+yDB447?!k1>jgiv21XA(nzZHb{exag~Lpo>8wW|-T zPRk-g zUnYC|-TA((v|~jMxoFmB@Wu>zbEIU=PX3#+dYF4yj@tZdw#ecK%GU_I zVbYNhk@M}NbHzux=DzM@SdAa113Z+08Udt?))a`=DMfv%l(U)A8yGGjqlEtl<54EF zek~`^y1I&uubr)sS(fVlPUkKO)68aC9ber>eeFr~{Ch<(n8Om5V&QYkB{h8 z!jUkOZVhFk@;Q}v#W;qYz{xlenT8{QWwZ~zha^>eQjI*tl)_7AysedLZypS2P3{V> zHy^O)y7uxu713S|K4T@bR98U#-(j3~VJO-sFx7V80rB7g8~m~!ow!Sc>}@DUX59p1Z{qVS&_M6&T@p7-LRX6ntaBE~I!kEkH?9*I zSf}s(oQ%qE(G!DA&y*&k&|zJQq7^9-90YF1RuWSSIR(^BMl51(4&G-H=YkkyD@!sp z6UFr&^vWO-XJV>OJdor>uy4=}FiF2WC}5CEUEI`(c{56J@zBnKSM+YxWo85ExPw}D z?k{LDHq5Tc2tSgp0(Q__D?kwwd>6jFQ_mJ$}1{oCk#~0zT#bNt6FF&LA z$rC^Eu+(f#1FjtrO^KM7) zGoS8q=>T_%X$v;` zpOf{A`y0I;TccR(v!k?E`Qs8jiYA?^;|(wga#S^1lC)^69dAN%O2xetSFRnF6|H#NKn4oz$6D|3q>}Vm9)?Cr2#2+d(6sh z6Zg%03e-2S8cIWDPDwcr8(*l7Wwx|N^4L9bxb=M_U?3ZRju(wvQ#XTHxy+SmFj|Nl z(E?w8;9J#gJ?D>H8TEt73^K}EEI9x37tRvtb1R}n&+7ec;Py9LdBQoEfZiUrgcf-vLsxJOxZ_>1}C^uyr*5~JzVT6M;5YhH3R^>Na-`=9&W zGNoktR#)u-dB6r@Q*G*1I=f)rqbHB`Ioa3Df!>#?w^w++P0!)TvO}Tj{cdI2Ti?pg zTh)wp*bgpPRa2c<9bL){i()^V_w`p+gI*=6W*!ph%5^Gr;Td?0xqpiu#$3|eK5ybi zj*W+&OV`BImfY`{Nxxeb3%JlG%w*2`h;>OB4l_e{Bhv zRuf6{-7N03ZI>IoA-B}s!fOQa}d%y0+8xDB@RA633T|h{7KQsGBq7Y z5yYM!s|!}U>u2c-ts!B?W@8O(D_tz&tyClV!=0&0uzwYD6W^_D4<3O%-sWF-BU@Bi zU#8q-ITF}K%Pu_NI#yTEJ9|=ysa^CH@i-5u#L{Y}C&i+wDuv~iNvSWv$Lo}GC`2ds z+=_}GdcJ#VI;UxV_Riy}ET$vDvm&#izwNRqCPUJk!RpDNuW)jzaM!4&ceapB6&>Eu zGgB$`%tM|%Ufxs4rsBZvlfXaCUa@hxXanyCQf>2-1U7RB&S)rbDSGGT4jp@ybK=U5 zVJ^Vfvy}nsEYfJoMA$F56~ow98~OgQs4t%~?|I=*GU( z1>~5s-J#HO-dl2UU>RbRXe7~-ATI^&E{fZ3n?sPKB z(EiPB1#i^;ph*vOLlc7ss|%u|cKDipJ^j`nG3K#N6My#ileVmZ)GB#w19>^u^Ij3& zWEZCpe_6*wzH8!Bn%xRU`hjtbZSO^8hpp0R*|Ra8Yfdb_p5Gb)eVM_rV;ecGO(Nm; zcemUs!Dlq*1#qquMISf8OiuU}rRTLInQL($-r7n~oj+6I;iaEbf<8xX77>7YyhKd|phf^{KHH%p05vbGq9SZ+giXy0 zF9@5ue}d&f1fc$30jU2`@RJM*HP3d_`gJ>omzq4AK$z8n{1${+&6h$9(d!Xr^#p0y z2(y~e6vtT*WYNV>p&o;tjWDYx7?gt$W_7vxmU!GVksN9)RCMZyU!mSxqt$Hn>HA( JkJGjJ Date: Mon, 14 Oct 2024 22:48:12 +0400 Subject: [PATCH 251/319] colors --- config/hyprland/hyprland.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/hyprland/hyprland.conf b/config/hyprland/hyprland.conf index b702016f..5ad56bf5 100644 --- a/config/hyprland/hyprland.conf +++ b/config/hyprland/hyprland.conf @@ -80,8 +80,8 @@ general { gaps_in = 0 gaps_out = 0 border_size = 1 - col.active_border = rgba(8b008bee) rgba(9400d3ee) 45deg - col.inactive_border = rgb(3F273F) rgb(410E41) 45deg + col.active_border = rgba(ea4c88ee) rgba(e691b1ee) 45deg + col.inactive_border = rgb(6F2440) rgb(734959) 45deg layout = dwindle } From 58aa0065a5126878d98714600670912cdacd8b35 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Mon, 14 Oct 2024 22:49:01 +0400 Subject: [PATCH 252/319] bro --- config/{wallpaper.png => background.png} | Bin 1 file changed, 0 insertions(+), 0 deletions(-) rename config/{wallpaper.png => background.png} (100%) diff --git a/config/wallpaper.png b/config/background.png similarity index 100% rename from config/wallpaper.png rename to config/background.png From cc3a38f2ebec503d55a39b150425227028c6865b Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 15 Oct 2024 06:36:47 +0400 Subject: [PATCH 253/319] config/hyprland: border --- config/hyprland/hyprland.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/hyprland/hyprland.conf b/config/hyprland/hyprland.conf index 5ad56bf5..9f21d8e4 100644 --- a/config/hyprland/hyprland.conf +++ b/config/hyprland/hyprland.conf @@ -79,7 +79,7 @@ general { gaps_in = 0 gaps_out = 0 - border_size = 1 + border_size = 2 col.active_border = rgba(ea4c88ee) rgba(e691b1ee) 45deg col.inactive_border = rgb(6F2440) rgb(734959) 45deg From 97e2181c9b1711639d996a854fe1fb9134364857 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 15 Oct 2024 08:43:21 +0400 Subject: [PATCH 254/319] config/hyprland: hyprlock --- config/hyprland/hyprlock.conf | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/config/hyprland/hyprlock.conf b/config/hyprland/hyprlock.conf index cd41f39f..e405aee9 100644 --- a/config/hyprland/hyprlock.conf +++ b/config/hyprland/hyprlock.conf @@ -3,6 +3,25 @@ background { path = /home/sako/background.png } +general { + no_fade_in = true + no_fade_out = true +} + +label { + monitor = + text = $TIME + text_align = center # center/right or any value for default left. multi-line text alignment inside label container + color = rgba(200, 200, 200, 1.0) + font_size = 25 + font_family = JetBrains Mono + rotate = 0 # degrees, counter-clockwise + + position = 0, 80 + halign = center + valign = center +} + input-field { monitor = size = 300, 50 From a19154e7b3f58f96d1981ffe0576c6c9303dde7b Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 15 Oct 2024 09:57:28 +0400 Subject: [PATCH 255/319] shennanigan --- config/hyprland/hyprlock.conf | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/config/hyprland/hyprlock.conf b/config/hyprland/hyprlock.conf index e405aee9..d4ecf717 100644 --- a/config/hyprland/hyprlock.conf +++ b/config/hyprland/hyprlock.conf @@ -8,6 +8,7 @@ general { no_fade_out = true } +# Time label { monitor = text = $TIME @@ -25,15 +26,15 @@ label { input-field { monitor = size = 300, 50 - outline_thickness = 4 + outline_thickness = 1 dots_size = 0.1 dots_spacing = 0.2 dots_center = true - outer_color = $accent + outer_color =rgb(ea4c88) inner_color = $surface0 font_color = $text fade_on_empty = false - placeholder_text = silly! + placeholder_text = placeholder rounding = 0 hide_input = false check_color = $accent From fe7ba4ce3f38b3b2b41aeb58d378994c912c8638 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 15 Oct 2024 10:31:16 +0400 Subject: [PATCH 256/319] test --- config/ags/style.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/ags/style.css b/config/ags/style.css index 148e96e8..45ebb74a 100644 --- a/config/ags/style.css +++ b/config/ags/style.css @@ -3,7 +3,8 @@ } window.bar { - background-color: @theme_bg_color; + /* background-color: @theme_bg_color; */ + background: #ff5050; color: @theme_fg_color; min-height: 4rem; } From bc8ec725253a02c38bbed829ccaf3c230d891f8f Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 15 Oct 2024 10:35:15 +0400 Subject: [PATCH 257/319] what the fuck --- config/ags/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/ags/style.css b/config/ags/style.css index 45ebb74a..44a04e41 100644 --- a/config/ags/style.css +++ b/config/ags/style.css @@ -4,7 +4,7 @@ window.bar { /* background-color: @theme_bg_color; */ - background: #ff5050; + background: #9C5464; color: @theme_fg_color; min-height: 4rem; } From 6ad808fd5e28ac33f380ff4847727c5778261ec4 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 15 Oct 2024 10:37:06 +0400 Subject: [PATCH 258/319] ok --- config/ags/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/ags/style.css b/config/ags/style.css index 44a04e41..206965fc 100644 --- a/config/ags/style.css +++ b/config/ags/style.css @@ -4,7 +4,7 @@ window.bar { /* background-color: @theme_bg_color; */ - background: #9C5464; + background: #583E43; color: @theme_fg_color; min-height: 4rem; } From 39b1c3d72e0fe7c1fe5e6b35fda5349f6b3b6c62 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 15 Oct 2024 10:40:20 +0400 Subject: [PATCH 259/319] ok --- config/ags/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/ags/style.css b/config/ags/style.css index 206965fc..bcbb9bdf 100644 --- a/config/ags/style.css +++ b/config/ags/style.css @@ -4,7 +4,7 @@ window.bar { /* background-color: @theme_bg_color; */ - background: #583E43; + background: rgba(0, 0, 0, .5); color: @theme_fg_color; min-height: 4rem; } From 201bc495912e583b8ccd26e39204b1bad57f4d5d Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 15 Oct 2024 10:42:22 +0400 Subject: [PATCH 260/319] ok --- config/ags/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/ags/style.css b/config/ags/style.css index bcbb9bdf..a9564517 100644 --- a/config/ags/style.css +++ b/config/ags/style.css @@ -4,7 +4,7 @@ window.bar { /* background-color: @theme_bg_color; */ - background: rgba(0, 0, 0, .5); + background: rgba(0, 0, 0, .1); color: @theme_fg_color; min-height: 4rem; } From a65bb2bee43fd0e9c930e7890b80f990c59a8186 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 15 Oct 2024 11:15:14 +0400 Subject: [PATCH 261/319] config/hyprland: thing --- config/hyprland/hyprland.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/hyprland/hyprland.conf b/config/hyprland/hyprland.conf index 9f21d8e4..77108021 100644 --- a/config/hyprland/hyprland.conf +++ b/config/hyprland/hyprland.conf @@ -77,8 +77,8 @@ input { general { # See https://wiki.hyprland.org/Configuring/Variables/ for more - gaps_in = 0 - gaps_out = 0 + gaps_in = 2 + gaps_out = 2 border_size = 2 col.active_border = rgba(ea4c88ee) rgba(e691b1ee) 45deg col.inactive_border = rgb(6F2440) rgb(734959) 45deg From e248729f41f3eb0019c64a6de6b59489343ee67f Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 15 Oct 2024 11:47:07 +0400 Subject: [PATCH 262/319] hypring it --- config/hyprland/hyprland.conf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/hyprland/hyprland.conf b/config/hyprland/hyprland.conf index 77108021..c49f0a0f 100644 --- a/config/hyprland/hyprland.conf +++ b/config/hyprland/hyprland.conf @@ -77,9 +77,9 @@ input { general { # See https://wiki.hyprland.org/Configuring/Variables/ for more - gaps_in = 2 - gaps_out = 2 - border_size = 2 + gaps_in = 10 + gaps_out = 10 + border_size = 4 col.active_border = rgba(ea4c88ee) rgba(e691b1ee) 45deg col.inactive_border = rgb(6F2440) rgb(734959) 45deg From 32d50fe9ef85db786498ad4ca05b080a060c5ca9 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 15 Oct 2024 11:47:14 +0400 Subject: [PATCH 263/319] f slur.... --- modules/desktop/hyprland/default.nix | 136 ++++++++++++--------------- overlays/default.nix | 2 +- 2 files changed, 63 insertions(+), 75 deletions(-) diff --git a/modules/desktop/hyprland/default.nix b/modules/desktop/hyprland/default.nix index c85e0c8e..8036a82f 100644 --- a/modules/desktop/hyprland/default.nix +++ b/modules/desktop/hyprland/default.nix @@ -1,80 +1,69 @@ -{ inputs, outputs, options, config, lib, pkgs, ...}: -let - cfg = config.modules.desktop.hyprland; -in -{ - imports = [ - inputs.hyprland.nixosModules.default - ]; +{ inputs, outputs, options, config, lib, pkgs, ... }: +let cfg = config.modules.desktop.hyprland; +in { + imports = [ inputs.hyprland.nixosModules.default ]; - options.modules.desktop.hyprland = { - enable = lib.mkEnableOption false; - }; + options.modules.desktop.hyprland = { enable = lib.mkEnableOption false; }; config = lib.mkIf cfg.enable { - modules.desktop.dunst.enable = lib.mkForce false; + modules.desktop.dunst.enable = lib.mkForce false; - services.gnome.gnome-keyring.enable = true; + services.gnome.gnome-keyring.enable = true; - services.greetd = { - enable = true; - settings = { - terminal = { - vt = 2; - }; - default_session = { - command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --time-format '%I:%M %p | %a • %h | %F' --cmd Hyprland"; - user = "greeter"; + services.greetd = { + enable = true; + settings = { + terminal = { vt = 2; }; + default_session = { + command = + "${pkgs.greetd.tuigreet}/bin/tuigreet --time --time-format '%I:%M %p | %a • %h | %F' --cmd Hyprland"; + user = "greeter"; + }; }; }; - }; - # https://github.com/apognu/tuigreet/issues/68#issuecomment-1586359960 - # make greetd not have systemd logs overlap - systemd.services.greetd.serviceConfig = { - Type = "idle"; - StandardInput = "tty"; - StandardOutput = "tty"; - StandardError = "journal"; # Without this errors will spam on screen - # Without these bootlogs will spam on screen - TTYReset = true; - TTYVHangup = true; - TTYVTDisallocate = true; - }; + # https://github.com/apognu/tuigreet/issues/68#issuecomment-1586359960 + # make greetd not have systemd logs overlap + systemd.services.greetd.serviceConfig = { + Type = "idle"; + StandardInput = "tty"; + StandardOutput = "tty"; + StandardError = "journal"; # Without this errors will spam on screen + # Without these bootlogs will spam on screen + TTYReset = true; + TTYVHangup = true; + TTYVTDisallocate = true; + }; - services.xserver = { + services.xserver = { + enable = true; + # displayManager = { + # # lightdm = { + # # enable = true; + # # background = ../../../config/background.png; + # # greeters.gtk = { + # # enable = true; + # # theme = { + # # name = "vimix-dark-ruby"; + # # package = pkgs.vimix-gtk-themes; + # # }; + # # }; + # # }; + # gdm = { + # enable = true; + # }; + # }; + }; + services.libinput = { enable = true; - # displayManager = { -# # lightdm = { -# # enable = true; -# # background = ../../../config/background.png; -# # greeters.gtk = { -# # enable = true; -# # theme = { -# # name = "vimix-dark-ruby"; -# # package = pkgs.vimix-gtk-themes; -# # }; -# # }; -# # }; - # gdm = { - # enable = true; - # }; - # }; - }; - services.libinput = { - enable = true; - # no mouse accel - mouse = { - accelProfile = "flat"; - }; + # no mouse accel + mouse = { accelProfile = "flat"; }; - # no touchpad accel - touchpad = { - accelProfile = "flat"; - }; - }; + # no touchpad accel + touchpad = { accelProfile = "flat"; }; + }; users.users.sako.packages = with pkgs; [ # use wayland counterparts @@ -114,9 +103,7 @@ in wl-clipboard ]; - programs.hyprland = { - enable = true; - }; + programs.hyprland = { enable = true; }; programs.hyprlock.enable = true; @@ -126,7 +113,7 @@ in # piece of shit thanks! services.emacs.startWithGraphical = false; - home-manager.users.sako = { pkgs , ...}: { + home-manager.users.sako = { pkgs, ... }: { home.pointerCursor = { # name = "Catppuccin-Mocha-Dark"; name = "catppuccin-mocha-dark-cursors"; @@ -136,10 +123,10 @@ in }; gtk = { enable = true; - theme.name = "Fluent-red-Dark"; - iconTheme.name = "Fluent-red-dark"; + theme.name = "Fluent-pink-Dark"; + iconTheme.name = "Fluent-pink-dark"; }; - home.file = { + home.file = { "background.png" = { enable = true; source = ../../../config/background.png; @@ -148,12 +135,13 @@ in # thanks PartyWumpus # https://github.com/PartyWumpus/dotfiles/blob/277949d84d53a58a3f52be935cd3c581c89d5d7c/modules/hyprland/hyprland.nix#L492 "/nixos/config/ags/types" = { - source = "${inputs.ags.packages.x86_64-linux.agsWithTypes.out}/share/com.github.Aylur.ags/types"; + source = + "${inputs.ags.packages.x86_64-linux.agsWithTypes.out}/share/com.github.Aylur.ags/types"; }; }; xdg.configFile = { hypr = { - source = ../../../config/hyprland; + source = ../../../config/hyprland; recursive = true; }; waybar = { @@ -168,7 +156,7 @@ in source = ../../../config/ags; recursive = true; }; - }; + }; }; environment.sessionVariables.NIXOS_OZONE_WL = "1"; diff --git a/overlays/default.nix b/overlays/default.nix index 512cd3d9..19161942 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -16,7 +16,7 @@ prev.vimix-gtk-themes.override { themeVariants = [ "ruby" ]; }; fluent-gtk-theme = prev.fluent-gtk-theme.override { colorVariants = [ "dark" ]; - themeVariants = [ "red" ]; + themeVariants = [ "pink" ]; tweaks = [ "square" ]; }; fluent-icon-theme = From 2238976d4fba2f274c70b669108463d7c9096524 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 15 Oct 2024 11:57:42 +0400 Subject: [PATCH 264/319] f slur... (again) --- overlays/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/overlays/default.nix b/overlays/default.nix index 19161942..61f24578 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -20,7 +20,7 @@ tweaks = [ "square" ]; }; fluent-icon-theme = - prev.fluent-icon-theme.override { colorVariants = [ "red" ]; }; + prev.fluent-icon-theme.override { colorVariants = [ "pink" ]; }; dwm = prev.dwm.overrideAttrs (old: { src = ../config/dwm; }); ags = prev.ags.overrideAttrs (old: { buildInputs = old.buildInputs From de7e10a025d73685821cfb21baa910004b22c98d Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 15 Oct 2024 12:03:56 +0400 Subject: [PATCH 265/319] ok --- config/ags/style.css | 1 - 1 file changed, 1 deletion(-) diff --git a/config/ags/style.css b/config/ags/style.css index a9564517..baa000c4 100644 --- a/config/ags/style.css +++ b/config/ags/style.css @@ -15,7 +15,6 @@ button { padding-bottom: 0; border: none; background-color: transparent; - border-bottom: 3px solid transparent; } button:active { From c1991400e58666a0ccfa5545a129b672f08fc5f4 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 15 Oct 2024 12:29:51 +0400 Subject: [PATCH 266/319] browsers/firefox: add home-manager to search things --- modules/desktop/browsers/firefox/default.nix | 71 ++++++++++---------- 1 file changed, 37 insertions(+), 34 deletions(-) diff --git a/modules/desktop/browsers/firefox/default.nix b/modules/desktop/browsers/firefox/default.nix index 17d12069..ab063002 100644 --- a/modules/desktop/browsers/firefox/default.nix +++ b/modules/desktop/browsers/firefox/default.nix @@ -1,11 +1,5 @@ -{ - options, - config, - lib, - pkgs, - ... -}: let - cfg = config.modules.desktop.browsers.firefox; +{ options, config, lib, pkgs, ... }: +let cfg = config.modules.desktop.browsers.firefox; in { options.modules.desktop.browsers.firefox = { enable = lib.mkEnableOption false; @@ -38,34 +32,43 @@ in { search.force = true; search.engines = { "Nix Packages" = { - urls = [ - { - template = "https://search.nixos.org/packages?channel=unstable"; - params = [ - { - name = "query"; - value = "{searchTerms}"; - } - ]; - } - ]; - icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; - definedAliases = ["@nixpkgs"]; + urls = [{ + template = + "https://search.nixos.org/packages?channel=unstable"; + params = [{ + name = "query"; + value = "{searchTerms}"; + }]; + }]; + icon = + "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = [ "@nixpkgs" ]; }; "Nix Options" = { - definedAliases = ["@nixopts"]; - icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; - urls = [ - { - template = "https://search.nixos.org/options?channel=unstable"; - params = [ - { - name = "query"; - value = "{searchTerms}"; - } - ]; - } - ]; + definedAliases = [ "@nixopts" ]; + icon = + "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + urls = [{ + template = + "https://search.nixos.org/options?channel=unstable"; + params = [{ + name = "query"; + value = "{searchTerms}"; + }]; + }]; + }; + "Home Manager Options" = { + definedAliases = [ "@homemgropts" ]; + icon = + "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + urls = [{ + template = + "https://home-manager-options.extranix.com/release=master"; + params = [{ + name = "query"; + value = "{searchTerms}"; + }]; + }]; }; }; }; From 8a8fd70584be6f04b38a514cbe3b75ee60b9e797 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 15 Oct 2024 13:28:11 +0400 Subject: [PATCH 267/319] config/hyprland: thats a bit too big --- config/hyprland/hyprland.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/hyprland/hyprland.conf b/config/hyprland/hyprland.conf index c49f0a0f..b56ffb48 100644 --- a/config/hyprland/hyprland.conf +++ b/config/hyprland/hyprland.conf @@ -79,7 +79,7 @@ general { gaps_in = 10 gaps_out = 10 - border_size = 4 + border_size = 3 col.active_border = rgba(ea4c88ee) rgba(e691b1ee) 45deg col.inactive_border = rgb(6F2440) rgb(734959) 45deg From 01ed78ad67e149af5d5a221b8d7c6d8a785f9a00 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 15 Oct 2024 13:39:28 +0400 Subject: [PATCH 268/319] kms --- config/hyprland/hyprland.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/hyprland/hyprland.conf b/config/hyprland/hyprland.conf index b56ffb48..e1116fd6 100644 --- a/config/hyprland/hyprland.conf +++ b/config/hyprland/hyprland.conf @@ -79,7 +79,7 @@ general { gaps_in = 10 gaps_out = 10 - border_size = 3 + border_size = 2 col.active_border = rgba(ea4c88ee) rgba(e691b1ee) 45deg col.inactive_border = rgb(6F2440) rgb(734959) 45deg From f3b3130ca300e461b72a6eb3dc563fb1bb685721 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 15 Oct 2024 13:45:28 +0400 Subject: [PATCH 269/319] ok --- config/ags/style.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/ags/style.css b/config/ags/style.css index baa000c4..1840740c 100644 --- a/config/ags/style.css +++ b/config/ags/style.css @@ -6,7 +6,8 @@ window.bar { /* background-color: @theme_bg_color; */ background: rgba(0, 0, 0, .1); color: @theme_fg_color; - min-height: 4rem; + min-height: 5rem; + border-style: 2px solid #ea4c88; } button { From d7e54dae4e1480c985880577e68ec31e84165ef7 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 15 Oct 2024 13:47:03 +0400 Subject: [PATCH 270/319] shit --- config/ags/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/ags/style.css b/config/ags/style.css index 1840740c..db2d5196 100644 --- a/config/ags/style.css +++ b/config/ags/style.css @@ -7,7 +7,7 @@ window.bar { background: rgba(0, 0, 0, .1); color: @theme_fg_color; min-height: 5rem; - border-style: 2px solid #ea4c88; + /* border-style: 2px solid #ea4c88; */ } button { From 087f7bc2f5ad275bf8f1d0650d88311202522d68 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 15 Oct 2024 13:49:29 +0400 Subject: [PATCH 271/319] i might be stupid --- config/ags/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/ags/style.css b/config/ags/style.css index db2d5196..fa9e5e18 100644 --- a/config/ags/style.css +++ b/config/ags/style.css @@ -7,7 +7,7 @@ window.bar { background: rgba(0, 0, 0, .1); color: @theme_fg_color; min-height: 5rem; - /* border-style: 2px solid #ea4c88; */ + border: 2px solid #ea4c88; } button { From 357323451779afedd097f75c1d213d747e8b9b04 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 15 Oct 2024 13:52:48 +0400 Subject: [PATCH 272/319] ok --- config/ags/style.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config/ags/style.css b/config/ags/style.css index fa9e5e18..653807c9 100644 --- a/config/ags/style.css +++ b/config/ags/style.css @@ -30,6 +30,10 @@ label { font-weight: bold; } +.workspaces button { + border-bottom: 1px transparent; +} + .workspaces button.focused { border-bottom: 1px solid @theme_selected_bg_color; } From ab29eaa377c17c72f1065750ddb6dff913d8b3be Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 15 Oct 2024 13:54:47 +0400 Subject: [PATCH 273/319] idk --- config/ags/style.css | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/config/ags/style.css b/config/ags/style.css index 653807c9..cc569f99 100644 --- a/config/ags/style.css +++ b/config/ags/style.css @@ -35,7 +35,7 @@ label { } .workspaces button.focused { - border-bottom: 1px solid @theme_selected_bg_color; + border-bottom: 3px solid @theme_selected_bg_color; } .client-title { @@ -62,12 +62,10 @@ label { .workspace-inactive { opacity: 0.5; - border-bottom: 3px transparent; } .workspace-occupied { opacity: 1; - border-bottom: 3px transparent; } .workspace-active { From 01b841364fb4683e83f5a247e624bd296f59da1a Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 15 Oct 2024 15:15:13 +0400 Subject: [PATCH 274/319] a --- config/ags/style.css | 1 + 1 file changed, 1 insertion(+) diff --git a/config/ags/style.css b/config/ags/style.css index cc569f99..96629315 100644 --- a/config/ags/style.css +++ b/config/ags/style.css @@ -8,6 +8,7 @@ window.bar { color: @theme_fg_color; min-height: 5rem; border: 2px solid #ea4c88; + padding: 2px; } button { From 9e5d0971a13dd6d9d004e9d367b1ada0d1a1453a Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 15 Oct 2024 15:20:33 +0400 Subject: [PATCH 275/319] a --- config/ags/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/ags/style.css b/config/ags/style.css index 96629315..49d9367d 100644 --- a/config/ags/style.css +++ b/config/ags/style.css @@ -8,7 +8,7 @@ window.bar { color: @theme_fg_color; min-height: 5rem; border: 2px solid #ea4c88; - padding: 2px; + padding: 10px; } button { From 295f2c3b5690b76dfed9d66f32380e8b122fd55f Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 15 Oct 2024 15:22:08 +0400 Subject: [PATCH 276/319] a --- config/ags/style.css | 1 - 1 file changed, 1 deletion(-) diff --git a/config/ags/style.css b/config/ags/style.css index 49d9367d..cc569f99 100644 --- a/config/ags/style.css +++ b/config/ags/style.css @@ -8,7 +8,6 @@ window.bar { color: @theme_fg_color; min-height: 5rem; border: 2px solid #ea4c88; - padding: 10px; } button { From 7f6bfc477953dd7737ab95cf0ab5446a9d723b59 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 15 Oct 2024 15:26:04 +0400 Subject: [PATCH 277/319] a --- config/ags/config.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/config/ags/config.js b/config/ags/config.js index 6fde77d0..b671ba25 100644 --- a/config/ags/config.js +++ b/config/ags/config.js @@ -235,8 +235,7 @@ function Bar(monitor = 0) { class_name: "bar", monitor, anchor: ["bottom", "left", "right"], - // margins: [5, 10, 0, 10], - margins: [0, 0, 0, 0], + margins: [5, 10, 0, 10], exclusivity: "exclusive", child: Widget.CenterBox({ start_widget: Left(), From 44c43ccef49bf621ef3e1888025cff4f0fed67ba Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 15 Oct 2024 15:29:27 +0400 Subject: [PATCH 278/319] a --- config/ags/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/ags/config.js b/config/ags/config.js index b671ba25..fae07cc2 100644 --- a/config/ags/config.js +++ b/config/ags/config.js @@ -235,7 +235,7 @@ function Bar(monitor = 0) { class_name: "bar", monitor, anchor: ["bottom", "left", "right"], - margins: [5, 10, 0, 10], + margins: [0, 10, 0, 10], exclusivity: "exclusive", child: Widget.CenterBox({ start_widget: Left(), From 7684087ba6d609fe6172da4d0facec000a5e8d30 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 15 Oct 2024 15:37:05 +0400 Subject: [PATCH 279/319] a --- config/ags/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/ags/style.css b/config/ags/style.css index cc569f99..a9e98eea 100644 --- a/config/ags/style.css +++ b/config/ags/style.css @@ -35,7 +35,7 @@ label { } .workspaces button.focused { - border-bottom: 3px solid @theme_selected_bg_color; + border-bottom: 1px solid @theme_selected_bg_color; } .client-title { From 9a8e237f793c94bed004afd0f384af02541d776f Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 15 Oct 2024 15:38:57 +0400 Subject: [PATCH 280/319] a --- config/ags/style.css | 5 ----- 1 file changed, 5 deletions(-) diff --git a/config/ags/style.css b/config/ags/style.css index a9e98eea..48ea6543 100644 --- a/config/ags/style.css +++ b/config/ags/style.css @@ -55,11 +55,6 @@ label { background-color: transparent; } -.workspace-indicator button.focused { - border-bottom: 3px solid @theme_selected_bg_color; -} - - .workspace-inactive { opacity: 0.5; } From 2c2b29c28720a725b7df0dbe09de62df0de34543 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 15 Oct 2024 15:42:41 +0400 Subject: [PATCH 281/319] a --- config/ags/style.css | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/config/ags/style.css b/config/ags/style.css index 48ea6543..d110a378 100644 --- a/config/ags/style.css +++ b/config/ags/style.css @@ -30,14 +30,6 @@ label { font-weight: bold; } -.workspaces button { - border-bottom: 1px transparent; -} - -.workspaces button.focused { - border-bottom: 1px solid @theme_selected_bg_color; -} - .client-title { color: @theme_selected_bg_color; } @@ -64,7 +56,7 @@ label { } .workspace-active { - border-bottom: 3px solid @theme_selected_bg_color; + border-bottom: 1px solid @theme_selected_bg_color; } levelbar block, From 483c201ee202b4a5b6b116f81c5f7acca793d195 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 15 Oct 2024 15:50:56 +0400 Subject: [PATCH 282/319] a --- config/ags/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/ags/style.css b/config/ags/style.css index d110a378..094fbaed 100644 --- a/config/ags/style.css +++ b/config/ags/style.css @@ -56,7 +56,7 @@ label { } .workspace-active { - border-bottom: 1px solid @theme_selected_bg_color; + background-color: red; } levelbar block, From 94269a458d1b874f38624799051c777463a2b26b Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 15 Oct 2024 15:51:36 +0400 Subject: [PATCH 283/319] a --- config/ags/style.css | 1 + 1 file changed, 1 insertion(+) diff --git a/config/ags/style.css b/config/ags/style.css index 094fbaed..9dbf38c8 100644 --- a/config/ags/style.css +++ b/config/ags/style.css @@ -8,6 +8,7 @@ window.bar { color: @theme_fg_color; min-height: 5rem; border: 2px solid #ea4c88; + border-radius: 3px 3px 0px 0px; } button { From 8b62a8172d4232d6ffb6fa1bfe8cb8c7c0248765 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 15 Oct 2024 15:53:13 +0400 Subject: [PATCH 284/319] a --- config/ags/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/ags/style.css b/config/ags/style.css index 9dbf38c8..7dc6b7c1 100644 --- a/config/ags/style.css +++ b/config/ags/style.css @@ -8,7 +8,7 @@ window.bar { color: @theme_fg_color; min-height: 5rem; border: 2px solid #ea4c88; - border-radius: 3px 3px 0px 0px; + border-radius: 5px 5px 0px 0px; } button { From b37257d2124988512cefe6e3f44017d5cf9caf6d Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 15 Oct 2024 15:54:51 +0400 Subject: [PATCH 285/319] a --- config/ags/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/ags/style.css b/config/ags/style.css index 7dc6b7c1..3f28b790 100644 --- a/config/ags/style.css +++ b/config/ags/style.css @@ -8,7 +8,7 @@ window.bar { color: @theme_fg_color; min-height: 5rem; border: 2px solid #ea4c88; - border-radius: 5px 5px 0px 0px; + border-radius: 10px 10px 0px 0px; } button { From cb200c753920963235c38372170dc97c5e6898d0 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 15 Oct 2024 15:57:32 +0400 Subject: [PATCH 286/319] a --- config/ags/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/ags/style.css b/config/ags/style.css index 3f28b790..358f1870 100644 --- a/config/ags/style.css +++ b/config/ags/style.css @@ -8,7 +8,7 @@ window.bar { color: @theme_fg_color; min-height: 5rem; border: 2px solid #ea4c88; - border-radius: 10px 10px 0px 0px; + border-radius: 6px 6px 0px 0px; } button { From 1226c069b4d364ee2f9873c6ce97d9e2a7a773f5 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 15 Oct 2024 16:09:46 +0400 Subject: [PATCH 287/319] ok --- config/ags/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/ags/style.css b/config/ags/style.css index 358f1870..7760056e 100644 --- a/config/ags/style.css +++ b/config/ags/style.css @@ -57,7 +57,7 @@ label { } .workspace-active { - background-color: red; + border-bottom: 2px solid #ea4c88; } levelbar block, From 9133c78800aa62c2638ea0188accf2d0c4728063 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 15 Oct 2024 17:02:50 +0400 Subject: [PATCH 288/319] height --- config/ags/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/ags/style.css b/config/ags/style.css index 7760056e..a84684ae 100644 --- a/config/ags/style.css +++ b/config/ags/style.css @@ -6,7 +6,7 @@ window.bar { /* background-color: @theme_bg_color; */ background: rgba(0, 0, 0, .1); color: @theme_fg_color; - min-height: 5rem; + min-height: 10rem; border: 2px solid #ea4c88; border-radius: 6px 6px 0px 0px; } From 8df0c5cf5e420c8332193d6711b0a1162e2b7f06 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 15 Oct 2024 18:08:19 +0400 Subject: [PATCH 289/319] config/ags: I DID IT --- config/ags/style.css | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/config/ags/style.css b/config/ags/style.css index a84684ae..8eded59e 100644 --- a/config/ags/style.css +++ b/config/ags/style.css @@ -13,10 +13,14 @@ window.bar { button { min-width: 0; - padding-top: 0; - padding-bottom: 0; - border: none; + /* padding-top: 0; + padding-bottom: 0; */ background-color: transparent; + padding: 5px; + padding-left: 10px; + padding-right: 10px; + border: none; + background: none; } button:active { @@ -46,6 +50,7 @@ label { padding-bottom: 0; margin: 0; background-color: transparent; + padding-bottom: 2px; } .workspace-inactive { @@ -58,6 +63,7 @@ label { .workspace-active { border-bottom: 2px solid #ea4c88; + padding-bottom: 0; } levelbar block, From 0b17752bcee74f5e8a7bf0f6d85d573abb0ee473 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 15 Oct 2024 18:57:48 +0400 Subject: [PATCH 290/319] desktop/foot: home-manager fever dream --- modules/desktop/foot/default.nix | 35 +++++++++++++++++++------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/modules/desktop/foot/default.nix b/modules/desktop/foot/default.nix index 8c33ae85..94c17816 100644 --- a/modules/desktop/foot/default.nix +++ b/modules/desktop/foot/default.nix @@ -1,23 +1,30 @@ -{ options, config, lib, pkgs, ...}: -let - cfg = config.modules.desktop.foot; +{ options, config, lib, pkgs, ... }: +let cfg = config.modules.desktop.foot; in { - options.modules.desktop.foot = { - enable = lib.mkEnableOption false; - }; + options.modules.desktop.foot = { enable = lib.mkEnableOption false; }; config = lib.mkIf cfg.enable { - users.users.sako.packages = with pkgs; [ - foot - ]; + users.users.sako.packages = with pkgs; [ foot ]; - home-manager.users.sako = {pkgs, ...}: { - xdg.configFile = { - foot = { - source = ../../../config/foot; + home-manager.users.sako = { pkgs, ... }: { + programs.foot = { + enable = true; + server.enable = false; + settings = { + main = { + term = "xterm-256color"; + font = "JetBrainsMono NF:size=12"; + }; + scrollback = { lines = 1000; }; + cursor = { + style = "block"; + blink = "yes"; + blink-rate = "1000"; + }; + mouse = { hide-when-typing = "yes"; }; + }; }; }; }; - }; } From 8f01622ef0e1fc175d12e4e561c8d42147aefc1a Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 15 Oct 2024 18:59:22 +0400 Subject: [PATCH 291/319] config: remove foot (replaced with home-manager) --- config/foot/foot.ini | 236 ------------------------------------------- 1 file changed, 236 deletions(-) delete mode 100644 config/foot/foot.ini diff --git a/config/foot/foot.ini b/config/foot/foot.ini deleted file mode 100644 index 2f99cd2a..00000000 --- a/config/foot/foot.ini +++ /dev/null @@ -1,236 +0,0 @@ -# -*- conf -*- - -# shell=$SHELL (if set, otherwise user's default shell from /etc/passwd) -term=xterm-256color -# login-shell=no - -# app-id=foot # globally set wayland app-id. Default values are "foot" and "footclient" for desktop and server mode -# title=foot -# locked-title=no - -font=JetBrainsMono NF:size=12 -# font-bold= -# font-italic= -# font-bold-italic= -# font-size-adjustment=0.5 -# line-height= -# letter-spacing=0 -# horizontal-letter-offset=0 -# vertical-letter-offset=0 -# underline-offset= -# underline-thickness= -# box-drawings-uses-font-glyphs=no -# dpi-aware=no - -# initial-window-size-pixels=700x500 # Or, -# initial-window-size-chars= -# initial-window-mode=windowed -# pad=0x0 # optionally append 'center' -# resize-by-cells=yes -# resize-delay-ms=100 - -# bold-text-in-bright=no -# word-delimiters=,│`|:"'()[]{}<> -# selection-target=primary -# workers= -# utmp-helper=/usr/lib/utempter/utempter # When utmp backend is ‘libutempter’ (Linux) -# utmp-helper=/usr/libexec/ulog-helper # When utmp backend is ‘ulog’ (FreeBSD) - -[environment] -# name=value - -[bell] -# urgent=no -# notify=no -# visual=no -# command= -# command-focused=no - -#[desktop-notifications] -# command=notify-send --wait --app-name ${app-id} --icon ${app-id} --category ${category} --urgency ${urgency} --expire-time ${expire-time} --hint STRING:image-path:${icon} --replace-id ${replace-id} ${action-argument} --print-id -- ${title} ${body} -# command-action-argument=--action ${action-name}=${action-label} -# close="" -# inhibit-when-focused=yes - - -[scrollback] -lines=1000 -# multiplier=3.0 -# indicator-position=relative -# indicator-format="" - -[url] -# launch=xdg-open ${url} -# label-letters=sadfjklewcmpgh -# osc8-underline=url-mode -# protocols=http, https, ftp, ftps, file, gemini, gopher -# uri-characters=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.,~:;/?#@!$&%*+="'()[] - -[cursor] -# style=block -# color= -# blink=no -# blink-rate=500 -# beam-thickness=1.5 -# underline-thickness= - -[mouse] -# hide-when-typing=no -# alternate-scroll-mode=yes - -[touch] -# long-press-delay=400 - -[colors] -# alpha=1.0 -# background=242424 -# foreground=ffffff -# flash=7f7f00 -# flash-alpha=0.5 - -## Normal/regular colors (color palette 0-7) -# regular0=242424 # black -# regular1=f62b5a # red -# regular2=47b413 # green -# regular3=e3c401 # yellow -# regular4=24acd4 # blue -# regular5=f2affd # magenta -# regular6=13c299 # cyan -# regular7=e6e6e6 # white - -## Bright colors (color palette 8-15) -# bright0=616161 # bright black -# bright1=ff4d51 # bright red -# bright2=35d450 # bright green -# bright3=e9e836 # bright yellow -# bright4=5dc5f8 # bright blue -# bright5=feabf2 # bright magenta -# bright6=24dfc4 # bright cyan -# bright7=ffffff # bright white - -## dimmed colors (see foot.ini(5) man page) -# dim0= -# ... -# dim7= - -## The remaining 256-color palette -# 16 = <256-color palette #16> -# ... -# 255 = <256-color palette #255> - -## Misc colors -# selection-foreground= -# selection-background= -# jump-labels= # black-on-yellow -# scrollback-indicator= # black-on-bright-blue -# search-box-no-match= # black-on-red -# search-box-match= # black-on-yellow -# urls= - -[csd] -# preferred=server -# size=26 -# font= -# color= -# hide-when-maximized=no -# double-click-to-maximize=yes -# border-width=0 -# border-color= -# button-width=26 -# button-color= -# button-minimize-color= -# button-maximize-color= -# button-close-color= - -[key-bindings] -# scrollback-up-page=Shift+Page_Up -# scrollback-up-half-page=none -# scrollback-up-line=none -# scrollback-down-page=Shift+Page_Down -# scrollback-down-half-page=none -# scrollback-down-line=none -# scrollback-home=none -# scrollback-end=none -# clipboard-copy=Control+Shift+c XF86Copy -# clipboard-paste=Control+Shift+v XF86Paste -# primary-paste=Shift+Insert -# search-start=Control+Shift+r -# font-increase=Control+plus Control+equal Control+KP_Add -# font-decrease=Control+minus Control+KP_Subtract -# font-reset=Control+0 Control+KP_0 -# spawn-terminal=Control+Shift+n -# minimize=none -# maximize=none -# fullscreen=none -# pipe-visible=[sh -c "xurls | fuzzel | xargs -r firefox"] none -# pipe-scrollback=[sh -c "xurls | fuzzel | xargs -r firefox"] none -# pipe-selected=[xargs -r firefox] none -# pipe-command-output=[wl-copy] none # Copy last command's output to the clipboard -# show-urls-launch=Control+Shift+o -# show-urls-copy=none -# show-urls-persistent=none -# prompt-prev=Control+Shift+z -# prompt-next=Control+Shift+x -# unicode-input=Control+Shift+u -# noop=none - -[search-bindings] -# cancel=Control+g Control+c Escape -# commit=Return -# find-prev=Control+r -# find-next=Control+s -# cursor-left=Left Control+b -# cursor-left-word=Control+Left Mod1+b -# cursor-right=Right Control+f -# cursor-right-word=Control+Right Mod1+f -# cursor-home=Home Control+a -# cursor-end=End Control+e -# delete-prev=BackSpace -# delete-prev-word=Mod1+BackSpace Control+BackSpace -# delete-next=Delete -# delete-next-word=Mod1+d Control+Delete -# extend-char=Shift+Right -# extend-to-word-boundary=Control+w Control+Shift+Right -# extend-to-next-whitespace=Control+Shift+w -# extend-line-down=Shift+Down -# extend-backward-char=Shift+Left -# extend-backward-to-word-boundary=Control+Shift+Left -# extend-backward-to-next-whitespace=none -# extend-line-up=Shift+Up -# clipboard-paste=Control+v Control+Shift+v Control+y XF86Paste -# primary-paste=Shift+Insert -# unicode-input=none -# quit=none -# scrollback-up-page=Shift+Page_Up -# scrollback-up-half-page=none -# scrollback-up-line=none -# scrollback-down-page=Shift+Page_Down -# scrollback-down-half-page=none -# scrollback-down-line=none -# scrollback-home=none -# scrollback-end=none - -[url-bindings] -# cancel=Control+g Control+c Control+d Escape -# toggle-url-visible=t - -[text-bindings] -# \x03=Mod4+c # Map Super+c -> Ctrl+c - -[mouse-bindings] -# scrollback-up-mouse=BTN_WHEEL_BACK -# scrollback-down-mouse=BTN_WHEEL_FORWARD -# font-increase=Control+BTN_WHEEL_BACK -# font-decrease=Control+BTN_WHEEL_FORWARD -# selection-override-modifiers=Shift -# primary-paste=BTN_MIDDLE -# select-begin=BTN_LEFT -# select-begin-block=Control+BTN_LEFT -# select-extend=BTN_RIGHT -# select-extend-character-wise=Control+BTN_RIGHT -# select-word=BTN_LEFT-2 -# select-word-whitespace=Control+BTN_LEFT-2 -# select-quote = BTN_LEFT-3 -# select-row=BTN_LEFT-4 - -# vim: ft=dosini From 5bc039792979ef2591ac7f8d397473a7e546b4dc Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 15 Oct 2024 20:30:26 +0400 Subject: [PATCH 292/319] config/ags: hopefully stop overflow --- config/ags/style.css | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/config/ags/style.css b/config/ags/style.css index 8eded59e..03e9c026 100644 --- a/config/ags/style.css +++ b/config/ags/style.css @@ -24,7 +24,7 @@ button { } button:active { - background-color: @theme_selected_bg_color; + background-color: #ea4c88; } button:hover { @@ -37,12 +37,20 @@ label { .client-title { color: @theme_selected_bg_color; + max-width: 50px; + overflow: hidden; + text-overflow: ellipsis; } .notification { color: yellow; } +.media { + max-width: 50px; + overflow: hidden; + text-overflow: ellipsis; +} .workspace-indicator { min-width: 0; From 39b72ca9cd014b9091d476fcd0e563728ec6b45b Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 15 Oct 2024 20:31:19 +0400 Subject: [PATCH 293/319] nvm it broke it lmao This reverts commit 5bc039792979ef2591ac7f8d397473a7e546b4dc. --- config/ags/style.css | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/config/ags/style.css b/config/ags/style.css index 03e9c026..8eded59e 100644 --- a/config/ags/style.css +++ b/config/ags/style.css @@ -24,7 +24,7 @@ button { } button:active { - background-color: #ea4c88; + background-color: @theme_selected_bg_color; } button:hover { @@ -37,20 +37,12 @@ label { .client-title { color: @theme_selected_bg_color; - max-width: 50px; - overflow: hidden; - text-overflow: ellipsis; } .notification { color: yellow; } -.media { - max-width: 50px; - overflow: hidden; - text-overflow: ellipsis; -} .workspace-indicator { min-width: 0; From 364529c5b0a8c342e49a7755468bcc9b9425c3f2 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 15 Oct 2024 20:32:27 +0400 Subject: [PATCH 294/319] config/ags: take two --- config/ags/style.css | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/config/ags/style.css b/config/ags/style.css index 8eded59e..ea8d79e1 100644 --- a/config/ags/style.css +++ b/config/ags/style.css @@ -24,7 +24,7 @@ button { } button:active { - background-color: @theme_selected_bg_color; + background-color: #ea4c88; } button:hover { @@ -37,12 +37,16 @@ label { .client-title { color: @theme_selected_bg_color; + max-width: 50px; } .notification { color: yellow; } +.media { + max-width: 50px; +} .workspace-indicator { min-width: 0; From 13d71b43863a5076ee555dabb038119a1817b614 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 15 Oct 2024 20:33:41 +0400 Subject: [PATCH 295/319] orang --- config/ags/style.css | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/config/ags/style.css b/config/ags/style.css index ea8d79e1..f1a1f42f 100644 --- a/config/ags/style.css +++ b/config/ags/style.css @@ -36,18 +36,13 @@ label { } .client-title { - color: @theme_selected_bg_color; - max-width: 50px; + color: #ea4c88; } .notification { color: yellow; } -.media { - max-width: 50px; -} - .workspace-indicator { min-width: 0; padding-top: 0; From 7cbe92f10d0b3ede51b5250919d2b8aa83b9fec2 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 15 Oct 2024 21:14:42 +0400 Subject: [PATCH 296/319] modules/desktop/foot: colors --- modules/desktop/foot/default.nix | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/modules/desktop/foot/default.nix b/modules/desktop/foot/default.nix index 94c17816..6b74bc69 100644 --- a/modules/desktop/foot/default.nix +++ b/modules/desktop/foot/default.nix @@ -23,6 +23,31 @@ in { blink-rate = "1000"; }; mouse = { hide-when-typing = "yes"; }; + colors = { + alpha = "1.0"; + background = "513942"; + foreground = "fbfffc"; + + # Normal/Regular colors + regular0 = "191516"; + regular1 = "ea4c4c"; + regular2 = "4cea50"; + regular3 = "df7620"; + regular4 = "4ca5ea"; + regular5 = "b24cea"; + regular6 = "33eabf"; + regular7 = "766169"; + + # Bright colors (8-15) + bright0 = "4c4043"; + bright1 = "ff5353"; + bright2 = "99ff69"; + bright3 = "df8f4d"; + bright4 = "88c1ea"; + bright5 = "d6a0ea"; + bright6 = "9dead8"; + bright7 = "eaeaea"; + }; }; }; }; From bc851c426efdcaf18d4a7949eeb4ebb764fb76fc Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 15 Oct 2024 21:30:26 +0400 Subject: [PATCH 297/319] (modules) desktop/foot: slight inconvinence --- modules/desktop/foot/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/desktop/foot/default.nix b/modules/desktop/foot/default.nix index 6b74bc69..cb65eb4b 100644 --- a/modules/desktop/foot/default.nix +++ b/modules/desktop/foot/default.nix @@ -36,7 +36,7 @@ in { regular4 = "4ca5ea"; regular5 = "b24cea"; regular6 = "33eabf"; - regular7 = "766169"; + regular7 = "D2AFBC"; # Bright colors (8-15) bright0 = "4c4043"; From 8c8ef17053a4a6c862e3d5d39a2ecfbaa40f6d1c Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Tue, 15 Oct 2024 21:34:05 +0400 Subject: [PATCH 298/319] (modules) desktop/foot: i have colorblind --- modules/desktop/foot/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/desktop/foot/default.nix b/modules/desktop/foot/default.nix index cb65eb4b..f7cd4c47 100644 --- a/modules/desktop/foot/default.nix +++ b/modules/desktop/foot/default.nix @@ -36,17 +36,17 @@ in { regular4 = "4ca5ea"; regular5 = "b24cea"; regular6 = "33eabf"; - regular7 = "D2AFBC"; + regular7 = "A3003E"; # Bright colors (8-15) - bright0 = "4c4043"; + bright0 = "C3A5AC"; bright1 = "ff5353"; bright2 = "99ff69"; bright3 = "df8f4d"; bright4 = "88c1ea"; bright5 = "d6a0ea"; bright6 = "9dead8"; - bright7 = "eaeaea"; + bright7 = "FF0061"; }; }; }; From 519295833f0df7c7d20968f3b95ef0e43ef06733 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 16 Oct 2024 06:17:06 +0400 Subject: [PATCH 299/319] (modules) desktop/foot: pywal moment --- modules/desktop/foot/default.nix | 38 ++++++++++++++++---------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/modules/desktop/foot/default.nix b/modules/desktop/foot/default.nix index f7cd4c47..5fe06ad5 100644 --- a/modules/desktop/foot/default.nix +++ b/modules/desktop/foot/default.nix @@ -25,28 +25,28 @@ in { mouse = { hide-when-typing = "yes"; }; colors = { alpha = "1.0"; - background = "513942"; - foreground = "fbfffc"; + background = "010000"; + foreground = "bfbfbf"; - # Normal/Regular colors - regular0 = "191516"; - regular1 = "ea4c4c"; - regular2 = "4cea50"; - regular3 = "df7620"; - regular4 = "4ca5ea"; - regular5 = "b24cea"; - regular6 = "33eabf"; - regular7 = "A3003E"; + # Normal/Regular colors (0-7) + regular0 = "010000"; + regular1 = "67514A"; + regular2 = "6A5D4E"; + regular3 = "9B686A"; + regular4 = "9F8975"; + regular5 = "BD7D81"; + regular6 = "D07789"; + regular7 = "bfbfbf"; # Bright colors (8-15) - bright0 = "C3A5AC"; - bright1 = "ff5353"; - bright2 = "99ff69"; - bright3 = "df8f4d"; - bright4 = "88c1ea"; - bright5 = "d6a0ea"; - bright6 = "9dead8"; - bright7 = "FF0061"; + bright0 = "615050"; + bright1 = "67514A"; + bright2 = "6A5D4E"; + bright3 = "9B686A"; + bright4 = "9F8975"; + bright5 = "BD7D81"; + bright6 = "D07788"; + bright7 = "bfbfbf"; }; }; }; From c1acf539ec181ee06ee7c2808123db6bd1988ebf Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 16 Oct 2024 08:30:05 +0400 Subject: [PATCH 300/319] (config) ags: forgot to do this yesterday --- config/ags/style.css | 1 + 1 file changed, 1 insertion(+) diff --git a/config/ags/style.css b/config/ags/style.css index f1a1f42f..c3bdc75e 100644 --- a/config/ags/style.css +++ b/config/ags/style.css @@ -8,6 +8,7 @@ window.bar { color: @theme_fg_color; min-height: 10rem; border: 2px solid #ea4c88; + border-bottom: none; border-radius: 6px 6px 0px 0px; } From 26054842a531dc08218ecdd1f8fdaaf44e68e7d6 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 16 Oct 2024 08:44:21 +0400 Subject: [PATCH 301/319] (config) ags: remove client title --- config/ags/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/ags/config.js b/config/ags/config.js index fae07cc2..a8717c65 100644 --- a/config/ags/config.js +++ b/config/ags/config.js @@ -201,7 +201,7 @@ function Left() { spacing: 8, children: [ Workspaces(), - ClientTitle(), + // ClientTitle(), ], }) } From a6defdb54eb0ff3d0d88e3cc74f9f303479ea489 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 16 Oct 2024 09:29:33 +0400 Subject: [PATCH 302/319] (config) ags: fix battery icon --- config/ags/config.js | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/config/ags/config.js b/config/ags/config.js index a8717c65..f5757edb 100644 --- a/config/ags/config.js +++ b/config/ags/config.js @@ -161,22 +161,38 @@ function Volume() { function BatteryLabel() { - const value = battery.bind("percent").as(p => p > 0 ? p / 100 : 0) - const icon = battery.bind("percent").as(p => - `battery-level-${Math.floor(p / 10) * 10}-symbolic`) + const icons = { + 100: "full", + 50: "good", + 25: "low", + 0: "empty", + }; + const value = battery.bind("percent").as(p => p > 0 ? p / 100 : 0); + // const icon = battery.bind("percent").as(p => + // `battery-level-${Math.floor(p / 10) * 10}-symbolic`) - const percent = battery.bind("percent").as(x => x.toString()) + "%" + const percent = battery.bind("percent").as(x => x.toString()) + "%"; + + function getIcon() { + const icon = [100, 50, 25, 0].find(threshold => threshold <= battery.percent); + + return `battery-${icons[icon]}-symbolic`; + } + + const icon = Widget.Icon({ + icon: Utils.watch(getIcon(), battery, getIcon), + }); return Widget.Box({ class_name: "battery", visible: battery.bind("available"), children: [ - Widget.Icon({ icon }), + icon, Widget.Label({ label: battery.bind('percent').as(x => x.toString()), }) ], - }) + }); } From b8a424dfbe3bc600dd3423936bbbd3cf8d39791c Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 16 Oct 2024 11:26:28 +0400 Subject: [PATCH 303/319] (config) ags: change battery icon ranges --- config/ags/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/ags/config.js b/config/ags/config.js index f5757edb..ff818238 100644 --- a/config/ags/config.js +++ b/config/ags/config.js @@ -162,7 +162,7 @@ function Volume() { function BatteryLabel() { const icons = { - 100: "full", + 75: "full", 50: "good", 25: "low", 0: "empty", From f8386617370b9b886a804cfe1bda3bfdcb66ffec Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 16 Oct 2024 14:42:50 +0400 Subject: [PATCH 304/319] (config) ags: again --- config/ags/config.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/ags/config.js b/config/ags/config.js index ff818238..482ac17c 100644 --- a/config/ags/config.js +++ b/config/ags/config.js @@ -162,10 +162,10 @@ function Volume() { function BatteryLabel() { const icons = { - 75: "full", + 80: "full", 50: "good", - 25: "low", - 0: "empty", + 30: "low", + 10: "empty", }; const value = battery.bind("percent").as(p => p > 0 ? p / 100 : 0); // const icon = battery.bind("percent").as(p => From 5dc2e4794274b59df379c99c2e407e51e778a76e Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 16 Oct 2024 15:32:51 +0400 Subject: [PATCH 305/319] (config) ags: oops --- config/ags/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/ags/config.js b/config/ags/config.js index 482ac17c..8700e8ff 100644 --- a/config/ags/config.js +++ b/config/ags/config.js @@ -174,7 +174,7 @@ function BatteryLabel() { const percent = battery.bind("percent").as(x => x.toString()) + "%"; function getIcon() { - const icon = [100, 50, 25, 0].find(threshold => threshold <= battery.percent); + const icon = [100, 50, 30, 10].find(threshold => threshold <= battery.percent); return `battery-${icons[icon]}-symbolic`; } From 4ac4ddcd446ffb5bf543ccb8a7a676c5ce502485 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 16 Oct 2024 15:35:40 +0400 Subject: [PATCH 306/319] woke agenda --- config/ags/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/ags/config.js b/config/ags/config.js index 8700e8ff..5e3dc92b 100644 --- a/config/ags/config.js +++ b/config/ags/config.js @@ -174,7 +174,7 @@ function BatteryLabel() { const percent = battery.bind("percent").as(x => x.toString()) + "%"; function getIcon() { - const icon = [100, 50, 30, 10].find(threshold => threshold <= battery.percent); + const icon = [80, 50, 30, 10].find(threshold => threshold <= battery.percent); return `battery-${icons[icon]}-symbolic`; } From bebb2cbb86eefa171c43bf4f6a70f3635d237590 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 16 Oct 2024 21:13:17 +0400 Subject: [PATCH 307/319] up --- secrets/shared/torrc.age | Bin 1615 -> 1935 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/secrets/shared/torrc.age b/secrets/shared/torrc.age index 191ed9343545a27bfcc0fc233b150da74a229bd2..5819278771e8b6796c2873014908462c3f67caa9 100644 GIT binary patch delta 1912 zcmV-;2Z#92437_xEPpq1a$#>}FmGlsNMlcHGhs$XD{63PdU$A1X-;l&d2vrtZA4Nw zb~IKqFbX(zLT)f+RaR4Ma#d1PRaaPOQcHJQNo!XzZ$w0MNo+S!ZAo-ZO;k)*Zwf6w zAaiqQEoEdfH8n9gAZIgBLrp;-cvEOvYcMe@FL+cqSZ{iGRDUaDZFO=}buTkVP;**g zXfRr5ODlFaPic5(3Ug$3MOsL3Oige>ICV}!Q)psoQA1H^L~vqEH!(R-dTT~_ST{sY zYC?HY3N0-yAWTD2L`^kfFHm!5R(4fmZ&_JuP)u@IIeBq8NpECkbu)TMMo3siM|xvb z3L;p~pdkaa2!HKR|J1-F;cSfxGj4nJfe{cn@ANKgFJ-EL{>9%9Qi6;7;ld`gv2{EV+@n9C*LANs@e>Tun9~I2ACxcVVNbeJAV>lEF|^EPPbY5V?@!E*3N;Y z$3f1IVVdzLs2RPI)_S-jC2n*W^$*DrO8X)PUhlG4nzN9`coXQetAxy7cY5L|Fw2}V z-|c3${ZOl#@hoamIT|f0l&!#-1K>*V0pGjsQ+@La0umsqp?$#LC?EtCJ!#O$uVclat6-cttG zdg)0oCuJKss9iMx$G>ngM<_E!fHsDQXMDA)SAQXKnz1*qaOaN*&}`*h5l9He(v*Au zI3^_#c@!)OnH#~)%N{&4@@{1;a0kAl3Kj;5e>s0a6t#>B&J~slRfs$E*#009;!()| z$m%0d@RM_HnK>fWs!+N76Q1#WvEmR?hd=pt)pA9v!R!iXTk z6+lUzbs%2w8gd4TR0nvWWD6R0ke&|sw||g|eLp)_CzkBH8=-su9(I*STVd`=NRL7r zb0p~TBk#dV--<*o3NpKK>i%Y$&akKt^P4rEWZp|#Sz%Wx^HP~C4?^v;jID8opoV97$+6`DB!4;d z%w2N*3w1DQp_*O>rr?8p^ z6)ETrg)`!d9Jr5o8hllho62KDKvE8!S9*9Xvtr8D@$fdcz;52YOHz|M~8b^;+HF3&0|rg6F@zguXJ~im=zlvfp59788~I6k$+TxYFq!xX(Feo5>jBm9WUnxd2JXf z@tG)g;lADllvKm<<%(DEPb;r_sB;oeafN_j}o?rptuiv+kE`P>E zgny~kxS)8fuw*Er>mpyA?-YHB5oO9lw1 y0;Hiv8U(Oufb_V zQd&4hNeV|uY(s2RI7(?YXhBA7c57I3bV5lsW<)kPRYFg6YfE`DPHRk1cvx9hO$seO zAaiqQEoEdfH8n9gAZIgBLrp;-Gd6lpIAeB4I88AxG%q$*L4QqDdQx^dM^ZU;ZbNT! zPeE!=FIY%VOLJ;L3OGZ0Pb)@RL^nY~NkUm`OmTW*WHDGaYB^_kX;W!6FhWH_PH$RP zFM4E23N0-yAUAI`cyCEEc1A-oXKr|984 zc$ip9tL1vuyO3zzLZ_3>WT-O!$h2c{Y99~{JcGyZCznu2oCy2v60O%KS0-Ix+&4x<$#2*y@kLrOs?hwEb3h zghHY){NrpS>C?%7@57C2vD#YK&kO#SzoVKfWGNEi&8@|`lb{ePwtzWhTn#zot-NbSyt(P=eE9VCskC(1%K_Ld6r(S_Y1>!l`MpXC*~d2|0YpB95F0n zSEt=G@;Ie~xPFiS-Zu0- z83$7{d@Euc6Umi6+-*a*Zf`o%syZdQGE%WBVj4AGq-D zy2#34<+>>xHL$gJB2NpuqA{@m#xFkAFf*{EZ4~ zDSjVjr*n6S);JJFx;!n9X+QPRX2?^eyqULnBjdu^^ec=#>iGh7e(p2RGkTyS6RNEG zpn?l%XAnLcjIin8O0oEr%qGf9QCYEm>igkw(oAf5^Orr?K^RYIQ63|mr*n0qNuyTY zuF>qaZgNR;%bDp`QeUEM>VFDsY-)W@x6y}*;lPH`dHuOc*q3oD-KZ1tWbN(jd%oCF zarF3vbnrdVdd%BXp+^|E+M2tL-K?TAmqFqsc8LcF0d@3AlvDE#{%~L%>d!KCQ|L*C ztO1+sUm6#hQ6^J9(^?QjwW-6}X_`0cQ=(9TBs+5g7DyM+jW>VtX)irD?H8>(*_&1v80bP~NbvOQSIK-2eap From 66c283bc5ebbc4e148a91ed66e7f9a064ec1fe63 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sat, 19 Oct 2024 14:51:09 +0400 Subject: [PATCH 308/319] (modules) desktop/browsers/firefox: add searxng --- modules/desktop/browsers/firefox/default.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/desktop/browsers/firefox/default.nix b/modules/desktop/browsers/firefox/default.nix index ab063002..32ccd88c 100644 --- a/modules/desktop/browsers/firefox/default.nix +++ b/modules/desktop/browsers/firefox/default.nix @@ -70,6 +70,18 @@ in { }]; }]; }; + "sakosearch" = { + definedAliases = [ "@sakosearch" ]; + icon = + "${pkgs.searxng}/share/static/themes/simple/img/favicon.svg"; + urls = [{ + template = "https://search.sako.box/search"; + params = [{ + name = "q"; + value = "searchTerms"; + }]; + }]; + }; }; }; }; From 808fbcfa4e6ce6205f82e03ef010fe9b769f37c3 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sat, 19 Oct 2024 14:55:11 +0400 Subject: [PATCH 309/319] (modules) desktop/browsers/firefox: pain and misery for thee --- modules/desktop/browsers/firefox/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/desktop/browsers/firefox/default.nix b/modules/desktop/browsers/firefox/default.nix index 32ccd88c..b07e64b6 100644 --- a/modules/desktop/browsers/firefox/default.nix +++ b/modules/desktop/browsers/firefox/default.nix @@ -28,7 +28,8 @@ in { # userChrome = '' # ''; - search.default = "DuckDuckGo"; + # search.default = "DuckDuckGo"; + search.default = "sakosearch"; search.force = true; search.engines = { "Nix Packages" = { From f7c22d963a630ef99120f8bc93f710c4a06d1a00 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sat, 19 Oct 2024 14:58:30 +0400 Subject: [PATCH 310/319] (modules) desktop/browsers/firefox: i am so stupid --- modules/desktop/browsers/firefox/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/desktop/browsers/firefox/default.nix b/modules/desktop/browsers/firefox/default.nix index b07e64b6..5ba25801 100644 --- a/modules/desktop/browsers/firefox/default.nix +++ b/modules/desktop/browsers/firefox/default.nix @@ -64,7 +64,7 @@ in { "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; urls = [{ template = - "https://home-manager-options.extranix.com/release=master"; + "https://home-manager-options.extranix.com/?release=master"; params = [{ name = "query"; value = "{searchTerms}"; @@ -79,7 +79,7 @@ in { template = "https://search.sako.box/search"; params = [{ name = "q"; - value = "searchTerms"; + value = "{searchTerms}"; }]; }]; }; From f1df9f060914d8a1888f3c7bc8b67660d2d77635 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sat, 19 Oct 2024 15:01:58 +0400 Subject: [PATCH 311/319] (modules) desktop/browsers/firefox: bismillah before using fetchurl --- modules/desktop/browsers/firefox/default.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/desktop/browsers/firefox/default.nix b/modules/desktop/browsers/firefox/default.nix index 5ba25801..015ffb1a 100644 --- a/modules/desktop/browsers/firefox/default.nix +++ b/modules/desktop/browsers/firefox/default.nix @@ -73,8 +73,11 @@ in { }; "sakosearch" = { definedAliases = [ "@sakosearch" ]; - icon = - "${pkgs.searxng}/share/static/themes/simple/img/favicon.svg"; + icon = pkgs.fetchurl { + url = + "https://raw.githubusercontent.com/searxng/searxng/refs/heads/master/src/brand/searxng-wordmark.svg"; + hash = "sha256-TwwPUNL+IRRjLY7Xmd466F474vglkvpJUYa+fBwDzFI="; + }; urls = [{ template = "https://search.sako.box/search"; params = [{ From 8e3d26e656d19e2fc05328a90d4fc26fcde44a66 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sat, 19 Oct 2024 16:46:54 +0400 Subject: [PATCH 312/319] (config) emacs: make my configuration not evil --- config/emacs/emacs.org | 242 ++++++++++++++++++++--------------------- 1 file changed, 121 insertions(+), 121 deletions(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index afda47c5..545ffa58 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -339,141 +339,141 @@ kept-old-versions 5) #+end_src ** General #+begin_src emacs-lisp - (use-package general - :config - (general-create-definer sk/leader-keys - :keymaps '(normal insert visual emacs) - :prefix "SPC" - :global-prefix "C-SPC") + ;; (use-package general + ;; :config + ;; (general-create-definer sk/leader-keys + ;; :keymaps '(normal insert visual emacs) + ;; :prefix "SPC" + ;; :global-prefix "C-SPC") - (sk/leader-keys - ;; code - "c" '(:ignore c :which-key "code") - "cc" '(compile :which-key "compile") - "cC" '(recompile :which-key "compile") - "cX" '(lsp-treeemacs-errors-list :which-ley "list errors") - ;; toggles - "t" '(:ignore t :which-key "toggles") - "tt" '(counsel-load-theme :which-key "choose theme") - "ts" '(hydra-text-scale/body :which-key "scale text") - ;; search - "s" '(:ignore s :which-key "search") - "sb" '(swiper :which-key "search buffer") - ;; insert - "i" '(:ignore i :which-key "insert") - "ie" '(emoji-search :which-key "Emoji") - ;; project - "p" '(:ignore p :which-key "projects") - "pp" '(project-switch-project :which-key "open project") - "pk" '(project-kill-buffers :which-key "close project") - "pt" '(magit-todos-list :which-key "list project todos") - "po" '(project-find-file :which-key "find file") - "pc" '(project-compile :which-key "compile project") - ;; open - "o" '(:ignore o :which-key "open") - "op" '(treemacs :which-key "treemacs") - "oP" '(treemacs-find-file :which-key "treemacs find file") - "oe" '(eshell :which-key "eshell") - "ov" '(vterm :which-key "vterm") - "or" '(elfeed :which-key "rss") - ;; notes - "n" '(:ignore o :which-key "notes") - "na" '(org-agenda :which-key "agenda") - "nf" '(org-roam-node-find :which-key "find node") - "nc" '(org-capture :which-key "capture") - "np" '(org-pomodoro :which-key "pomodoro") - "ne" '(:ignore ne :which-key "export") - "nep" '(org-latex-export-to-pdf :which-key "pdf") - ;; quit - "q" '(:ignore q :which-key "quit") - "qq" '(delete-frame :which-key "close emacs") - "qK" '(kill-emacs :which-key "quit emacs") - ;; git - "g" '(:ignore g :which-key "git") - "gs" '(magit-status :which-key "status") - "gc" '(:ignore gc :which-key "create") - "gcr" '(magit-init :which-key "init repo") - "gcR" '(magit-clone :which-key "clone repo") - "gcc" '(magit-commit-create :which-key "commit") - "gci" '(forge-create-issue :which-key "issue") - "gcp" '(forge-create-pullreq :which-key "pull request") - ;; mail - "m" '(mu4e :which-key "mu4e"))) + ;; (sk/leader-keys + ;; ;; code + ;; "c" '(:ignore c :which-key "code") + ;; "cc" '(compile :which-key "compile") + ;; "cC" '(recompile :which-key "compile") + ;; "cX" '(lsp-treeemacs-errors-list :which-ley "list errors") + ;; ;; toggles + ;; "t" '(:ignore t :which-key "toggles") + ;; "tt" '(counsel-load-theme :which-key "choose theme") + ;; "ts" '(hydra-text-scale/body :which-key "scale text") + ;; ;; search + ;; "s" '(:ignore s :which-key "search") + ;; "sb" '(swiper :which-key "search buffer") + ;; ;; insert + ;; "i" '(:ignore i :which-key "insert") + ;; "ie" '(emoji-search :which-key "Emoji") + ;; ;; project + ;; "p" '(:ignore p :which-key "projects") + ;; "pp" '(project-switch-project :which-key "open project") + ;; "pk" '(project-kill-buffers :which-key "close project") + ;; "pt" '(magit-todos-list :which-key "list project todos") + ;; "po" '(project-find-file :which-key "find file") + ;; "pc" '(project-compile :which-key "compile project") + ;; ;; open + ;; "o" '(:ignore o :which-key "open") + ;; "op" '(treemacs :which-key "treemacs") + ;; "oP" '(treemacs-find-file :which-key "treemacs find file") + ;; "oe" '(eshell :which-key "eshell") + ;; "ov" '(vterm :which-key "vterm") + ;; "or" '(elfeed :which-key "rss") + ;; ;; notes + ;; "n" '(:ignore o :which-key "notes") + ;; "na" '(org-agenda :which-key "agenda") + ;; "nf" '(org-roam-node-find :which-key "find node") + ;; "nc" '(org-capture :which-key "capture") + ;; "np" '(org-pomodoro :which-key "pomodoro") + ;; "ne" '(:ignore ne :which-key "export") + ;; "nep" '(org-latex-export-to-pdf :which-key "pdf") + ;; ;; quit + ;; "q" '(:ignore q :which-key "quit") + ;; "qq" '(delete-frame :which-key "close emacs") + ;; "qK" '(kill-emacs :which-key "quit emacs") + ;; ;; git + ;; "g" '(:ignore g :which-key "git") + ;; "gs" '(magit-status :which-key "status") + ;; "gc" '(:ignore gc :which-key "create") + ;; "gcr" '(magit-init :which-key "init repo") + ;; "gcR" '(magit-clone :which-key "clone repo") + ;; "gcc" '(magit-commit-create :which-key "commit") + ;; "gci" '(forge-create-issue :which-key "issue") + ;; "gcp" '(forge-create-pullreq :which-key "pull request") + ;; ;; mail + ;; "m" '(mu4e :which-key "mu4e"))) #+end_src ** Evil #+begin_src emacs-lisp - (use-package evil - :init - ;; Pre-load configuration - (setq evil-want-integration t) - (setq evil-want-keybinding nil) - (setq evil-want-C-u-scroll t) - (setq evil-want-C-i-jump nil) - (setq evil-respect-visual-line-mode t) - (setq evil-undo-system 'undo-tree) - :config - (evil-mode 1) + ;; (use-package evil + ;; :init + ;; ;; Pre-load configuration + ;; (setq evil-want-integration t) + ;; (setq evil-want-keybinding nil) + ;; (setq evil-want-C-u-scroll t) + ;; (setq evil-want-C-i-jump nil) + ;; (setq evil-respect-visual-line-mode t) + ;; (setq evil-undo-system 'undo-tree) + ;; :config + ;; (evil-mode 1) - ;; use emacs state for these mods - (dolist (mode '(custom-mode - eshell-mode - git-rebase-mode - erc-mode - circe-server-mode - circe-chat-mode - circe-query-mode - term-mode)) - (add-to-list 'evil-emacs-state-modes mode)) + ;; ;; use emacs state for these mods + ;; (dolist (mode '(custom-mode + ;; eshell-mode + ;; git-rebase-mode + ;; erc-mode + ;; circe-server-mode + ;; circe-chat-mode + ;; circe-query-mode + ;; term-mode)) + ;; (add-to-list 'evil-emacs-state-modes mode)) - (defun sk/dont-arrow-me-bro () - (interactive) - (message "STOP USING THE ARROW KEYS!!!!!!!!!!!!!!!!!!!!!!!")) + ;; (defun sk/dont-arrow-me-bro () + ;; (interactive) + ;; (message "STOP USING THE ARROW KEYS!!!!!!!!!!!!!!!!!!!!!!!")) - ;; Disable arrow keys in normal and visual modes - (define-key evil-normal-state-map (kbd "") 'sk/dont-arrow-me-bro) - (define-key evil-normal-state-map (kbd "") 'sk/dont-arrow-me-bro) - (define-key evil-normal-state-map (kbd "") 'sk/dont-arrow-me-bro) - (define-key evil-normal-state-map (kbd "") 'sk/dont-arrow-me-bro) - (evil-global-set-key 'motion (kbd "") 'sk/dont-arrow-me-bro) - (evil-global-set-key 'motion (kbd "") 'sk/dont-arrow-me-bro) - (evil-global-set-key 'motion (kbd "") 'sk/dont-arrow-me-bro) - (evil-global-set-key 'motion (kbd "") 'sk/dont-arrow-me-bro) + ;; ;; Disable arrow keys in normal and visual modes + ;; (define-key evil-normal-state-map (kbd "") 'sk/dont-arrow-me-bro) + ;; (define-key evil-normal-state-map (kbd "") 'sk/dont-arrow-me-bro) + ;; (define-key evil-normal-state-map (kbd "") 'sk/dont-arrow-me-bro) + ;; (define-key evil-normal-state-map (kbd "") 'sk/dont-arrow-me-bro) + ;; (evil-global-set-key 'motion (kbd "") 'sk/dont-arrow-me-bro) + ;; (evil-global-set-key 'motion (kbd "") 'sk/dont-arrow-me-bro) + ;; (evil-global-set-key 'motion (kbd "") 'sk/dont-arrow-me-bro) + ;; (evil-global-set-key 'motion (kbd "") 'sk/dont-arrow-me-bro) - (evil-set-initial-state 'messages-buffer-mode 'normal) - (evil-set-initial-state 'dashboard-mode 'normal)) + ;; (evil-set-initial-state 'messages-buffer-mode 'normal) + ;; (evil-set-initial-state 'dashboard-mode 'normal)) - (use-package evil-collection - :after evil - :custom - (evil-collection-outline-bind-tab-p nil) - :config - ;; Is this a bug in evil-collection? - (setq evil-collection-company-use-tng nil) - (delete 'lispy evil-collection-mode-list) - (delete 'org-present evil-collection-mode-list) - ;; (delete 'mu4e evil-collection-mode-list) - ;; (delete 'mu4e-conversation evil-collection-mode-list) - (evil-collection-init)) + ;; (use-package evil-collection + ;; :after evil + ;; :custom + ;; (evil-collection-outline-bind-tab-p nil) + ;; :config + ;; ;; Is this a bug in evil-collection? + ;; (setq evil-collection-company-use-tng nil) + ;; (delete 'lispy evil-collection-mode-list) + ;; (delete 'org-present evil-collection-mode-list) + ;; ;; (delete 'mu4e evil-collection-mode-list) + ;; ;; (delete 'mu4e-conversation evil-collection-mode-list) + ;; (evil-collection-init)) - (use-package evil-org - :after (evil org) - :hook ((org-mode . evil-org-mode) - (org-agenda-mode . evil-org-mode)) - :config - (require 'evil-org-agenda) - (evil-org-set-key-theme '(navigation todo insert textobjects additional)) - (evil-org-agenda-set-keys)) + ;; (use-package evil-org + ;; :after (evil org) + ;; :hook ((org-mode . evil-org-mode) + ;; (org-agenda-mode . evil-org-mode)) + ;; :config + ;; (require 'evil-org-agenda) + ;; (evil-org-set-key-theme '(navigation todo insert textobjects additional)) + ;; (evil-org-agenda-set-keys)) - (use-package evil-nerd-commenter - :bind ("M-/" . evilnc-comment-or-uncomment-lines)) + ;; (use-package evil-nerd-commenter + ;; :bind ("M-/" . evilnc-comment-or-uncomment-lines)) - (with-eval-after-load 'org - (evil-define-key '(normal insert visual) org-mode-map (kbd "C-j") 'org-next-visible-heading) - (evil-define-key '(normal insert visual) org-mode-map (kbd "C-k") 'org-previous-visible-heading) - (evil-define-key '(normal insert visual) org-mode-map (kbd "M-j") 'org-metadown) - (evil-define-key '(normal insert visual) org-mode-map (kbd "M-k") 'org-metaup)) + ;; (with-eval-after-load 'org + ;; (evil-define-key '(normal insert visual) org-mode-map (kbd "C-j") 'org-next-visible-heading) + ;; (evil-define-key '(normal insert visual) org-mode-map (kbd "C-k") 'org-previous-visible-heading) + ;; (evil-define-key '(normal insert visual) org-mode-map (kbd "M-j") 'org-metadown) + ;; (evil-define-key '(normal insert visual) org-mode-map (kbd "M-k") 'org-metaup)) #+end_src * Interface #+begin_src emacs-lisp From bd3f3a8f963fc7d726c0a8a509fd90ed4987f8c1 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 20 Oct 2024 15:01:13 +0400 Subject: [PATCH 313/319] (config) emacs: add C-` binding for vterm --- config/emacs/emacs.org | 1 + 1 file changed, 1 insertion(+) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 545ffa58..4f9f8635 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -692,6 +692,7 @@ this should be useful later ** VTerm #+begin_src emacs-lisp (use-package vterm + :bind ("C-`" . vterm) :commands vterm :config (setq vterm-max-scrollback 10000)) From 9667a4fb9d0c6bdd25ab1eb656c3e0ec125ae261 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 20 Oct 2024 15:04:43 +0400 Subject: [PATCH 314/319] (config) emacs: bind to f1 instead --- config/emacs/emacs.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 4f9f8635..a750ddca 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -692,7 +692,7 @@ this should be useful later ** VTerm #+begin_src emacs-lisp (use-package vterm - :bind ("C-`" . vterm) + :bind ("F1" . vterm) :commands vterm :config (setq vterm-max-scrollback 10000)) From 1e43709539e778b62f182b6e23f61518615a5b96 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 20 Oct 2024 15:07:23 +0400 Subject: [PATCH 315/319] (config) emacs: skill issue --- config/emacs/emacs.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index a750ddca..76cbf76d 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -692,7 +692,7 @@ this should be useful later ** VTerm #+begin_src emacs-lisp (use-package vterm - :bind ("F1" . vterm) + :bind ("f1" . vterm) :commands vterm :config (setq vterm-max-scrollback 10000)) From e74a6586b1b40598666b5708fa7631869affd01c Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 20 Oct 2024 15:09:31 +0400 Subject: [PATCH 316/319] (config) emacs: naming convention issue --- config/emacs/emacs.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 76cbf76d..f7ac23e5 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -692,7 +692,7 @@ this should be useful later ** VTerm #+begin_src emacs-lisp (use-package vterm - :bind ("f1" . vterm) + :bind ("" . vterm) :commands vterm :config (setq vterm-max-scrollback 10000)) From 25c483d69ffe14d1f04152405808aa245abc16f4 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 20 Oct 2024 16:49:05 +0400 Subject: [PATCH 317/319] (config) emacs: add msmtp thingies --- config/emacs/emacs.org | 170 +++++++++++++++++++++++------------------ 1 file changed, 97 insertions(+), 73 deletions(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index f7ac23e5..4f79af7d 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1205,94 +1205,118 @@ GNU patch review metho dor sometihng idk (setq mu4e-change-filenames-when-moving t) ;; sending mail - (setq message-send-mail-function 'smtpmail-send-it) - (add-to-list 'smtpmail-auth-supported 'xoauth2) + ;;(setq message-send-mail-function 'smtpmail-send-it) + ;;(add-to-list 'smtpmail-auth-supported 'xoauth2) + (setq send-mail-function 'sendmail-send-it) + (setq message-send-mail-function 'sendmail-sent-it) + (setq sendmail-program (executable-find "msmtp")) + + ;; select the right sender email from the context. + (setq message-sendmail-envelope-from 'header) (setq mu4e-update-interval (* 10 60)) (setq mu4e-get-mail-command (format "INSIDE_EMACS=%s offlineimap" emacs-version) - epa-pinentry-mode 'ask) + epa-pinentry-mode 'ask) (setq mu4e-maildir "~/.mail") ;; for mail accounts (setq sakomacs-mail-accounts (json-read-file "~/.mail/accounts.json")) + (defun sakomacs/set-msmtp-account () + (if (message-mail-p) + (save-excursion + (let* + ((from (save-restriction + (message-narrow-to-headers) + (message-fetch-field "from"))) + (account + (cond + ((string-match (cdr (assoc 'gmail-1 sakomacs-mail-accounts)) from) "gmail-1") + ((string-match (cdr (assoc 'gmail-2 sakomacs-mail-accounts)) from) "gmail-2") + ((string-match (cdr (assoc 'protonmail sakomacs-mail-accounts)) from) "protonmail") + ((string-match (cdr (assoc 'li sakomacs-mail-accounts)) from) "li") + ((string-match (cdr (assoc 'outlook sakomacs-mail-accounts)) from))))) + (setq message-sendmail-extra-arguments (list '"-a" account)))))) + + (add-hook 'message-send-mail-hook 'sakomacs/set-msmtp-account) + ;; kill message buffers (setq message-kill-buffer-on-exit t) (setq mu4e-context-policy 'pick-first) (setq mu4e-compose-context-policy 'always-ask) (setq mu4e-contexts - (list - ;; outlook + (list + ;; outlook + (make-mu4e-context + :name "Outlook" + :match-func + (lambda (msg) + (when msg + (string-prefix-p "/outlook" (mu4e-message-field msg :maildir)))) + :vars `((user-mail-address . ,(cdr (assoc 'outlook sakomacs-mail-accounts))) + (user-full-name . "Sako") + (mu4e-drafts-folder . "/outlook/Drafts") + (mu4e-sent-folder . "/outlook/Sent") + (mu4e-refile-folder . "/outlook/Inbox") + (mu4e-trash-folder . "/outlook/Deleted") + ;; todo stmpmail and compose signatures + )) + (make-mu4e-context + :name "Proton" + :match-func + (lambda (msg) + (when msg + (string-prefix-p "/protonmail" (mu4e-message-field msg :maildir)))) + :vars `((user-mail-address . ,(cdr (assoc 'protonmail sakomacs-mail-accounts))) + (user-full-name . "Sako") + (mu4e-drafts-folder . "/protonmail/Drafts") + (mu4e-sent-folder . "/protonmail/Sent") + (mu4e-refile-folder . "/protonmail/Inbox") + (mu4e-trash-folder . "/protonmail/Trash")) + ;; todo stmpmail and compose signatures + ) + (make-mu4e-context + :name "Gmail Personal 1" + :match-func + (lambda (msg) + (when msg + (string-prefix-p "/gmail1" (mu4e-message-field msg :maildir)))) + :vars `((user-mail-address . ,(cdr (assoc 'gmail-1 sakomacs-mail-accounts))) + (user-full-name . "Sako") + (mu4e-drafts-folder . "/gmail1/Drafts") + (mu4e-sent-folder . "/gmail1/Sent Mail") + (mu4e-refile-folder . "/gmail1/Inbox") + (mu4e-trash-folder . "gmail1/Trash") + ;; todo stmpmail and compose signatures + )) + (make-mu4e-context + :name "Second Personal Gmail" + :match-func + (lambda (msg) + (when msg + (string-prefix-p "/gmail2" (mu4e-message-field msg :maildir)))) + :vars `((user-mail-address . ,(cdr (assoc 'gmail-2 sakomacs-mail-accounts))) + (user-full-name . "Sako") + (mu4e-drafts-folder . "/gmail2/Drafts") + (mu4e-sent-folder . "/gmail2/Sent Mail") + (mu4e-refile-folder . "/gmail2/Inbox") + (mu4e-trash-folder . "gmail2/Trash") + )) (make-mu4e-context - :name "Outlook" - :match-func - (lambda (msg) - (when msg - (string-prefix-p "/outlook" (mu4e-message-field msg :maildir)))) - :vars `((user-mail-address . ,(cdr (assoc 'outlook sakomacs-mail-accounts))) - (user-full-name . "Sako") - (mu4e-drafts-folder . "/outlook/Drafts") - (mu4e-sent-folder . "/outlook/Sent") - (mu4e-refile-folder . "/outlook/Inbox") - (mu4e-trash-folder . "/outlook/Deleted") - ;; todo stmpmail and compose signatures - )) - (make-mu4e-context - :name "Proton" - :match-func - (lambda (msg) - (when msg - (string-prefix-p "/protonmail" (mu4e-message-field msg :maildir)))) - :vars `((user-mail-address . ,(cdr (assoc 'protonmail sakomacs-mail-accounts))) - (user-full-name . "Sako") - (mu4e-drafts-folder . "/protonmail/Drafts") - (mu4e-sent-folder . "/protonmail/Sent") - (mu4e-refile-folder . "/protonmail/Inbox") - (mu4e-trash-folder . "/protonmail/Trash")) - ;; todo stmpmail and compose signatures - ) - (make-mu4e-context - :name "Gmail Personal 1" - :match-func - (lambda (msg) - (when msg - (string-prefix-p "/gmail1" (mu4e-message-field msg :maildir)))) - :vars `((user-mail-address . ,(cdr (assoc 'gmail-1 sakomacs-mail-accounts))) - (user-full-name . "Sako") - (mu4e-drafts-folder . "/gmail1/Drafts") - (mu4e-sent-folder . "/gmail1/Sent Mail") - (mu4e-refile-folder . "/gmail1/Inbox") - (mu4e-trash-folder . "gmail1/Trash") - ;; todo stmpmail and compose signatures - )) - (make-mu4e-context - :name "Second Personal Gmail" - :match-func - (lambda (msg) - (when msg - (string-prefix-p "/gmail2" (mu4e-message-field msg :maildir)))) - :vars `((user-mail-address . ,(cdr (assoc 'gmail-2 sakomacs-mail-accounts))) - (user-full-name . "Sako") - (mu4e-drafts-folder . "/gmail2/Drafts") - (mu4e-sent-folder . "/gmail2/Sent Mail") - (mu4e-refile-folder . "/gmail2/Inbox") - (mu4e-trash-folder . "gmail2/Trash") - )) - (make-mu4e-context - :name "li" - :match-func - (lambda (msg) - (when msg - (string-prefix-p "/li" (mu4e-message-field msg :maildir)))) - :vars `((user-mail-address . ,(cdr (assoc 'li sakomacs-mail-accounts))) - (user-full-name . "user") - (mu4e-sent-folder . "/li/Sent Mail") - (mu4e-refile-folder . "/li/INBOX") - (mu4e-trash-folder . "/li/Trash") - )) - - )) + :name "li" + :match-func + (lambda (msg) + (when msg + (string-prefix-p "/li" (mu4e-message-field msg :maildir)))) + :vars `((user-mail-address . ,(cdr (assoc 'li sakomacs-mail-accounts))) + (user-full-name . "user") + (mu4e-sent-folder . "/li/Sent Mail") + (mu4e-refile-folder . "/li/INBOX") + (mu4e-trash-folder . "/li/Trash") + )) + + )) ) (use-package mu4e-alert From 7be935358b7d10fd391c8da09fec08e987a0f009 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 20 Oct 2024 23:37:10 +0400 Subject: [PATCH 318/319] (config) emacs: remove docker --- config/emacs/emacs.org | 6 ------ 1 file changed, 6 deletions(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 4f79af7d..330ea2bb 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -792,12 +792,6 @@ this should be useful later :config (global-flycheck-mode +1)) #+end_src -** Docker -#+begin_src emacs-lisp -(use-package docker - :ensure t - :bind ("C-c d" . docker)) -#+end_src ** Treemacs #+begin_src emacs-lisp (use-package treemacs From 4e1b1b77951d8503ecf5ec0a2edb03be0bd3aefc Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Mon, 21 Oct 2024 11:14:52 +0400 Subject: [PATCH 319/319] (hosts) sakopc: disable flatpak --- hosts/sakopc/configuration.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/hosts/sakopc/configuration.nix b/hosts/sakopc/configuration.nix index 8e647c49..e06aed99 100644 --- a/hosts/sakopc/configuration.nix +++ b/hosts/sakopc/configuration.nix @@ -10,7 +10,6 @@ modules = { desktop = { - flatpak.enable = true; wireguard.enable = true; printing.enable = true; bspwm = {