From d17c3e942d681a3df4cc8660653c85c9ff2e1e26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kier=C3=A1n=20Meinhardt?= Date: Sun, 23 Jan 2022 11:44:31 +0100 Subject: [PATCH] feat: give rofi another chance --- configs/default.nix | 1 + configs/i3.nix | 8 +++----- packages/scripts/dmenurandr.sh | 4 ++-- packages/scripts/unicodmenu.nix | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/configs/default.nix b/configs/default.nix index 82fa671..f07e4c6 100644 --- a/configs/default.nix +++ b/configs/default.nix @@ -20,6 +20,7 @@ in { config = { allowUnfree = true; packageOverrides = pkgs: { + dmenu = pkgs.writers.writeDashBin "dmenu" ''exec ${pkgs.rofi}/bin/rofi -dmenu "$@"''; gfs-fonts = pkgs.callPackage {}; tocharian-font = pkgs.callPackage {}; iolanguage = pkgs.callPackage { }; diff --git a/configs/i3.nix b/configs/i3.nix index 9f09b2d..821dee3 100644 --- a/configs/i3.nix +++ b/configs/i3.nix @@ -205,14 +205,12 @@ in { "${modifier}+0" = "exec ${pkgs.scripts.menu-calc}/bin/="; "${modifier}+Shift+w" = "exec ${pkgs.scripts.k-lock}/bin/k-lock"; - "${modifier}+a" = - "exec --no-startup-id ${pkgs.rofi}/bin/rofi -display-window — -show window"; - "${modifier}+d" = "exec --no-startup-id ${pkgs.dmenu}/bin/dmenu_run"; + "${modifier}+d" = "exec ${pkgs.writers.writeDash "run" ''exec ${pkgs.rofi}/bin/rofi -combi-modi run,drun -modi combi,window -show combi''}"; "${modifier}+Shift+d" = "exec ${ pkgs.writers.writeDash "notemenu" '' set -efu PATH=$PATH:${ - lib.makeBinPath [ pkgs.dmenu pkgs.findutils pkgs.coreutils ] + lib.makeBinPath [ pkgs.rofi pkgs.findutils pkgs.coreutils ] } cd ~/notes @@ -220,7 +218,7 @@ in { echo diary/$(date -I).md echo diary/$(date -I -d yesterday).md find . -type f -printf "%T@ %p\n" | sort --reverse --numeric-sort | cut --delimiter=" " --fields=2 - } | dmenu -i) + } | rofi -dmenu -i -p 'notes') if test "$note_file" then i3-sensible-terminal -e "$EDITOR" "$note_file" diff --git a/packages/scripts/dmenurandr.sh b/packages/scripts/dmenurandr.sh index 24685e6..cb6a8c8 100755 --- a/packages/scripts/dmenurandr.sh +++ b/packages/scripts/dmenurandr.sh @@ -15,7 +15,7 @@ twoscreen() { # If multi-monitor is selected and there are two screens. # Mirror displays using native resolution of external display and a scaled # version for the internal display if [ "$mirror" = "yes" ]; then - external=$(echo "$screens" | dmenu -i -p "Optimize resolution for:") + external=$(echo "$screens" | dmenu -i -p "Optimize resolution for") internal=$(echo "$screens" | grep -v "$external") res_external=$(xrandr --query | sed -n "/^$external/,/\+/p" | \ @@ -38,7 +38,7 @@ twoscreen() { # If multi-monitor is selected and there are two screens. else - primary=$(echo "$screens" | dmenu -i -p "Select primary display:") + primary=$(echo "$screens" | dmenu -i -p "Select primary display") secondary=$(echo "$screens" | grep -v "$primary") direction=$(query_direction | dmenu -i -p "What side of $primary should $secondary be on?") xrandr --output "$primary" --auto --scale 1.0x1.0 --output "$secondary" --"$direction" "$primary" --auto --scale 1.0x1.0 diff --git a/packages/scripts/unicodmenu.nix b/packages/scripts/unicodmenu.nix index d0a090e..7cdfbbb 100644 --- a/packages/scripts/unicodmenu.nix +++ b/packages/scripts/unicodmenu.nix @@ -59,7 +59,7 @@ let in # ref https://github.com/LukeSmithxyz/voidrice/blob/9fe6802122f6e0392c7fe20eefd30437771d7f8e/.local/bin/dmenuunicode writers.writeDashBin "unicodmenu" '' PATH=${lib.makeBinPath [ coreutils dmenu gnused libnotify xclip xdotool ]} - chosen=$(cat ${kaomoji-file} ${unicode-file} | dmenu -i -l 10 | sed "s/ .*//") + chosen=$(cat ${kaomoji-file} ${unicode-file} | dmenu -p unicode -i -l 10 | sed "s/ .*//") [ "$chosen" != "" ] || exit