resurrect #8
9
home/deepak/config/uair/scripts/break.sh
Executable file
9
home/deepak/config/uair/scripts/break.sh
Executable file
@@ -0,0 +1,9 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Notify with tmux?
|
||||||
|
|
||||||
|
message="Break done"
|
||||||
|
|
||||||
|
echo "sth"
|
||||||
|
echo "$message"
|
||||||
|
|
||||||
|
tmux display-popup -T "uair" "echo -e \"$message\""
|
||||||
13
home/deepak/config/uair/scripts/notify.sh
Executable file
13
home/deepak/config/uair/scripts/notify.sh
Executable file
@@ -0,0 +1,13 @@
|
|||||||
|
#!/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\""
|
||||||
19
home/deepak/config/uair/uair.toml
Normal file
19
home/deepak/config/uair/uair.toml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
loop_on_end = true
|
||||||
|
|
||||||
|
[defaults]
|
||||||
|
format = "🍅 {name} {state}: {time}\n"
|
||||||
|
paused_state_text = "paused"
|
||||||
|
resumed_state_text = "playing"
|
||||||
|
|
||||||
|
[[sessions]]
|
||||||
|
id = "work"
|
||||||
|
name = "Work"
|
||||||
|
duration = "10m"
|
||||||
|
command = '~/.config/uair/scripts/notify.sh "Work Done!"'
|
||||||
|
|
||||||
|
[[sessions]]
|
||||||
|
id = "rest"
|
||||||
|
name = "Rest"
|
||||||
|
duration = "2m"
|
||||||
|
command = "~/.config/uair/scripts/break.sh"
|
||||||
|
|
||||||
@@ -49,6 +49,7 @@ in
|
|||||||
pkgs.ydiff
|
pkgs.ydiff
|
||||||
pkgs.xsel
|
pkgs.xsel
|
||||||
pkgs.delta
|
pkgs.delta
|
||||||
|
pkgs.uair
|
||||||
|
|
||||||
pkgs-unstable.claude-code
|
pkgs-unstable.claude-code
|
||||||
# default_python
|
# default_python
|
||||||
@@ -100,6 +101,7 @@ in
|
|||||||
programs.direnv.nix-direnv.enable = true;
|
programs.direnv.nix-direnv.enable = true;
|
||||||
|
|
||||||
xdg.enable = true;
|
xdg.enable = true;
|
||||||
|
xdg.configFile."uair".source = ./config/uair;
|
||||||
|
|
||||||
services.nextcloud-client = pkgs.lib.mkIf specialArgs.withGUI {
|
services.nextcloud-client = pkgs.lib.mkIf specialArgs.withGUI {
|
||||||
enable = true;
|
enable = true;
|
||||||
@@ -254,40 +256,10 @@ in
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.tmux = {
|
programs.tmux = import ./tmux/tmux.nix {
|
||||||
enable = true;
|
inherit config;
|
||||||
package = pkgs-unstable.tmux;
|
inherit pkgs;
|
||||||
historyLimit = 100000;
|
inherit pkgs-unstable;
|
||||||
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.newsboat = {
|
programs.newsboat = {
|
||||||
@@ -389,4 +361,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" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
42
home/deepak/tmux/tmux.nix
Normal file
42
home/deepak/tmux/tmux.nix
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
{
|
||||||
|
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
|
||||||
|
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 "
|
||||||
|
'';
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user