Use faster launcher, show battery in waybar, default to wezterm

This commit is contained in:
Daniel Flanagan 2024-03-26 11:04:47 -05:00
parent fafd242e46
commit e209716a07
4 changed files with 65 additions and 47 deletions

View file

@ -3,6 +3,7 @@
outputs, outputs,
lib, lib,
config, config,
pkgs,
# font, # font,
... ...
}: { }: {
@ -13,36 +14,26 @@
linux-desktop linux-desktop
]; ];
programs.wofi = {
enable = true;
settings = {
width = "640";
height = "360";
};
style = ''
* {
border-radius: 0;
}
window {
margin: 0px;
padding: 8px;
}
#outer-box {
margin: 8px;
}
#outer-box, #inner-box {
margin-top: 8px;
}
'';
};
programs.foot = { programs.foot = {
enable = true; enable = true;
}; };
home.file."${config.xdg.configHome}/tofi/config" = {
enable = true;
text = ''
font = ${pkgs.iosevka-lyteterm}/share/fonts/truetype/iosevka-lyteterm-regular.ttf
text-color = #f8f8f8
prompt-color = #f38ba8
selection-color = #66d9ef
background-color = #1e1e2e
border-width = 4
border-color = #66d9ef
fuzzy-match = true
'';
};
wayland.windowManager.sway = { wayland.windowManager.sway = {
/* /*
TODO: TODO:
@ -74,7 +65,7 @@
swaymsg "workspace 1" swaymsg "workspace 1"
} }
set $tilers "(wezterm.*|kitty.*|firefox.*|slack.*|Slack.*|thunar.*|Alacritty.*|alacritty.*|Discord.*|discord.*)" set $tilers "(wezterm.*|kitty.*|firefox.*|[Ss]lack.*|thunar.*|[Aa]lacritty.*|[Dd]iscord.*)"
for_window [title=".*"] floating enable for_window [title=".*"] floating enable
for_window [app_id=$tilers] floating disable for_window [app_id=$tilers] floating disable
''; '';
@ -119,6 +110,9 @@
}; };
startup = [ startup = [
{
command = "swayosd-server";
}
{ {
command = "waybar"; command = "waybar";
} }
@ -148,7 +142,7 @@
# {command = "mako";} # {command = "mako";}
# {command = "firefox";} # {command = "firefox";}
# {command = "wezterm";} # {command = "wezterm";}
{command = "kitty --single-instance";} {command = "wezterm";}
]; ];
modes = { modes = {
@ -190,17 +184,18 @@
}; };
keybindings = let keybindings = let
mod = config.wayland.windowManager.sway.config.modifier; mod = config.wayland.windowManager.sway.config.modifier;
menu = "tofi-run | xargs swaymsg exec --";
in { in {
# bindsym $mod+shift+space exec wofi --show drun
"${mod}+control+space" = "exec makoctl dismiss"; "${mod}+control+space" = "exec makoctl dismiss";
"${mod}+shift+space" = "exec makoctl invoke"; "${mod}+shift+space" = "exec makoctl invoke";
# "${mod}+return" = "exec kitty --single-instance"; # "${mod}+return" = "exec kitty --single-instance";
"${mod}+return" = "exec kitty"; "${mod}+return" = "exec wezterm";
"${mod}+shift+return" = "exec floating-term"; "${mod}+shift+return" = "exec floating-term";
"${mod}+shift+alt+return" = "exec kitty"; "${mod}+shift+alt+return" = "exec kitty";
"${mod}+c" = "kill"; "${mod}+c" = "kill";
"${mod}+shift+c" = "kill # TODO: kill -9?"; "${mod}+shift+c" = "kill # TODO: kill -9?";
"${mod}+space" = "exec wofi --show drun"; "${mod}+alt+space" = "exec wofi --show drun";
"${mod}+space" = "exec ${menu}";
"${mod}+shift+s" = "exec clipshot"; "${mod}+shift+s" = "exec clipshot";
"${mod}+e" = "exec thunar"; "${mod}+e" = "exec thunar";
"${mod}+shift+r" = "reload"; "${mod}+shift+r" = "reload";
@ -277,23 +272,39 @@
# TODO: this should also reset the horizontal and vertical gaps? # TODO: this should also reset the horizontal and vertical gaps?
"${mod}+control+equal" = "gaps inner current set 0"; "${mod}+control+equal" = "gaps inner current set 0";
"XF86AudioRaiseVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ +5%"; "XF86AudioRaiseVolume" = "exec swayosd-client --output-volume raise";
"XF86AudioLowerVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ -5%"; "XF86AudioLowerVolume" = "exec swayosd-client --output-volume lower";
"XF86AudioMute" = "exec swayosd-client --output-volume mute-toggle";
"XF86AudioMicMute" = "exec swayosd-client --input-volume mute-toggle";
"${mod}+shift+v" = "exec swayosd-client --input-volume mute-toggle";
# "XF86AudioRaiseVolume" = "exec swayosd-client --output-volume 15";
# "XF86AudioLowerVolume" = "exec swayosd-client --output-volume -15";
# "XF86AudioRaiseVolume" = "exec swayosd-client --output-volume raise --max-volume 120";
# "XF86AudioLowerVolume" = "exec swayosd-client --output-volume lower --max-volume 120";
# "XF86AudioRaiseVolume" = "exec swayosd-client --output-volume +10 --device alsa_output.pci-0000_11_00.4.analog-stereo.monitor";
# "XF86AudioLowerVolume" = "exec swayosd-client --output-volume -10 --device alsa_output.pci-0000_11_00.4.analog-stereo.monitor";
"XF86MonBrightnessUp" = "exec swayosd-client --brightness raise";
"XF86MonBrightnessDown" = "exec swayosd-client --brightness lower";
# "XF86MonBrightnessUp" = " exec swayosd-client --brightness 10";
# "XF86MonBrightnessDown" = "exec swayosd-client --brightness -10";
# "XF86AudioRaiseVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ +5%";
# "XF86AudioLowerVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ -5%";
"control+XF86AudioRaiseVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ +1%"; "control+XF86AudioRaiseVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ +1%";
"control+XF86AudioLowerVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ -1%"; "control+XF86AudioLowerVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ -1%";
"XF86AudioMute" = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle"; # "XF86AudioMute" = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle";
"${mod}+F1" = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle"; "${mod}+F1" = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle";
"XF86AudioMicMute" = "exec pactl set-source-mute @DEFAULT_SOURCE@ toggle"; # "XF86AudioMicMute" = "exec pactl set-source-mute @DEFAULT_SOURCE@ toggle";
"XF86MonBrightnessDown" = "exec brightnessctl set 10%-"; # "XF86MonBrightnessDown" = "exec brightnessctl set 10%-";
"XF86MonBrightnessUp" = "exec brightnessctl set +10%"; # "XF86MonBrightnessUp" = "exec brightnessctl set +10%";
"shift+XF86MonBrightnessDown" = "exec brightnessctl set 1%"; # "shift+XF86MonBrightnessDown" = "exec brightnessctl set 1%";
"shift+XF86MonBrightnessUp" = "exec brightnessctl set 100%"; # "shift+XF86MonBrightnessUp" = "exec brightnessctl set 100%";
"control+XF86MonBrightnessDown" = "exec brightnessctl set 1%-"; # "control+XF86MonBrightnessDown" = "exec brightnessctl set 1%-";
"control+XF86MonBrightnessUp" = "exec brightnessctl set +1%"; # "control+XF86MonBrightnessUp" = "exec brightnessctl set +1%";
"XF86AudioPlay" = "exec playerctl play-pause"; "XF86AudioPlay" = "exec playerctl play-pause";
"XF86AudioNext" = "exec playerctl next"; "XF86AudioNext" = "exec playerctl next";
"XF86AudioPrev" = "exec playerctl previous"; "XF86AudioPrev" = "exec playerctl previous";
"${mod}+shift+v" = "exec pactl set-source-mute @DEFAULT_SOURCE@ toggle"; # "${mod}+shift+v" = "exec pactl set-source-mute @DEFAULT_SOURCE@ toggle";
"${mod}+control+shift+l" = "exec swaylock"; "${mod}+control+shift+l" = "exec swaylock";

View file

@ -91,11 +91,11 @@
"warning" = 30; "warning" = 30;
"critical" = 1; "critical" = 1;
}; };
"format" = "{capacity}% {icon}"; "format" = "{capacity}% {time} {icon}";
"format-charging" = "{capacity}% 󱐋"; "format-charging" = "{capacity}% {time} 󱐋";
"format-plugged" = "{capacity}% 󰚥"; "format-plugged" = "{capacity}% {time} 󰚥";
"format-alt" = "{time} {icon}"; "format-alt" = "{capacity}% {icon}";
"format-good" = ""; # An empty format will hide the modul; "format-good" = ""; # An empty format will hide the module
"format-full" = "󰁹"; "format-full" = "󰁹";
"format-icons" = ["󰂎" "󰁻" "󰁽" "󰁿" "󰂂"]; "format-icons" = ["󰂎" "󰁻" "󰁽" "󰁿" "󰂂"];
}; };

View file

@ -299,6 +299,11 @@ in {
}; };
}; };
services.udev.extraRules = ''
ACTION=="add", SUBSYSTEM=="backlight", RUN+="${pkgs.coreutils}/bin/chgrp video /sys/class/backlight/%k/brightness"
ACTION=="add", SUBSYSTEM=="backlight", RUN+="${pkgs.coreutils}/bin/chmod g+w /sys/class/backlight/%k/brightness"
'';
# # TODO: regular cron or something? # # TODO: regular cron or something?
# programs.nix-index = { # programs.nix-index = {
# enable = true; # enable = true;

View file

@ -78,6 +78,8 @@
swaybg swaybg
swayidle swayidle
swaylock swaylock
swayosd
tofi
# vlc # vlc
# vulkan-tools # vulkan-tools
waybar waybar