Compare commits

...

8 Commits

Author SHA1 Message Date
Nathan McCarty 177b60befa
Setup layman 2023-04-20 02:20:23 -04:00
Nathan McCarty 324f519623
Format 2023-04-20 02:01:43 -04:00
Nathan McCarty 502518c570
Package layman 2023-04-19 20:42:07 -04:00
Nathan McCarty 0d693b1789
Update swayimg 2023-04-19 20:24:12 -04:00
Nathan McCarty 5d9dda884c
Update discord 2023-04-19 20:01:14 -04:00
Nathan McCarty 146eae6f68
Setup sworkstyle 2023-04-19 19:59:41 -04:00
Nathan McCarty ee50baf6aa
Move mako to service 2023-04-19 18:49:51 -04:00
Nathan McCarty 1c0382befa
Move glpaper to a user service 2023-04-19 18:49:47 -04:00
7 changed files with 164 additions and 25 deletions

View File

@ -229,15 +229,16 @@
pname = "discord-electron";
binaryName = "DiscordCanary";
desktopName = "Discord (Wayland)";
version = "0.0.150";
version = "0.0.151";
src = pkgs.fetchurl {
url =
"https://dl-canary.discordapp.net/apps/linux/${version}/discord-canary-${version}.tar.gz";
hash = "sha256-8huDp1u0t9/kZbeB7bPqQUw8+HQ6rIyzKYUVN02gQfo=";
hash = "sha256-ZN+lEGtSajgYsyMoGRmyTZCpUGVmb9LKgVv89NA4m7U=";
};
electron = pkgs.electron_22;
};
swayimg = pkgs.callPackage ./packages/swayimg/default.nix { };
layman = pkgs.callPackage ./packages/layman/default.nix { };
};
});
}

View File

@ -4,6 +4,7 @@ in with lib; {
config = mkIf nathan.programs.swaywm.enable (let
swaylock-command = ''
${pkgs.swaylock-effects}/bin/swaylock --screenshots --grace 30 --indicator --clock --timestr "%-I:%M:%S %p" --datestr "%A %Y-%M-%d" --effect-blur 20x3'';
layman-package = inputs.self.packages.${pkgs.system}.layman;
in {
home.packages = with pkgs; [
# Locking and display management
@ -41,11 +42,17 @@ in with lib; {
evince
# Productivity
libreoffice-fresh
## Sway addons
# sworkstyle - Automatic workspace renaming
swayest-workstyle
font-awesome
layman-package
];
#########################
## Sway
#########################
wayland.windowManager.sway = {
wayland.windowManager.sway = let modifier = "Mod4";
in {
enable = true;
systemdIntegration = true;
wrapperFeatures = {
@ -141,19 +148,18 @@ in with lib; {
};
};
# Setup keybindings
keybindings = let modifer = "Mod4";
in lib.mkOptionDefault {
"${modifer}+q" = "kill";
"${modifer}+z" = "exec ${swaylock-command}";
keybindings = lib.mkOptionDefault {
"${modifier}+q" = "kill";
"${modifier}+z" = "exec ${swaylock-command}";
## Sreenshot keybinds
# Copy area to clipboard
"${modifer}+x" =
"${modifier}+x" =
"exec ${pkgs.sway-contrib.grimshot}/bin/grimshot copy area";
# Copy window to clipboard
"${modifer}+Ctrl+x" =
"${modifier}+Ctrl+x" =
"exec ${pkgs.sway-contrib.grimshot}/bin/grimshot copy window";
# Clpy entire output to clipboard
"${modifer}+Alt+x" =
"${modifier}+Alt+x" =
"exec ${pkgs.sway-contrib.grimshot}/bin/grimshot copy output";
# Make the mute key work
"XF86AudioMute" = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle";
@ -166,16 +172,29 @@ in with lib; {
"XF86AudioPlay" = "exec mpc toggle";
"XF86AudioNext" = "exec mpc next";
# Setup scratchpads
"${modifer}+n" =
"${modifier}+n" =
"exec sh -c 'swaymsg [app_id=\"emacs\"] scratchpad show'";
"${modifer}+m" =
"${modifier}+m" =
"exec sh -c 'swaymsg [app_id=\"Alacritty\"] scratchpad show'";
# Rebind movement keys to use layman
"${modifier}+Shift+h" = "nop layman move left";
"${modifier}+Shift+j" = "nop layman move down";
"${modifier}+Shift+k" = "nop layman move up";
"${modifier}+Shift+l" = "nop layman move right";
# Switch to layman mode
"${modifier}+g" = "mode layout";
};
# Startup applications
startup = [
# Mako, the notification daemon
{ command = "mako"; }
];
modes = lib.mkOptionDefault {
layout = {
h = "nop layman none";
j = "nop layman Autotiling";
k = "nop layman Grid";
l = "nop layman MasterStack";
Escape = "mode default";
Return = "mode default";
};
};
# Setup a custom mode for layman operations
# Turn on numlock by default
input = {
"*" = { xkb_numlock = "enable"; };
@ -184,6 +203,76 @@ in with lib; {
};
};
#########################
## Sway Addons
#########################
## swayest_workstyle
# first setup the service
systemd.user.services.sworkstyle = {
Unit = {
Description = "sworkstyle - sway workspace renamer";
After = [ "graphical-session.target" ];
};
Service = {
Type = "simple";
ExecStart = ''
${pkgs.swayest-workstyle}/bin/sworkstyle
'';
Restart = "always";
};
Install = { WantedBy = [ "graphical-session.target" ]; };
};
# then setup the configuration
xdg.configFile."sworkstyle" = {
target = "sworkstyle/config.toml";
text = ''
[matching]
'firefox-beta' = ''
'emacs' = ''
'signal' = ''
'chrome-messages.google.com__web-Default' = ''
'chrome-app.cinny.in__-Default' = ''
'chrome-messenger.com__-Default' = ''
'chrome-localhost__iris_-Default' = ''
'org.jellyfin.' = ''
'';
};
## layman
# First setup the service
systemd.user.services.layman = {
Unit = {
Description = "layman - sway layout manager";
After = [ "graphical-session.target" ];
};
Service = {
Type = "simple";
ExecStart = ''
${layman-package}/bin/layman
'';
Restart = "always";
};
Install = { WantedBy = [ "graphical-session.target" ]; };
};
# then setup the configuration
xdg.configFile."layman" = {
target = "layman/config.toml";
text = ''
# The `layman` section configures options that apply to the layman daemon, and any fallback
# values for options not set in a [workspace] or [output] section.
[layman]
defaultLayout = "none" # The default WLM to assign to a workspace
excludedWorkspaces = [] # Numbers of workspaces to be excuded
excludedOutputs = [] # Names of outputs to be excuded
debug = true # Enable logging debug messages globaly
depthLimit = 0 # Autotiling: Default depth limit (disabled) for all workspaces
stackLayout = "splitv" # MasterStack: Default stack layout for all workspaces
stackSidet = "left" # MasterStack: Default stack position for all workspaces
masterWidth = 65 # MasterStack: Default master width for all workspaces
'';
onChange = ''
${layman-package}/bin/layman || true
'';
};
#########################
## Mako (notifications)
#########################
programs.mako = {
@ -208,6 +297,20 @@ in with lib; {
defaultTimeout = 0;
ignoreTimeout = true;
};
systemd.user.services.mako = {
Unit = {
Description = "mako notification daemon";
After = [ "graphical-session.target" ];
};
Service = {
Type = "simple";
ExecStart = ''
${pkgs.mako}/bin/mako
'';
Restart = "always";
};
Install = { WantedBy = [ "graphical-session.target" ]; };
};
#########################
## Swayidle
#########################

View File

@ -26,16 +26,32 @@
};
input = { "type:pointer" = { pointer_accel = "-0.3"; }; };
startup = [
# GLPaper
# { command = "glpaper DP-1 ${../../custom-files/sway/selen.frag} --fork"; }
{
command = "glpaper DP-1 ${../../custom-files/sway/selen.frag} --fork";
}
# Up the mouse dpi
{ command = "solaar config 1 dpi 4000"; }
];
};
# Sway background
# Spin up glpaper as a user service so we can have it restart on failure (liable due to kvm switch
# disconnecting input)
systemd.user.services.glpaper-dp1 = {
Unit = {
Description = "glpaper (DP-1)";
After = [ "graphical-session.target" ];
};
Service = {
Type = "simple";
ExecStart = ''
/etc/profiles/per-user/nathan/bin/glpaper DP-1 ${
../../custom-files/sway/selen.frag
}
'';
Restart = "always";
};
Install = { WantedBy = [ "graphical-session.target" ]; };
};
# Gammastep
services.gammastep = {
enable = true;

View File

@ -16,7 +16,7 @@ in with lib; {
AppleShowAllExtensions = true;
ShowPathbar = true;
};
NSGlobalDomain = {
NSGlobalDomain = {
# Enable dark mode
AppleInterfaceStyle = "Dark";
# Disable "natural" scrolling

View File

@ -1,3 +1,4 @@
# https://github.com/Admicos/minecraft-wayland
{ stdenv, lib, fetchzip, cmake, libGL, libXrandr, libXinerama, libXcursor
, libX11, libXi, libXext, extra-cmake-modules, wayland, wayland-protocols
, libxkbcommon }:

View File

@ -0,0 +1,18 @@
{ pkgs, lib, pythonPkgs ? pkgs.python311Packages }:
let
inherit pythonPkgs;
f = { buildPythonPackage, i3ipc, setproctitle, tomli, setuptools }:
buildPythonPackage rec {
pname = "layman";
version = "0.0.1";
format = "pyproject";
src = pkgs.fetchFromGitHub {
owner = "frap129";
repo = "layman";
rev = "c827811d71461d9190c3f5d0d00d339d74ff3407";
hash = "sha256-Z8gliSEZgFtOtCZf51J79SqMTHOEd2zwtv0tFiXWn8k=";
};
nativeBuildInputs = [ setuptools ];
propagatedBuildInputs = [ i3ipc setproctitle tomli ];
};
in pythonPkgs.callPackage f { }

View File

@ -5,12 +5,12 @@
stdenv.mkDerivation rec {
pname = "swayimg";
version = "1.9";
version = "1.11";
src = fetchurl {
url =
"https://github.com/artemsen/swayimg/archive/refs/tags/v${version}.tar.gz";
sha256 = "sha256-aTojp3VevtsUQnGytnSYChxRogNtq8/5aXw+PGJY8Qg=";
hash = "sha256-t4U0F8rzySgZUQdkTfMbqAqQb8PsyhgNsoQau/rCdzY=";
name = "${pname}-${version}.tar.gz";
};