diff --git a/hosts/mrmeeseeks/home-config.nix b/hosts/mrmeeseeks/home-config.nix index d00ab09..e180376 100644 --- a/hosts/mrmeeseeks/home-config.nix +++ b/hosts/mrmeeseeks/home-config.nix @@ -1,10 +1,7 @@ -{ inputs, ... }: { +{ ... }: { config.modules = { application = { - gnupg = { - enable = true; - enableSshSupport = true; - }; + gnupg.enable = true; zathura.enable = true; foot.enable = true; }; @@ -14,10 +11,7 @@ git.enable = true; neovim.enable = true; starship.enable = true; - tmux = { - enable = true; - extraConfig = inputs.nix-private.tmux.personal; - }; + tmux.enable = true; utils.enable = true; vifm.enable = true; zsh.enable = true; diff --git a/hosts/work/home-config.nix b/hosts/work/home-config.nix index 733c542..0155435 100644 --- a/hosts/work/home-config.nix +++ b/hosts/work/home-config.nix @@ -38,7 +38,8 @@ laptop = true; gpuThermal.enable = false; cpuThermal = { - thermalZone = 9; + hwmonPathAbs = "/sys/devices/platform/coretemp.0/hwmon/"; + inputFilename = "temp1_input"; }; }; xdg.useDistributionPortals = true; diff --git a/modules/home-manager/application/gnupg/default.nix b/modules/home-manager/application/gnupg/default.nix index 62a2aab..53a24f1 100644 --- a/modules/home-manager/application/gnupg/default.nix +++ b/modules/home-manager/application/gnupg/default.nix @@ -46,6 +46,12 @@ in noAllowExternalCache = true; }; + home.sessionVariablesExtra = lib.mkIf cfg.enableSshSupport '' + if [[ -z "''${SSH_AUTH_SOCK}" ]]; then + export SSH_AUTH_SOCK="$(${config.programs.gpg.package}/bin/gpgconf --list-dirs agent-ssh-socket)" + fi + ''; + services.ssh-agent.enable = if cfg.enableSshSupport then false else true; programs.password-store = { enable = cfg.pass; diff --git a/modules/home-manager/cli/neovim/default.nix b/modules/home-manager/cli/neovim/default.nix index 9d928b1..ee3302e 100644 --- a/modules/home-manager/cli/neovim/default.nix +++ b/modules/home-manager/cli/neovim/default.nix @@ -65,7 +65,7 @@ in python3Packages.python-lsp-server shellcheck - tofu-ls + terraform-lsp tflint vscode-langservers-extracted yaml-language-server @@ -120,7 +120,7 @@ in { plugin = gitsigns-nvim; type = "lua"; - config = (builtins.readFile ./files/plugins/gitsign.lua); + config = (builtins.readFile ./files/plugins/luasnip.lua); } { plugin = indent-blankline-nvim; @@ -205,10 +205,7 @@ in type = "lua"; config = ( builtins.readFile ./files/plugins/nvim-k8s-lsp.lua ); } - { - plugin = helm-ls-nvim; - type = "lua"; - } + vim-helm ]; }; }; diff --git a/modules/home-manager/cli/neovim/files/keybindings.lua b/modules/home-manager/cli/neovim/files/keybindings.lua index b0d8b13..aeaabe3 100644 --- a/modules/home-manager/cli/neovim/files/keybindings.lua +++ b/modules/home-manager/cli/neovim/files/keybindings.lua @@ -1,15 +1,6 @@ -local opts = { noremap = true, silent = true} - -vim.api.nvim_set_keymap('n', '/', ':nohlsearch', opts) -vim.api.nvim_set_keymap('n', 'l', ':set list!', {silent = true}) - -- clear search vim.keymap.set('n', 'l', ':nohlsearch', { desc = 'Clear search', remap = true, silent = true }) --- Move tabs with \[ and \] -vim.api.nvim_set_keymap('n', ']', ':tabnext', opts) -vim.api.nvim_set_keymap('n', '[', ':tabprev', opts) - -- Switch between windows. vim.keymap.set('n', '', 'h', { desc = 'Move to the left window', remap = true }) vim.keymap.set('n', '', 'j', { desc = 'Move to the bottom window', remap = true }) @@ -28,3 +19,31 @@ vim.keymap.set('n', 'tn', ':tabnew', { desc = "Tab [n]ew", remap = t -- Show all caracters vim.keymap.set('n', 'l', ':set list!', { desc = "Show a[l]l caraters", remap = true, silent = true}) + +-- neotree +-- ------- +vim.keymap.set('n', 'nc', ':Neotree close', {desc='Neotree [c]lose'}) +vim.keymap.set('n', 'nf', ':Neotree focus filesystem', {desc='Neotree [f]ocus'}) +vim.keymap.set('n', 'nb', ':Neotree focus buffers', {desc='Neotree Nvim [b]uffers'}) +vim.keymap.set('n', 'ng', ':Neotree focus git_status', {desc='Neotree [g]it status'}) + +-- fzf-lua +-- ------ +vim.keymap.set('n', 'fb', function() require('fzf-lua').buffers() end, {desc='open [b]uffers'}) +vim.keymap.set('n', 'ff', function() require('fzf-lua').files() end, {desc='[r]esume last command'}) +vim.keymap.set('n', 'fr', function() require('fzf-lua').files() end, {desc='[f]iles'}) + +-- git related keymaps +vim.keymap.set('n', 'fgb', function() require('fzf-lua').git_branches() end, {desc='Git [b]ranches'}) +vim.keymap.set('n', 'fgc', function() require('fzf-lua').git_commits() end, {desc='Git [c]ommits'}) +vim.keymap.set('n', 'fgC', function() require('fzf-lua').git_bcommits() end, {desc='Git current buffer [C]ommits'}) +vim.keymap.set('n', 'fgf', function() require('fzf-lua').git_files() end, {desc='Git [f]iles'}) +vim.keymap.set('n', 'fgs', function() require('fzf-lua').git_stash() end, {desc='Git [s]tash'}) +vim.keymap.set('n', 'fgS', function() require('fzf-lua').git_status() end, {desc='Git [S]tash'}) + +-- grep related keymaps +vim.keymap.set('n', 'fGb', function() require('fzf-lua').grep_curbuf() end, {desc='grep in current [b]uffer'}) +vim.keymap.set('n', 'fGc', function() require('fzf-lua').grep_cword() end, {desc='grep word under the [c]ursor'}) +vim.keymap.set('n', 'fGg', function() require('fzf-lua').grep() end, {desc='[g]rep'}) +vim.keymap.set('n', 'fGl', function() require('fzf-lua').live_grep() end, {desc='[l]ive grep'}) +vim.keymap.set('n', 'fGr', function() require('fzf-lua').grep_last() end, {desc='[r]erun last grep'}) diff --git a/modules/home-manager/cli/neovim/files/lsp/helm.lua b/modules/home-manager/cli/neovim/files/lsp/helm.lua index 29e9e11..8086a4a 100644 --- a/modules/home-manager/cli/neovim/files/lsp/helm.lua +++ b/modules/home-manager/cli/neovim/files/lsp/helm.lua @@ -1,8 +1,7 @@ return { cmd = { 'helm_ls', 'serve' }, - filetypes = { 'helm', 'yaml.helm-values' }, - single_file_support = true, - root_markers = { 'values.yaml', 'Chart.yaml' }, + filetypes = { 'helm' }, + root_markers = { 'Chart.yaml' }, capabilities = { workspace = { didChangeWatchedFiles = { @@ -19,7 +18,9 @@ return { showdiagnosticsdirectly = false, path = "yaml-language-server", config = { - schemas = {}, + schemas = { + kubernetes = "template/**", + }, completion = true, hover = true, } diff --git a/modules/home-manager/cli/neovim/files/lsp/tofuls.lua b/modules/home-manager/cli/neovim/files/lsp/terraformls.lua similarity index 73% rename from modules/home-manager/cli/neovim/files/lsp/tofuls.lua rename to modules/home-manager/cli/neovim/files/lsp/terraformls.lua index 8eba7d0..4a875c3 100644 --- a/modules/home-manager/cli/neovim/files/lsp/tofuls.lua +++ b/modules/home-manager/cli/neovim/files/lsp/terraformls.lua @@ -1,5 +1,5 @@ return { - cmd = { 'tofu-ls', 'serve' }, + cmd = { 'terraform-ls', 'serve' }, filetypes = { 'terraform', 'terraform-vars' }, root_markers = { '.terraform', '.git' }, } diff --git a/modules/home-manager/cli/neovim/files/options.lua b/modules/home-manager/cli/neovim/files/options.lua index 37fcdcb..b683e0a 100644 --- a/modules/home-manager/cli/neovim/files/options.lua +++ b/modules/home-manager/cli/neovim/files/options.lua @@ -52,7 +52,7 @@ vim.opt.wildmode = 'lastused:full,list' -- enhance menu vim.opt.pumheight = 10 vim.opt.pumwidth = 50 vim.opt.pumblend = 10 -vim.o.winborder = 'none' + -- manage line break smartly vim.opt.wrap = true vim.opt.breakindent = true @@ -103,13 +103,24 @@ vim.opt.wildignore = { '*.sw?' } +-- Key biding +-- " ---------- +local opts = { noremap = true, silent = true} + +vim.api.nvim_set_keymap('n', '/', ':nohlsearch', opts) + +-- Move tabs with \[ and \] +vim.api.nvim_set_keymap('n', ']', ':tabnext', opts) +vim.api.nvim_set_keymap('n', '[', ':tabprev', opts) +vim.api.nvim_set_keymap('n', 'l', ':set list!', {silent = true}) + -- disable lsplog -- This is not usefull on a daily basis and should positively impact performance vim.lsp.set_log_level("off") -- define a timeout for match parens -vim.g.matchparen_timeout = 10 -vim.g.matchparen_insert_timeout = 10 +vim.g.matchparen_timeout = 2 +vim.g.matchparen_insert_timeout = 2 -- activate virtual lines for diagnistics -- no more plugins needed @@ -123,73 +134,3 @@ vim.diagnostic.config({ -- }, signs = { text = { [x.ERROR] = "󰅙", [x.WARN] = "", [x.INFO] = "󰋼", [x.HINT] = "󰌵" } }, }) - --- LSP -vim.api.nvim_create_autocmd("LspAttach", { - group = vim.api.nvim_create_augroup("UserLspConfig", {}), - callback = function(ev) - vim.bo[ev.buf].omnifunc = "v:lua.vim.lsp.omnifunc" - - local opts = { buffer = ev.buf } - local client = vim.lsp.get_client_by_id(ev.data.client_id) - local bufnr = ev.buf - local function desc(description) - return { noremap = true, silent = true, buffer = bufnr, desc = description } - end - - vim.keymap.set("n", "gD", vim.lsp.buf.declaration, { buffer = ev.buf, desc = "Go to [D]eclaration" }) - vim.keymap.set("n", "gd", vim.lsp.buf.definition, { buffer = ev.buf, desc = "Go to [d]efinition" }) - vim.keymap.set("n", "gi", vim.lsp.buf.implementation, { buffer = ev.buf, desc = "Go to [i]mplementation" }) - vim.keymap.set("n", "gr", vim.lsp.buf.references, { buffer = ev.buf, desc = "Go to [r]eferences" }) - - vim.keymap.set( - "n", - "K", - function() - vim.lsp.buf.hover - { border = "rounded", max_width = 250 } - end, - opts) - - vim.keymap.set( - "n", - "", - function() - vim.lsp.buf.signature_help - { border = "rounded", max_width = 250 } - end, - {buffer = ev.buf, desc = "Signature help"} - ) - - vim.keymap.set("n", "wa", vim.lsp.buf.add_workspace_folder, opts) - vim.keymap.set("n", "wr", vim.lsp.buf.remove_workspace_folder, opts) - - vim.keymap.set( - "n", - "wl", - function() - print(vim.inspect(vim.lsp.buf.list_workspace_folders())) - end, - opts - ) - - vim.keymap.set("n", "D", vim.lsp.buf.type_definition, { buffer = ev.buf, desc = "Type [D]efinition" }) - vim.keymap.set("n", "rn", vim.lsp.buf.rename, { buffer = ev.buf, desc = "LSP [r]e[n]ame" }) - vim.keymap.set("n", "ca", vim.lsp.buf.code_action, { buffer = ev.buf, desc = "Show [c]ode [a]ction"}) - - vim.keymap.set( - "n", - "F", - function() - require("conform").format({ bufnr = bufnr }) - end, - { buffer = ev.buf, desc = "[F]ormat file" } - ) - - if client.server_capabilities.inlayHintProvider then - vim.keymap.set("n", "h", function() - vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled()) - end, desc("LSP toggle inlay [h]ints")) - end - end, -}) diff --git a/modules/home-manager/cli/neovim/files/plugins/gitsign.lua b/modules/home-manager/cli/neovim/files/plugins/luasnip.lua similarity index 100% rename from modules/home-manager/cli/neovim/files/plugins/gitsign.lua rename to modules/home-manager/cli/neovim/files/plugins/luasnip.lua diff --git a/modules/home-manager/cli/neovim/files/plugins/neotree.lua b/modules/home-manager/cli/neovim/files/plugins/neotree.lua index 27d8aff..d1fd640 100644 --- a/modules/home-manager/cli/neovim/files/plugins/neotree.lua +++ b/modules/home-manager/cli/neovim/files/plugins/neotree.lua @@ -18,8 +18,3 @@ neotree.setup({ }, } }) - -vim.keymap.set('n', 'nc', ':Neotree close', {desc='Neotree [c]lose'}) -vim.keymap.set('n', 'nf', ':Neotree focus filesystem', {desc='Neotree [f]ocus'}) -vim.keymap.set('n', 'nb', ':Neotree focus buffers', {desc='Neotree Nvim [b]uffers'}) -vim.keymap.set('n', 'ng', ':Neotree focus git_status', {desc='Neotree [g]it status'}) diff --git a/modules/home-manager/cli/neovim/files/plugins/nvim-k8s-lsp.lua b/modules/home-manager/cli/neovim/files/plugins/nvim-k8s-lsp.lua index 400c8a1..a2176c6 100644 --- a/modules/home-manager/cli/neovim/files/plugins/nvim-k8s-lsp.lua +++ b/modules/home-manager/cli/neovim/files/plugins/nvim-k8s-lsp.lua @@ -1,6 +1,6 @@ require("nvim-k8s-lsp").setup({ - kubernetes_version = "v1.32.8", + kubernetes_version = "v1.32.2", integrations = { - lualine = true, + lualine = false, } }) diff --git a/modules/home-manager/desktop/sway/default.nix b/modules/home-manager/desktop/sway/default.nix index d8fa2ff..4f53efa 100644 --- a/modules/home-manager/desktop/sway/default.nix +++ b/modules/home-manager/desktop/sway/default.nix @@ -46,24 +46,6 @@ in }; }; - iconTheme = mkOption { - type = types.package; - default = pkgs.papirus-icon-theme; - description = ''Icon theme package to use''; - }; - - iconThemeName = mkOption { - type = types.str; - default = "Papirus Dark"; - description = ''Icon theme variant to use''; - }; - - iconThemePathname = mkOption { - type = types.str; - default = "Papirus-Dark"; - description = ''Icon theme variant to use''; - }; - waybar = { laptop = mkOption { type = types.bool; @@ -74,8 +56,8 @@ in cpuThermal = { thermalZone = mkOption { - type = types.int or null; - default = null; + type = types.str; + default = ""; description = "CPU thermal hwmon thermal Zone"; }; @@ -125,8 +107,6 @@ in # emojione font-awesome grim - hicolor-icon-theme - jq lato liberation_ttf libertine @@ -137,7 +117,6 @@ in noto-fonts-cjk-sans slurp wl-clipboard - wl-screenrec xdg-utils ]; @@ -154,8 +133,8 @@ in package = pkgs.arc-theme; }; iconTheme = { - name = cfg.iconThemeName; - package = cfg.iconTheme; + name = "Papirus Dark"; + package = pkgs.papirus-icon-theme; }; font = { name = "Deja Vu Sans"; @@ -207,7 +186,7 @@ in xdg-desktop-portal-wlr xdg-desktop-portal-gtk ]; - xdgOpenUsePortal = false; + xdgOpenUsePortal = true; config = { sway = { default = [ diff --git a/modules/home-manager/desktop/sway/includes/files/screencapt.sh b/modules/home-manager/desktop/sway/includes/files/screencapt.sh deleted file mode 100755 index 353218d..0000000 --- a/modules/home-manager/desktop/sway/includes/files/screencapt.sh +++ /dev/null @@ -1,161 +0,0 @@ -#!/usr/bin/env bash -set -eu -o pipefail - -APP_NAME="ScreenCapt" - -declare -A COMMAND -COMMAND=( - [screenshot]="grim" - [video]="wl-screenrec" -) -declare -A ICONS -ICONS=( - ["screenshot"]="accessories-screenshot" - ["video"]="record-desktop" -) - -declare -A OUTPUT_DIR -OUTPUT_DIR=( - ["screenshot"]="${XDG_PICTURES_DIR:-"~/pictures"}/screenshots" - ["video"]="${XDG_VIDEOS_DIR:="~/videos"}/screenrecords" -) - -declare -A OUTPUT_FILE_EXT -OUTPUT_FILE_EXT=( - ["screenshot"]="png" - ["video"]="mp4" -) - -TO_FILE=0 -RECORD_AUDIO=0 -ACTION="screenshot" -REGION_TYPE="window" - -notify() { - local summary message command - filename="${1:-""}" - summary="New ${ACTION}!" - if [[ $TO_FILE -eq 1 ]]; then - message+="Available in ${filename##*/}" - else - message+="Available in the clipboard" - fi - command=(notify-send "${summary}" --app-name="$APP_NAME") - if [[ -n "$filename" && "$ACTION" == "screenshot" ]]; then - command+=(--icon="${filename}") - else - command+=("--icon=${ICONS[$ACTION]}") - fi - command+=("$message") - "${command[@]}" -} - -process_args() { - while :; do - case ''${1:-""} in - screenshot) - ACTION="$1" - ;; - - video) - # If a video record is in progress Stop it - if pgrep "wl-screenrec"; then - kill -s SIGINT $(pgrep "wl-screenrec") - exit 0 - fi - TO_FILE=1 - ACTION="$1" - ;; - -r | --region) - if [[ "${2:-""}" =~ ^(r|region|s|screen|w|window)$ ]]; then - REGION_TYPE="$2" - else - exit 1 - fi - shift - ;; - -f | --file) - TO_FILE=1 - ;; - -a | --with-audio) - RECORD_AUDIO=1 - ;; - *) - break - ;; - esac - shift - done -} - -get_app_name() { - local appname - case "$REGION_TYPE" in - r | region) - appname="region" - ;; - s | screen) - appname="screen" - ;; - w | window) - appname=$(swaymsg -t get_tree | jq -r '.. | ((.nodes? // empty) + (.floating_nodes? // empty))[] | select(.visible and .pid and .focused) | "\(.app_id)"') - ;; - esac - printf "%s" "${appname:-}" -} - -get_region() { - local region switch - case "$REGION_TYPE" in - r | region) - region=$(slurp) - switch="-g" - ;; - s | screen) - region=$(swaymsg -t get_outputs | jq -r '.[] | select(.focused) | "\(.name)"') - switch="-o" - ;; - w | window) - region=$(swaymsg -t get_tree | jq -r '.. | ((.nodes? // empty) + (.floating_nodes? // empty))[] | select(.visible and .pid and .focused) | .rect | "\(.x),\(.y) \(.width)x\(.height)"') - switch="-g" - ;; - esac - printf "%s%s" "${switch:-}" "${region:-}" -} - -get_output_filename() { - local date - printf -v date '%(%F_%H.%M.%S)T' - printf "%s/%s-%s.%s" "${OUTPUT_DIR[$ACTION]}" "$date" "$(get_app_name)" "${OUTPUT_FILE_EXT[$ACTION]}" -} - -ensure_directories_exist() { - for dir in "${!OUTPUT_DIR[@]}"; do - mkdir -p "${OUTPUT_DIR[$dir]}" - done -} - -main() { - process_args "$@" - ensure_directories_exist - local command - command=("${COMMAND[$ACTION]}" "$(get_region)") - if [[ "$TO_FILE" -eq 1 ]]; then - local filename - filename=$(get_output_filename) - if [[ "$ACTION" = "video" ]]; then - if [[ "$RECORD_AUDIO" -eq 1 ]]; then - command+=(--audio) - fi - command+=(-f) - fi - command+=("$filename") - "${command[@]}" - else - "${command[@]}" - | wl-copy - fi - notify "${filename:-""}" - exit 0 -} - -main "$@" diff --git a/modules/home-manager/desktop/sway/includes/files/waybar-style.css b/modules/home-manager/desktop/sway/includes/files/waybar-style.css deleted file mode 100644 index d1dd1a2..0000000 --- a/modules/home-manager/desktop/sway/includes/files/waybar-style.css +++ /dev/null @@ -1,134 +0,0 @@ -@define-color color-base-bg #323232; -@define-color color-base-fg #ddd; - -@define-color color-hover #f268b3; -@define-color color-selected #1cd180; - -@define-color color-ok #1cd180; -@define-color color-warning #f2b768; -@define-color color-critical #f268b3; - -* { - border: none; - border-radius: 0; - min-height:0; -} - -window#waybar { - background: @color-base-bg ; - color: @color-base-fg; - font-family: "Fira Code Nerd Font"; - font-size: 12px; -} - -button, -button:disabled,label:disabled{ - color:inherit; -} - -button:hover{ - background:none; - box-shadow:inherit; - box-shadow:inherit; - text-shadow:inherit; - text-shadow:inherit; - border-top:none; -} -#workspaces { - color:#fff; -} -#workspaces button { - margin:0 3px; - padding:4px 4px; - color:#9c9c9c; - border-bottom: 1px solid transparent; -} - -#workspaces button:hover { - box-shadow:inherit; - text-shadow:inherit; - color: @color-hover; - border-bottom: 1px solid @color-hover; -} - -#workspaces button.focused { - background: @color-selected; - color: @color-base-bg; -} -#workspaces button.visible:not(.focused) { - color: @color-selected; - border-color: @color-selected; -} - -#clock, -#cpu, -#memory, -#backlight, -#network, -#tray, -#mode, -#battery, -#idle_inhibitor { - padding: 2px 4px; - margin: 0; - background-color: transparent; -} - -#mode{ - background:@color-warning; - color: @color-base-bg; - font-weight:200; - font-variant: small-caps; - font-size: 16px; -} -#pulseaudio {} -#pulseaudio.output.muted { - color:@color-critical; -} -#pulseaudio.input.source-muted { - color:@color-critical; -} - -#battery.discharging { - color: @color-base-fg; - border-bottom: none; -} - -#battery.charging, #battery.plugged { - border-bottom: 1px solid @color-ok; - color: @color-selected; -} - -#battery.critical:not(.charging), -#cpu.critical, -#memory.critical, -#temperature.critical{ - border-color: @color-critical; - color: @color-critical; -} - -#battery.warning:not(.charging), -#cpu.warning, -#memory.warning{ - border-color: @color-warning; - color: @color-warning; -} - -#tray { - font-family: "DejaVu sans"; - font-size: 12px; -} -#custom-screenrecord { - color: @color-critical; - border-bottom: 1px solid @color-critical; - animation-name: critical-animation; - animation-duration: 2s; - animation-timing-function: ease-in-out; - animation-direction: alternate; - animation-iteration-count: infinite; -} - -@keyframes critical-animation { - from {color: @color-critical;} - to {color: white;} -} diff --git a/modules/home-manager/desktop/sway/includes/mako.nix b/modules/home-manager/desktop/sway/includes/mako.nix index b098010..3b8d3df 100644 --- a/modules/home-manager/desktop/sway/includes/mako.nix +++ b/modules/home-manager/desktop/sway/includes/mako.nix @@ -1,8 +1,5 @@ { config, pkgs, lib, ... }: with lib; -let - cfg = config.modules.desktop.sway; -in { config = mkIf config.modules.desktop.sway.enable { systemd.user.services.mako = { @@ -27,11 +24,12 @@ in border-radius = 0; border-size = 2; icons = true; - icon-path = "${cfg.iconTheme}/share/icons/${cfg.iconThemePathname}"; max-icon-size = 64; layer = "overlay"; anchor = "top-right"; - format = ''%a\n%s\n%b''; + format = '' + %a\n%s\n%b + ''; "urgency=high" = { border-color = "#F268b3"; }; diff --git a/modules/home-manager/desktop/sway/includes/sway.nix b/modules/home-manager/desktop/sway/includes/sway.nix index 4f0874c..f93d2c6 100644 --- a/modules/home-manager/desktop/sway/includes/sway.nix +++ b/modules/home-manager/desktop/sway/includes/sway.nix @@ -87,12 +87,8 @@ in "${mod}+Shift+space" = "floating toggle"; "${mod}+space" = "focus mode_toggle"; "${mod}+a" = "focus parent"; - "${mod}+Shift+minus" = "move scratchpad"; - "${mod}+minus" = "scratchpad show"; - "${mod}+p" = "exec screencapt --region window"; - "${mod}+Shift+p" = "exec screencapt --region screen"; - "${mod}+Alt+p" = "mode screenshot"; - "${mod}+Alt+r" = "mode screenrecord"; + "${mod}+Shift+p" = "move scratchpad"; + "${mod}+p" = "scratchpad show"; # Media stuff "${mod}+F1" = "exec ${pkgs.brightnessctl}/bin/brightnessctl s 1%-"; "${mod}+F2" = "exec ${pkgs.brightnessctl}/bin/brightnessctl s +1%"; @@ -122,27 +118,6 @@ in "r" = "exec ${pkgs.mako}/bin/makoctl restore"; "Escape" = "mode default"; }; - "screenshot" = { - "s" = "exec screencapt --region screen; mode default"; - "Shift+s" = "exec screencapt --region screen -f; mode default"; - "r" = "exec screencapt --region region; mode default"; - "Shift+r" = "exec screencapt --region region -f; mode default"; - "w" = "exec screencapt --region window; mode default"; - "Shift+w" = "exec screencapt --region window -f; mode default"; - "Return" = "mode default"; - "Escape" = "mode default"; - }; - "screenrecord" = { - "s" = "exec screencapt video --region screen; mode default"; - "Shift+s" = "exec screencapt --region video screen -a; mde default"; - "r" = "exec screencapt video --region region; mode default"; - "Shift+r" = "exec screencapt video --region region -a; mode default"; - "w" = "exec screencapt video --region window -f ; mode default"; - "Shift+w" = "exec screencapt --region video window -a; mode default"; - "Return" = "mode default"; - "Escape" = "mode default"; - }; - }; colors = { focused = { @@ -239,9 +214,5 @@ in title_align right ''; }; - home.file.".local/bin/screencapt" = { - executable = true; - source = ./files/screencapt.sh; - }; }; } diff --git a/modules/home-manager/desktop/sway/includes/waybar.nix b/modules/home-manager/desktop/sway/includes/waybar.nix index 3f74082..d46baf1 100644 --- a/modules/home-manager/desktop/sway/includes/waybar.nix +++ b/modules/home-manager/desktop/sway/includes/waybar.nix @@ -1,4 +1,4 @@ -{lib, config, pkgs, ...}: +{lib, config, ...}: with lib; let cfg = config.modules.desktop.sway; @@ -16,9 +16,7 @@ in layer = "top"; spacing = 6; disable-toolptips = true; - modules-center = [ - "custom/screenrecord" - ]; + modules-center = []; modules-left = [ "sway/workspaces" "sway/mode" @@ -50,12 +48,10 @@ in ] ) ++ [ - "pulseaudio#input" - "pulseaudio#output" + "pulseaudio" "custom/sep" "clock" "custom/sep" - "privacy" "tray" ]; "clock" = { @@ -76,14 +72,6 @@ in "format" = "|"; "tooltip" = false; }; - "custom/screenrecord" = { - "format" = "  [rec.] "; - "interval" = 1; - "exec" = "echo '{\"class\": \"recording\"}'"; - "exec-if" = "${pkgs.procps}/bin/pgrep wl-screenrec"; - "on-click" = "exec ${pkgs.coreutils}/bin/kill -s SIGINT $(${pkgs.procps}/bin/pgrep wl-screenrec)"; - "tooltype" = false; - }; "idle_inhibitor" = { "format" = "{icon}"; "format-icons" = { @@ -92,7 +80,7 @@ in }; }; "memory" = { - "format" = "{used:0.0f}/{total:0.0f}G "; + "format" = "{used:0.1f}G/{total:0.1f}G "; "interval" = 30; "states" = { "critical" = 90; @@ -100,51 +88,27 @@ in }; }; "network" = { - "format-alt" = "{ifname}: {essid} {ipaddr}/{cidr} 󰈀 "; + "format-alt" = "{ifname}: {ipaddr}/{cidr}"; "format-disconnected" = "Disconnected ⚠ "; - "format-ethernet" = "{ifname} 󰈀 "; + "format-ethernet" = "{ifname}: {ipaddr}/{cidr} 󰈀 "; "format-linked" = "{ifname} (No IP) 󰈀 "; - "format-wifi" = "{signalStrength}%  "; + "format-wifi" = "{essid} ({signalStrength}%)  "; "tooltip" = false; }; - "privacy"= { - "icon-spacing" = 6; - "icon-size" = 11; - "transition-duration" = 250; - "modules"= [ - { - "type" = "screenshare"; - "tooltip" = false; - } - { - "type" = "audio-out"; - "tooltip" = false; - } - { - "type" = "audio-in"; - "tooltip" = false; - } - ]; - "ignore-monitor" = true; - }; - "pulseaudio#output" = { - "format" = "{volume}% {icon} "; + "pulseaudio" = { + "format" = "{format_source} {volume}% {icon} "; "format-bluetooth" = "{volume}% {icon}"; "format-icons" = { "car" = ""; - "default" = "󰕾"; + "default" = ""; "hands-free" = "󰋎"; "headphone" = "󰋋"; "headset" = "󰋎"; "phone" = ""; "portable" = ""; }; - "format-muted" = "󰖁 "; - "tooltip" = false; - }; - "pulseaudio#input" = { - "format" = "{format_source} "; - "format-source" = "{volume}% "; + "format-muted" = "{format_source} 󰝟 "; + "format-source" = "{volume}%  "; "format-source-muted" = " "; "tooltip" = false; }; @@ -156,7 +120,7 @@ in }; "temperature" = { "critical-threshold" = 80; - "format" = " {temperatureC}°C  "; + "format" = "{temperatureC}°C  "; "thermal-zone" = mkIf ( cfg.waybar.cpuThermal.thermalZone != "" ) "${cfg.waybar.cpuThermal.thermalZone}"; "hwmon-path-abs" = mkIf ( cfg.waybar.cpuThermal.hwmonPathAbs != "" ) @@ -206,7 +170,121 @@ in }; }; }; - style = builtins.readFile ./files/waybar-style.css; + style = '' + @define-color color-base-bg #323232; + @define-color color-base-fg #ddd; + + @define-color color-hover #f268b3; + @define-color color-selected #1cd180; + + @define-color color-ok #1cd180; + @define-color color-warning #f2b768; + @define-color color-critical #f268b3; + + * { + border: none; + border-radius: 0; + min-height:0; + } + + window#waybar { + background: @color-base-bg ; + color: @color-base-fg; + font-family: "Fira Code Nerd Font"; + font-size: 12px; + } + + button, + button:disabled,label:disabled{ + color:inherit; + } + + button:hover{ + background:none; + box-shadow:inherit; + box-shadow:inherit; + text-shadow:inherit; + text-shadow:inherit; + border-top:none; + } + #workspaces { + color:#fff; + } + #workspaces button { + margin:0 3px; + padding:4px 4px; + color:#9c9c9c; + border-bottom: 1px solid transparent; + } + + #workspaces button:hover { + box-shadow:inherit; + text-shadow:inherit; + color: @color-hover; + border-bottom: 1px solid @color-hover; + } + + #workspaces button.focused { + background: @color-selected; + color: @color-base-bg; + } + #workspaces button.visible:not(.focused) { + color: @color-selected; + border-color: @color-selected; + } + + #clock, + #cpu, + #memory, + #backlight, + #network, + #tray, + #mode, + #battery, + #idle_inhibitor { + padding: 2px 4px; + margin: 0; + background-color: transparent; + } + + #mode{ + background:@color-warning; + font-weight:bold; + } + #pulseaudio {} + #pulseaudio.muted { + color:@color-critical; + } + + #battery.discharging { + color: @color-base-fg; + border-bottom: none; + } + + #battery.charging, #battery.plugged { + border-bottom: 1px solid @color-ok; + color: @color-selected; + } + + #battery.critical:not(.charging), + #cpu.critical, + #memory.critical{ + border-color: @color-critical; + color: @color-critical; + } + + #battery.warning:not(.charging), + #cpu.warning, + #memory.warning{ + border-color: @color-warning; + color: @color-warning; + } + + #tray { + font-family: "DejaVu sans"; + font-size: 12px; + } + ''; }; }; }