mirror of
https://github.com/nmasur/dotfiles
synced 2025-02-07 08:42:03 +00:00
fixing up i3 and terminal inputs
This commit is contained in:
parent
f77f0c2fd6
commit
ea3ab18cca
@ -15,7 +15,7 @@ in
|
||||
config = lib.mkIf cfg.enable {
|
||||
|
||||
# Set the i3 terminal
|
||||
xsession.windowManager.i3.config.terminal = lib.mkIf pkgs.stdenv.isLinux "kitty";
|
||||
config.nmasur.presets.services.i3.terminal = pkgs.kitty;
|
||||
|
||||
# Set the Rofi terminal for running programs
|
||||
programs.rofi.terminal = lib.mkIf pkgs.stdenv.isLinux (lib.mkDefault "${pkgs.kitty}/bin/kitty");
|
||||
|
@ -21,7 +21,7 @@ in
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
# Set the i3 terminal
|
||||
xsession.windowManager.i3.config.terminal = lib.mkIf pkgs.stdenv.isLinux "wezterm";
|
||||
config.nmasur.presets.services.i3.terminal = pkgs.wezterm;
|
||||
|
||||
# Display images in the terminal
|
||||
programs.fish.shellAliases = {
|
||||
|
@ -13,6 +13,10 @@ in
|
||||
|
||||
options.nmasur.presets.services.i3 = {
|
||||
enable = lib.mkEnableOption "i3 window manager";
|
||||
terminal = lib.mkOption {
|
||||
type = lib.types.package;
|
||||
description = "Terminal application to launch";
|
||||
};
|
||||
commands = {
|
||||
launcher = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
@ -30,6 +34,9 @@ in
|
||||
default = "${lib.getExe pkgs.betterlockscreen} --update ${config.wallpaper} --display 1 --span";
|
||||
};
|
||||
toggleBar = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
description = "Toggle menu bar panel";
|
||||
default = null;
|
||||
};
|
||||
systemdSearch = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
@ -82,6 +89,7 @@ in
|
||||
ws10 = "10:X";
|
||||
in
|
||||
{
|
||||
terminal = cfg.terminal.meta.mainProgram;
|
||||
modifier = modifier;
|
||||
assigns = {
|
||||
"${ws1}" = [ { class = "Firefox"; } ];
|
||||
@ -169,33 +177,34 @@ in
|
||||
"XF86AudioPrev" = "exec ${lib.getExe pkgs.playerctl} previous";
|
||||
|
||||
# Launchers
|
||||
"${modifier}+Return" = "exec --no-startup-id ${
|
||||
config.home-manager.users.${config.user}.programs.rofi.terminal
|
||||
}; workspace ${ws2}; layout tabbed";
|
||||
"${modifier}+space" = "exec --no-startup-id ${cfg.commands.launcher}";
|
||||
"${modifier}+Shift+s" = "exec --no-startup-id ${cfg.commands.systemdSearch}";
|
||||
"${modifier}+Shift+a" = "exec --no-startup-id ${cfg.commands.audioSwitch}";
|
||||
"Mod1+Tab" = "exec --no-startup-id ${cfg.commands.altTab}";
|
||||
"${modifier}+Shift+period" = "exec --no-startup-id ${cfg.commands.power}";
|
||||
"${modifier}+Shift+m" = "exec --no-startup-id ${cfg.commands.brightness}";
|
||||
"${modifier}+c" = "exec --no-startup-id ${cfg.commands.calculator}";
|
||||
"${modifier}+Return" =
|
||||
"exec --no-startup-id ${lib.getExe cfg.terminal}; workspace ${ws2}; layout tabbed";
|
||||
"${modifier}+space" =
|
||||
lib.mkIf cfg.commands.launcher != null "exec --no-startup-id ${cfg.commands.launcher}";
|
||||
"${modifier}+Shift+s" =
|
||||
lib.mkIf cfg.commands.systemdSearch != null "exec --no-startup-id ${cfg.commands.systemdSearch}";
|
||||
"${modifier}+Shift+a" =
|
||||
lib.mkIf cfg.commands.audioSwitch != null "exec --no-startup-id ${cfg.commands.audioSwitch}";
|
||||
"Mod1+Tab" = lib.mkIf cfg.commands.altTab != null "exec --no-startup-id ${cfg.commands.altTab}";
|
||||
"${modifier}+Shift+period" =
|
||||
lib.mkIf cfg.commands.power != null "exec --no-startup-id ${cfg.commands.power}";
|
||||
"${modifier}+Shift+m" =
|
||||
lib.mkIf cfg.commands.brightness != null "exec --no-startup-id ${cfg.commands.brightness}";
|
||||
"${modifier}+c" =
|
||||
lib.mkIf cfg.commands.calculator != null "exec --no-startup-id ${cfg.commands.calculator}";
|
||||
"${modifier}+Shift+c" = "reload";
|
||||
"${modifier}+Shift+r" = "restart";
|
||||
"${modifier}+Shift+q" =
|
||||
''exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'"'';
|
||||
"${modifier}+Shift+x" = "exec ${cfg.commands.lockScreen}";
|
||||
"${modifier}+Shift+x" = lib.mkIf cfg.commands.lockScreen != null "exec ${cfg.commands.lockScreen}";
|
||||
"${modifier}+Mod1+h" =
|
||||
"exec --no-startup-id ${
|
||||
config.home-manager.users.${config.user}.programs.rofi.terminal
|
||||
} -e sh -c '${pkgs.home-manager}/bin/home-manager switch --flake ${config.dotfilesPath}#${config.networking.hostName} || read'";
|
||||
"exec --no-startup-id ${lib.getExe cfg.terminal} -e sh -c '${pkgs.home-manager}/bin/home-manager switch --flake ${config.dotfilesPath}#${config.networking.hostName} || read'";
|
||||
"${modifier}+Mod1+r" =
|
||||
"exec --no-startup-id ${
|
||||
config.home-manager.users.${config.user}.programs.rofi.terminal
|
||||
} -e sh -c 'doas nixos-rebuild switch --flake ${config.dotfilesPath}#${config.networking.hostName} || read'";
|
||||
"exec --no-startup-id ${lib.getExe cfg.terminal} -e sh -c 'doas nixos-rebuild switch --flake ${config.dotfilesPath}#${config.networking.hostName} || read'";
|
||||
|
||||
# Window options
|
||||
"${modifier}+q" = "kill";
|
||||
"${modifier}+b" = "exec ${config.toggleBarCommand}";
|
||||
"${modifier}+b" = lib.mkIf cfg.commands.toggleBar "exec ${cfg.commands.toggleBar}";
|
||||
"${modifier}+f" = "fullscreen toggle";
|
||||
"${modifier}+h" = "focus left";
|
||||
"${modifier}+j" = "focus down";
|
||||
@ -299,9 +308,10 @@ in
|
||||
};
|
||||
|
||||
programs.fish.functions = {
|
||||
update-lock-screen = lib.mkIf config.services.xserver.enable {
|
||||
update-lock-screen =
|
||||
lib.mkIf cfg.commands.updateLockScreen != null {
|
||||
description = "Update lockscreen with wallpaper";
|
||||
body = lockUpdate;
|
||||
body = cfg.commands.updateLockScreen;
|
||||
};
|
||||
};
|
||||
|
||||
@ -310,10 +320,10 @@ in
|
||||
let
|
||||
cacheDir = "${config.homePath}/.cache/betterlockscreen/current";
|
||||
in
|
||||
lib.mkIf config.services.xserver.enable (
|
||||
lib.mkIf cfg.commands.updateLockScreen != null (
|
||||
config.lib.dag.entryAfter [ "writeBoundary" ] ''
|
||||
if [ ! -d ${cacheDir} ] || [ -z "$(ls ${cacheDir})" ]; then
|
||||
$DRY_RUN_CMD ${lockUpdate}
|
||||
run ${cfg.commands.updateLockScreen}
|
||||
fi
|
||||
''
|
||||
);
|
||||
|
@ -15,6 +15,8 @@ in
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
|
||||
nmasur.presets.services.i3.commands.toggleBar = "polybar-msg cmd toggle";
|
||||
|
||||
services.polybar = {
|
||||
enable = true;
|
||||
package = pkgs.polybar.override {
|
||||
|
Loading…
x
Reference in New Issue
Block a user