From 7df356950a6a6455a562ea6d349b03945e189e46 Mon Sep 17 00:00:00 2001 From: Akshay Date: Wed, 1 Feb 2023 21:37:39 +0530 Subject: tweak tmux --- home.nix | 38 +++++++++++++++++++++++++------------- hosts/myrtle/configuration.nix | 3 +-- programs/tmux.nix | 9 ++++----- programs/zathura.nix | 2 +- scripts/default.nix | 35 ++++++++++++----------------------- 5 files changed, 43 insertions(+), 44 deletions(-) diff --git a/home.nix b/home.nix index 33949b8..16cc9dd 100644 --- a/home.nix +++ b/home.nix @@ -20,46 +20,58 @@ home.extraOutputsToInstall = [ "man" ]; home.packages = with pkgs; [ + # essentials vim - unzip - curl - tmux weechat firefox + unzip + tmux xclip ripgrep miniserve rnix-lsp pfetch st - arandr - imagemagick - ffmpeg - maim - wget cmus tree - rxvt-unicode neomutt - mpv nodePackages.bash-language-server w3m noto-fonts-emoji ripgrep-all urlview - slop fd du-dust jq libnotify inotify-tools + pavucontrol + + # sync rtorrent - sxiv lftp - pavucontrol + wget + curl + + # graphics + krita + sxiv + imagemagick + ffmpeg + mpv + slop + maim + arandr + + # graphics debug cudatoolkit pciutils + # monitoring + s-tui + stress + powertop + # input xinput_calibrator libinput diff --git a/hosts/myrtle/configuration.nix b/hosts/myrtle/configuration.nix index c86efd4..db70416 100644 --- a/hosts/myrtle/configuration.nix +++ b/hosts/myrtle/configuration.nix @@ -116,11 +116,10 @@ supergfxd.enable = true; logind.extraConfig = '' - HandlePowerKey=suspend-then-hibernate + HandlePowerKey=suspend HandlePowerKeyLongPress=poweroff ''; - auto-cpufreq.enable = true; batteryNotifier = { enable = true; notifyCapacity = 20; diff --git a/programs/tmux.nix b/programs/tmux.nix index 15f9a13..c748a60 100644 --- a/programs/tmux.nix +++ b/programs/tmux.nix @@ -82,10 +82,7 @@ in setw -g pane-base-index 1 # session jumper - bind C-j display-popup -E "\ - tmux list-sessions -F '#{session_name}' |\ - fzf |\ - xargs tmux switch-client -t" + bind-key -n C-j run-shell "tmux-fzf" # pane binds @@ -101,7 +98,9 @@ in # window binds bind -n M-h previous-window - bind -n M-i next-window + bind -n M-i next-window + bind -n M-? switch-client -p + bind -n M-/ switch-client -n bind-key "{" split-window -h -c "#{pane_current_path}" bind-key "}" split-window -v -c "#{pane_current_path}" bind-key s choose-session diff --git a/programs/zathura.nix b/programs/zathura.nix index 5e5c8ce..9758c7a 100644 --- a/programs/zathura.nix +++ b/programs/zathura.nix @@ -31,7 +31,7 @@ with theme; statusbar-h-padding = "50"; statusbar-v-padding = "50"; guioptions = "s"; - font = "Input 10"; + font = "Nerd Input 10"; }; }; } diff --git a/scripts/default.nix b/scripts/default.nix index 1c57566..627b121 100644 --- a/scripts/default.nix +++ b/scripts/default.nix @@ -38,41 +38,30 @@ let # fzf script to switch between tmux sessions tmux-fzf = pkgs.writeScriptBin "tmux-fzf" '' - tbin() { - ${pkgs.tmux}/bin/tmux "$@" - } - fbin() { - ${pkgs.fzf}/bin/fzf "$@" - } + LIST_DATA="#{session_name}/#{window_name}/#{pane_current_command}" + FZF_COMMAND="${pkgs.fzf}/bin/fzf-tmux -p --delimiter=: --with-nth 4 --color=hl:2" - __fzf() { - fbin --cycle --height 7 --reverse - } + TARGET_SPEC="#{session_name}:#{window_id}:#{pane_id}:" - __list_to_fzf() { - tbin ls -F "#{session_name}" | fzf - } + LINE=$(tmux list-windows -a -F "$TARGET_SPEC $LIST_DATA" | $FZF_COMMAND) || exit 0 + args=(''${LINE//:/ }) - if [ -n "$TMUX" ]; then - tbin switch-client -t "$(__list_to_fzf)" - else - tbin a -t "$(tbin ls -F "#{session_name}" | fbin)" - fi + ${pkgs.tmux}/bin/tmux select-window -t ''${args[1]} && tmux switch-client -t ''${args[0]} ''; - touchscreen = 21; - stylus = 15; + touchscreen = "ELAN9008:00 04F3:2ED6"; + stylus = "ELAN9008:00 04F3:2ED6 Stylus Pen (0)"; portait-transform = builtins.toString [ 0 (-1) 1 1 0 0 0 0 1 ]; landscape-transform = builtins.toString [ 0 0 0 0 0 0 0 0 0 ]; portrait = pkgs.writeScriptBin "portrait" '' ${pkgs.xorg.xrandr}/bin/xrandr -o left - ${pkgs.xorg.xinput}/bin/xinput set-prop ${builtins.toString touchscreen} --type=float "Coordinate Transformation Matrix" ${portait-transform} - ${pkgs.xorg.xinput}/bin/xinput set-prop ${builtins.toString stylus} --type=float "Coordinate Transformation Matrix" ${portait-transform} + ${pkgs.xorg.xinput}/bin/xinput set-prop ${touchscreen} --type=float "Coordinate Transformation Matrix" ${portait-transform} + ${pkgs.xorg.xinput}/bin/xinput set-prop ${stylus} --type=float "Coordinate Transformation Matrix" ${portait-transform} ''; landscape = pkgs.writeScriptBin "landscape" '' ${pkgs.xorg.xrandr}/bin/xrandr -o normal - ${pkgs.xorg.xinput}/bin/xinput set-prop ${builtins.toString touchscreen} --type=float "Coordinate Transformation Matrix" ${landscape-transform} - ${pkgs.xorg.xinput}/bin/xinput set-prop ${builtins.toString stylus} --type=float "Coordinate Transformation Matrix" ${landscape-transform} + ${pkgs.xorg.xinput}/bin/xinput set-prop ${touchscreen} --type=float "Coordinate Transformation Matrix" ${landscape-transform} + ${pkgs.xorg.xinput}/bin/xinput set-prop ${stylus} --type=float "Coordinate Transformation Matrix" ${landscape-transform} ''; in -- cgit v1.2.3