summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorbee <beebeeb5k@gmail.com>2026-05-08 02:03:19 +0530
committerbee <beebeeb5k@gmail.com>2026-05-08 02:03:19 +0530
commit34d86d83e848020764f419458ca888532893eec3 (patch)
treee806e485c28edf658e02fea032cd6ed14b0078e8 /common
parent819cba6808c560628ec46176297a76219cebf9b4 (diff)
tmux wrapped terminal script
Diffstat (limited to 'common')
-rw-r--r--common/modules/window_managers/default.nix1
-rw-r--r--common/modules/window_managers/dwm/default.nix40
-rw-r--r--common/modules/window_managers/hyprland/default.nix18
-rw-r--r--common/modules/window_managers/mango/default.nix16
-rw-r--r--common/modules/window_managers/scripts.nix23
-rw-r--r--common/programs/tmux.nix11
6 files changed, 41 insertions, 68 deletions
diff --git a/common/modules/window_managers/default.nix b/common/modules/window_managers/default.nix
index 6591583..bc93e35 100644
--- a/common/modules/window_managers/default.nix
+++ b/common/modules/window_managers/default.nix
@@ -63,6 +63,7 @@ in
cliphist
brightnessctl
maim
+ wtype
];
}
else
diff --git a/common/modules/window_managers/dwm/default.nix b/common/modules/window_managers/dwm/default.nix
index d1f7850..49537a2 100644
--- a/common/modules/window_managers/dwm/default.nix
+++ b/common/modules/window_managers/dwm/default.nix
@@ -12,19 +12,6 @@
}:
let
cfg = config.${moduleNameSpace}.windowManagers;
- snipx11 = pkgs.writeShellScript "snipx11" ''
- case $1 in
- full)
- ${pkgs.maim}/bin/maim | xclip -selection clipboard -t image/png
- ;;
- selection)
- ${pkgs.maim}/bin/maim -s | xclip -selection clipboard -t image/png
- ;;
- window)
- ${pkgs.maim}/bin/maim -i $(xdotool getactivewindow) | xclip -selection clipboard -t image/png
- ;;
- esac
- '';
st-patched =
(pkgs.st.override {
extraLibs = [ pkgs.libXcursor ];
@@ -32,18 +19,6 @@ let
(oldAttrs: rec {
patches = map pkgs.fetchpatch [
{
- url = "https://st.suckless.org/patches/scrollback/st-scrollback-0.9.2.diff";
- sha256 = "sha256-ZypvRONAHS//wnZjivmqpWIqZlKTqAQ0Q8DhQpZVaqU=";
- }
- {
- url = "https://st.suckless.org/patches/scrollback/st-scrollback-mouse-0.9.2.diff";
- sha256 = "sha256-CuNJ5FdKmAtEjwbgKeBKPJTdEfJvIdmeSAphbz0u3Uk=";
- }
- {
- url = "https://st.suckless.org/patches/scrollback/st-scrollback-mouse-altscreen-20220127-2c5edf2.diff";
- sha256 = "sha256-8oVLgbsYCfMhNEOGadb5DFajdDKPxwgf3P/4vOXfUFo=";
- }
- {
url = "https://st.suckless.org/patches/xresources/st-xresources-20230320-45a15676.diff";
sha256 = "sha256-WcL9IeyanXFiOFDGGRU0QNT8DU7wSo2o+3n+TaqASUY=";
}
@@ -71,16 +46,13 @@ let
url = "https://st.suckless.org/patches/boxdraw/st-boxdraw_v2-0.8.5.diff";
sha256 = "sha256-WN/R6dPuw1eviHOvVVBw2VBSMDtfi1LCkXyX36EJKi4=";
}
- # {
- # url = "https://st.suckless.org/patches/themed_cursor/st-themed_cursor-0.8.1.diff";
- # sha256 = "sha256-Q/6VN9oCrdJiZPPjKMpw3UB09tIs4eJ1Hi5c8k7O7uo=";
- # }
+ {
+ url = "https://st.suckless.org/patches/bold-is-not-bright/st-bold-is-not-bright-20190127-3be4cf1.diff";
+ sha256 = "sha256-IhrTgZ8K3tcf5HqSlHm3GTacVJLOhO7QPho6SCGXTHw=";
+ }
];
postPatch = oldAttrs.postPatch or "" + ''
- sed -i 's/Button4, *kscrollup, *{.i = 1}/Button4, kscrollup, {.i = 10}/g' config.def.h
- sed -i 's/Button5, *kscrolldown, *{.i = 1}/Button5, kscrolldown, {.i = 10}/g' config.def.h
-
sed -i 's/const int boxdraw = 0;/const int boxdraw = 1;/g' config.def.h
sed -i 's/const int boxdraw_bold = 0;/const int boxdraw_bold = 1;/g' config.def.h
@@ -194,10 +166,10 @@ in
"Xft.hintstyle" = "hintfull";
"Xft.rgba" = "rgb";
"st.font" =
- "${config.beeMods.terminal.font.family}:size=${toString config.beeMods.terminal.font.size}:antialias=true:autohint=true";
+ "JetBrainsMono Nerd Font:size=${toString config.beeMods.terminal.font.size}:antialias=true:autohint=true";
"dmenu.font" =
"${config.beeMods.terminal.font.family}:size=${toString config.beeMods.terminal.font.size}";
- "st.borderpx" = 2;
+ # "st.borderpx" = 2;
};
}
);
diff --git a/common/modules/window_managers/hyprland/default.nix b/common/modules/window_managers/hyprland/default.nix
index aaf202f..fea9db6 100644
--- a/common/modules/window_managers/hyprland/default.nix
+++ b/common/modules/window_managers/hyprland/default.nix
@@ -12,21 +12,7 @@
}:
let
cfg = config.${moduleNameSpace}.windowManagers;
- smart-alacritty = pkgs.writeShellScript "smart-alacritty" ''
- alacritty msg create-window || exec alacritty
- '';
-
- smart-ghostty = pkgs.writeShellScript "smart-ghostty" ''
- ghostty +new-window || exec ghostty
- '';
-
- terminal =
- if config.beeMods.terminal.default == "alacritty" then
- smart-alacritty
- else if config.beeMods.terminal.default == "ghostty" then
- smart-ghostty
- else
- config.beeMods.terminal.default;
+ scripts = import ../scripts.nix { inherit pkgs config; };
in
{
config = lib.mkIf cfg.hyprland.enable (
@@ -222,7 +208,7 @@ in
bind = [
"$mainMod, r, exec, hyprctl reload"
- "$mainMod, Return, exec, ${terminal}"
+ "$mainMod, Return, exec, ${scripts.terminal}"
"$mainMod, a, exec,noctalia-shell ipc call launcher toggle"
"$mainMod, y, exec,noctalia-shell ipc call wallpaper toggle"
"$mainMod, v, exec,noctalia-shell ipc call launcher clipboard"
diff --git a/common/modules/window_managers/mango/default.nix b/common/modules/window_managers/mango/default.nix
index 41c6f5c..73db1ab 100644
--- a/common/modules/window_managers/mango/default.nix
+++ b/common/modules/window_managers/mango/default.nix
@@ -12,6 +12,7 @@
}:
let
cfg = config.${moduleNameSpace}.windowManagers;
+ scripts = import ../scripts.nix { inherit pkgs config; };
snip = pkgs.writeShellScript "snip" ''
case $1 in
full)
@@ -32,19 +33,6 @@ let
;;
esac
'';
- smart-alacritty = pkgs.writeShellScript "smart-alacritty" ''
- alacritty msg create-window || exec alacritty
- '';
- smart-ghostty = pkgs.writeShellScript "smart-ghostty" ''
- ghostty +new-window || exec ghostty
- '';
- terminal =
- if config.beeMods.terminal.default == "alacritty" then
- smart-alacritty
- else if config.beeMods.terminal.default == "ghostty" then
- smart-ghostty
- else
- config.beeMods.terminal.default;
in
{
imports =
@@ -224,7 +212,7 @@ in
# reload config
bind=SUPER,r,reload_config
- bind=SUPER,Return,spawn,${terminal}
+ bind=SUPER,Return,spawn,${scripts.terminal}
bind=SUPER,v,spawn,noctalia-shell ipc call launcher clipboard
bind=SUPER,a,spawn,noctalia-shell ipc call launcher toggle
diff --git a/common/modules/window_managers/scripts.nix b/common/modules/window_managers/scripts.nix
new file mode 100644
index 0000000..1d854ae
--- /dev/null
+++ b/common/modules/window_managers/scripts.nix
@@ -0,0 +1,23 @@
+{ pkgs, config }:
+
+{
+ terminal = pkgs.writeShellScript "terminal" ''
+ TERM="${config.beeMods.terminal.default}"
+ SESSION="_main"
+
+ if pgrep -x "$TERM" >/dev/null; then
+ if tmux ls &>/dev/null; then
+ tmux neww
+ exit 0
+ else
+ exec $TERM -e tmux new -s $SESSION
+ fi
+ else
+ if tmux ls &>/dev/null; then
+ exec $TERM -e tmux attach
+ else
+ exec $TERM -e tmux new -s $SESSION
+ fi
+ fi
+ '';
+}
diff --git a/common/programs/tmux.nix b/common/programs/tmux.nix
index 906fa82..9b59dba 100644
--- a/common/programs/tmux.nix
+++ b/common/programs/tmux.nix
@@ -1,18 +1,21 @@
{
programs.tmux = {
enable = true;
+ terminal = "tmux-256color";
+ keyMode = "vi";
+ prefix = "C-a";
+ escapeTime = 0;
+ shortcut = "a";
+ mouse = true;
+ baseIndex = 1;
extraConfig = ''
set -g status-position top
set -g status-justify absolute-centre
set -g status-right ""
set -g status-left "#S"
- set -g base-index 1
set -g renumber-windows on
- set -g mode-key vi
- set -sg escape-time 0
set-option -g status-style bg=default
set-option -g window-status-current-style "fg=blue bold"
- set -g prefix C-SPACE
'';
};
}