From fbbd1a6ee7cb8f4a221b9ec77f714778eb4ae7f4 Mon Sep 17 00:00:00 2001 From: tzlil Date: Thu, 30 Mar 2023 10:46:52 +0300 Subject: cleanup, fmt, work on emacs, start hydrus booru integration --- mixins/cli.nix | 2 +- mixins/emacs/default.nix | 59 ++++++++++++++++++++++++++++-------------------- mixins/greet.nix | 6 ++--- mixins/sway.nix | 32 ++++++++++---------------- 4 files changed, 50 insertions(+), 49 deletions(-) (limited to 'mixins') diff --git a/mixins/cli.nix b/mixins/cli.nix index abf40e0..dbed8fd 100644 --- a/mixins/cli.nix +++ b/mixins/cli.nix @@ -23,7 +23,7 @@ bat croc ]; - sessionVariables.EDITOR = "nvim"; + # sessionVariables.EDITOR = "nvim"; }; programs = { git = { diff --git a/mixins/emacs/default.nix b/mixins/emacs/default.nix index 0290d20..7303ebb 100644 --- a/mixins/emacs/default.nix +++ b/mixins/emacs/default.nix @@ -5,29 +5,38 @@ inputs, ... }: { - # imports = [ - # inputs.home-manager.nixosModules."home-manager" - # ]; - # config = { - # home-manager.users.tzlil = { - # pkgs, - # config, - # nixosConfig, - # ... - # } @ hm: { - # home = { - # packages = with pkgs; [ - - # ]; - # }; - # services.emacs = { - # enable = true; - # defaultEditor = true; - # }; - # programs.emacs = { - # enable = true; - # extraConfig = builtins.readFile ./init.el - # }; - # }; - # } + imports = [ + inputs.home-manager.nixosModules."home-manager" + ]; + config = { + home-manager.users.tzlil = { + pkgs, + config, + nixosConfig, + ... + } @ hm: { + home = { + packages = with pkgs; [ + ]; + }; + services.emacs = { + enable = true; + defaultEditor = true; + startWithUserSession = true; + client.enable = true; + package = with pkgs; (emacsWithPackages (with emacsPackagesNg; [ + evil + nix-mode + org + python-mode + ])); + }; + # xdg.configFile."emacs/init.el".text = builtins.readFile ./init.el; + # non client + programs.emacs = { + enable = true; + extraConfig = builtins.readFile ./init.el; + }; + }; + }; } diff --git a/mixins/greet.nix b/mixins/greet.nix index 794d322..27a8a75 100644 --- a/mixins/greet.nix +++ b/mixins/greet.nix @@ -10,9 +10,9 @@ greet = "${pkgs.greetd.gtkgreet.out}/bin/gtkgreet -l -s ${pkgs.writeText "gtkgreet.css" " window { background-image: url(\"${pkgs.fetchurl { - url = "https://i.imgur.com/D6qCaQG.png"; - sha256 = "sha256-Yt5JxmqN6++76cWu8EI/gsmelsJT/3jvLxyeRASQUhI="; - }}\"); + url = "https://i.imgur.com/D6qCaQG.png"; + sha256 = "sha256-Yt5JxmqN6++76cWu8EI/gsmelsJT/3jvLxyeRASQUhI="; + }}\"); background-size: cover; background-position: center; color: white; diff --git a/mixins/sway.nix b/mixins/sway.nix index dd8a44c..fe9e217 100644 --- a/mixins/sway.nix +++ b/mixins/sway.nix @@ -17,18 +17,10 @@ app_id=menu chooser="${pkgs.fzf}/bin/fzf <$in_pipe >$out_pipe" - foot -W40x40 --app-id "$app_id" -- sh -c "$chooser" & + ${pkgs.foot}/bin/foot -W40x40 --app-id "$app_id" -- sh -c "$chooser" & cat >"$in_pipe" cat <"$out_pipe" ''; - sel = - pkgs.writeShellScript "sel" - '' - #!/bin/sh - swaymsg -t get_tree | \ - ${pkgs.jq}/bin/jq -r '.. | select(.pid? and .visible?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"' | \ - ${pkgs.slurp}/bin/slurp - ''; in { config = { security.pam.services.swaylock = {}; @@ -51,7 +43,7 @@ in { [[block]] block = "sound" - on_click = "pavucontrol" + on_click = "${pkgs.pavucontrol}/bin/pavucontrol" [[block]] block = "time" @@ -60,8 +52,6 @@ in { ''; services.mako.enable = true; home.packages = with pkgs; [ - grim - slurp wf-recorder font-awesome_6 waypipe @@ -149,7 +139,7 @@ in { keybindings = { "${modifier}+Return" = "exec $term"; "${modifier}+q" = "kill"; - "${modifier}+space" = "exec ${pkgs.dmenu}/bin/dmenu_path | ${menuscript} | xargs swaymsg exec --"; + "${modifier}+d" = "exec ${pkgs.dmenu}/bin/dmenu_path | ${menuscript} | xargs swaymsg exec --"; "${modifier}+Shift+c" = "reload"; "${modifier}+Shift+q" = "exit"; "${modifier}+Shift+p" = "exec systemctl poweroff"; @@ -204,6 +194,11 @@ in { "${modifier}+Shift+minus" = "move scratchpad"; "${modifier}+minus" = "scratchpad show"; "${modifier}+m" = "mode notifications"; + + "${modifier}+l" = "exec ${pkgs.swaylock}/bin/swaylock -c 070D0D"; + "Print" = "exec ${pkgs.sway-contrib.grimshot}/bin/grimshot copy area"; + "Shift+Print" = "exec ${pkgs.sway-contrib.grimshot}/bin/grimshot copy active"; + "Ctrl+Print" = "exec ${pkgs.sway-contrib.grimshot}/bin/grimshot copy output"; }; input = { "type:keyboard" = { @@ -275,16 +270,13 @@ in { bindsym XF86MonBrightnessUp exec ${pkgs.brightnessctl}/bin/brightnessctl s +5% bindsym XF86MonBrightnessDown exec ${pkgs.brightnessctl}/bin/brightnessctl s 5%- - bindsym Print exec ${pkgs.grim}/bin/grim - | tee $(xdg-user-dir PICTURES)/$(date +'%s_grim.png') | wl-copy - bindsym Shift+Print exec ${pkgs.grim}/bin/grim -g "$(${sel})" - | tee $(xdg-user-dir PICTURES)/$(date +'%s_grim.png') | wl-copy - bindsym Ctrl+Print exec ${pkgs.grim}/bin/grim -g "$(swaymsg -t get_tree | jq -j '.. | select(.type?) | select(.focused).rect | "\(.x),\(.y) \(.width)x\(.height)"')" - |tee $(xdg-user-dir PICTURES)/$(date +'%s_grim.png') | wl-copy - - bindsym $mod+l exec ${pkgs.swaylock}/bin/swaylock -c 070D0D - exec ${pkgs.mako}/bin/mako >/tmp/mako.log 2>&1 exec_always ${pkgs.kanshi}/bin/kanshi >/tmp/kanshi.log 2>&1 - exec foot + + default_border pixel 2 + gaps outer 5 + gaps inner 5 include /etc/sway/config.d/* ''; }; -- cgit 1.4.1