mirror of
https://github.com/ellmau/nixos.git
synced 2025-12-19 09:29:36 +01:00
xmonad base configuration and setup
This commit is contained in:
parent
a1de91a862
commit
34e6673c3e
@ -22,7 +22,10 @@ with lib; {
|
||||
'';
|
||||
};
|
||||
xserver.enable = mkEnableOption "enable X server";
|
||||
xmonad.enable = mkEnableOption "enable xmonad";
|
||||
xmonad = {
|
||||
enable = mkEnableOption "enable xmonad";
|
||||
polybar.enable = mkEnableOption "enable Polybar for xmonad";
|
||||
};
|
||||
i3.enable = mkEnableOption "enable i3";
|
||||
};
|
||||
config = let
|
||||
|
||||
@ -11,6 +11,8 @@ with lib; {
|
||||
|
||||
x11.enable = mkEnableOption "Activate XSession related options in user-configs";
|
||||
|
||||
dunst.enable = mkEnableOption "Activate Dunst";
|
||||
|
||||
users = mkOption {
|
||||
description = "logins of non-admin users to configure";
|
||||
type = types.listOf types.str;
|
||||
|
||||
@ -10,13 +10,22 @@ with lib; {
|
||||
in
|
||||
mkIf cfg.enable {
|
||||
elss.graphical.xserver.enable = true;
|
||||
elss.users.dunste.enable = true;
|
||||
cfg.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;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
195
users/ellmau/conf/rofi/theme.rafi
Normal file
195
users/ellmau/conf/rofi/theme.rafi
Normal file
@ -0,0 +1,195 @@
|
||||
/**
|
||||
* official theme arthur.rasi
|
||||
* ROFI Color theme
|
||||
* User: Qball
|
||||
* Copyright: Dave Davenport
|
||||
*/
|
||||
|
||||
configuration {
|
||||
|
||||
// The display name of this browser
|
||||
display-ssh: " ";
|
||||
// The display name of this browser
|
||||
display-run: "";
|
||||
// The display name of this browser
|
||||
display-drun: "";
|
||||
// The display name of this browser
|
||||
display-window: "";
|
||||
display-combi: "";
|
||||
show-icons: true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* User: Qball
|
||||
* Copyright: Dave Davenport
|
||||
*/
|
||||
* {
|
||||
foreground: #ffeedd;
|
||||
backlight: #ccffeedd;
|
||||
background-color: transparent;
|
||||
dark: #1c1c1c;
|
||||
// Black
|
||||
black: #3d352a;
|
||||
lightblack: #554444;
|
||||
tlightblack: #554444cc;
|
||||
//
|
||||
// Red
|
||||
red: #cd5c5c;
|
||||
lightred: #cc5533;
|
||||
//
|
||||
// Green
|
||||
green: #86af80;
|
||||
lightgreen: #88cc22;
|
||||
//
|
||||
// Yellow
|
||||
yellow: #e8ae5b;
|
||||
lightyellow: #ffa75d;
|
||||
//
|
||||
// Blue
|
||||
blue: #6495ed;
|
||||
lightblue: #87ceeb;
|
||||
//
|
||||
// Magenta
|
||||
magenta: #deb887;
|
||||
lightmagenta: #996600;
|
||||
//
|
||||
// Cyan
|
||||
cyan: #b0c4de;
|
||||
tcyan: #ccb0c4de;
|
||||
lightcyan: #b0c4de;
|
||||
//
|
||||
// White
|
||||
white: #bbaa99;
|
||||
lightwhite: #ddccbb;
|
||||
//
|
||||
// Bold, Italic, Underline
|
||||
highlight: underline bold #ffffff;
|
||||
|
||||
transparent: rgba(0,0,0,0);
|
||||
font: "Source Code Pro 10";
|
||||
}
|
||||
#window {
|
||||
location: center;
|
||||
anchor: center;
|
||||
transparency: "screenshot";
|
||||
padding: 10px;
|
||||
border: 0px;
|
||||
border-radius: 10px;
|
||||
color: @magenta;
|
||||
background-color: @transparent;
|
||||
spacing: 0;
|
||||
children: [mainbox];
|
||||
orientation: horizontal;
|
||||
}
|
||||
|
||||
#mainbox {
|
||||
spacing: 0;
|
||||
children: [ inputbar, message, listview ];
|
||||
}
|
||||
|
||||
#message {
|
||||
border-color: @foreground;
|
||||
border: 0px 2px 2px 2px;
|
||||
// border-radius: 10px;
|
||||
padding: 5;
|
||||
background-color: @tcyan;
|
||||
}
|
||||
#message {
|
||||
font: "Source Code Pro 8";
|
||||
color: @black;
|
||||
}
|
||||
|
||||
#inputbar {
|
||||
color: @lightgreen;
|
||||
padding: 11px;
|
||||
background-color: @tlightblack;
|
||||
border: 2px 2px 2px 2px;
|
||||
border-radius: 15px 15px 0px 0px;
|
||||
border-color: @foreground;
|
||||
font: "Source Code Pro 18";
|
||||
}
|
||||
#entry,prompt,case-indicator {
|
||||
text-font: inherit;
|
||||
text-color:inherit;
|
||||
}
|
||||
#prompt {
|
||||
margin: 0px 0.3em 0em 0em ;
|
||||
}
|
||||
#listview {
|
||||
padding: 8px;
|
||||
border-radius: 0px 0px 15px 15px;
|
||||
border-color: @foreground;
|
||||
border: 0px 2px 2px 2px;
|
||||
background-color: #1c1c1ccc;
|
||||
dynamic: false;
|
||||
lines: 10;
|
||||
}
|
||||
#element {
|
||||
padding: 3px;
|
||||
vertical-align: 0.5;
|
||||
// border: 2px;
|
||||
border-radius: 4px;
|
||||
background-color: transparent;
|
||||
color: @foreground;
|
||||
font:inherit;
|
||||
}
|
||||
#element selected.normal {
|
||||
background-color: @blue;
|
||||
}
|
||||
#element normal active {
|
||||
foreground: @lightblue;
|
||||
}
|
||||
#element normal urgent {
|
||||
foreground: @lightred;
|
||||
}
|
||||
#element alternate normal {
|
||||
}
|
||||
#element alternate active {
|
||||
foreground: @lightblue;
|
||||
}
|
||||
#element alternate urgent {
|
||||
foreground: @lightred;
|
||||
}
|
||||
#element selected active {
|
||||
background-color: @lightblue;
|
||||
foreground: @dark;
|
||||
}
|
||||
#element selected urgent {
|
||||
background-color: @lightred;
|
||||
foreground: @dark;
|
||||
}
|
||||
#element normal normal {
|
||||
|
||||
}
|
||||
|
||||
#vertb {
|
||||
expand: false;
|
||||
children: [ dummy0, mode-switcher, dummy1 ];
|
||||
}
|
||||
#dummy0, dummy1 {
|
||||
expand: true;
|
||||
}
|
||||
|
||||
#mode-switcher {
|
||||
expand: false;
|
||||
orientation: vertical;
|
||||
spacing: 0px;
|
||||
border: 0px 0px 0px 0px;
|
||||
}
|
||||
#button {
|
||||
font: "FontAwesome 22";
|
||||
padding: 6px;
|
||||
border: 2px 0px 2px 2px;
|
||||
border-radius: 4px 0px 0px 4px;
|
||||
background-color: @tlightblack;
|
||||
border-color: @foreground;
|
||||
color: @foreground;
|
||||
horizontal-align: 0.5;
|
||||
}
|
||||
#button selected normal {
|
||||
color: @dark;
|
||||
border: 2px 0px 2px 2px;
|
||||
background-color: @backlight;
|
||||
border-color: @foreground;
|
||||
}
|
||||
@ -7,7 +7,7 @@
|
||||
}:
|
||||
with lib; {
|
||||
config = let
|
||||
cfg = nixosConfig.elss.graphical.i3;
|
||||
cfg = nixosConfig.elss.users.dunst;
|
||||
in
|
||||
mkIf cfg.enable {
|
||||
services.dunst = {
|
||||
|
||||
216
users/ellmau/polybar_xmonad.nix
Normal file
216
users/ellmau/polybar_xmonad.nix
Normal file
@ -0,0 +1,216 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
nixosConfig,
|
||||
...
|
||||
}:
|
||||
with lib; {
|
||||
config = let
|
||||
cfg = nixosConfig.elss.graphical.xmonad;
|
||||
in
|
||||
mkIf cfg.polybar.enable {
|
||||
services.polybar = {
|
||||
enable = true;
|
||||
packages = 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:}
|
||||
'';
|
||||
};
|
||||
|
||||
"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;
|
||||
};
|
||||
"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";
|
||||
};
|
||||
};
|
||||
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;
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
19
users/ellmau/rofi.nix
Normal file
19
users/ellmau/rofi.nix
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
nixosConfig,
|
||||
...
|
||||
}:
|
||||
with lib; {
|
||||
config = let
|
||||
cfg = nixosConfig.elss.graphical.xmonad;
|
||||
in
|
||||
mkIf cfg.enable {
|
||||
programs.rofi = {
|
||||
enable = true;
|
||||
terminal = ${pkgs.alacritty} /bin/alacritty;
|
||||
#theme = conf/rofi/theme.rafi;
|
||||
};
|
||||
};
|
||||
}
|
||||
37
users/ellmau/xmonad.nix
Normal file
37
users/ellmau/xmonad.nix
Normal file
@ -0,0 +1,37 @@
|
||||
{
|
||||
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;
|
||||
};
|
||||
};
|
||||
|
||||
services = {
|
||||
betterlockscreen = {
|
||||
enable = true;
|
||||
inactiveInterval = 10;
|
||||
};
|
||||
picom = {
|
||||
enable = true;
|
||||
backend = "glx";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user