From 5cf01c8df105865eecf8cb37659b7bddd327ae36 Mon Sep 17 00:00:00 2001 From: Deepak Mallubhotla Date: Tue, 9 Sep 2025 10:12:04 -0500 Subject: [PATCH 1/6] uair add config --- home/deepak/config/uair.toml | 22 ++++++++++++++++++++++ home/deepak/home.nix | 18 ++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 home/deepak/config/uair.toml diff --git a/home/deepak/config/uair.toml b/home/deepak/config/uair.toml new file mode 100644 index 0000000..8015977 --- /dev/null +++ b/home/deepak/config/uair.toml @@ -0,0 +1,22 @@ +loop_on_end = true + +[defaults] +format = "🍅 {name}: {time} / {total}{end}\n" + +[[sessions]] +id = "work" +name = "Work" +duration = "30m" +command = "notify-send 'Work Done!'" + +[[sessions]] +id = "rest" +name = "Rest" +duration = "5m" +command = "notify-send 'Rest Done!'" + +[[sessions]] +id = "hardwork" +name = "Work, but harder" +duration = "1h 30m" +command = "notify-send 'Hard Work Done!'" diff --git a/home/deepak/home.nix b/home/deepak/home.nix index 9687872..75328f1 100644 --- a/home/deepak/home.nix +++ b/home/deepak/home.nix @@ -49,6 +49,7 @@ in pkgs.ydiff pkgs.xsel pkgs.delta + pkgs.uair pkgs-unstable.claude-code # default_python @@ -100,6 +101,7 @@ in programs.direnv.nix-direnv.enable = true; xdg.enable = true; + xdg.configFile."uair/uair.toml".source = ./config/uair.toml; services.nextcloud-client = pkgs.lib.mkIf specialArgs.withGUI { enable = true; @@ -391,4 +393,20 @@ in }; }; + systemd.user.services = { + uair = { + Unit = { + Description = "Uair pomodoro timer"; + }; + Service = { + Type = "simple"; + ExecStart = "${pkgs.uair}/bin/uair -q"; + Restart = "always"; + }; + Install = { + WantedBy = ["default.target"]; + }; + }; + }; + } -- 2.49.1 From 9278c2d4670ee1326a86479133a9fad5ebc7adc3 Mon Sep 17 00:00:00 2001 From: Deepak Mallubhotla Date: Tue, 9 Sep 2025 11:20:24 -0500 Subject: [PATCH 2/6] uair --- home/deepak/config/uair.toml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/home/deepak/config/uair.toml b/home/deepak/config/uair.toml index 8015977..f3bb7cc 100644 --- a/home/deepak/config/uair.toml +++ b/home/deepak/config/uair.toml @@ -1,7 +1,9 @@ loop_on_end = true [defaults] -format = "🍅 {name}: {time} / {total}{end}\n" +format = "🍅 {name} {state}: {time}\n" +paused_state_text = "paused" +resumed_state_text = "playing" [[sessions]] id = "work" @@ -15,8 +17,3 @@ name = "Rest" duration = "5m" command = "notify-send 'Rest Done!'" -[[sessions]] -id = "hardwork" -name = "Work, but harder" -duration = "1h 30m" -command = "notify-send 'Hard Work Done!'" -- 2.49.1 From f5991b9df03ddf3f94a1f5f9d75c183d2955e5ca Mon Sep 17 00:00:00 2001 From: Deepak Mallubhotla Date: Tue, 9 Sep 2025 12:20:26 -0500 Subject: [PATCH 3/6] uair setup 1 --- home/deepak/config/uair/scripts/break.sh | 10 ++++++++++ home/deepak/config/uair/scripts/notify.sh | 14 ++++++++++++++ home/deepak/config/{ => uair}/uair.toml | 8 ++++---- home/deepak/home.nix | 4 ++-- 4 files changed, 30 insertions(+), 6 deletions(-) create mode 100755 home/deepak/config/uair/scripts/break.sh create mode 100755 home/deepak/config/uair/scripts/notify.sh rename home/deepak/config/{ => uair}/uair.toml (61%) diff --git a/home/deepak/config/uair/scripts/break.sh b/home/deepak/config/uair/scripts/break.sh new file mode 100755 index 0000000..56b12e4 --- /dev/null +++ b/home/deepak/config/uair/scripts/break.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +# Notify with tmux? + +message="Break done" + +echo "sth" +echo "$message" + +tmux display-popup -T "uair" "echo -e \"$message\"" + diff --git a/home/deepak/config/uair/scripts/notify.sh b/home/deepak/config/uair/scripts/notify.sh new file mode 100755 index 0000000..2f5d6e5 --- /dev/null +++ b/home/deepak/config/uair/scripts/notify.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +# Notify with tmux? + +message=" +$1 + +exit with ctrl-C, resume next with uairctl +" + +echo "sth" +echo "$message" + +tmux display-popup -T "uair" "echo -e \"$message\"" + diff --git a/home/deepak/config/uair.toml b/home/deepak/config/uair/uair.toml similarity index 61% rename from home/deepak/config/uair.toml rename to home/deepak/config/uair/uair.toml index f3bb7cc..e07fce8 100644 --- a/home/deepak/config/uair.toml +++ b/home/deepak/config/uair/uair.toml @@ -8,12 +8,12 @@ resumed_state_text = "playing" [[sessions]] id = "work" name = "Work" -duration = "30m" -command = "notify-send 'Work Done!'" +duration = "10m" +command = '~/.config/uair/scripts/notify.sh "Work Done!"' [[sessions]] id = "rest" name = "Rest" -duration = "5m" -command = "notify-send 'Rest Done!'" +duration = "2m" +command = "~/.config/uair/scripts/break.sh" diff --git a/home/deepak/home.nix b/home/deepak/home.nix index 75328f1..58bc104 100644 --- a/home/deepak/home.nix +++ b/home/deepak/home.nix @@ -101,7 +101,7 @@ in programs.direnv.nix-direnv.enable = true; xdg.enable = true; - xdg.configFile."uair/uair.toml".source = ./config/uair.toml; + xdg.configFile."uair".source = ./config/uair; services.nextcloud-client = pkgs.lib.mkIf specialArgs.withGUI { enable = true; @@ -404,7 +404,7 @@ in Restart = "always"; }; Install = { - WantedBy = ["default.target"]; + WantedBy = [ "default.target" ]; }; }; }; -- 2.49.1 From 542cba92cbb1b8f27dc37c2fef1525adc21a77cc Mon Sep 17 00:00:00 2001 From: Deepak Mallubhotla Date: Tue, 9 Sep 2025 12:58:10 -0500 Subject: [PATCH 4/6] fmt sh scripts --- home/deepak/config/uair/scripts/break.sh | 1 - home/deepak/config/uair/scripts/notify.sh | 1 - 2 files changed, 2 deletions(-) diff --git a/home/deepak/config/uair/scripts/break.sh b/home/deepak/config/uair/scripts/break.sh index 56b12e4..b7e834e 100755 --- a/home/deepak/config/uair/scripts/break.sh +++ b/home/deepak/config/uair/scripts/break.sh @@ -7,4 +7,3 @@ echo "sth" echo "$message" tmux display-popup -T "uair" "echo -e \"$message\"" - diff --git a/home/deepak/config/uair/scripts/notify.sh b/home/deepak/config/uair/scripts/notify.sh index 2f5d6e5..d3c5ece 100755 --- a/home/deepak/config/uair/scripts/notify.sh +++ b/home/deepak/config/uair/scripts/notify.sh @@ -11,4 +11,3 @@ echo "sth" echo "$message" tmux display-popup -T "uair" "echo -e \"$message\"" - -- 2.49.1 From 71e62552e5a7e137aef84b059e077209e18b3313 Mon Sep 17 00:00:00 2001 From: Deepak Mallubhotla Date: Wed, 10 Sep 2025 10:01:48 -0500 Subject: [PATCH 5/6] tmux config move --- home/deepak/home.nix | 38 ++++--------------------------------- home/deepak/tmux/tmux.nix | 40 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 34 deletions(-) create mode 100644 home/deepak/tmux/tmux.nix diff --git a/home/deepak/home.nix b/home/deepak/home.nix index 58bc104..ad451e3 100644 --- a/home/deepak/home.nix +++ b/home/deepak/home.nix @@ -256,40 +256,10 @@ in ''; }; - programs.tmux = { - enable = true; - package = pkgs-unstable.tmux; - historyLimit = 100000; - clock24 = true; - keyMode = "vi"; - mouse = true; - prefix = "M-,"; - plugins = [ - pkgs.tmuxPlugins.vim-tmux-navigator - pkgs.tmuxPlugins.better-mouse-mode - pkgs.tmuxPlugins.sensible - pkgs.tmuxPlugins.power-theme - ]; - extraConfig = '' - set-option -g status-position top - unbind '"' - unbind % - set -s copy-command 'xsel -bi' - bind -N "Change layout" -T prefix % next-layout - bind -N "Horizontal split" -T prefix | split-window -h -c '#{pane_current_path}' - bind -N "Horizontal split" -T prefix \\ split-window -h -c '#{pane_current_path}' - bind -N "Vertical split" -T prefix - split-window -v -c '#{pane_current_path}' - bind -N "Create a new window" -T prefix c new-window -c '#{pane_current_path}' - bind -N "Quick pane for obsidian todos" -T prefix . split-window -c $DPK_OBSIDIAN_DIR -h "vim todos.md" - bind -N "Enter copy mode" -T prefix Space copy-mode - bind -N "Load buffer from xsel and paste" -T prefix C-p run "xsel -ob | tmux load-buffer - ; tmux paste-buffer" - set -g escape-time 1 - bind -N "Leave copy mode" -T copy-mode-vi Escape send-keys -X cancel - bind -N "Leave copy mode" -T copy-mode-vi y send -X copy-pipe - bind -N "Selection toggle" -T copy-mode-vi Space if -F "#{selection_present}" { send -X clear-selection } { send -X begin-selection } - bind -N "Copy and leave copy-mode" -T copy-mode-vi Enter send -X copy-pipe-and-cancel - set-option -g status-right "#[fg=#ffb86c]#[fg=#262626,bg=#ffb86c]#(cat ${config.xdg.cacheHome}/weather/short-weather.txt) #[fg=#3a3a3a,bg=#ffb86c]#[fg=#ffb86c,bg=#3a3a3a]  %T #[fg=#ffb86c,bg=#3a3a3a]#[fg=#262626,bg=#ffb86c]  %F " - ''; + programs.tmux = import ./tmux/tmux.nix { + inherit config; + inherit pkgs; + inherit pkgs-unstable; }; programs.newsboat = { diff --git a/home/deepak/tmux/tmux.nix b/home/deepak/tmux/tmux.nix new file mode 100644 index 0000000..7aed486 --- /dev/null +++ b/home/deepak/tmux/tmux.nix @@ -0,0 +1,40 @@ +{ + config, + pkgs, + pkgs-unstable, +}: +{ + enable = true; + package = pkgs-unstable.tmux; + historyLimit = 100000; + clock24 = true; + keyMode = "vi"; + mouse = true; + prefix = "M-,"; + plugins = [ + pkgs.tmuxPlugins.vim-tmux-navigator + pkgs.tmuxPlugins.better-mouse-mode + pkgs.tmuxPlugins.sensible + pkgs.tmuxPlugins.power-theme + ]; + extraConfig = '' + set-option -g status-position top + unbind '"' + unbind % + set -s copy-command 'xsel -bi' + bind -N "Change layout" -T prefix % next-layout + bind -N "Horizontal split" -T prefix | split-window -h -c '#{pane_current_path}' + bind -N "Horizontal split" -T prefix \\ split-window -h -c '#{pane_current_path}' + bind -N "Vertical split" -T prefix - split-window -v -c '#{pane_current_path}' + bind -N "Create a new window" -T prefix c new-window -c '#{pane_current_path}' + bind -N "Quick pane for obsidian todos" -T prefix . split-window -c $DPK_OBSIDIAN_DIR -h "vim todos.md" + bind -N "Enter copy mode" -T prefix Space copy-mode + bind -N "Load buffer from xsel and paste" -T prefix C-p run "xsel -ob | tmux load-buffer - ; tmux paste-buffer" + set -g escape-time 1 + bind -N "Leave copy mode" -T copy-mode-vi Escape send-keys -X cancel + bind -N "Leave copy mode" -T copy-mode-vi y send -X copy-pipe + bind -N "Selection toggle" -T copy-mode-vi Space if -F "#{selection_present}" { send -X clear-selection } { send -X begin-selection } + bind -N "Copy and leave copy-mode" -T copy-mode-vi Enter send -X copy-pipe-and-cancel + set-option -g status-right "#[fg=#ffb86c]#[fg=#262626,bg=#ffb86c]#(cat ${config.xdg.cacheHome}/weather/short-weather.txt) #[fg=#3a3a3a,bg=#ffb86c]#[fg=#ffb86c,bg=#3a3a3a]  %T #[fg=#ffb86c,bg=#3a3a3a]#[fg=#262626,bg=#ffb86c]  %F " + ''; +} -- 2.49.1 From a0f7c1be695676d23213437f2f714894c2ab96ee Mon Sep 17 00:00:00 2001 From: Deepak Mallubhotla Date: Wed, 10 Sep 2025 10:47:35 -0500 Subject: [PATCH 6/6] adding resurrect --- home/deepak/tmux/tmux.nix | 40 ++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/home/deepak/tmux/tmux.nix b/home/deepak/tmux/tmux.nix index 7aed486..861d15f 100644 --- a/home/deepak/tmux/tmux.nix +++ b/home/deepak/tmux/tmux.nix @@ -16,25 +16,27 @@ pkgs.tmuxPlugins.better-mouse-mode pkgs.tmuxPlugins.sensible pkgs.tmuxPlugins.power-theme + pkgs.tmuxPlugins.resurrect ]; extraConfig = '' - set-option -g status-position top - unbind '"' - unbind % - set -s copy-command 'xsel -bi' - bind -N "Change layout" -T prefix % next-layout - bind -N "Horizontal split" -T prefix | split-window -h -c '#{pane_current_path}' - bind -N "Horizontal split" -T prefix \\ split-window -h -c '#{pane_current_path}' - bind -N "Vertical split" -T prefix - split-window -v -c '#{pane_current_path}' - bind -N "Create a new window" -T prefix c new-window -c '#{pane_current_path}' - bind -N "Quick pane for obsidian todos" -T prefix . split-window -c $DPK_OBSIDIAN_DIR -h "vim todos.md" - bind -N "Enter copy mode" -T prefix Space copy-mode - bind -N "Load buffer from xsel and paste" -T prefix C-p run "xsel -ob | tmux load-buffer - ; tmux paste-buffer" - set -g escape-time 1 - bind -N "Leave copy mode" -T copy-mode-vi Escape send-keys -X cancel - bind -N "Leave copy mode" -T copy-mode-vi y send -X copy-pipe - bind -N "Selection toggle" -T copy-mode-vi Space if -F "#{selection_present}" { send -X clear-selection } { send -X begin-selection } - bind -N "Copy and leave copy-mode" -T copy-mode-vi Enter send -X copy-pipe-and-cancel - set-option -g status-right "#[fg=#ffb86c]#[fg=#262626,bg=#ffb86c]#(cat ${config.xdg.cacheHome}/weather/short-weather.txt) #[fg=#3a3a3a,bg=#ffb86c]#[fg=#ffb86c,bg=#3a3a3a]  %T #[fg=#ffb86c,bg=#3a3a3a]#[fg=#262626,bg=#ffb86c]  %F " - ''; + set-option -g status-position top + unbind '"' + unbind % + + set -s copy-command 'xsel -bi' + bind -N "Change layout" -T prefix % next-layout + bind -N "Horizontal split" -T prefix | split-window -h -c '#{pane_current_path}' + bind -N "Horizontal split" -T prefix \\ split-window -h -c '#{pane_current_path}' + bind -N "Vertical split" -T prefix - split-window -v -c '#{pane_current_path}' + bind -N "Create a new window" -T prefix c new-window -c '#{pane_current_path}' + bind -N "Quick pane for obsidian todos" -T prefix . split-window -c $DPK_OBSIDIAN_DIR -h "vim todos.md" + bind -N "Enter copy mode" -T prefix Space copy-mode + bind -N "Load buffer from xsel and paste" -T prefix C-p run "xsel -ob | tmux load-buffer - ; tmux paste-buffer" + set -g escape-time 1 + bind -N "Leave copy mode" -T copy-mode-vi Escape send-keys -X cancel + bind -N "Leave copy mode" -T copy-mode-vi y send -X copy-pipe + bind -N "Selection toggle" -T copy-mode-vi Space if -F "#{selection_present}" { send -X clear-selection } { send -X begin-selection } + bind -N "Copy and leave copy-mode" -T copy-mode-vi Enter send -X copy-pipe-and-cancel + set-option -g status-right "#[fg=#ffb86c]#[fg=#262626,bg=#ffb86c]#(cat ${config.xdg.cacheHome}/weather/short-weather.txt) #[fg=#3a3a3a,bg=#ffb86c]#[fg=#ffb86c,bg=#3a3a3a]  %T #[fg=#ffb86c,bg=#3a3a3a]#[fg=#262626,bg=#ffb86c]  %F " + ''; } -- 2.49.1