Skip to content

Commit

Permalink
Feat: Switch to Tofi
Browse files Browse the repository at this point in the history
  • Loading branch information
NamesCode committed Nov 2, 2024
1 parent 3ba2ae4 commit c75ec4b
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 44 deletions.
2 changes: 1 addition & 1 deletion modules/home-manager/lib.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
mainFont = lib.mkOption {
description = "The font that all themed applications should follow";
example = "Sans Serif";
type = lib.types.string;
type = lib.types.str;
};
wallpaper = lib.mkOption {
description = "The wallpaper that should be used";
Expand Down
29 changes: 0 additions & 29 deletions modules/impure/patches/ctp-dmenu.patch

This file was deleted.

2 changes: 1 addition & 1 deletion modules/impure/scripts/screenshot.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env sh

DATE=$(date '+%Y-%m-%d')
FILENAME=$(printf "%s\nscreenshot\nclipboard\nquit\n" "$DATE" | dmenu)
FILENAME=$(printf "%s\nscreenshot\nclipboard\nquit\n" "$DATE" | tofi)


if [ "$FILENAME" == "clipboard" ]; then
Expand Down
13 changes: 12 additions & 1 deletion users/Name/home.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@
home.packages = with pkgs; [
# Install patches dev fonts
(pkgs.nerdfonts.override {fonts = ["FiraCode" "JetBrainsMono"];})

# View system resource usage nicely
htop

# Better tools
ripgrep

# # You can also create simple shell scripts directly inside your
# # configuration. For example, this adds a command 'my-hello' to your
# # environment:
Expand Down Expand Up @@ -76,10 +81,16 @@

# Imports the modules for different configs.
imports = [
# WM setup
./sway.nix
./bash.nix
./waybar.nix
./mako.nix
./tofi.nix

# Shell
./bash.nix

# The dotfile lib
../../modules/home-manager/lib.nix
];

Expand Down
18 changes: 6 additions & 12 deletions users/Name/sway.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
modifier = "Mod4";
# Keyboard backlight device
keyboard = "kbd_backlight";
# Patch dmenu to theme it because its a suckless util
ctp-dmenu = pkgs.dmenu.override( { patches = [ ../../modules/impure/patches/ctp-dmenu.patch ];} );
in {
# Configure Sway
wayland.windowManager.sway = {
Expand Down Expand Up @@ -72,7 +70,7 @@ in {
keybindings = {
# General binds
"${modifier}+q" = "kill";
"${modifier}+d" = "exec ${pkgs.dmenu}/bin/dmenu_run";
"${modifier}+d" = "exec $(${pkgs.tofi}/bin/tofi-run)";
"${modifier}+r" = "mode resize";

"${modifier}+Shift+r" = "reload";
Expand Down Expand Up @@ -200,19 +198,15 @@ in {
};
};

home.packages = [
home.packages = with pkgs; [
# Screenshots
pkgs.grim
pkgs.slurp
grim
slurp

# Clipboard
pkgs.wl-clipboard

# General launcher
# pkgs.dmenu
ctp-dmenu
wl-clipboard

# Handle idling
pkgs.swayidle
swayidle
];
}
28 changes: 28 additions & 0 deletions users/Name/tofi.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
config,
pkgs,
...
}: {
# Configure tofi
programs.tofi = {
enable = true;
settings = {
# Fullscreen theme
width = "100%";
height = "100%";
border-width = 0;
outline-width = 0;
padding-left = "35%";
padding-top = "35%";
result-spacing = 25;
num-results = 5;
font = "${config.vars.mainFont}";

# Catppuccin Mocha
text-color = "#7f849c";
prompt-color = "#f38ba8";
selection-color = "#cdd6f4";
background-color = "#1e1e2eDD";
};
};
}

0 comments on commit c75ec4b

Please sign in to comment.