Want to contribute? Fork me on Codeberg.org!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

172 lines
5.3 KiB

2 years ago
{ pkgs, lib, ... }:
let
theme = import ../theme;
2 years ago
mod = "Mod4";
in with theme.colors; {
# Dependencies
home.packages = with pkgs; [
playerctl # pactl comes with PulseAudio
wmctrl # For rofi power menu
xborders # Active window borders
maim xdotool unclutter # Active window screenshots
xsel # Disable middle mouse paste
];
# Screenshots
services.flameshot = {
enable = true;
settings = {
General = {
disabledTrayIcon = true;
showStartupLaunchMessage = false;
showHelp = false;
showSidePanelButton = false;
uiColor = "${bg1}";
contrastUiColor = "${bg0}";
drawColor = "#ffffff";
};
};
};
2 years ago
xsession.windowManager.i3 = {
enable = true;
config = {
defaultWorkspace = "workspace number 1"; # defaults to 10 for some reason
2 years ago
modifier = mod;
# Causes alt usage to break in programs i.e. Blender
#floating.modifier = "Mod1";
gaps = {
inner = 12;
smartGaps = true;
};
colors = {
focused = {
border = "${bg1}";
background = "${bg1}";
text = "${fg0}";
indicator = "${undefined}";
childBorder = "${undefined}";
};
focusedInactive = {
border = "${bg1}";
background = "${bg1}";
text = "${fg0}";
indicator = "${undefined}";
childBorder = "${undefined}";
};
unfocused = {
border = "${bg0}";
background = "${bg0}";
text = "${fg0}";
indicator = "${undefined}";
childBorder = "${undefined}";
};
};
2 years ago
startup = [
{
command = "systemctl --user restart polybar &";
always = true;
notification = false;
}
{
command = "nm-applet &";
always = true;
notification = false;
}
{
command = "nextcloud &";
always = true;
notification = false;
}
{
command = "protonmail-bridge --noninteractive &";
always = true;
notification = false;
}
{
command = "(xborders --border-rgb ${builtins.substring 1 6 primary}ff --border-radius 12 --border-width 2 --smart-hide-border --disable-version-warning) &";
2 years ago
always = true;
notification = false;
}
{
# Disable middle mouse paste
# https://unix.stackexchange.com/a/501445
# Other solutions such as the xbindkeys approach
# will break other functionality, such as panning
# https://unix.stackexchange.com/a/277488
command = "(while true; do xsel -fin < /dev/null; done) &";
always = true;
notification = false;
}
2 years ago
];
keybindings = lib.mkOptionDefault {
"${mod}+Return" = "exec kitty";
"${mod}+Shift+e" = "exec i3-msg exit"; # bypass default session exit confirmation menu
"${mod}+space" = "exec i3-msg open"; # Open blank space
"Mod1+Q" = let rofi-power = pkgs.substituteAll {
src = ./power.sh;
isExecutable = true;
}; in "exec ${rofi-power}";
"${mod}+a" = "exec com.github.alainm23.task-planner.quick-add";
# Audio controls
"XF86AudioRaiseVolume" = "exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10%";
"XF86AudioLowerVolume" = "exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10%";
"XF86AudioMute" = "exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle";
"XF86AudioMicMute" = "exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle";
# Media player controls
"XF86AudioPlay" = "exec playerctl play-pause";
"XF86AudioNext" = "exec playerctl next";
"XF86AudioPrev" = "exec playerctl previous";
# Window resizing
"${mod}+Ctrl+Left" = "resize shrink width 16px or 1ppt";
"${mod}+Ctrl+Right" = "resize grow width 16px or 1ppt";
"${mod}+Ctrl+Up" = "resize grow height 16px or 1ppt";
"${mod}+Ctrl+Down" = "resize shrink height 16px or 1ppt";
# Screenshots
"Print" = "exec flameshot gui";
# For some reason -u/--hidecursor tag makes image blank
# So, we hide then unhide the cursor
"${mod}+Print" = "exec (unclutter -idle 0 &) && maim -i \"$(xdotool getactivewindow)\" | xclip -selection clipboard -t image/png && killall unclutter";
2 years ago
# Remove dmenu
"${mod}+d" = null;
};
2 years ago
keycodebindings = {
"133" = "--release exec rofi -show drun -theme";
2 years ago
};
window.commands = [
{
command = "border pixel 0";
criteria = { class = "^.*"; };
}
{
command = "floating enable";
criteria = { class = "Nextcloud"; };
}
2 years ago
{
command = "floating enable";
criteria = { class = "PureRef"; };
}
{
command = "floating enable";
criteria = { title = "Drawing Panel"; };
}
{
command = "floating enable";
criteria = { title = "Task Planner - Quick Add"; };
}
{
command = "floating enable";
criteria = { instance = "Godot_Engine"; title="*(DEBUG)"; };
}
2 years ago
];
bars = [];
};
};
}