Compare commits
19 commits
ef733f10a3
...
710e8f6395
Author | SHA1 | Date | |
---|---|---|---|
710e8f6395 | |||
64c6149fde | |||
7c8685e7da | |||
7994ecd86c | |||
c155aa783d | |||
6000d5951b | |||
2570f25e11 | |||
0116c861bd | |||
d556ad85e4 | |||
a3b08d0a40 | |||
d732e1bda2 | |||
79d55b304c | |||
ed79106342 | |||
0fc804a42d | |||
2dca1fb254 | |||
38267e6530 | |||
8e5ac13e94 | |||
cc2a158732 | |||
c66ff4d68b |
17 changed files with 517 additions and 202 deletions
|
@ -1,7 +1,10 @@
|
|||
{ ... }: {
|
||||
{ inputs, ... }: {
|
||||
config.modules = {
|
||||
application = {
|
||||
gnupg.enable = true;
|
||||
gnupg = {
|
||||
enable = true;
|
||||
enableSshSupport = true;
|
||||
};
|
||||
zathura.enable = true;
|
||||
foot.enable = true;
|
||||
};
|
||||
|
@ -11,7 +14,10 @@
|
|||
git.enable = true;
|
||||
neovim.enable = true;
|
||||
starship.enable = true;
|
||||
tmux.enable = true;
|
||||
tmux = {
|
||||
enable = true;
|
||||
extraConfig = inputs.nix-private.tmux.personal;
|
||||
};
|
||||
utils.enable = true;
|
||||
vifm.enable = true;
|
||||
zsh.enable = true;
|
||||
|
|
|
@ -38,8 +38,7 @@
|
|||
laptop = true;
|
||||
gpuThermal.enable = false;
|
||||
cpuThermal = {
|
||||
hwmonPathAbs = "/sys/devices/platform/coretemp.0/hwmon/";
|
||||
inputFilename = "temp1_input";
|
||||
thermalZone = 9;
|
||||
};
|
||||
};
|
||||
xdg.useDistributionPortals = true;
|
||||
|
|
|
@ -46,12 +46,6 @@ 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;
|
||||
|
|
|
@ -65,7 +65,7 @@ in
|
|||
python3Packages.python-lsp-server
|
||||
shellcheck
|
||||
|
||||
terraform-lsp
|
||||
tofu-ls
|
||||
tflint
|
||||
vscode-langservers-extracted
|
||||
yaml-language-server
|
||||
|
@ -120,7 +120,7 @@ in
|
|||
{
|
||||
plugin = gitsigns-nvim;
|
||||
type = "lua";
|
||||
config = (builtins.readFile ./files/plugins/luasnip.lua);
|
||||
config = (builtins.readFile ./files/plugins/gitsign.lua);
|
||||
}
|
||||
{
|
||||
plugin = indent-blankline-nvim;
|
||||
|
@ -205,7 +205,10 @@ in
|
|||
type = "lua";
|
||||
config = ( builtins.readFile ./files/plugins/nvim-k8s-lsp.lua );
|
||||
}
|
||||
vim-helm
|
||||
{
|
||||
plugin = helm-ls-nvim;
|
||||
type = "lua";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1,6 +1,15 @@
|
|||
local opts = { noremap = true, silent = true}
|
||||
|
||||
vim.api.nvim_set_keymap('n', '<leader>/', ':nohlsearch<CR>', opts)
|
||||
vim.api.nvim_set_keymap('n', '<leader>l', ':set list!<CR>', {silent = true})
|
||||
|
||||
-- clear search
|
||||
vim.keymap.set('n', '<leader>l', ':nohlsearch<CR>', { desc = 'Clear search', remap = true, silent = true })
|
||||
|
||||
-- Move tabs with \[ and \]
|
||||
vim.api.nvim_set_keymap('n', '<Leader>]', ':tabnext<CR>', opts)
|
||||
vim.api.nvim_set_keymap('n', '<Leader>[', ':tabprev<CR>', opts)
|
||||
|
||||
-- Switch between windows.
|
||||
vim.keymap.set('n', '<C-h>', '<C-w>h', { desc = 'Move to the left window', remap = true })
|
||||
vim.keymap.set('n', '<C-j>', '<C-w>j', { desc = 'Move to the bottom window', remap = true })
|
||||
|
@ -19,31 +28,3 @@ vim.keymap.set('n', '<Leader>tn', ':tabnew<CR>', { desc = "Tab [n]ew", remap = t
|
|||
|
||||
-- Show all caracters
|
||||
vim.keymap.set('n', '<leader>l', ':set list!<CR>', { desc = "Show a[l]l caraters", remap = true, silent = true})
|
||||
|
||||
-- neotree
|
||||
-- -------
|
||||
vim.keymap.set('n', '<leader>nc', ':Neotree close<cr>', {desc='Neotree [c]lose'})
|
||||
vim.keymap.set('n', '<leader>nf', ':Neotree focus filesystem<cr>', {desc='Neotree [f]ocus'})
|
||||
vim.keymap.set('n', '<leader>nb', ':Neotree focus buffers<cr>', {desc='Neotree Nvim [b]uffers'})
|
||||
vim.keymap.set('n', '<leader>ng', ':Neotree focus git_status<cr>', {desc='Neotree [g]it status'})
|
||||
|
||||
-- fzf-lua
|
||||
-- ------
|
||||
vim.keymap.set('n', '<leader>fb', function() require('fzf-lua').buffers() end, {desc='open [b]uffers'})
|
||||
vim.keymap.set('n', '<leader>ff', function() require('fzf-lua').files() end, {desc='[r]esume last command'})
|
||||
vim.keymap.set('n', '<leader>fr', function() require('fzf-lua').files() end, {desc='[f]iles'})
|
||||
|
||||
-- git related keymaps
|
||||
vim.keymap.set('n', '<leader>fgb', function() require('fzf-lua').git_branches() end, {desc='Git [b]ranches'})
|
||||
vim.keymap.set('n', '<leader>fgc', function() require('fzf-lua').git_commits() end, {desc='Git [c]ommits'})
|
||||
vim.keymap.set('n', '<leader>fgC', function() require('fzf-lua').git_bcommits() end, {desc='Git current buffer [C]ommits'})
|
||||
vim.keymap.set('n', '<leader>fgf', function() require('fzf-lua').git_files() end, {desc='Git [f]iles'})
|
||||
vim.keymap.set('n', '<leader>fgs', function() require('fzf-lua').git_stash() end, {desc='Git [s]tash'})
|
||||
vim.keymap.set('n', '<leader>fgS', function() require('fzf-lua').git_status() end, {desc='Git [S]tash'})
|
||||
|
||||
-- grep related keymaps
|
||||
vim.keymap.set('n', '<leader>fGb', function() require('fzf-lua').grep_curbuf() end, {desc='grep in current [b]uffer'})
|
||||
vim.keymap.set('n', '<leader>fGc', function() require('fzf-lua').grep_cword() end, {desc='grep word under the [c]ursor'})
|
||||
vim.keymap.set('n', '<leader>fGg', function() require('fzf-lua').grep() end, {desc='[g]rep'})
|
||||
vim.keymap.set('n', '<leader>fGl', function() require('fzf-lua').live_grep() end, {desc='[l]ive grep'})
|
||||
vim.keymap.set('n', '<leader>fGr', function() require('fzf-lua').grep_last() end, {desc='[r]erun last grep'})
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
return {
|
||||
cmd = { 'helm_ls', 'serve' },
|
||||
filetypes = { 'helm' },
|
||||
root_markers = { 'Chart.yaml' },
|
||||
filetypes = { 'helm', 'yaml.helm-values' },
|
||||
single_file_support = true,
|
||||
root_markers = { 'values.yaml', 'Chart.yaml' },
|
||||
capabilities = {
|
||||
workspace = {
|
||||
didChangeWatchedFiles = {
|
||||
|
@ -18,9 +19,7 @@ return {
|
|||
showdiagnosticsdirectly = false,
|
||||
path = "yaml-language-server",
|
||||
config = {
|
||||
schemas = {
|
||||
kubernetes = "template/**",
|
||||
},
|
||||
schemas = {},
|
||||
completion = true,
|
||||
hover = true,
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
return {
|
||||
cmd = { 'terraform-ls', 'serve' },
|
||||
cmd = { 'tofu-ls', 'serve' },
|
||||
filetypes = { 'terraform', 'terraform-vars' },
|
||||
root_markers = { '.terraform', '.git' },
|
||||
}
|
|
@ -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,24 +103,13 @@ vim.opt.wildignore = {
|
|||
'*.sw?'
|
||||
}
|
||||
|
||||
-- Key biding
|
||||
-- " ----------
|
||||
local opts = { noremap = true, silent = true}
|
||||
|
||||
vim.api.nvim_set_keymap('n', '<leader>/', ':nohlsearch<CR>', opts)
|
||||
|
||||
-- Move tabs with \[ and \]
|
||||
vim.api.nvim_set_keymap('n', '<Leader>]', ':tabnext<CR>', opts)
|
||||
vim.api.nvim_set_keymap('n', '<Leader>[', ':tabprev<CR>', opts)
|
||||
vim.api.nvim_set_keymap('n', '<leader>l', ':set list!<CR>', {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 = 2
|
||||
vim.g.matchparen_insert_timeout = 2
|
||||
vim.g.matchparen_timeout = 10
|
||||
vim.g.matchparen_insert_timeout = 10
|
||||
|
||||
-- activate virtual lines for diagnistics
|
||||
-- no more plugins needed
|
||||
|
@ -134,3 +123,73 @@ 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",
|
||||
"<C-k>",
|
||||
function()
|
||||
vim.lsp.buf.signature_help
|
||||
{ border = "rounded", max_width = 250 }
|
||||
end,
|
||||
{buffer = ev.buf, desc = "Signature help"}
|
||||
)
|
||||
|
||||
vim.keymap.set("n", "<leader>wa", vim.lsp.buf.add_workspace_folder, opts)
|
||||
vim.keymap.set("n", "<leader>wr", vim.lsp.buf.remove_workspace_folder, opts)
|
||||
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<leader>wl",
|
||||
function()
|
||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||
end,
|
||||
opts
|
||||
)
|
||||
|
||||
vim.keymap.set("n", "<leader>D", vim.lsp.buf.type_definition, { buffer = ev.buf, desc = "Type [D]efinition" })
|
||||
vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, { buffer = ev.buf, desc = "LSP [r]e[n]ame" })
|
||||
vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, { buffer = ev.buf, desc = "Show [c]ode [a]ction"})
|
||||
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<leader>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", "<space>h", function()
|
||||
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled())
|
||||
end, desc("LSP toggle inlay [h]ints"))
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
|
|
@ -18,3 +18,8 @@ neotree.setup({
|
|||
},
|
||||
}
|
||||
})
|
||||
|
||||
vim.keymap.set('n', '<leader>nc', ':Neotree close<cr>', {desc='Neotree [c]lose'})
|
||||
vim.keymap.set('n', '<leader>nf', ':Neotree focus filesystem<cr>', {desc='Neotree [f]ocus'})
|
||||
vim.keymap.set('n', '<leader>nb', ':Neotree focus buffers<cr>', {desc='Neotree Nvim [b]uffers'})
|
||||
vim.keymap.set('n', '<leader>ng', ':Neotree focus git_status<cr>', {desc='Neotree [g]it status'})
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require("nvim-k8s-lsp").setup({
|
||||
kubernetes_version = "v1.32.2",
|
||||
kubernetes_version = "v1.32.8",
|
||||
integrations = {
|
||||
lualine = false,
|
||||
lualine = true,
|
||||
}
|
||||
})
|
||||
|
|
|
@ -46,6 +46,24 @@ 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;
|
||||
|
@ -56,8 +74,8 @@ in
|
|||
cpuThermal = {
|
||||
|
||||
thermalZone = mkOption {
|
||||
type = types.str;
|
||||
default = "";
|
||||
type = types.int or null;
|
||||
default = null;
|
||||
description = "CPU thermal hwmon thermal Zone";
|
||||
};
|
||||
|
||||
|
@ -107,6 +125,8 @@ in
|
|||
# emojione
|
||||
font-awesome
|
||||
grim
|
||||
hicolor-icon-theme
|
||||
jq
|
||||
lato
|
||||
liberation_ttf
|
||||
libertine
|
||||
|
@ -117,6 +137,7 @@ in
|
|||
noto-fonts-cjk-sans
|
||||
slurp
|
||||
wl-clipboard
|
||||
wl-screenrec
|
||||
xdg-utils
|
||||
];
|
||||
|
||||
|
@ -133,8 +154,8 @@ in
|
|||
package = pkgs.arc-theme;
|
||||
};
|
||||
iconTheme = {
|
||||
name = "Papirus Dark";
|
||||
package = pkgs.papirus-icon-theme;
|
||||
name = cfg.iconThemeName;
|
||||
package = cfg.iconTheme;
|
||||
};
|
||||
font = {
|
||||
name = "Deja Vu Sans";
|
||||
|
@ -186,7 +207,7 @@ in
|
|||
xdg-desktop-portal-wlr
|
||||
xdg-desktop-portal-gtk
|
||||
];
|
||||
xdgOpenUsePortal = true;
|
||||
xdgOpenUsePortal = false;
|
||||
config = {
|
||||
sway = {
|
||||
default = [
|
||||
|
|
161
modules/home-manager/desktop/sway/includes/files/screencapt.sh
Executable file
161
modules/home-manager/desktop/sway/includes/files/screencapt.sh
Executable file
|
@ -0,0 +1,161 @@
|
|||
#!/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 <i>${filename##*/}</i>"
|
||||
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 "$@"
|
|
@ -0,0 +1,134 @@
|
|||
@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;}
|
||||
}
|
|
@ -1,5 +1,8 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.desktop.sway;
|
||||
in
|
||||
{
|
||||
config = mkIf config.modules.desktop.sway.enable {
|
||||
systemd.user.services.mako = {
|
||||
|
@ -24,12 +27,11 @@ with lib;
|
|||
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 = ''
|
||||
<span font_scale='small-caps'>%a</span>\n<b>%s</b>\n%b
|
||||
'';
|
||||
format = ''<span font_scale='small-caps'>%a</span>\n<b>%s</b>\n%b'';
|
||||
"urgency=high" = {
|
||||
border-color = "#F268b3";
|
||||
};
|
||||
|
|
|
@ -87,8 +87,12 @@ in
|
|||
"${mod}+Shift+space" = "floating toggle";
|
||||
"${mod}+space" = "focus mode_toggle";
|
||||
"${mod}+a" = "focus parent";
|
||||
"${mod}+Shift+p" = "move scratchpad";
|
||||
"${mod}+p" = "scratchpad show";
|
||||
"${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";
|
||||
# Media stuff
|
||||
"${mod}+F1" = "exec ${pkgs.brightnessctl}/bin/brightnessctl s 1%-";
|
||||
"${mod}+F2" = "exec ${pkgs.brightnessctl}/bin/brightnessctl s +1%";
|
||||
|
@ -118,6 +122,27 @@ 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 = {
|
||||
|
@ -214,5 +239,9 @@ in
|
|||
title_align right
|
||||
'';
|
||||
};
|
||||
home.file.".local/bin/screencapt" = {
|
||||
executable = true;
|
||||
source = ./files/screencapt.sh;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{lib, config, ...}:
|
||||
{lib, config, pkgs, ...}:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.desktop.sway;
|
||||
|
@ -16,7 +16,9 @@ in
|
|||
layer = "top";
|
||||
spacing = 6;
|
||||
disable-toolptips = true;
|
||||
modules-center = [];
|
||||
modules-center = [
|
||||
"custom/screenrecord"
|
||||
];
|
||||
modules-left = [
|
||||
"sway/workspaces"
|
||||
"sway/mode"
|
||||
|
@ -48,10 +50,12 @@ in
|
|||
]
|
||||
) ++
|
||||
[
|
||||
"pulseaudio"
|
||||
"pulseaudio#input"
|
||||
"pulseaudio#output"
|
||||
"custom/sep"
|
||||
"clock"
|
||||
"custom/sep"
|
||||
"privacy"
|
||||
"tray"
|
||||
];
|
||||
"clock" = {
|
||||
|
@ -72,6 +76,14 @@ 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" = {
|
||||
|
@ -80,7 +92,7 @@ in
|
|||
};
|
||||
};
|
||||
"memory" = {
|
||||
"format" = "{used:0.1f}G/{total:0.1f}G ";
|
||||
"format" = "{used:0.0f}/{total:0.0f}G ";
|
||||
"interval" = 30;
|
||||
"states" = {
|
||||
"critical" = 90;
|
||||
|
@ -88,27 +100,51 @@ in
|
|||
};
|
||||
};
|
||||
"network" = {
|
||||
"format-alt" = "{ifname}: {ipaddr}/{cidr}";
|
||||
"format-alt" = "{ifname}: {essid} {ipaddr}/{cidr} ";
|
||||
"format-disconnected" = "Disconnected ⚠ ";
|
||||
"format-ethernet" = "{ifname}: {ipaddr}/{cidr} ";
|
||||
"format-ethernet" = "{ifname} ";
|
||||
"format-linked" = "{ifname} (No IP) ";
|
||||
"format-wifi" = "{essid} ({signalStrength}%) ";
|
||||
"format-wifi" = "{signalStrength}% ";
|
||||
"tooltip" = false;
|
||||
};
|
||||
"pulseaudio" = {
|
||||
"format" = "{format_source} {volume}% {icon} ";
|
||||
"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} ";
|
||||
"format-bluetooth" = "{volume}% {icon}";
|
||||
"format-icons" = {
|
||||
"car" = "";
|
||||
"default" = "";
|
||||
"default" = "";
|
||||
"hands-free" = "";
|
||||
"headphone" = "";
|
||||
"headset" = "";
|
||||
"phone" = "";
|
||||
"portable" = "";
|
||||
};
|
||||
"format-muted" = "{format_source} ";
|
||||
"format-source" = "{volume}% ";
|
||||
"format-muted" = " ";
|
||||
"tooltip" = false;
|
||||
};
|
||||
"pulseaudio#input" = {
|
||||
"format" = "{format_source} ";
|
||||
"format-source" = "{volume}% ";
|
||||
"format-source-muted" = " ";
|
||||
"tooltip" = false;
|
||||
};
|
||||
|
@ -120,7 +156,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 != "" )
|
||||
|
@ -170,121 +206,7 @@ in
|
|||
};
|
||||
};
|
||||
};
|
||||
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;
|
||||
}
|
||||
'';
|
||||
style = builtins.readFile ./files/waybar-style.css;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue