Skip to content

Commit

Permalink
terminal.withTitle
Browse files Browse the repository at this point in the history
  • Loading branch information
mightyiam committed Nov 20, 2024
1 parent d5d798e commit 3da1e7d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
3 changes: 2 additions & 1 deletion home-manager-modules/users/mightyiam/modules/launcher.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
enable = true;
catppuccin.enable = true;
package = pkgs.rofi-wayland;
terminal = config.terminal;
terminal = config.terminal.path;
extraConfig = {
show-icons = true;
modi = "run,drun,window";
Expand All @@ -28,6 +28,7 @@
display-run = "  Run ";
display-window = " 󰕰 Window";
display-Network = " 󰤨 Network";
run-shell-command = config.terminal.withTitle "{cmd}";
};
theme = {
listview.columns = 1;
Expand Down
21 changes: 15 additions & 6 deletions home-manager-modules/users/mightyiam/modules/terminal.nix
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
{ config, lib, ... }:
{
options.terminal = lib.mkOption {
type = lib.types.path;
default = null;
options.terminal = {
path = lib.mkOption {
type = lib.types.path;
default = null;
};
withTitle = lib.mkOption {
type = lib.types.functionTo lib.types.string;
default = null;
};
};

config = lib.mkIf config.gui.enable {
terminal = lib.getExe config.programs.alacritty.package;
terminal = {
path = lib.getExe config.programs.alacritty.package;
withTitle = cmd: "${config.terminal.path} --title ${cmd} --command ${cmd}";
};

programs.alacritty = {
enable = true;
Expand All @@ -15,7 +24,7 @@
window.decorations = "none";
window.dynamic_title = true;
window.opacity = config.style.windowOpacity;
window.title = "";
window.title = "Terminal";
bell = {
duration = builtins.ceil config.style.bellDuration;
color = "#000000";
Expand All @@ -24,7 +33,7 @@
};

wayland.windowManager.sway.config = {
terminal = config.terminal;
terminal = config.terminal.path;
keybindings = {
"Mod4+Return" = null;
"--no-repeat Mod4+Return" = "exec ${config.wayland.windowManager.sway.config.terminal}";
Expand Down

0 comments on commit 3da1e7d

Please sign in to comment.