summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2022-02-08 15:57:16 -0500
committerBen Sima <ben@bsima.me>2022-02-09 12:50:27 -0500
commit637df81d6359a6396627da26fb16c30fb568a3e4 (patch)
tree50395353299d082f90bf5879572945729207ed14
parenta92b587fe0fdd74da7ebc7933ad20263d5b3600e (diff)
Improvements
- using fzf-tmux wherever i can now - some more fzf integration tweaks - added some rofi plugins, idk if they work tho - fixed the polybar sound widget - added autorandr config, it mostly(?) works - added nix-direnv support by default
-rw-r--r--lib/common.nix32
-rw-r--r--lib/linux.nix13
-rw-r--r--profiles/laptop.nix35
3 files changed, 70 insertions, 10 deletions
diff --git a/lib/common.nix b/lib/common.nix
index 0fa9302..bf9b3c6 100644
--- a/lib/common.nix
+++ b/lib/common.nix
@@ -77,6 +77,13 @@ in
enable = true;
enableBashIntegration = true;
defaultCommand = "rg --files";
+ changeDirWidgetCommand = "fd --type d"; # M-c
+ changeDirWidgetOptions = ["--preview 'tree -C {} | head -100'"];
+ fileWidgetCommand = "fd --type f";
+ fileWidgetOptions = ["--preview 'head -n100 {}'"];
+ historyWidgetOptions = ["--sort" "--exact"];
+ tmux.enableShellIntegration = true;
+ tmux.shellIntegrationOptions = [ "-p 70%" ];
};
git = {
@@ -121,7 +128,6 @@ in
date = "local";
};
};
-
};
tmux = {
@@ -211,6 +217,8 @@ in
direnv = {
enable = true;
+ enableBashIntegration = true;
+ nix-direnv.enable = true;
};
vim = {
@@ -232,6 +240,14 @@ in
extraConfig = builtins.readFile ./vimrc;
};
+ info.enable = true;
+ man.enable = true;
+
+ nix-index = {
+ enable = true;
+ enableBashIntegration = true;
+ };
+
bash = {
enable = true;
initExtra = ''
@@ -273,14 +289,12 @@ in
git rev-parse HEAD > /dev/null 2>&1
}
- fzf-down() {
- fzf --reverse --height 50% "$@" --border
- }
+ alias fzf-tmux='fzf-tmux -p "70%"'
_gf() {
is_in_git_repo || return
git -c color.status=always status --short |
- fzf-down -m --ansi --nth 2..,.. \
+ fzf-tmux -p "70%" -m --ansi --nth 2..,.. \
--preview '(git diff --color=always -- {-1} | sed 1,4d; cat {-1}) | head -500' |
cut -c4- | sed 's/.* -> //'
}
@@ -288,7 +302,7 @@ in
_gb() {
is_in_git_repo || return
git branch -a --color=always | grep -v '/HEAD\s' | sort |
- fzf-down --ansi --multi --tac --preview-window right:70% \
+ fzf-tmux --ansi --multi --tac --preview-window right:70% \
--preview 'git log --oneline --graph --date=short --color=always --pretty="format:%C(auto)%cd %h%d %s" $(sed s/^..// <<< {} | cut -d" " -f1) | head -'$LINES |
sed 's/^..//' | cut -d' ' -f1 |
sed 's#^remotes/##'
@@ -297,14 +311,14 @@ in
_gt() {
is_in_git_repo || return
git tag --sort -version:refname |
- fzf-down --multi --preview-window right:70% \
+ fzf-tmux --multi --preview-window right:70% \
--preview 'git show --color=always {} | head -'$LINES
}
_gh() {
is_in_git_repo || return
git log --date=short --format="%C(green)%C(bold)%cd %C(auto)%h%d %s (%an)" --graph --color=always |
- fzf-down --ansi --no-sort --reverse --multi --bind 'ctrl-s:toggle-sort' \
+ fzf-tmux --ansi --no-sort --reverse --multi --bind 'ctrl-s:toggle-sort' \
--header 'Press CTRL-S to toggle sort' \
--preview 'grep -o "[a-f0-9]\{7,\}" <<< {} | xargs git show --color=always | head -'$LINES |
grep -o "[a-f0-9]\{7,\}"
@@ -313,7 +327,7 @@ in
_gr() {
is_in_git_repo || return
git remote -v | awk '{print $1 "\t" $2}' | uniq |
- fzf-down --tac \
+ fzf-tmux --tac \
--preview 'git log --oneline --graph --date=short --pretty="format:%C(auto)%cd %h%d %s" {1} | head -200' |
cut -d$'\t' -f1
}
diff --git a/lib/linux.nix b/lib/linux.nix
index c234593..6154f00 100644
--- a/lib/linux.nix
+++ b/lib/linux.nix
@@ -239,7 +239,8 @@ in
full-at = 99;
};
"module/volume-bar" = {
- type = "internal/volume";
+ type = "internal/alsa";
+ master-soundcard = "hw:1";
bar-volume-font = 2;
bar-volume-width = 9;
format-volume = "<label-volume><bar-volume>";
@@ -427,6 +428,16 @@ in
rofi = {
enable = true;
+ pass.enable = true;
+ plugins = with pkgs; [
+ rofi-calc
+ rofi-emoji
+ rofi-file-browser
+ rofi-menugen
+ rofi-mpd
+ rofi-pass
+ rofi-systemd
+ ];
};
};
diff --git a/profiles/laptop.nix b/profiles/laptop.nix
index c0b2d80..1b9c55e 100644
--- a/profiles/laptop.nix
+++ b/profiles/laptop.nix
@@ -14,4 +14,39 @@
pkgs.wmctrl
];
};
+ programs.autorandr.enable = true;
+ programs.autorandr.hooks.postswitch = {
+ "restart-polybar" = "systemctl --user restart polybar.service";
+ };
+ programs.autorandr.profiles = {
+ # get fingerprints with `autorandr --fingerprint`
+ docked = {
+ fingerprint.HDMI-2 = "00ffffffffffff0006b3ba28c0f40300151f0103803e22782ab4a5ad4f449e250f50542308008140818081c081009500b300d1c001014dd000a0f0703e80303035006d552100001a565e00a0a0a02950302035006d552100001e000000fd00283c1ea03c000a202020202020000000fc00415355532056473238390a20200159020359f159010304121305141f100706025d5e5f60610e0f15161d1e20482309070783010000e200d56d030c001200383c20006001020367d85dc401788003681a00000101283ee6e305c301e50f00800100e6060701565500023a801871382d40582c45006d552100001e000000000000000000000000000000000000000071";
+ config = {
+ eDP-1.enable = false;
+ HDMI-2 = {
+ enable = true;
+ primary = true;
+ position = "0x0";
+ mode = "2160x3840";
+ rate = "30.00";
+ rotate = "right";
+ };
+ };
+ };
+ laptop = {
+ fingerprint.eDP-1 = "00ffffffffffff000daea814000000002c170104951f11780237459e55539229125054000000010101010101010101010101010101015e358096703814402c1c240034ad10000018000000fe004e3134304847452d4541310a20000000fe00434d4e0a202020202020202020000000fe004e3134304847452d4541310a20001f";
+ config = {
+ HDMI-2.enable = false;
+ # eDP-1 active 31cm/17cm 1920x1080+0+0 60Hz
+ eDP-1 = {
+ enable = true;
+ primary = true;
+ position = "0x0";
+ mode = "1920x1080";
+ rate = "60.00";
+ };
+ };
+ };
+ };
}