From 8898a6cc13fb51ecbbd73d4f359dad453bcca48b Mon Sep 17 00:00:00 2001 From: vorboyvo Date: Tue, 30 Jan 2024 15:21:59 -0500 Subject: [PATCH] Reorganized packages list a bit Added xdg-terminal-exec Added papirus icon theme; not yet active Enabled fcitx for sway Enabled sway autolaunch on login in tty1 Set git config --- home.nix | 42 +++++++++++++++----- pkgs/xdg-terminal-exec/xdg-terminal-exec.nix | 17 ++++++++ programs/neovim/init.lua | 18 +++++++++ programs/sway.nix | 14 +++++-- scripts/dynscreenshot.sh | 4 +- scripts/shutdownmenu.sh | 2 +- todo | 6 +-- 7 files changed, 83 insertions(+), 20 deletions(-) create mode 100644 pkgs/xdg-terminal-exec/xdg-terminal-exec.nix diff --git a/home.nix b/home.nix index 6b647c6..0ca4a26 100644 --- a/home.nix +++ b/home.nix @@ -20,14 +20,15 @@ in home.packages = with pkgs; [ texliveFull ] ++ # TeX distribution (with ocamlPackages; [ ocaml opam dune_3 dune-release merlin ocaml-lsp odoc ocamlformat utop ]) ++ # OCaml - [ grim slurp wl-clipboard jq ] ++ # Basic utilities + [ grim slurp wl-clipboard jq (callPackage ./pkgs/xdg-terminal-exec/xdg-terminal-exec.nix {}) ] ++ # Basic utilities [ bitwarden-cli ] ++ # Personalized selection of command-line (CLI/TUI) apps [ wezterm ] ++ # Terminal emulator [ firefox cinnamon.nemo gnome.file-roller cinnamon.nemo-fileroller imv vlc pavucontrol ] ++ # Basic graphical apps [ libreoffice signal-desktop element-desktop prismlauncher mumble gimp inkscape ] ++ # Personalized selection of graphical apps # [ factorio ] ++ # Games - [ bemenu j4-dmenu-desktop fcitx5-with-addons grim slurp wl-clipboard ] ++ # Sway- and Wayland-related packages + [ bemenu j4-dmenu-desktop fcitx5-with-addons ] ++ # Sway- and Wayland-related packages [ noto-fonts redhat-official-fonts overpass ibm-plex ] ++ # Fonts + [ papirus-icon-theme ] ++ # Icons # [ vanilla-dmz ] ++ # Cursor [ ]; @@ -36,11 +37,21 @@ in # Enabling bash from home-manager means environment variables set by HM get set correctly programs.bash = { enable = true; - profileExtra = "export VISUAL=nvim"; + profileExtra = '' + export VISUAL=nvim + # Enable fcitx for sway + export GTK_IM_MODULE=fcitx + export QT_IM_MODULE=fcitx + export XMODIFIERS=@im=fcitx + # If running from tty1 start sway + [ "$(tty)" = "/dev/tty1" ] && exec sway + ''; }; programs.git = { enable = true; + userName = "vorboyvo"; + userEmail = "mrsirofvibe@outlook.com"; extraConfig = { init.defaultBranch = "main"; }; }; @@ -68,14 +79,7 @@ in # fix nemo terminal integration dconf.settings."org/cinnamon/desktop/applications/terminal".exec = "wezterm"; - # programs.kitty = { - # enable = true; - # font = { - # name = "NotoMono"; - # size = 11; - # }; - # shellIntegration.enableBashIntegration = true; - # }; + # terminal emulator programs.wezterm = { enable = true; enableBashIntegration = true; @@ -102,6 +106,22 @@ in enable = true; }; + # Configure notifications + services.dunst = { + enable = true; + settings = { + global.font = "Red Hat Display 12"; + }; + }; + services.batsignal = { + enable = true; + }; + + services.kdeconnect = { + enable = true; + indicator = true; + }; + programs.firefox = import ./programs/firefox.nix {inherit pkgs;}; programs.thunderbird = import ./programs/thunderbird.nix; diff --git a/pkgs/xdg-terminal-exec/xdg-terminal-exec.nix b/pkgs/xdg-terminal-exec/xdg-terminal-exec.nix new file mode 100644 index 0000000..633fc86 --- /dev/null +++ b/pkgs/xdg-terminal-exec/xdg-terminal-exec.nix @@ -0,0 +1,17 @@ +{ pkgs }: +with pkgs; +stdenv.mkDerivation rec { + name = "xdg-terminal-exec"; + version = "efc3517"; + + src = fetchFromGitHub { + owner = "Vladimir-csp"; + repo = "xdg-terminal-exec"; + rev = version; + hash = "sha256-uLUHvSjxIjmy0ejqLfliB6gHFRwyTWNH1RL5kTXebUM="; # TODO will fix + }; + + installPhase = '' + install -Dm755 xdg-terminal-exec $out/bin/xdg-terminal-exec + ''; +} diff --git a/programs/neovim/init.lua b/programs/neovim/init.lua index d350b11..6ece94a 100644 --- a/programs/neovim/init.lua +++ b/programs/neovim/init.lua @@ -43,9 +43,27 @@ plugins = { require 'nordic' .load() end }, + "lervag/vimtex", + { + 'nvim-lualine/lualine.nvim', + dependencies = { 'nvim-tree/nvim-web-devicons' } + }, } require("lazy").setup(plugins) -- Configure nvim-lspconfig to work with servers require'lspconfig'.ocamllsp.setup{} + +-- Configure vimtex +vim.g.vimtex_view_method = "zathura" + +-- Configure lualine +require('lualine').setup { + options = { + icons_enabled = true, + theme = 'nord', + + }, +} + diff --git a/programs/sway.nix b/programs/sway.nix index 7b6b33c..694d3f5 100644 --- a/programs/sway.nix +++ b/programs/sway.nix @@ -7,10 +7,11 @@ let mod = config.wayland.windowManager.sway.config.modifier; dmenuCommand = builtins.readFile "${scripts}/dmenu.sh"; shutdownMenu = pkgs.writeShellScript "shutdownmenu" (builtins.readFile "${scripts}/shutdownmenu.sh"); + terminal = "wezterm"; in { enable = true; config = rec { - terminal = "wezterm"; + inherit terminal; modifier = "Mod4"; fonts = { names = [ "Red Hat Display" ]; @@ -21,6 +22,7 @@ in { natural_scroll = "disabled"; dwt = "disabled"; click_method = "clickfinger"; + scroll_factor = "0.5"; }; bars = let config = config; in [{ position = "top"; @@ -32,8 +34,8 @@ in { titlebar = true; }; keybindings = let screenshotPath = "Pictures/Screenshots/screenshot`date +%Y%m%d%H%M%S`.png"; in lib.mkOptionDefault ({ # Screenshot keybinds - "Print" = "exec grim ${screenshotPath} && wl-copy < ${screenshotPath}"; # Take screenshot of whole screen, save it, and copy it to clipboard - "Shift+Print" = "exec swaymsg -t get_tree | jq -r '.. | select(.focused?) | .rect | \"\\(.x),\\(.y) \\(.width)x\\(.height)\"' | grim -g - ${screenshotPath} && wl-copy < ${screenshotPath}"; # Take screenshot of current window, save it, and copy it to clipboard + "Print" = "exec grim - | wl-copy && wl-paste > ${screenshotPath}"; # Take screenshot of whole screen, save it, and copy it to clipboard + "Shift+Print" = "exec swaymsg -t get_tree | jq -r '.. | select(.focused?) | .rect | \"\\(.x),\\(.y) \\(.width)x\\(.height)\"' | grim -g - | wl-copy && wl-paste > ${screenshotPath}"; # Take screenshot of current window, save it, and copy it to clipboard "Ctrl+Print" = "exec bash ${dynscreenshot}"; # Take screenshot of selection, save it, and copy it to clipboard } // { # Function Media Keys XF86MonBrightnessUp = "exec bash ${changebrightness} 1"; @@ -42,11 +44,12 @@ in { XF86AudioLowerVolume = "exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05-"; "${mod}+XF86AudioRaiseVolume" = "exec wpctl set-volume @DEFAULT_AUDIO_SOURCE@ 0.05+"; "${mod}+XF86AudioLowerVolume" = "exec wpctl set-volume @DEFAULT_AUDIO_SOURCE@ 0.05-"; + "${mod}+Shift+e" = null; XF86PowerOff = "exec DMENU_COMMAND='${dmenuCommand}' bash ${shutdownMenu}"; } // { "${mod}+space" = "exec fcitx5-remote -t"; }); - menu = "j4-dmenu-desktop --no-generic --term=wezterm --dmenu='${dmenuCommand}'"; # I don't like hardcoding kitty here, TODO think of better way to do it + menu = "j4-dmenu-desktop --no-generic --term=${terminal} --dmenu='${dmenuCommand}'"; focus.followMouse = false; }; extraConfig = @@ -56,5 +59,8 @@ in { '' exec fcitx5 '' + # Fcitx5 enables input method switching + '' + exec dunst + '' + # Enable notifications ""; } diff --git a/scripts/dynscreenshot.sh b/scripts/dynscreenshot.sh index 69fe526..f942cb1 100644 --- a/scripts/dynscreenshot.sh +++ b/scripts/dynscreenshot.sh @@ -1 +1,3 @@ -shotpath="Pictures/Screenshots/screenshot`date +%Y%m%d%H%M%S`.png"; slurp | grim -g - $shotpath && wl-copy < $shotpath +shotpath="$HOME/Pictures/Screenshots/screenshot`date +%Y%m%d%H%M%S`.png" +grim -g "$(slurp)" - | wl-copy +wl-paste > $shotpath diff --git a/scripts/shutdownmenu.sh b/scripts/shutdownmenu.sh index 5a63214..a6157d4 100644 --- a/scripts/shutdownmenu.sh +++ b/scripts/shutdownmenu.sh @@ -12,6 +12,6 @@ case `printf "Cancel\nSuspend\nPower Off\nReboot\nLog Out" | $DMENU_COMMAND` in systemctl reboot ;; "Log Out") - loginctl kill-session + swaymsg exit ;; esac diff --git a/todo b/todo index c7571c5..0e51f88 100644 --- a/todo +++ b/todo @@ -1,7 +1,7 @@ # enable NUR and firefox extensions -split app configs off into separate files set up a keyring and store networkmanager wifi passwords in there instead of plain text -fnott: notifications -neovim and vimtex config mute button i3status bar +bluetooth setup +media player daemon +dmenu files