change to sway
This commit is contained in:
parent
ed9c5eebd4
commit
814391b33d
@ -16,7 +16,8 @@
|
|||||||
{
|
{
|
||||||
imports =
|
imports =
|
||||||
[
|
[
|
||||||
../../modules/desktop/hyprland/home.nix # Window Manager
|
#../../modules/desktop/hyprland/home.nix # Window Manager
|
||||||
|
../../modules/desktop/sway/home.nix # Window Manager
|
||||||
];
|
];
|
||||||
|
|
||||||
home = { # Specific packages for laptop
|
home = { # Specific packages for laptop
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
''; # Will automatically open sway when logged into tty1
|
''; # Will automatically open sway when logged into tty1
|
||||||
systemPackages = with pkgs; [
|
systemPackages = with pkgs; [
|
||||||
xdg-desktop-portal-wlr
|
xdg-desktop-portal-wlr
|
||||||
|
sway
|
||||||
swaylock
|
swaylock
|
||||||
swayidle
|
swayidle
|
||||||
slurp
|
slurp
|
||||||
@ -38,7 +39,7 @@
|
|||||||
|
|
||||||
programs = {
|
programs = {
|
||||||
sway.enable = true;
|
sway.enable = true;
|
||||||
extraSessionCommands = ''
|
sway.extraSessionCommands = ''
|
||||||
export MOZ_ENABLE_WAYLAND="1";
|
export MOZ_ENABLE_WAYLAND="1";
|
||||||
export MOZ_WEBRENDER="1";
|
export MOZ_WEBRENDER="1";
|
||||||
export MOZ_USE_XINPUT2="2";
|
export MOZ_USE_XINPUT2="2";
|
||||||
@ -55,6 +56,7 @@
|
|||||||
#export LIBCL_ALWAYS_SOFTWARE="1"; # For applications in VM like alacritty to work
|
#export LIBCL_ALWAYS_SOFTWARE="1"; # For applications in VM like alacritty to work
|
||||||
#export WLR_NO_HARDWARE_CURSORS="1"; # For cursor in VM
|
#export WLR_NO_HARDWARE_CURSORS="1"; # For cursor in VM
|
||||||
'';
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
security.pam.services.swaylock = {};
|
security.pam.services.swaylock = {};
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Hyprland NixOS & Home manager configuration
|
# Sway NixOS & Home manager configuration
|
||||||
#
|
#
|
||||||
# flake.nix
|
# flake.nix
|
||||||
# ├─ ./hosts
|
# ├─ ./hosts
|
||||||
@ -7,71 +7,176 @@
|
|||||||
# │ └─ home.nix
|
# │ └─ home.nix
|
||||||
# └─ ./modules
|
# └─ ./modules
|
||||||
# └─ ./desktop
|
# └─ ./desktop
|
||||||
# └─ ./hyprland
|
# └─ ./sway
|
||||||
# └─ home.nix *
|
# └─ home.nix *
|
||||||
#
|
#
|
||||||
|
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
home.file = { ".config/sway/2in1screen".source = ../modules/desktop/scripts/2in1screen };
|
home.file.".config/sway/2in1screen".source = ../scripts/2in1screen;
|
||||||
|
|
||||||
wayland.windowManager.sway = {
|
wayland.windowManager.sway = {
|
||||||
config = {
|
enable = true;
|
||||||
menu = 'bemenu-run --no-exec -m -1 --hf "#ffff00" --tf "#888888" --nf "#00ff40" --hb "#424242" | xargs swaymsg exec --';
|
config = rec {
|
||||||
left = h;
|
menu = "${pkgs.bemenu}/bin/bemenu-run --no-exec -m -1 --hf #ffff00 --tf #888888 --nf #00ff40 --hb #424242 | xargs swaymsg exec --";
|
||||||
down = n;
|
left = "h";
|
||||||
up = e;
|
down = "n";
|
||||||
right = i;
|
up = "e";
|
||||||
modifier = Mod4;
|
right = "i";
|
||||||
|
modifier = "Mod4";
|
||||||
|
|
||||||
input = {
|
input = {
|
||||||
* = {
|
"type:keyboard" = {
|
||||||
xkb_layout = "us";
|
xkb_layout = "us";
|
||||||
xkb_variant = "altgr-intl";
|
xkb_variant = "altgr-intl";
|
||||||
};
|
};
|
||||||
"2321:21128:HTIX5288:00_0911:5288_Touchpad" {
|
"type:touchpad" = {
|
||||||
tap enabled
|
tap = "enabled";
|
||||||
natural_scroll disabled
|
natural_scroll = "disabled";
|
||||||
drag enabled
|
drag = "enabled";
|
||||||
dwt enabled
|
dwt = "enabled";
|
||||||
middle_emulation enabled
|
middle_emulation = "enabled";
|
||||||
scroll_method two_finger
|
scroll_method = "two_finger";
|
||||||
tap_button_map lmr
|
tap_button_map = "lmr";
|
||||||
drag enabled
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
output = {
|
output = {
|
||||||
* = { bg = "$HOME/.config/wall"; };
|
"*" = {
|
||||||
eDP-1 = {
|
bg = "$HOME/.config/wall fill";
|
||||||
resolution = 1920x1080 position 4480,0;
|
|
||||||
subpixel = none;
|
|
||||||
scale = 1.3;
|
|
||||||
};
|
};
|
||||||
DP-1 = {
|
"DP-1" = {
|
||||||
resolution = 1920x1080 position 0,0;
|
mode = "1920x1080";
|
||||||
|
pos = "0,0";
|
||||||
};
|
};
|
||||||
HDMI-A-1 = {
|
"HDMI-A-1" = {
|
||||||
resolution = 2560x1080 position 1920,0;
|
mode = "2560x1080";
|
||||||
|
pos = "1920,0";
|
||||||
|
};
|
||||||
|
"eDP-1" = {
|
||||||
|
mode = "1920x1080";
|
||||||
|
pos = "4480,0";
|
||||||
|
subpixel = "none";
|
||||||
|
scale = "1.3";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
terminal = "alacritty";
|
terminal = "${pkgs.alacritty}/bin/alacritty";
|
||||||
|
|
||||||
|
fonts = {
|
||||||
|
names = [ "Source Code Pro" ];
|
||||||
|
size = 10.0;
|
||||||
|
};
|
||||||
|
|
||||||
|
colors.focused = {
|
||||||
|
background = "#999999";
|
||||||
|
border = "#999999";
|
||||||
|
childBorder = "#999999";
|
||||||
|
indicator = "#212121";
|
||||||
|
text = "#999999";
|
||||||
|
};
|
||||||
|
|
||||||
startup = [
|
startup = [
|
||||||
{ command = "${HOME}/.config/sway/scripts/2in1screen"; }
|
{ command = "$HOME/.config/sway/scripts/2in1screen"; }
|
||||||
{ command = "xrdb -load ~/.Xresources"
|
{ command = "xrdb -load ~/.Xresources"; }
|
||||||
{ command = "gsettings set org.gnome.desktop.interface gtk-theme Arc"
|
{ command = "gsettings set org.gnome.desktop.interface gtk-theme Arc"; }
|
||||||
{ command = "gsettings set org.gnome.desktop.interface icon-theme ePapirus"
|
{ command = "gsettings set org.gnome.desktop.interface icon-theme ePapirus"; }
|
||||||
{ command = "gsettings set org.gnome.desktop.interface cursor-theme Adwaita"
|
{ command = "gsettings set org.gnome.desktop.interface cursor-theme Adwaita"; }
|
||||||
{ command = "${pkgs.thunderbird}/bin/thunderbird";
|
{ command = "${pkgs.thunderbird}/bin/thunderbird"; }
|
||||||
{ command = "${pkgs.firefox}/bin/firefox";
|
{ command = "${pkgs.firefox}/bin/firefox"; }
|
||||||
{ command = "${pkgs.element}/bin/element";
|
{ command = "${pkgs.element}/bin/element"; }
|
||||||
];
|
];
|
||||||
|
|
||||||
workspaceAutoBackAndForth = true;
|
workspaceAutoBackAndForth = true;
|
||||||
|
|
||||||
|
gaps.inner = 8;
|
||||||
|
gaps.outer = 4;
|
||||||
|
|
||||||
|
assigns = {
|
||||||
|
"3: web" = [{ class = "^Firefox$"; }];
|
||||||
|
"2: mail" = [{ class = "^Thunderbird$"; }];
|
||||||
|
"4: im" = [{ class = "^Element$"; }];
|
||||||
|
};
|
||||||
|
|
||||||
|
window.commands = [
|
||||||
|
{ command = "floating enable"; criteria = { class = "Pavucontrol"; }; }
|
||||||
|
{ command = "floating enable"; criteria = { class = "Galculator"; }; }
|
||||||
|
{ command = "floating enable"; criteria = { class = "yubioath-desktop"; }; }
|
||||||
|
{ command = "floating enable"; criteria = { window_role = "pop-up"; }; }
|
||||||
|
];
|
||||||
|
|
||||||
|
bars = [
|
||||||
|
{ command = "${pkgs.waybar}/bin/waybar"; }
|
||||||
|
];
|
||||||
|
|
||||||
|
defaultWorkspace = "workspace number 2";
|
||||||
|
|
||||||
|
keybindings = {
|
||||||
|
"${modifier}+Escape" = "exec swaymsg exit"; # Exit Sway
|
||||||
|
"${modifier}+Return" = "exec ${terminal}"; # Open terminal
|
||||||
|
"${modifier}+d" = "exec ${menu}"; # Open menu
|
||||||
|
"${modifier}+e" = "exec ${pkgs.pcmanfm}/bin/pcmanfm"; # File Manager
|
||||||
|
"${modifier}+l" = "exec ${pkgs.swaylock-fancy}/bin/swaylock-fancy"; # Lock Screen
|
||||||
|
|
||||||
|
"${modifier}+r" = "reload"; # Reload environment
|
||||||
|
"${modifier}+q" = "kill"; # Kill container
|
||||||
|
"${modifier}+f" = "fullscreen toggle"; # Fullscreen
|
||||||
|
"${modifier}+h" = "floating toggle"; # Floating
|
||||||
|
|
||||||
|
"${modifier}+Left" = "focus left"; # Focus container in workspace
|
||||||
|
"${modifier}+Right" = "focus right";
|
||||||
|
"${modifier}+Up" = "focus up";
|
||||||
|
"${modifier}+Down" = "focus down";
|
||||||
|
|
||||||
|
"${modifier}+Shift+Left" = "move left"; # Move container in workspace
|
||||||
|
"${modifier}+Shift+Right" = "move right";
|
||||||
|
"${modifier}+Shift+Up" = "move up";
|
||||||
|
"${modifier}+Shift+Down" = "move down";
|
||||||
|
|
||||||
|
"ALT+Left" = "workspace prev_on_output"; # Navigate to previous or next workspace on output if it exists
|
||||||
|
"ALT+Right" = "workspace next_on_output";
|
||||||
|
|
||||||
|
"ALT+1" = "workspace number 1"; # Open workspace x
|
||||||
|
"ALT+2" = "workspace number 2"; # Open workspace x
|
||||||
|
"ALT+3" = "workspace number 3"; # Open workspace x
|
||||||
|
"ALT+4" = "workspace number 4"; # Open workspace x
|
||||||
|
"ALT+5" = "workspace number 5"; # Open workspace x
|
||||||
|
"ALT+6" = "workspace number 6"; # Open workspace x
|
||||||
|
"ALT+7" = "workspace number 7"; # Open workspace x
|
||||||
|
"ALT+8" = "workspace number 8"; # Open workspace x
|
||||||
|
|
||||||
|
"ALT+Shift+Left" = "move container to workspace prev, workspace prev"; # Move container to next available workspace and focus
|
||||||
|
"ALT+Shift+Right" = "move container to workspace next, workspace next";
|
||||||
|
|
||||||
|
"ALT+Shift+1" = "move container to workspace number 1"; # Move container to specific workspace
|
||||||
|
"ALT+Shift+2" = "move container to workspace number 2";
|
||||||
|
"ALT+Shift+3" = "move container to workspace number 3";
|
||||||
|
"ALT+Shift+4" = "move container to workspace number 4";
|
||||||
|
"ALT+Shift+5" = "move container to workspace number 5";
|
||||||
|
"ALT+Shift+6" = "move container to workspace number 6";
|
||||||
|
"ALT+Shift+7" = "move container to workspace number 7";
|
||||||
|
"ALT+Shift+8" = "move container to workspace number 8";
|
||||||
|
|
||||||
|
"Control+Up" = "resize shrink height 20px"; # Resize container
|
||||||
|
"Control+Down" = "resize grow height 20px";
|
||||||
|
"Control+Left" = "resize shrink width 20px";
|
||||||
|
"Control+Right" = "resize grow width 20px";
|
||||||
|
|
||||||
|
XF86AudioMute = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle";
|
||||||
|
XF86AudioRaiseVolume = "exec pactl set-sink-volume @DEFAULT_SINK@ +5%";
|
||||||
|
XF86AudioLowerVolume = "exec pactl set-sink-volume @DEFAULT_SINK@ -5%";
|
||||||
|
XF86AudioMicMute = "exec pactl set-source-mute @DEFAULT_SOURCE@ toggle";
|
||||||
|
XF86AudioPlay = "exec ~/.config/waybar/scripts/toggle-play";
|
||||||
|
XF86AudioNext = "exec playerctl --player=spotify next";
|
||||||
|
XF86AudioPrev = "exec playerctl --player=spotify previous";
|
||||||
|
XF86MonBrightnessDown = "exec light -s sysfs/backlight/intel_backlight -U 5%";
|
||||||
|
XF86MonBrightnessUp = "exec light -s sysfs/backlight/intel_backlight -A 5%";
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
systemdIntegration = true;
|
||||||
|
wrapperFeatures.gtk = true;
|
||||||
extraSessionCommands = ''
|
extraSessionCommands = ''
|
||||||
export MOZ_ENABLE_WAYLAND="1";
|
export MOZ_ENABLE_WAYLAND="1";
|
||||||
export MOZ_WEBRENDER="1";
|
export MOZ_WEBRENDER="1";
|
||||||
@ -90,33 +195,6 @@
|
|||||||
#export WLR_NO_HARDWARE_CURSORS="1"; # For cursor in VM
|
#export WLR_NO_HARDWARE_CURSORS="1"; # For cursor in VM
|
||||||
'';
|
'';
|
||||||
|
|
||||||
gaps.inner = 8;
|
|
||||||
gaps.outer = 4;
|
|
||||||
|
|
||||||
assigns = {
|
|
||||||
"3: web" = [{ class = "^Firefox$"; }];
|
|
||||||
"2: mail" = [{ class = "^Thunderbird$"; }];
|
|
||||||
"4: im" = [{ class = "^Element$"; }];
|
|
||||||
};
|
|
||||||
|
|
||||||
window.commands = [
|
|
||||||
{ command = "floating enable"; criteria = { class = "Pavucontrol" }; }
|
|
||||||
{ command = "floating enable"; criteria = { class = "Galculator" }; }
|
|
||||||
{ command = "floating enable"; criteria = { class = "yubioath-desktop" }; }
|
|
||||||
{ command = "floating enable"; criteria = { window_role = "pop-up" }; }
|
|
||||||
];
|
|
||||||
|
|
||||||
bars.*.command = "${pkgs.waybar}/bin/waybar";
|
|
||||||
|
|
||||||
defaultWorkspace = "workspace number 3";
|
|
||||||
|
|
||||||
keybindings = {
|
|
||||||
XF86AudioMute = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle";
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
systemdIntegration = true;
|
|
||||||
wrapperFeatures.gtk = true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.swaylock.settings = {
|
programs.swaylock.settings = {
|
||||||
@ -127,15 +205,16 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
services.swayidle = {
|
services.swayidle = {
|
||||||
enable = false;
|
enable = true;
|
||||||
events = [
|
events = [
|
||||||
{ event = "before-sleep"; command = "${pkgs.swaylock}/bin/swaylock"; }
|
{ event = "before-sleep"; command = "${pkgs.swaylock}/bin/swaylock"; }
|
||||||
{ event = "lock"; command = "${pkgs.swaylock}/bin/swaylock -fF"; }
|
{ event = "lock"; command = "${pkgs.swaylock}/bin/swaylock -fF"; }
|
||||||
{ event = "after-resume"; command = "${pkgs.sway}/bin/swaymsg output * dpms on"; }
|
{ event = "after-resume"; command = "${pkgs.sway}/bin/swaymsg output * dpms on"; }
|
||||||
|
{ event = "unlock"; command = "${pkgs.sway}/bin/swaymsg output * dpms on"; }
|
||||||
];
|
];
|
||||||
timeouts = [
|
timeouts = [
|
||||||
{ timeout = 300; command = "${pkgs.swaylock}/bin/swaylock -fF"; }
|
{ timeout = 300; command = "${pkgs.swaylock}/bin/swaylock -fF"; }
|
||||||
{ timeout = 600; command = "${pkgs.sway}/bin/swaymsg output * dpms off"; }
|
{ timeout = 600; command = "${pkgs.sway}/bin/swaymsg output * dpms off"; resumeCommand = "${pkgs.sway}/bin/swaymsg output * dpms on"; }
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -149,8 +149,8 @@
|
|||||||
height = 22;
|
height = 22;
|
||||||
tray = { spacing = 10; };
|
tray = { spacing = 10; };
|
||||||
modules-center = [ "clock" "custom/appkill" ];
|
modules-center = [ "clock" "custom/appkill" ];
|
||||||
#modules-left = [ "wlr/mode" "wlr/workspaces" "wlr/window" ];
|
modules-left = [ "sway/mode" "sway/workspaces" "sway/window" ];
|
||||||
modules-left = [ "wlr/workspaces" ];
|
#modules-left = [ "wlr/workspaces" ];
|
||||||
modules-right = [ "idle_inhibitor" "pulseaudio" "network" "cpu" "memory" "backlight" "temperature" "battery" "tray" ];
|
modules-right = [ "idle_inhibitor" "pulseaudio" "network" "cpu" "memory" "backlight" "temperature" "battery" "tray" ];
|
||||||
#modules-right = [ "cpu" "memory" "pulseaudio" "clock" "tray" ];
|
#modules-right = [ "cpu" "memory" "pulseaudio" "clock" "tray" ];
|
||||||
|
|
||||||
@ -272,7 +272,8 @@
|
|||||||
"custom/appkill" = {
|
"custom/appkill" = {
|
||||||
format = " ";
|
format = " ";
|
||||||
icon-size = 20;
|
icon-size = 20;
|
||||||
on-click = "${pkgs.hyprland}/bin/hyprctl dispatch killactive .";
|
#on-click = "${pkgs.hyprland}/bin/hyprctl dispatch killactive .";
|
||||||
|
on-click = "${pkgs.sway}/bin/swaymsg kill";
|
||||||
tooltip = false;
|
tooltip = false;
|
||||||
};
|
};
|
||||||
}];
|
}];
|
||||||
|
Loading…
Reference in New Issue
Block a user