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 = {}; # profiles = {};
package = pkgs.wrapMpv (pkgs.mpv-unwrapped.override { package = pkgs.wrapMpv (pkgs.mpv-unwrapped.override {
# webp support
ffmpeg_5 = pkgs.ffmpeg_5-full; ffmpeg_5 = pkgs.ffmpeg_5-full;
}) { }) {
scripts = scripts =
@ -284,7 +285,8 @@
# cli tools # cli tools
imagemagick ffmpeg_5-full imagemagick ffmpeg_5-full
# fonts # 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" ]; }) (nerdfonts.override { fonts = [ "NerdFontsSymbolsOnly" ]; })
# might check out some day (tm) # might check out some day (tm)
# nyxt qutebrowser # nyxt qutebrowser

View file

@ -310,12 +310,16 @@ in
export XDG_CURRENT_DESKTOP=sway export XDG_CURRENT_DESKTOP=sway
export XDG_SESSION_DESKTOP=sway export XDG_SESSION_DESKTOP=sway
# TODO: set to sdl3 compat when SDL3 releases # 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" '' services.swayidle = let swaylock-start = builtins.toString (with pkgs; writeScript "swaylock-start" ''
#! ${bash}/bin/bash #! ${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 { ''); in {
enable = config.wayland.windowManager.sway.enable; enable = config.wayland.windowManager.sway.enable;
events = [ events = [
@ -326,14 +330,8 @@ in
{ timeout = 300; { timeout = 300;
command = "${pkgs.sway}/bin/swaymsg \"output * dpms off\""; command = "${pkgs.sway}/bin/swaymsg \"output * dpms off\"";
resumeCommand = "${pkgs.sway}/bin/swaymsg \"output * dpms on\""; } resumeCommand = "${pkgs.sway}/bin/swaymsg \"output * dpms on\""; }
{ timeout = 598;
command = "${pkgs.sway}/bin/swaymsg \"output * dpms on\""; }
{ timeout = 600; { timeout = 600;
command = swaylock-start; 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\""; }
]; ];
}; };
programs.swaylock.settings = rec { programs.swaylock.settings = rec {

View file

@ -99,7 +99,7 @@
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts) vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts)
vim.keymap.set('n', 'K', vim.lsp.buf.hover, 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', '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>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>wr', vim.lsp.buf.remove_workspace_folder, bufopts)
vim.keymap.set('n', '<space>wl', function() vim.keymap.set('n', '<space>wl', function()

View file

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

View file

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