mirror of
https://github.com/ellmau/nixos.git
synced 2025-12-19 09:29:36 +01:00
Update XMonad setup
This commit is contained in:
parent
897fa059bc
commit
ca537a05d9
@ -1,10 +1,4 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
inputs,
|
||||
nixos-hardware,
|
||||
...
|
||||
}: {
|
||||
{ config, pkgs, inputs, nixos-hardware, ... }: {
|
||||
imports = [
|
||||
../../common/users.nix
|
||||
./printer.nix
|
||||
@ -25,9 +19,10 @@
|
||||
# enable X11 with lightdm and i3
|
||||
graphical = {
|
||||
enable = true;
|
||||
sway.enable = true;
|
||||
sway.enable = false;
|
||||
i3.enable = false;
|
||||
plasma.enable = false;
|
||||
xmonad.enable = true;
|
||||
# set dpi if used in mobile applications
|
||||
# dpi = 180;
|
||||
};
|
||||
@ -39,15 +34,10 @@
|
||||
openvpn.enable = true;
|
||||
|
||||
# nm-networks
|
||||
networking.nmConnections = [
|
||||
"tartaros"
|
||||
"eduroam"
|
||||
];
|
||||
networking.nmConnections = [ "tartaros" "eduroam" ];
|
||||
|
||||
# enable sops
|
||||
sops = {
|
||||
enable = true;
|
||||
};
|
||||
sops = { enable = true; };
|
||||
|
||||
# enable wireguard
|
||||
wireguard.enable = true;
|
||||
@ -55,8 +45,8 @@
|
||||
# user setup
|
||||
users = {
|
||||
enable = true;
|
||||
admins = ["ellmau"];
|
||||
users = [];
|
||||
admins = [ "ellmau" ];
|
||||
users = [ ];
|
||||
|
||||
meta = {
|
||||
ellmau.git = {
|
||||
@ -69,13 +59,9 @@
|
||||
};
|
||||
|
||||
boot = {
|
||||
extraModulePackages = [
|
||||
config.boot.kernelPackages.v4l2loopback
|
||||
];
|
||||
extraModulePackages = [ config.boot.kernelPackages.v4l2loopback ];
|
||||
|
||||
kernelModules = [
|
||||
"v4l2loopback"
|
||||
];
|
||||
kernelModules = [ "v4l2loopback" ];
|
||||
|
||||
plymouth.enable = true;
|
||||
};
|
||||
|
||||
@ -21,7 +21,10 @@ with lib; {
|
||||
DPI setting for the xserver
|
||||
'';
|
||||
};
|
||||
xserver.enable = mkEnableOption "enable X server";
|
||||
xserver = {
|
||||
enable = mkEnableOption "enable X server";
|
||||
autorandr.enable = mkEnableOption "enable autorandr";
|
||||
};
|
||||
xmonad = {
|
||||
enable = mkEnableOption "enable xmonad";
|
||||
polybar.enable = mkEnableOption "enable Polybar for xmonad";
|
||||
|
||||
@ -1,31 +1,27 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{ config, pkgs, lib, ... }:
|
||||
with lib; {
|
||||
config = let
|
||||
cfg = config.elss.graphical.xmonad;
|
||||
in
|
||||
mkIf cfg.enable {
|
||||
elss.graphical.xserver.enable = true;
|
||||
elss.users.dunst.enable = true;
|
||||
elss.graphical.xmonad.polybar.enable = true;
|
||||
services = {
|
||||
xserver = {
|
||||
startDbusSession = true;
|
||||
windowManager.xmonad = {
|
||||
enable = true;
|
||||
enableContribAndExtras = true;
|
||||
};
|
||||
displayManager.defaultSession = "none+xmonad";
|
||||
libinput = {
|
||||
enable = true;
|
||||
disableWhileTyping = true;
|
||||
};
|
||||
};
|
||||
upower.enable = true;
|
||||
};
|
||||
config = let cfg = config.elss.graphical.xmonad;
|
||||
in mkIf cfg.enable {
|
||||
elss.graphical.xserver = {
|
||||
enable = true;
|
||||
autorandr.enable = true;
|
||||
};
|
||||
elss.users.dunst.enable = true;
|
||||
elss.graphical.xmonad.polybar.enable = true;
|
||||
services = {
|
||||
xserver = {
|
||||
windowManager.xmonad = {
|
||||
enable = true;
|
||||
enableContribAndExtras = true;
|
||||
};
|
||||
displayManager.defaultSession = "none+xmonad";
|
||||
libinput = {
|
||||
enable = true;
|
||||
touchpad = { disableWhileTyping = true; };
|
||||
};
|
||||
};
|
||||
upower.enable = true;
|
||||
};
|
||||
environment.systemPackages = with pkgs; [ firefox thunderbird ];
|
||||
};
|
||||
}
|
||||
|
||||
@ -1,131 +1,134 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
nixosConfig,
|
||||
...
|
||||
}:
|
||||
{ config, pkgs, lib, nixosConfig, ... }:
|
||||
with lib; {
|
||||
config = let
|
||||
cfg = nixosConfig.elss.graphical.i3;
|
||||
in
|
||||
mkIf cfg.enable {
|
||||
programs.autorandr = {
|
||||
enable = true;
|
||||
profiles = {
|
||||
"home" = {
|
||||
fingerprint = {
|
||||
DP-1 = "00ffffffffffff0009d1507945540000221e0104b54627783f5995af4f42af260f5054a56b80d1c0b300a9c08180810081c0010101014dd000a0f0703e8030203500ba892100001a000000ff004e384c30323634373031390a20000000fd00283c87873c010a202020202020000000fc0042656e5120455733323730550a01bc02033af1515d5e5f6061101f222120051404131203012309070783010000e200c06d030c0020003878200060010203e305e001e6060501544c2ca36600a0f0701f8030203500ba892100001a565e00a0a0a029502f203500ba892100001abf650050a0402e6008200808ba892100001c000000000000000000000000000000bf";
|
||||
eDP-1 = "00ffffffffffff0006af2b2800000000001c0104a51d117802ee95a3544c99260f50540000000101010101010101010101010101010152d000a0f0703e803020350025a51000001a000000000000000000000000000000000000000000fe0039304e544880423133335a414e0000000000024103a8011100000b010a20200006";
|
||||
};
|
||||
config = {
|
||||
eDP-1.enable = false;
|
||||
DP-1 = {
|
||||
enable = true;
|
||||
crtc = 1;
|
||||
primary = true;
|
||||
position = "0x0";
|
||||
mode = "3840x2160";
|
||||
dpi = 96;
|
||||
};
|
||||
};
|
||||
config = let cfg = nixosConfig.elss.graphical.xserver.autorandr;
|
||||
in mkIf cfg.enable {
|
||||
#services.autorandr = { enable = true; };
|
||||
programs.autorandr = {
|
||||
enable = true;
|
||||
profiles = {
|
||||
"home" = {
|
||||
fingerprint = {
|
||||
DP-1 =
|
||||
"00ffffffffffff0009d1507945540000221e0104b54627783f5995af4f42af260f5054a56b80d1c0b300a9c08180810081c0010101014dd000a0f0703e8030203500ba892100001a000000ff004e384c30323634373031390a20000000fd00283c87873c010a202020202020000000fc0042656e5120455733323730550a01bc02033af1515d5e5f6061101f222120051404131203012309070783010000e200c06d030c0020003878200060010203e305e001e6060501544c2ca36600a0f0701f8030203500ba892100001a565e00a0a0a029502f203500ba892100001abf650050a0402e6008200808ba892100001c000000000000000000000000000000bf";
|
||||
eDP-1 =
|
||||
"00ffffffffffff0006af2b2800000000001c0104a51d117802ee95a3544c99260f50540000000101010101010101010101010101010152d000a0f0703e803020350025a51000001a000000000000000000000000000000000000000000fe0039304e544880423133335a414e0000000000024103a8011100000b010a20200006";
|
||||
};
|
||||
"mobile" = {
|
||||
fingerprint.eDP-1 = "00ffffffffffff0006af2b2800000000001c0104a51d117802ee95a3544c99260f50540000000101010101010101010101010101010152d000a0f0703e803020350025a51000001a000000000000000000000000000000000000000000fe0039304e544880423133335a414e0000000000024103a8011100000b010a20200006";
|
||||
config = {
|
||||
eDP-1 = {
|
||||
enable = true;
|
||||
primary = true;
|
||||
mode = "3840x2160";
|
||||
dpi = 192;
|
||||
};
|
||||
};
|
||||
};
|
||||
"work" = {
|
||||
fingerprint = {
|
||||
eDP-1 = "00ffffffffffff0006af2b2800000000001c0104a51d117802ee95a3544c99260f50540000000101010101010101010101010101010152d000a0f0703e803020350025a51000001a000000000000000000000000000000000000000000fe0039304e544880423133335a414e0000000000024103a8011100000b010a20200006";
|
||||
DP-2 = "00ffffffffffff0010acb5414c4133452c1e0104b53c22783eee95a3544c99260f5054a54b00e1c0d100d1c0b300a94081808100714f4dd000a0f0703e803020350055502100001a000000ff0031444e593132330a2020202020000000fd00184b1e8c36010a202020202020000000fc0044454c4c205532373230510a2001af020319f14c101f2005140413121103020123097f0783010000a36600a0f0703e803020350055502100001a565e00a0a0a029503020350055502100001a114400a0800025503020360055502100001a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d9";
|
||||
};
|
||||
config = {
|
||||
eDP-1 = {
|
||||
enable = true;
|
||||
crtc = 0;
|
||||
position = "3840x0";
|
||||
mode = "3840x2160";
|
||||
#dpi = 288;
|
||||
dpi = 96;
|
||||
};
|
||||
DP-2 = {
|
||||
enable = true;
|
||||
primary = true;
|
||||
mode = "3840x2160";
|
||||
#dpi = 144;
|
||||
dpi = 96;
|
||||
position = "0x0";
|
||||
};
|
||||
};
|
||||
};
|
||||
"home-nuc" = {
|
||||
fingerprint = {
|
||||
DP-2 = "00ffffffffffff0009d1507945540000221e0104b54627783f5995af4f42af260f5054a56b80d1c0b300a9c08180810081c0010101014dd000a0f0703e8030203500ba892100001a000000ff004e384c30323634373031390a20000000fd00283c87873c010a202020202020000000fc0042656e5120455733323730550a01bc02033af1515d5e5f6061101f222120051404131203012309070783010000e200c06d030c0020003878200060010203e305e001e6060501544c2ca36600a0f0701f8030203500ba892100001a565e00a0a0a029502f203500ba892100001abf650050a0402e6008200808ba892100001c000000000000000000000000000000bf";
|
||||
};
|
||||
config = {
|
||||
DP-2 = {
|
||||
enable = true;
|
||||
crtc = 1;
|
||||
primary = true;
|
||||
position = "0x0";
|
||||
mode = "3840x2160";
|
||||
dpi = 96;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
"e3027" = {
|
||||
fingerprint = {
|
||||
e-DP1 = "00ffffffffffff0006af2b2800000000001c0104a51d117802ee95a3544c99260f50540000000101010101010101010101010101010152d000a0f0703e803020350025a51000001a000000000000000000000000000000000000000000fe0039304e544880423133335a414e0000000000024103a8011100000b010a20200006";
|
||||
DP-1 = "00ffffffffffff004ca306a7010101011715010380a05a780ade50a3544c99260f5054a10800814081c0950081809040b300a9400101283c80a070b023403020360040846300001a9e20009051201f304880360040846300001c000000fd0017550f5c11000a202020202020000000fc004550534f4e20504a0a202020200116020328f651901f202205140413030212110706161501230907078301000066030c00100080e200fd023a801871382d40582c450040846300001e011d801871382d40582c450040846300001e662156aa51001e30468f330040846300001e302a40c8608464301850130040846300001e00000000000000000000000000000089";
|
||||
};
|
||||
config = {
|
||||
eDP-1 = {
|
||||
enable = true;
|
||||
crtc = 0;
|
||||
position = "0x0";
|
||||
mode = "3840x2160";
|
||||
};
|
||||
DP-1 = {
|
||||
enable = true;
|
||||
crtc = 1;
|
||||
position = "3840x0";
|
||||
mode = "1920x1200";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
"e3027-clone" = {
|
||||
fingerprint = {
|
||||
e-DP1 = "00ffffffffffff0006af2b2800000000001c0104a51d117802ee95a3544c99260f50540000000101010101010101010101010101010152d000a0f0703e803020350025a51000001a000000000000000000000000000000000000000000fe0039304e544880423133335a414e0000000000024103a8011100000b010a20200006";
|
||||
DP-1 = "00ffffffffffff004ca306a7010101011715010380a05a780ade50a3544c99260f5054a10800814081c0950081809040b300a9400101283c80a070b023403020360040846300001a9e20009051201f304880360040846300001c000000fd0017550f5c11000a202020202020000000fc004550534f4e20504a0a202020200116020328f651901f202205140413030212110706161501230907078301000066030c00100080e200fd023a801871382d40582c450040846300001e011d801871382d40582c450040846300001e662156aa51001e30468f330040846300001e302a40c8608464301850130040846300001e00000000000000000000000000000089";
|
||||
};
|
||||
config = {
|
||||
eDP-1 = {
|
||||
enable = true;
|
||||
crtc = 0;
|
||||
position = "0x0";
|
||||
mode = "1920x1200";
|
||||
};
|
||||
DP-1 = {
|
||||
enable = true;
|
||||
crtc = 1;
|
||||
position = "0x0";
|
||||
mode = "1920x1200";
|
||||
};
|
||||
config = {
|
||||
eDP-1.enable = false;
|
||||
DP-1 = {
|
||||
enable = true;
|
||||
crtc = 1;
|
||||
primary = true;
|
||||
position = "0x0";
|
||||
mode = "3840x2160";
|
||||
dpi = 96;
|
||||
};
|
||||
};
|
||||
};
|
||||
hooks.postswitch = {
|
||||
"polybar" = "systemctl --user restart polybar.service";
|
||||
"mobile" = {
|
||||
fingerprint.eDP-1 =
|
||||
"00ffffffffffff0006af2b2800000000001c0104a51d117802ee95a3544c99260f50540000000101010101010101010101010101010152d000a0f0703e803020350025a51000001a000000000000000000000000000000000000000000fe0039304e544880423133335a414e0000000000024103a8011100000b010a20200006";
|
||||
config = {
|
||||
eDP-1 = {
|
||||
enable = true;
|
||||
primary = true;
|
||||
mode = "3840x2160";
|
||||
dpi = 192;
|
||||
};
|
||||
};
|
||||
};
|
||||
"work" = {
|
||||
fingerprint = {
|
||||
eDP-1 =
|
||||
"00ffffffffffff0006af2b2800000000001c0104a51d117802ee95a3544c99260f50540000000101010101010101010101010101010152d000a0f0703e803020350025a51000001a000000000000000000000000000000000000000000fe0039304e544880423133335a414e0000000000024103a8011100000b010a20200006";
|
||||
DP-2 =
|
||||
"00ffffffffffff0010acb5414c4133452c1e0104b53c22783eee95a3544c99260f5054a54b00e1c0d100d1c0b300a94081808100714f4dd000a0f0703e803020350055502100001a000000ff0031444e593132330a2020202020000000fd00184b1e8c36010a202020202020000000fc0044454c4c205532373230510a2001af020319f14c101f2005140413121103020123097f0783010000a36600a0f0703e803020350055502100001a565e00a0a0a029503020350055502100001a114400a0800025503020360055502100001a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d9";
|
||||
};
|
||||
config = {
|
||||
eDP-1 = {
|
||||
enable = true;
|
||||
crtc = 0;
|
||||
position = "3840x0";
|
||||
mode = "3840x2160";
|
||||
#dpi = 288;
|
||||
dpi = 96;
|
||||
};
|
||||
DP-2 = {
|
||||
enable = true;
|
||||
primary = true;
|
||||
mode = "3840x2160";
|
||||
#dpi = 144;
|
||||
dpi = 96;
|
||||
position = "0x0";
|
||||
};
|
||||
};
|
||||
};
|
||||
"home-nuc" = {
|
||||
fingerprint = {
|
||||
DP-2 =
|
||||
"00ffffffffffff0009d1507945540000221e0104b54627783f5995af4f42af260f5054a56b80d1c0b300a9c08180810081c0010101014dd000a0f0703e8030203500ba892100001a000000ff004e384c30323634373031390a20000000fd00283c87873c010a202020202020000000fc0042656e5120455733323730550a01bc02033af1515d5e5f6061101f222120051404131203012309070783010000e200c06d030c0020003878200060010203e305e001e6060501544c2ca36600a0f0701f8030203500ba892100001a565e00a0a0a029502f203500ba892100001abf650050a0402e6008200808ba892100001c000000000000000000000000000000bf";
|
||||
};
|
||||
config = {
|
||||
DP-2 = {
|
||||
enable = true;
|
||||
crtc = 1;
|
||||
primary = true;
|
||||
position = "0x0";
|
||||
mode = "3840x2160";
|
||||
dpi = 96;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
"e3027" = {
|
||||
fingerprint = {
|
||||
e-DP1 =
|
||||
"00ffffffffffff0006af2b2800000000001c0104a51d117802ee95a3544c99260f50540000000101010101010101010101010101010152d000a0f0703e803020350025a51000001a000000000000000000000000000000000000000000fe0039304e544880423133335a414e0000000000024103a8011100000b010a20200006";
|
||||
DP-1 =
|
||||
"00ffffffffffff004ca306a7010101011715010380a05a780ade50a3544c99260f5054a10800814081c0950081809040b300a9400101283c80a070b023403020360040846300001a9e20009051201f304880360040846300001c000000fd0017550f5c11000a202020202020000000fc004550534f4e20504a0a202020200116020328f651901f202205140413030212110706161501230907078301000066030c00100080e200fd023a801871382d40582c450040846300001e011d801871382d40582c450040846300001e662156aa51001e30468f330040846300001e302a40c8608464301850130040846300001e00000000000000000000000000000089";
|
||||
};
|
||||
config = {
|
||||
eDP-1 = {
|
||||
enable = true;
|
||||
crtc = 0;
|
||||
position = "0x0";
|
||||
mode = "3840x2160";
|
||||
};
|
||||
DP-1 = {
|
||||
enable = true;
|
||||
crtc = 1;
|
||||
position = "3840x0";
|
||||
mode = "1920x1200";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
"e3027-clone" = {
|
||||
fingerprint = {
|
||||
e-DP1 =
|
||||
"00ffffffffffff0006af2b2800000000001c0104a51d117802ee95a3544c99260f50540000000101010101010101010101010101010152d000a0f0703e803020350025a51000001a000000000000000000000000000000000000000000fe0039304e544880423133335a414e0000000000024103a8011100000b010a20200006";
|
||||
DP-1 =
|
||||
"00ffffffffffff004ca306a7010101011715010380a05a780ade50a3544c99260f5054a10800814081c0950081809040b300a9400101283c80a070b023403020360040846300001a9e20009051201f304880360040846300001c000000fd0017550f5c11000a202020202020000000fc004550534f4e20504a0a202020200116020328f651901f202205140413030212110706161501230907078301000066030c00100080e200fd023a801871382d40582c450040846300001e011d801871382d40582c450040846300001e662156aa51001e30468f330040846300001e302a40c8608464301850130040846300001e00000000000000000000000000000089";
|
||||
};
|
||||
config = {
|
||||
eDP-1 = {
|
||||
enable = true;
|
||||
crtc = 0;
|
||||
position = "0x0";
|
||||
mode = "1920x1200";
|
||||
};
|
||||
DP-1 = {
|
||||
enable = true;
|
||||
crtc = 1;
|
||||
position = "0x0";
|
||||
mode = "1920x1200";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
hooks.postswitch = {
|
||||
"polybar" = "systemctl --user restart polybar.service";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
7
users/ellmau/conf/keyboard/keyboard_layout_toggle.sh
Executable file
7
users/ellmau/conf/keyboard/keyboard_layout_toggle.sh
Executable file
@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [[ `setxkbmap -query | awk '$1 == "layout:"{print($2)}'` = "us" ]]; then
|
||||
setxkbmap -layout de
|
||||
else
|
||||
setxkbmap -layout us
|
||||
fi
|
||||
@ -1,30 +1,52 @@
|
||||
module Main where
|
||||
|
||||
import ELSS
|
||||
|
||||
import Data.Ratio
|
||||
import XMonad hiding ((|||))
|
||||
import XMonad.Actions.FindEmptyWorkspace
|
||||
import XMonad.Layout
|
||||
import XMonad.Hooks.FadeInactive
|
||||
import XMonad.Hooks.FadeWindows
|
||||
import XMonad.Hooks.EwmhDesktops
|
||||
import XMonad.Hooks.ManageDocks
|
||||
import XMonad.Hooks.ManageHelpers
|
||||
import XMonad.Hooks.Place
|
||||
import XMonad.Hooks.StatusBar
|
||||
import XMonad.Util.EZConfig
|
||||
import Network.HostName (getHostName)
|
||||
|
||||
import qualified XMonad.StackSet as W
|
||||
-- Imports for Polybar --
|
||||
import qualified Codec.Binary.UTF8.String as UTF8
|
||||
import qualified DBus as D
|
||||
import qualified DBus.Client as D
|
||||
import XMonad.Hooks.DynamicLog
|
||||
-- Code Action Imports
|
||||
import System.Exit
|
||||
import XMonad.Actions.PhysicalScreens
|
||||
|
||||
main :: IO ()
|
||||
main' :: D.Client -> IO ()
|
||||
main = mkDbusClient >>= main'
|
||||
|
||||
layout = avoidStruts $
|
||||
(Full ||| tall ||| Mirror tall)
|
||||
where tall = Tall 1 (3/100) (1/2)
|
||||
|
||||
main' dbus = do
|
||||
hostname <- io $ getHostName
|
||||
xmonad . docks . ewmhFullscreen . ewmh $ def
|
||||
{ terminal = "alacritty"
|
||||
, logHook = polybarLogHook dbus
|
||||
, layoutHook = layout
|
||||
, modMask = mod4Mask -- rebind mod to super key
|
||||
, keys = keyMap
|
||||
, manageHook = composeAll [ manageDocks
|
||||
, isFullscreen --> doFullFloat
|
||||
, placeHook $ withGaps (32, 32, 32, 32) $ smart (0.5, 0.5)
|
||||
, manageHook def
|
||||
]
|
||||
}
|
||||
|
||||
mkDbusClient :: IO D.Client
|
||||
@ -45,22 +67,62 @@ dbusOutput dbus str =
|
||||
body = [D.toVariant $ UTF8.decodeString str]
|
||||
in D.emit dbus $ signal { D.signalBody = body }
|
||||
|
||||
keyMap c = mkKeymap c $
|
||||
[ ("M-<Return>" , spawn $ XMonad.terminal c)
|
||||
, ("M-d" , spawn "rofi -show drun")
|
||||
, ("M-<Tab>" , spawn "rofi -show window")
|
||||
, ("M-S-q" , kill)
|
||||
, ("M-<Space>" , sendMessage NextLayout)
|
||||
, ("M-S-r" , refresh)
|
||||
, ("M-j" , windows W.focusUp)
|
||||
, ("M-k" , windows W.focusDown)
|
||||
, ("M-S-j" , windows W.swapUp)
|
||||
, ("M-S-k" , windows W.swapDown)
|
||||
, ("M-;" , viewEmptyWorkspace)
|
||||
, ("M-S-;" , tagToEmptyWorkspace)
|
||||
, ("M-S-<Backspace>" , io exitSuccess)
|
||||
, ("M-C-r" , broadcastMessage ReleaseResources >> restart "xmonad" True)
|
||||
, ("M-C-j" , sendMessage Expand)
|
||||
, ("M-C-k" , sendMessage Shrink)
|
||||
, ("M-w" , viewScreen def 0)
|
||||
, ("M-e" , viewScreen def 1)
|
||||
, ("M-r" , viewScreen def 2)
|
||||
, ("M-S-w" , sendToScreen def 0)
|
||||
, ("M-S-e" , sendToScreen def 1)
|
||||
, ("M-S-r" , sendToScreen def 2)
|
||||
, ("M-t" , withFocused $ windows . W.sink)
|
||||
, ("M-C-l" , spawn "betterlockscreen -l --show-layout -u ~/.background-image.png")
|
||||
, ("M-S-<Tab>" , spawn keyboardtoggle)
|
||||
] ++
|
||||
[(m ++ k, windows $ f w)
|
||||
| (w, k) <- zip (XMonad.workspaces c) (map show $ [1..9] ++ [0]),
|
||||
(m, f) <- [("M-", W.greedyView), ("M-S-", W.shift)]
|
||||
]
|
||||
++
|
||||
[ ("<XF86AudioMute>", spawn "pactl set-sink-mute @DEFAULT_SINK@ toggle")
|
||||
, ("<XF86AudioLowerVolume>", spawn "pactl set-sink-volume @DEFAULT_SINK@ -5%")
|
||||
, ("<XF86AudioRaiseVolume>", spawn "pactl set-sink-volume @DEFAULT_SINK@ +5%")
|
||||
, ("<XF86AudioMicMute>", spawn "pactl set-source-mute @DEFAULT_SOURCE@ toggle")
|
||||
]
|
||||
|
||||
polybarHook :: D.Client -> PP
|
||||
polybarHook dbus =
|
||||
let wrapper c s | s /= "NSP" = wrap ("%{F" <> c <> "} ") " %{F-}" s
|
||||
| otherwise = mempty
|
||||
blue = "#2E9AFE"
|
||||
gray = "#7F7F7F"
|
||||
orange = "#ea4300"
|
||||
purple = "#9058c7"
|
||||
red = "#722222"
|
||||
let wrapper c b "NSP" = mempty
|
||||
wrapper c (Just b) s = wrap ("%{F" <> c <> "}%{B" <> b <> "}") "%{F-}%{B-}" s
|
||||
wrapper c Nothing s = wrap ("%{F" <> c <> "}") "%{F-}" s
|
||||
current = "#859900"
|
||||
visible = "#eee8d5"
|
||||
urgent = "#d33682"
|
||||
highlighted = "#fdf6e3"
|
||||
title = "#657b83"
|
||||
free = "#93a1a1"
|
||||
in def { ppOutput = dbusOutput dbus
|
||||
, ppCurrent = wrapper blue
|
||||
, ppVisible = wrapper gray
|
||||
, ppUrgent = wrapper orange
|
||||
, ppHidden = wrapper gray
|
||||
, ppHiddenNoWindows = wrapper red
|
||||
, ppTitle = shorten 100 . wrapper purple
|
||||
, ppCurrent = wrapper highlighted $ Just current
|
||||
, ppVisible = wrapper title Nothing
|
||||
, ppUrgent = wrapper highlighted $ Just urgent
|
||||
, ppHidden = wrapper free Nothing
|
||||
, ppHiddenNoWindows = mempty
|
||||
, ppTitle = wrapper title Nothing . shorten 60
|
||||
}
|
||||
|
||||
fadeHook :: Rational -> Rational -> X ()
|
||||
@ -68,6 +130,7 @@ fadeHook act inact = fadeOutLogHook $ fadeAllBut exceptions act inact
|
||||
where exceptions = isFullscreen
|
||||
<||> className =? "firefox"
|
||||
<||> className =? "Chromium-browser"
|
||||
<||> className =? "Emacs"
|
||||
|
||||
fadeAllBut :: Query Bool -> Rational -> Rational -> Query Rational
|
||||
fadeAllBut qry amt inact = do isInactive <- isUnfocused
|
||||
@ -78,4 +141,4 @@ fadeAllBut qry amt inact = do isInactive <- isUnfocused
|
||||
then return inact
|
||||
else return amt
|
||||
|
||||
polybarLogHook dbus = fadeHook 0.95 0.75 <+> dynamicLogWithPP (polybarHook dbus)
|
||||
polybarLogHook dbus = fadeHook 0.95 0.75 <+> dynamicLogWithPP (polybarHook dbus)
|
||||
|
||||
@ -16,6 +16,7 @@
|
||||
./nextcloud.nix
|
||||
./polybar_i3.nix
|
||||
./polybar_xmonad.nix
|
||||
./xmonad.nix
|
||||
./zsh.nix
|
||||
|
||||
./sway.nix
|
||||
|
||||
@ -1,48 +1,40 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
nixosConfig,
|
||||
...
|
||||
}:
|
||||
{ config, pkgs, lib, nixosConfig, ... }:
|
||||
with lib; {
|
||||
config = let
|
||||
cfg = nixosConfig.elss.users.dunst;
|
||||
in
|
||||
mkIf cfg.enable {
|
||||
services.dunst = {
|
||||
iconTheme = {
|
||||
package = pkgs.numix-icon-theme;
|
||||
name = "Numix";
|
||||
size = "26";
|
||||
config = let cfg = nixosConfig.elss.users.dunst;
|
||||
in mkIf cfg.enable {
|
||||
services.dunst = {
|
||||
iconTheme = {
|
||||
package = pkgs.numix-icon-theme;
|
||||
name = "Numix";
|
||||
size = "26";
|
||||
};
|
||||
settings = {
|
||||
global = {
|
||||
geometry = "800x5-30+50";
|
||||
transparency = 10;
|
||||
frame_color = "#839496";
|
||||
font = "Hasklug Nerd Font 11";
|
||||
timeout = 5;
|
||||
follow = "mouse";
|
||||
markup = "full";
|
||||
icon_position = "left";
|
||||
history_length = 32;
|
||||
dmenu = "${pkgs.rofi}/bin/rofi -dmenu";
|
||||
word_wrap = true;
|
||||
};
|
||||
settings = {
|
||||
global = {
|
||||
geometry = "800x5-30+50";
|
||||
transparency = 10;
|
||||
frame_color = "#839496";
|
||||
font = "Hasklug Nerd Font 10";
|
||||
timeout = 5;
|
||||
follow = "mouse";
|
||||
markup = "full";
|
||||
icon_position = "left";
|
||||
history_length = 32;
|
||||
dmenu = "${pkgs.rofi}/bin/rofi -dmenu";
|
||||
word_wrap = true;
|
||||
};
|
||||
urgency_critical = {
|
||||
foreground = "#fdf6e3";
|
||||
background = "#dc322f";
|
||||
};
|
||||
urgency_normal = {
|
||||
foreground = "#fdf6e3";
|
||||
background = "#859900";
|
||||
};
|
||||
urgency_low = {
|
||||
foreground = "#fdf6e3";
|
||||
background = "#2aa198";
|
||||
};
|
||||
urgency_critical = {
|
||||
foreground = "#fdf6e3";
|
||||
background = "#dc322f";
|
||||
};
|
||||
urgency_normal = {
|
||||
foreground = "#fdf6e3";
|
||||
background = "#859900";
|
||||
};
|
||||
urgency_low = {
|
||||
foreground = "#fdf6e3";
|
||||
background = "#2aa198";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@ -1,216 +1,73 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
nixosConfig,
|
||||
...
|
||||
}:
|
||||
{ config, pkgs, lib, nixosConfig, ... }:
|
||||
with lib; {
|
||||
config = let
|
||||
cfg = nixosConfig.elss.graphical.xmonad.polybar;
|
||||
in
|
||||
mkIf cfg.enable {
|
||||
services.polybar = {
|
||||
enable = true;
|
||||
package = pkgs.polybarFull;
|
||||
settings = let
|
||||
fonts = [
|
||||
"Hasklig:style=Regular"
|
||||
"all-the-icons:style=Regular"
|
||||
"Webdings:style=Regular"
|
||||
"Noto Emoji:scale=10"
|
||||
"Unifont:style=Regular"
|
||||
"Material Icons:size=12;0"
|
||||
"Weather Icons:size=12;0"
|
||||
"Hasklug Nerd Font,Hasklig Medium:style=Medium,Regular"
|
||||
];
|
||||
in {
|
||||
"bar/main" = {
|
||||
font = fonts;
|
||||
modules = {
|
||||
left = "xmonad";
|
||||
center = "";
|
||||
right = "xbacklight xkeyboard eth wlan battery date powermenu dunst volume ";
|
||||
};
|
||||
tray = {
|
||||
position = "right";
|
||||
padding = 2;
|
||||
};
|
||||
|
||||
monitor = ''
|
||||
''${env:MONITOR:}
|
||||
'';
|
||||
config = let cfg = nixosConfig.elss.graphical.xmonad.polybar;
|
||||
in mkIf cfg.enable {
|
||||
services.polybar = {
|
||||
enable = true;
|
||||
package = pkgs.polybarFull;
|
||||
settings = let
|
||||
fonts = [
|
||||
"Weather Icons:size=12;0"
|
||||
"Hasklug Nerd Font,Hasklig Medium:style=Medium,Regular"
|
||||
"all-the-icons:style=Regular"
|
||||
"Webdings:style=Regular"
|
||||
"Noto Emoji:scale=10"
|
||||
"Unifont:style=Regular"
|
||||
"Material Icons:size=12;0"
|
||||
];
|
||||
in {
|
||||
"bar/main" = {
|
||||
font = fonts;
|
||||
modules = {
|
||||
left = "xmonad";
|
||||
center = "";
|
||||
# right = "xbacklight xkeyboard eth wlan battery date powermenu dunst volume ";
|
||||
right = "";
|
||||
};
|
||||
tray = {
|
||||
position = "right";
|
||||
padding = 2;
|
||||
};
|
||||
|
||||
"bar/aux" = {
|
||||
font = fonts;
|
||||
modules = {
|
||||
left = "xmonad";
|
||||
center = "";
|
||||
right = " xbacklight xkeyboard eth wlan battery date powermenu volume ";
|
||||
};
|
||||
monitor = ''
|
||||
''${env:MONITOR:}
|
||||
'';
|
||||
};
|
||||
background = "FFFFFF";
|
||||
foreground = "000000";
|
||||
|
||||
"module/xmonad" = {
|
||||
type = "custom/script";
|
||||
exec = "${pkgs.xmonad-log} /bin/xmonad-log";
|
||||
tail = true;
|
||||
};
|
||||
"module/xkeyboard" = {
|
||||
type = "internal/xkeyboard";
|
||||
blacklist-0 = "num lock";
|
||||
interval = "5";
|
||||
|
||||
format-prefix = ''""'';
|
||||
label-layout = "%layout%";
|
||||
|
||||
label-indicator-padding = "2";
|
||||
label-indicator-margin = "1";
|
||||
};
|
||||
"module/wlan" = {
|
||||
type = "internal/network";
|
||||
interface = "wlp0s20f3";
|
||||
interval = "3.0";
|
||||
|
||||
format-connected = " <ramp-signal> <label-connected>";
|
||||
format-connected-underline = "#9f78e1";
|
||||
label-connected = "%essid%";
|
||||
|
||||
ramp-signal-0 = ''"0.0"'';
|
||||
ramp-signal-1 = ''"0.5"'';
|
||||
ramp-signal-2 = ''"1.0"'';
|
||||
ramp-signal-3 = ''"1.0"'';
|
||||
ramp-signal-4 = ''"1.0"'';
|
||||
|
||||
format-disconnected = "";
|
||||
# ;format-disconnected = <label-disconnected>
|
||||
#;format-disconnected-underline = ${self.format-connected-underline}
|
||||
#;label-disconnected = %ifname% disconnected
|
||||
#;label-disconnected-foreground = ${colors.foreground-alt}
|
||||
};
|
||||
"module/eth" = {
|
||||
type = "internal/network";
|
||||
interface = "eno1";
|
||||
interval = "3.0";
|
||||
|
||||
format-connected-underline = "#55aa55";
|
||||
format-connected = " <label-connected>";
|
||||
label-connected = "%local_ip%";
|
||||
|
||||
format-disconnected = "";
|
||||
format-disconnected-background = "#5479b7";
|
||||
#;format-disconnected = <label-disconnected>
|
||||
#;format-disconnected-underline = ${self.format-connected-underline}
|
||||
#;label-disconnected = %ifname% disconnected
|
||||
#;label-disconnected-foreground = ${colors.foreground-alt}
|
||||
};
|
||||
"module/date" = {
|
||||
type = "internal/date";
|
||||
interval = "5";
|
||||
|
||||
date = ''" %Y-%m-%d"'';
|
||||
date-alt = ''" %Y-%m-%d"'';
|
||||
|
||||
time = "%H:%M";
|
||||
time-alt = "%H:%M:%S";
|
||||
|
||||
#format-prefix = "";
|
||||
#format-prefix-foreground = foreground_altcol;
|
||||
format-underline = "#0a6cf5";
|
||||
|
||||
label = "%{A} %date% %time%";
|
||||
};
|
||||
"module/battery" = {
|
||||
type = "internal/battery";
|
||||
battery = "BAT0";
|
||||
adapter = "ADP1";
|
||||
full-at = "98";
|
||||
|
||||
format-charging-background = "#689d6a";
|
||||
format-charging-prefix = ''" "'';
|
||||
format-charging = "<label-charging>";
|
||||
format-discharging-prefix = ''" "'';
|
||||
format-discharging = "<label-discharging>";
|
||||
format-discharging-background = "#689d6a";
|
||||
format-full-prefix = ''" "'';
|
||||
|
||||
format-charging-underline = "#ffaa55";
|
||||
format-full-underline = "#ffaa55";
|
||||
|
||||
ormat-full-padding = "1";
|
||||
format-charging-padding = "1";
|
||||
format-discharging-padding = "1";
|
||||
};
|
||||
"module/temperature" = {
|
||||
type = "internal/temperature";
|
||||
thermal-zone = "0";
|
||||
warn-temperature = "60";
|
||||
|
||||
format = "<ramp> <label>";
|
||||
format-underline = "#f50a4d";
|
||||
format-warn = "<ramp> <label-warn>";
|
||||
format-warn-underline = "#f50a4d";
|
||||
|
||||
label = " %temperature-c%";
|
||||
label-warn = "%temperature-c%";
|
||||
|
||||
ramp-0 = "l";
|
||||
ramp-1 = "m";
|
||||
ramp-2 = "h";
|
||||
};
|
||||
|
||||
"module/powermenu" = {
|
||||
type = "custom/menu";
|
||||
|
||||
expand-right = "true";
|
||||
|
||||
format-spacing = "1";
|
||||
|
||||
label-open = ''""'';
|
||||
label-close = " cancel";
|
||||
label-separator = "|";
|
||||
|
||||
menu-0-0 = "reboot";
|
||||
menu-0-0-exec = "menu-open-1";
|
||||
menu-0-1 = "power off";
|
||||
menu-0-1-exec = "menu-open-2";
|
||||
|
||||
menu-1-0 = "cancel";
|
||||
menu-1-0-exec = "menu-open-0";
|
||||
menu-1-1 = "reboot";
|
||||
menu-1-1-exec = "sudo reboot";
|
||||
|
||||
menu-2-0 = "power off";
|
||||
menu-2-0-exec = "sudo poweroff";
|
||||
menu-2-1 = "cancel";
|
||||
menu-2-1-exec = "menu-open-0";
|
||||
};
|
||||
|
||||
"module/xbacklight" = {
|
||||
type = "internal/xbacklight";
|
||||
|
||||
format = "<label> <bar>";
|
||||
label = "BL";
|
||||
};
|
||||
|
||||
"module/dunst" = {
|
||||
type = "custom/script";
|
||||
exec = "PATH=${pkgs.dbus}/bin/:$PATH ${pkgs.dunst}/bin/dunstctl is-paused | ${pkgs.gnugrep}/bin/grep -q true && echo || echo ";
|
||||
interval = 10;
|
||||
click-left = "PATH=${pkgs.dbus}/bin/:$PATH ${pkgs.dunst}/bin/dunstctl set-paused toggle";
|
||||
};
|
||||
monitor = ''
|
||||
''${env:MONITOR:}
|
||||
'';
|
||||
};
|
||||
|
||||
"bar/aux" = {
|
||||
font = fonts;
|
||||
modules = {
|
||||
left = "xmonad";
|
||||
center = "";
|
||||
right =
|
||||
" xbacklight xkeyboard eth wlan battery date powermenu volume ";
|
||||
};
|
||||
monitor = ''
|
||||
''${env:MONITOR:}
|
||||
'';
|
||||
};
|
||||
|
||||
"module/xmonad" = {
|
||||
type = "custom/script";
|
||||
exec = "${pkgs.xmonad-log}/bin/xmonad-log";
|
||||
tail = true;
|
||||
};
|
||||
script = ''
|
||||
for m in $(polybar --list-monitors | ${pkgs.gnugrep}/bin/grep '(primary)' | ${pkgs.coreutils}/bin/cut -d":" -f1); do
|
||||
MONITOR=$m polybar --reload main &
|
||||
done;
|
||||
for m in $(polybar --list-monitors | ${pkgs.gnugrep}/bin/grep -v '(primary)' | ${pkgs.coreutils}/bin/cut -d":" -f1); do
|
||||
MONITOR=$m polybar --reload aux &
|
||||
done;
|
||||
'';
|
||||
};
|
||||
script = ''
|
||||
for m in $(polybar --list-monitors | ${pkgs.gnugrep}/bin/grep '(primary)' | ${pkgs.coreutils}/bin/cut -d":" -f1); do
|
||||
MONITOR=$m polybar --reload main &
|
||||
done;
|
||||
for m in $(polybar --list-monitors | ${pkgs.gnugrep}/bin/grep -v '(primary)' | ${pkgs.coreutils}/bin/cut -d":" -f1); do
|
||||
MONITOR=$m polybar --reload aux &
|
||||
done;
|
||||
'';
|
||||
};
|
||||
|
||||
systemd.user.services.polybar = {
|
||||
Install.WantedBy = [ "graphical-session.target" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@ -1,37 +1,39 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
nixosConfig,
|
||||
...
|
||||
}:
|
||||
{ config, pkgs, lib, nixosConfig, ... }:
|
||||
with lib; {
|
||||
config = let
|
||||
cfg = nixosConfig.elss.graphical.xmonad;
|
||||
in
|
||||
mkIf cfg.enable {
|
||||
xsession = {
|
||||
windowManager.xmonad = {
|
||||
enable = true;
|
||||
enableContribAndExtras = true;
|
||||
enablePackages = hp: [
|
||||
hp.dbus
|
||||
hp.monad-logger
|
||||
hp.xmonad-contrib
|
||||
];
|
||||
config = conf/xmonad/xmonad.hs;
|
||||
};
|
||||
config = let cfg = nixosConfig.elss.graphical.xmonad;
|
||||
in mkIf cfg.enable {
|
||||
xsession = {
|
||||
windowManager.xmonad = {
|
||||
enable = true;
|
||||
enableContribAndExtras = true;
|
||||
extraPackages = hp: [
|
||||
hp.dbus
|
||||
hp.hostname
|
||||
hp.monad-logger
|
||||
hp.xmonad-contrib
|
||||
];
|
||||
libFiles."ELSS.hs" = pkgs.writeText "ELSS.hs" ''
|
||||
module ELSS where
|
||||
keyboardtoggle = "${../keyboard/keyboardtoggle.sh}"
|
||||
'';
|
||||
config = conf/xmonad/xmonad.hs;
|
||||
};
|
||||
|
||||
services = {
|
||||
betterlockscreen = {
|
||||
enable = true;
|
||||
inactiveInterval = 10;
|
||||
};
|
||||
picom = {
|
||||
enable = true;
|
||||
backend = "glx";
|
||||
};
|
||||
};
|
||||
|
||||
services = {
|
||||
betterlockscreen = {
|
||||
enable = true;
|
||||
inactiveInterval = 10;
|
||||
};
|
||||
picom = {
|
||||
enable = true;
|
||||
backend = "glx";
|
||||
};
|
||||
};
|
||||
|
||||
gtk.enable = true;
|
||||
|
||||
home.packages = with pkgs; [ rofi polybarFull firefox pulseaudioFull ];
|
||||
};
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user