Add basic rofi config.

This commit is contained in:
Kevin Baensch 2023-09-09 21:18:53 +02:00
parent dbe7fdfb4e
commit 8e689038db
Signed by: derped
GPG key ID: C0F1D326C7626543
3 changed files with 28 additions and 3 deletions

View file

@ -1,9 +1,10 @@
{ config, lib, ... }:
{ config, lib, pkgs, ... }:
with lib;
{
environment.etc = mkIf (elem "etcfiles" config.machine.conffiles) {
"rofi.rasi".source = (import ./etc/rofi.rasi.nix { inherit pkgs; });
"i3/py3status".source = ./etc/i3/py3status;
"sway/config".source = mkDefault ./etc/sway/config;
"mpv/input.conf".source = ./etc/mpv/input.conf;

View file

@ -149,8 +149,7 @@ bindsym $mod+Return exec alacritty
bindsym $mod+Shift+q kill
# start dmenu (a program launcher)
#bindsym $mod+d exec rofi -show run -lines 3 -eh 2 -width 100 -padding 330 -opacity "85" -config ~/.config/rofi.cfg -font "System San Francisco Display 12"
bindsym $mod+d exec dmenu_run -fn 'Droid Sans Mono-8'
bindsym $mod+d exec ${pkgs.rofi}/bin/rofi -config /etc/rofi.rasi -show combi
# There also is the (new) i3-dmenu-desktop which only displays applications
# shipping a .desktop file. It is a wrapper around dmenu, so you need that
# installed.

25
config/etc/rofi.rasi.nix Normal file
View file

@ -0,0 +1,25 @@
{ pkgs }:
let
tabMode = pkgs.writeScript "tab-finder.sh" (with pkgs; ''
#!/usr/bin/env bash
if [ -z ''${1} ]; then
${brotab}/bin/bt list;
else
TARGET_TAB=$(sed "s/\t.*$//g" <<< ''${1});
# activate window as focused to it is easy to switch to
${brotab}/bin/bt activate --focused ''${TARGET_TAB} > /dev/null 2>&1;
${i3}/bin/i3-msg -t run_command "[urgent=latest] focus" > /dev/null 2>&1;
fi
exit 0;
'');
in (pkgs.writeText "rofi.rasi" ''
configuration {
modi: "combi,window,drun,ssh,tabFinder:${tabMode}";
font: "hack 10";
combi-modi: "window,drun,ssh,tabFinder";
icon-theme: "Papirus";
show-icons: true;
}
@theme "solarized"
'')