i3 is mostly working!
This commit is contained in:
parent
fe1ed3e1be
commit
e27cafb15b
17 changed files with 444 additions and 260 deletions
|
@ -4,18 +4,195 @@
|
|||
lib,
|
||||
...
|
||||
}: {
|
||||
home.stateVersion = "23.11"; # Please read the comment before changing.
|
||||
|
||||
# Let Home Manager install and manage itself.
|
||||
programs.home-manager.enable = true;
|
||||
|
||||
# enable flakes
|
||||
nix =
|
||||
lib.mkIf config.targets.genericLinux.enable
|
||||
{
|
||||
package = pkgs.nix;
|
||||
settings.experimental-features = ["nix-command" "flakes"];
|
||||
settings.max-jobs = "auto";
|
||||
gc.automatic = true;
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
displayManager = {
|
||||
defaultSession = "none+i3";
|
||||
lightdm.enable = true;
|
||||
};
|
||||
windowManager.i3.enable = true;
|
||||
};
|
||||
home-manager.users.${config.host.user} = {config, ...}: {
|
||||
home.packages = with pkgs; [
|
||||
maim
|
||||
brightnessctl
|
||||
];
|
||||
services.playerctld.enable = true;
|
||||
xsession.enable = true;
|
||||
xsession.windowManager.i3 = let
|
||||
mod = "Mod4";
|
||||
|
||||
ws1 = "1";
|
||||
ws2 = "2";
|
||||
ws3 = "3";
|
||||
ws4 = "4";
|
||||
ws5 = "5";
|
||||
ws6 = "6";
|
||||
ws7 = "7";
|
||||
ws8 = "8";
|
||||
ws9 = "9";
|
||||
ws10 = "10";
|
||||
in {
|
||||
enable = true;
|
||||
config = {
|
||||
modifier = mod;
|
||||
terminal = "kitty";
|
||||
menu = "rofi -show drun";
|
||||
keybindings = {
|
||||
"${mod}+Return" = "exec ${config.xsession.windowManager.i3.config.terminal}";
|
||||
"${mod}+d" = "exec ${config.xsession.windowManager.i3.config.menu}";
|
||||
"${mod}+Shift+q" = "kill";
|
||||
|
||||
"${mod}+Left" = "focus left";
|
||||
"${mod}+Down" = "focus down";
|
||||
"${mod}+Up" = "focus up";
|
||||
"${mod}+Right" = "focus right";
|
||||
|
||||
"${mod}+Shift+Left" = "move left";
|
||||
"${mod}+Shift+Down" = "move down";
|
||||
"${mod}+Shift+Up" = "move up";
|
||||
"${mod}+Shift+Right" = "move right";
|
||||
|
||||
"${mod}+h" = "split h";
|
||||
"${mod}+v" = "split v";
|
||||
"${mod}+f" = "fullscreen toggle";
|
||||
|
||||
"${mod}+e" = "layout stacking";
|
||||
"${mod}+r" = "layout tabbed";
|
||||
"${mod}+t" = "layout toggle split";
|
||||
|
||||
"${mod}+Shift+space" = "floating toggle";
|
||||
"${mod}+space" = "focus mode_toggle";
|
||||
|
||||
"${mod}+a" = "focus parent";
|
||||
|
||||
"${mod}+Shift+o" = "move scratchpad";
|
||||
"${mod}+o" = "scratchpad show";
|
||||
|
||||
"${mod}+1" = "workspace ${ws1}";
|
||||
"${mod}+2" = "workspace ${ws2}";
|
||||
"${mod}+3" = "workspace ${ws3}";
|
||||
"${mod}+4" = "workspace ${ws4}";
|
||||
"${mod}+5" = "workspace ${ws5}";
|
||||
"${mod}+6" = "workspace ${ws6}";
|
||||
"${mod}+7" = "workspace ${ws7}";
|
||||
"${mod}+8" = "workspace ${ws8}";
|
||||
"${mod}+9" = "workspace ${ws9}";
|
||||
"${mod}+0" = "workspace ${ws10}";
|
||||
|
||||
"${mod}+Shift+1" = "move container to workspace ${ws1}";
|
||||
"${mod}+Shift+2" = "move container to workspace ${ws2}";
|
||||
"${mod}+Shift+3" = "move container to workspace ${ws3}";
|
||||
"${mod}+Shift+4" = "move container to workspace ${ws4}";
|
||||
"${mod}+Shift+5" = "move container to workspace ${ws5}";
|
||||
"${mod}+Shift+6" = "move container to workspace ${ws6}";
|
||||
"${mod}+Shift+7" = "move container to workspace ${ws7}";
|
||||
"${mod}+Shift+8" = "move container to workspace ${ws8}";
|
||||
"${mod}+Shift+9" = "move container to workspace ${ws9}";
|
||||
"${mod}+Shift+0" = "move container to workspace ${ws10}";
|
||||
|
||||
"${mod}+Shift+n" = "reload";
|
||||
"${mod}+Shift+r" = "restart";
|
||||
"${mod}+Shift+e" = "exec i3-nagbar -t warning -m 'Do you want to exit i3?' -b 'Yes' 'i3-msg exit'";
|
||||
|
||||
"${mod}+ctrl+r" = "mode resize";
|
||||
|
||||
# disable screen going to sleep with mod+b, enable screen going to sleep with mod+shift+b
|
||||
"${mod}+b" = ''
|
||||
exec --no-startup-id "xset s off -dpms; dunstify --timeout=500 'screen blanking off'"
|
||||
'';
|
||||
"${mod}+shift+b" = ''
|
||||
exec --no-startup-id "xset +dpms; dunstify --timeout=500 'screen blanking on'"
|
||||
'';
|
||||
# change brightness
|
||||
"${mod}+control+plus" = ''
|
||||
exec --no-startup-id "brightnessctl s +1%; dunstify -h string:x-dunst-stack-tag:brightness --timeout=500 Brightness\ $(brightnessctl -m| cut --delimiter=, -f 4)"
|
||||
'';
|
||||
"${mod}+control+minus" = ''
|
||||
exec --no-startup-id "brightnessctl s 1%-; dunstify -h string:x-dunst-stack-tag:brightness --timeout=500 Brightness\ $(brightnessctl -m| cut --delimiter=, -f 4)"
|
||||
'';
|
||||
|
||||
#screenshot everything with mod+s, current window with mod+shift+s, selection with mod+ctrl+s
|
||||
"${mod}+s" = ''
|
||||
exec --no-startup-id "maim ~/Pictures/$(date +%s).png; dunstify --timeout=1000 'Whole-desktop screenshot taken'"
|
||||
'';
|
||||
"${mod}+shift+s" = ''
|
||||
exec --no-startup-id "maim -i $(xdotool getactivewindow) ~/Pictures/$(date +%s).png; dunstify --timeout=1000 'Window screenshot taken'"
|
||||
'';
|
||||
"${mod}+ctrl+s" = ''
|
||||
exec --no-startup-id "maim -s ~/Pictures/$(date +%s).png; dunstify --timeout=1000 'Selection screenshot taken'"
|
||||
'';
|
||||
|
||||
#screenshot everything with mod+c, current window with mod+shift+c, selection with mod+ctrl+c (to clipboard)
|
||||
"${mod}+c" = ''
|
||||
exec --no-startup-id "maim | xclip -selection clipboard -t image/png; dunstify --timeout=1000 'Whole-desktop screenshot taken to clipboard'"
|
||||
'';
|
||||
"${mod}+shift+c" = ''
|
||||
exec --no-startup-id "maim -i $(xdotool getactivewindow) | xclip -selection clipboard -t image/png; dunstify --timeout=1000 'Window screenshot taken to clipboard'"
|
||||
'';
|
||||
"${mod}+ctrl+c" = ''
|
||||
exec --no-startup-id "maim -s | xclip -selection clipboard -t image/png; dunstify --timeout=1000 'Selection screenshot taken to clipboard'"
|
||||
'';
|
||||
|
||||
"${mod}+mod1+p" = ''
|
||||
exec --no-startup-id "playerctl play-pause"
|
||||
'';
|
||||
"${mod}+mod1+plus" = ''
|
||||
exec --no-startup-id "playerctl volume -- +0.1; dunstify -h string:x-dunst-stack-tag:playervol --timeout=500 Player $(playerctl volume)"
|
||||
'';
|
||||
"${mod}+mod1+minus" = ''
|
||||
exec --no-startup-id "playerctl volume -- -0.1; dunstify -h string:x-dunst-stack-tag:playervol --timeout=500 Player $(playerctl volume)"
|
||||
'';
|
||||
|
||||
#open volume control
|
||||
"${mod}+shift+p" = ''exec pwvucontrol'';
|
||||
|
||||
#volume control
|
||||
"${mod}+plus" = ''
|
||||
exec --no-startup-id "wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%+; dunstify --timeout=1000 -h string:x-dunst-stack-tag:volume -h int:value:$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | cut -d' ' -f2 | awk '{print $1*100}' ) Volume"
|
||||
'';
|
||||
"${mod}+minus" = ''
|
||||
exec --no-startup-id "wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%-; dunstify --timeout=1000 -h string:x-dunst-stack-tag:volume -h int:value:$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | cut -d' ' -f2 | awk '{print $1*100}' ) Volume"
|
||||
'';
|
||||
|
||||
#open firefox
|
||||
"${mod}+w" = ''exec firefox'';
|
||||
};
|
||||
modes = {
|
||||
resize = {
|
||||
"Left" = "resize shrink width 10 px or 10 ppt";
|
||||
"Down" = "resize grow height 10 px or 10 ppt";
|
||||
"Up" = "resize shrink height 10 px or 10 ppt";
|
||||
"Right" = "resize grow width 10 px or 10 ppt";
|
||||
"Escape" = "mode default";
|
||||
"Return" = "mode default";
|
||||
};
|
||||
};
|
||||
gaps = {
|
||||
inner = 5;
|
||||
outer = 2;
|
||||
};
|
||||
fonts = {
|
||||
names = ["Fira Code"];
|
||||
size = 8.0;
|
||||
};
|
||||
floating = {
|
||||
modifier = mod;
|
||||
# you can find window class names with xprop.
|
||||
criteria = [
|
||||
{class = "pwvucontrol";}
|
||||
{class = "helvum";}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
imports = [
|
||||
../../home-manager/kitty.nix
|
||||
../../home-manager/rofi.nix
|
||||
../../home-manager/dunst.nix
|
||||
];
|
||||
};
|
||||
imports = [
|
||||
../sound.nix
|
||||
];
|
||||
}
|
||||
|
|
|
@ -13,4 +13,11 @@
|
|||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
};
|
||||
|
||||
home-manager.users.${config.host.user} = {config, ...}: {
|
||||
home.packages = with pkgs; [
|
||||
pwvucontrol
|
||||
helvum
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
51
modules/home-manager/dunst.nix
Normal file
51
modules/home-manager/dunst.nix
Normal file
|
@ -0,0 +1,51 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
services = {
|
||||
dunst.enable = true;
|
||||
dunst.settings = {
|
||||
global = {
|
||||
font = "Fira Code";
|
||||
follow = "keyboard";
|
||||
origin = "top-right";
|
||||
transparency = 5;
|
||||
padding = 6;
|
||||
horizontal_padding = 6;
|
||||
};
|
||||
urgency_low = {
|
||||
# IMPORTANT: colors have to be defined in quotation marks.
|
||||
# Otherwise the "#" and following would be interpreted as a comment.
|
||||
frame_color = "#3B7C87";
|
||||
foreground = "#3B7C87";
|
||||
background = "#191311";
|
||||
#background = "#2B313C"
|
||||
timeout = 4;
|
||||
# Icon for notifications with low urgency, uncomment to enable
|
||||
#default_icon = /path/to/icon
|
||||
};
|
||||
|
||||
urgency_normal = {
|
||||
frame_color = "#5B8234";
|
||||
foreground = "#5B8234";
|
||||
background = "#191311";
|
||||
#background = "#2B313C"
|
||||
timeout = 6;
|
||||
# Icon for notifications with normal urgency, uncomment to enable
|
||||
#default_icon = /path/to/icon
|
||||
};
|
||||
|
||||
urgency_critical = {
|
||||
frame_color = "#B7472A";
|
||||
foreground = "#B7472A";
|
||||
background = "#191311";
|
||||
#background = "#2B313C"
|
||||
timeout = 8;
|
||||
# Icon for notifications with critical urgency, uncomment to enable
|
||||
#default_icon = /path/to/icon
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -5,7 +5,7 @@
|
|||
...
|
||||
}: {
|
||||
programs.nixvim = {
|
||||
options = {
|
||||
opts = {
|
||||
mouse = "a";
|
||||
lazyredraw = true;
|
||||
termguicolors = true;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
...
|
||||
}: {
|
||||
programs.nixvim = {
|
||||
plugins.comment-nvim.enable = true;
|
||||
plugins.comment.enable = true;
|
||||
plugins.marks.enable = true;
|
||||
plugins.surround.enable = true;
|
||||
plugins.todo-comments.enable = true;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
...
|
||||
}: {
|
||||
programs.nixvim = {
|
||||
options = {
|
||||
opts = {
|
||||
timeout = true;
|
||||
timeoutlen = 300;
|
||||
};
|
||||
|
|
13
modules/home-manager/rofi.nix
Normal file
13
modules/home-manager/rofi.nix
Normal file
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
programs.rofi = {
|
||||
enable = true;
|
||||
location = "top";
|
||||
terminal = "kitty";
|
||||
theme = "gruvbox-dark-soft";
|
||||
};
|
||||
}
|
|
@ -1,6 +1,8 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
inputs,
|
||||
outputs,
|
||||
...
|
||||
}: {
|
||||
# Bootloader.
|
||||
|
@ -18,6 +20,10 @@
|
|||
|
||||
# packages that should be on every system.
|
||||
environment.systemPackages = with pkgs; [
|
||||
vi # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
|
||||
neovim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
|
||||
];
|
||||
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.extraSpecialArgs = {inherit inputs outputs;};
|
||||
}
|
||||
|
|
|
@ -4,5 +4,12 @@
|
|||
...
|
||||
}: {
|
||||
# Enable touchpad support (enabled default in most desktopManager).
|
||||
services.xserver.libinput.enable = true;
|
||||
services.xserver.libinput = {
|
||||
enable = true;
|
||||
disableWhileTyping = true;
|
||||
naturalScrolling = true;
|
||||
additionalOptions = ''
|
||||
Option "PalmDetection" "True"
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue