fix swaylock, update waybar, add noto-fonts-cjk-serif

This commit is contained in:
chayleaf 2023-02-21 03:19:39 +07:00
parent e11b6598df
commit f33c647d6e
5 changed files with 28 additions and 24 deletions

View file

@ -147,6 +147,7 @@
};
# profiles = {};
package = pkgs.wrapMpv (pkgs.mpv-unwrapped.override {
# webp support
ffmpeg_5 = pkgs.ffmpeg_5-full;
}) {
scripts =
@ -284,7 +285,8 @@
# cli tools
imagemagick ffmpeg_5-full
# fonts
noto-fonts noto-fonts-cjk noto-fonts-emoji
noto-fonts noto-fonts-cjk-sans noto-fonts-cjk-serif
noto-fonts-emoji noto-fonts-extra
(nerdfonts.override { fonts = [ "NerdFontsSymbolsOnly" ]; })
# might check out some day (tm)
# nyxt qutebrowser

View file

@ -310,12 +310,16 @@ in
export XDG_CURRENT_DESKTOP=sway
export XDG_SESSION_DESKTOP=sway
# TODO: set to sdl3 compat when SDL3 releases
export SDL_DYNAMIC_API=${pkgs.SDL2.out}/lib/libSDL2.so
# this is for steam games, I set the launch options to:
# `SDL_DYNAMIC_API=$SDL2_DYNAMIC_API %command%`
# Steam itself doesn't work with SDL_DYNAMIC_API set, so it's
# a bad idea to set SDL_DYNAMIC_API globally
export SDL2_DYNAMIC_API=${pkgs.SDL2.out}/lib/libSDL2.so
'';
};
services.swayidle = let swaylock-start = builtins.toString (with pkgs; writeScript "swaylock-start" ''
#! ${bash}/bin/bash
${procps}/bin/pgrep -fx ${swaylock}/bin/swaylock || (${swaylock}/bin/swaylock && ${pkgs.sway}/bin/swaymsg "output * dpms on")
${procps}/bin/pgrep -fx "${swaylock}/bin/swaylock -f" || ${swaylock}/bin/swaylock -f
''); in {
enable = config.wayland.windowManager.sway.enable;
events = [
@ -326,14 +330,8 @@ in
{ timeout = 300;
command = "${pkgs.sway}/bin/swaymsg \"output * dpms off\"";
resumeCommand = "${pkgs.sway}/bin/swaymsg \"output * dpms on\""; }
{ timeout = 598;
command = "${pkgs.sway}/bin/swaymsg \"output * dpms on\""; }
{ timeout = 600;
command = swaylock-start;
resumeCommand = "${pkgs.sway}/bin/swaymsg \"output * dpms on\""; }
{ timeout = 602;
command = "${pkgs.sway}/bin/swaymsg \"output * dpms off\"";
resumeCommand = "${pkgs.sway}/bin/swaymsg \"output * dpms on\""; }
command = swaylock-start; }
];
};
programs.swaylock.settings = rec {

View file

@ -99,7 +99,7 @@
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts)
vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts)
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts)
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, bufopts)
vim.keymap.set('n', '<C-h>', vim.lsp.buf.signature_help, bufopts)
vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, bufopts)
vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, bufopts)
vim.keymap.set('n', '<space>wl', function()

View file

@ -55,15 +55,18 @@ window#waybar.hidden {
}
#clock,
#cpu,
#memory,
#wireplumber,
#battery,
#language,
#tray {
padding: 0 8px;
}
#memory,
#cpu,
#wireplumber,
#language {
padding: 0 3px;
}
#mode,
#workspaces,
#workspaces button
@ -75,8 +78,8 @@ window#waybar.hidden {
}
#window {
padding: 0 3px;
margin: 3px 2px;
padding: 0 0;
margin: 3px 0;
background-color: transparent;
color: @fg;
}

View file

@ -9,8 +9,8 @@
src = pkgs.fetchFromGitHub {
owner = "chayleaf";
repo = "Waybar";
rev = "44984a3990d347af50c09d8492bf3853cd361b96";
sha256 = "sha256-aiMvzB/uMaaQreCQ2T2nl4qFYW0DzMnvknvmdbGhF2c=";
rev = "8c3a5d8044b9de7de445c76b22443939a6870dc4";
sha256 = "sha256-4dRsR6D2KYa3eLojTNAS6UZNnle78yeNbSH2XwjcwlU=";
};
});
settings = [{
@ -23,7 +23,7 @@
tooltip = true;
format = "{player_icon} {dynamic}";
format-paused = "{status_icon} {dynamic}";
interval = 10;
interval = 1;
# tooltip-format = "{dynamic}";
album-len = 32;
artist-len = 32;
@ -73,12 +73,12 @@
modules-right = [ "memory" "cpu" "tray" "wireplumber" "clock" "sway/language" ];
cpu = {
# format = "{usage}% ";
format = "{icon0}{icon1}{icon2}{icon3}{icon4}{icon5}{icon6}{icon7}{icon8}{icon9}{icon10}{icon11}{icon12}{icon13}{icon14}{icon15}";
format = "{icon0}{icon1}{icon2}{icon3}{icon4}{icon5}{icon6}{icon7}{icon8}{icon9}{icon10}{icon11}{icon12}{icon13}{icon14}{icon15}";
format-icons = ["" "" "" "" "" "" "" ""];
tooltip = false;
};
memory = {
format = "{used}G";
format = "{used}G";
tooltip = false;
};
tray = {
@ -86,9 +86,8 @@
spacing = 5;
};
wireplumber = {
format = "{icon}{volume}%";
format = "{volume}%";
format-muted = "";
format-icons = ["" "奔" ""];
tooltip = false;
};
clock = {
@ -98,6 +97,8 @@
};
"sway/language" = {
tooltip = false;
# make sure it isn't pushed away when other modules get too big
min-length = 2;
};
}];
style = ./waybar.css;