Compare commits

...

12 commits

7 changed files with 136 additions and 41 deletions

View file

@ -7,6 +7,7 @@
./services/polybar
./services/dunst
./services/udiskie
./services/picom
];
home = {

View file

@ -1,7 +1,11 @@
{ config, lib, pkgs, ... }:
{
home.shellAliases = { suspend = "systemctl hibernate"; };
home.shellAliases = {
suspend = "systemctl hibernate";
nrs = "sudo nixos-rebuild switch --flake .";
nrb = "sudo nixos-rebuild build --flake .";
};
programs.zsh = {
enable = true;

View file

@ -0,0 +1,15 @@
{ config, lib, pkgs, ... }:
{
config.services.picom = {
enable = true;
activeOpacity = 1.0;
inactiveOpacity = 0.8;
backend = "glx";
fade = true;
fadeDelta = 5;
opacityRules = [ "100:name *= 'i3lock'" ];
shadow = true;
shadowOpacity = 0.75;
};
}

View file

@ -52,7 +52,7 @@ font-0 = monospace;2
modules-left = xworkspaces xwindow
modules-center = systray
modules-right = filesystem pulseaudio xkeyboard memory cpu wlan eth date
modules-right = filesystem pulseaudio xkeyboard memory cpu battery wlan eth backlight date
cursor-click = pointer
cursor-scroll = ns-resize
@ -73,6 +73,62 @@ type = internal/tray
format-margin = 8pt
tray-spacing = 16pt
[module/battery]
type = internal/battery
; This is useful in case the battery never reports 100% charge
; Default: 100
full-at = 99
; format-low once this charge percentage is reached
; Default: 10
; New in version 3.6.0
low-at = 10
; Use the following command to list batteries and adapters:
; $ ls -1 /sys/class/power_supply/
battery = BAT0
adapter = ADP0
; If an inotify event haven't been reported in this many
; seconds, manually poll for new values.
;
; Needed as a fallback for systems that don't report events
; on sysfs/procfs.
;
; Disable polling by setting the interval to 0.
;
; Default: 5
poll-interval = 5
[module/backlight]
type = internal/xbacklight
; XRandR output to get get values from
; Default: the monitor defined for the running bar
;output = DP-4
; Create scroll handlers used to set the backlight value
; Default: true
enable-scroll = true
; Available tags:
; <label> (default)
; <ramp>
; <bar>
format = <ramp>
; Available tokens:
; %percentage% (default)
label = %percentage%%
; Only applies if <ramp> is used
ramp-0 = 🌕
ramp-1 = 🌔
ramp-2 = 🌓
ramp-3 = 🌒
ramp-4 = 🌑
[module/xworkspaces]
type = internal/xworkspaces

22
modules/wm/light.nix Normal file
View file

@ -0,0 +1,22 @@
{ config, lib, pkgs, ... }:
{
config.programs.light = { enable = true; };
config.services.actkbd = let light = "${pkgs.light}/bin/light";
in {
enable = true;
bindings = [
{
keys = [ 232 ];
events = [ "key" ];
command = "${light} -U 10";
}
{
keys = [ 233 ];
events = [ "key" ];
command = "${light} -A 10";
}
];
};
}

View file

@ -1,8 +1,13 @@
import XMonad
import XMonad.Actions.Navigation2D (navigation2DP, windowGo, windowSwap)
import qualified XMonad.Actions.CycleWS as WS
import XMonad.Util.Ungrab (unGrab)
import XMonad.Layout.ThreeColumns
import XMonad.Layout.Magnifier (magnifiercz')
import XMonad.Layout.ToggleLayouts (ToggleLayout(..), toggleLayouts)
import XMonad.Layout.BinarySpacePartition
import XMonad.Layout.BorderResize (borderResize)
import XMonad.Hooks.EwmhDesktops
import XMonad.Hooks.SetWMName
import qualified XMonad.Hooks.ManageDocks as Docks
import qualified XMonad.Util.EZConfig as EZ
import Control.Monad (when)
@ -24,10 +29,11 @@ compileRestart resume = do
executeFile (cacheDir dirs </> compiledConfig) False args Nothing
)
myLayout = Docks.avoidStruts (tiled ||| Mirror tiled ||| Full ||| columns)
myLayout = borderResize $ Docks.avoidStruts $ layout
where
layout = (emptyBSP ||| columns ||| tiled ||| Full)
tiled = Tall nmaster delta ratio
columns = magnifiercz' 1.3 $ ThreeColMid nmaster delta ratio
columns = ThreeColMid nmaster delta ratio
nmaster = 1 -- default number of windows in the master pane
ratio = 1/2 -- default proportion occupied by master pane
delta = 3/100 -- percent of screen to increment when resizing
@ -35,10 +41,12 @@ myLayout = Docks.avoidStruts (tiled ||| Mirror tiled ||| Full ||| columns)
main :: IO ()
main = getDirectories >>= launch myConfig
myConfig = ewmhFullscreen $ ewmh $ Docks.docks $ def
myConfig = ewmhFullscreen $ ewmh $ Docks.docks $ nav $ def
{ modMask = mod4Mask -- Use Super instead of Alt
, terminal = "alacritty"
, layoutHook = myLayout
-- this seems to be necessary to make java gui applications work :(
, startupHook = ewmhDesktopsStartup >> setWMName "LG3D"
}
`EZ.additionalKeysP`
[ ("M-S-z", spawn "xscreensaver-command -lock")
@ -46,7 +54,28 @@ myConfig = ewmhFullscreen $ ewmh $ Docks.docks $ def
, ("M-S-q", restart "xmonad" True)
, ("M-C-s", unGrab *> spawn "scrot -s")
, ("M-b", sendMessage Docks.ToggleStruts)
, ("M-f", sendMessage (Toggle "Full"))
, ("M-p", spawn appLauncher)
, ("M-i", spawn passLauncher)
, ("M-w", kill)
, ("M-l", WS.toggleWS)
, ("M-g", WS.prevWS)
, ("M-r", WS.nextWS)
, ("<XF86MonBrightnessDown>", spawn "xbacklight -dec 5")
, ("<XF86MonBrightnessUp>", spawn "xbacklight -inc 5")
, ("M-S-c", sendMessage $ MoveSplit U)
, ("M-S-h", sendMessage $ MoveSplit L)
, ("M-S-t", sendMessage $ MoveSplit D)
, ("M-S-n", sendMessage $ MoveSplit R)
, ("M-a", sendMessage Balance)
, ("M-S-a", sendMessage Equalize)
, ("M-o", sendMessage Rotate)
]
where
-- navigate using dvorak bindings
nav = navigation2DP def ("c", "h", "t", "n") [("M-", windowGo), ("M-C-", windowSwap)] True
appLauncher = "rofi -show combi -modes combi -combi-modes window,drun,run,ssh"
passLauncher = "rofi-pass"
-- myManageHook :: ManageHook
@ -54,38 +83,3 @@ myConfig = ewmhFullscreen $ ewmh $ Docks.docks $ def
-- [ className =? "Gimp" --> doFloat
-- , isDialog --> doFloat
-- ]
-- main = xmonad
-- . ewmhFullscreen
-- . ewmh
-- . withEasySB (statusBarProp "xmobar" (pure myXmobarPP)) defToggleStrutsKey
-- $ myConfig
-- myXmobarPP :: PP
-- myXmobarPP = def
-- { ppSep = magenta " • "
-- , ppTitleSanitize = xmobarStrip
-- , ppCurrent = wrap " " "" . xmobarBorder "Top" "#8be9fd" 2
-- , ppHidden = white . wrap " " ""
-- , ppHiddenNoWindows = lowWhite . wrap " " ""
-- , ppUrgent = red . wrap (yellow "!") (yellow "!")
-- , ppOrder = \[ws, l, _, wins] -> [ws, l, wins]
-- , ppExtras = [logTitles formatFocused formatUnfocused]
-- }
-- where
-- formatFocused = wrap (white "[") (white "]") . magenta . ppWindow
-- formatUnfocused = wrap (lowWhite "[") (lowWhite "]") . blue . ppWindow
-- -- | Windows should have *some* title, which should not not exceed a
-- -- sane length.
-- ppWindow :: String -> String
-- ppWindow = xmobarRaw . (\w -> if null w then "untitled" else w) . shorten 30
-- blue, lowWhite, magenta, red, white, yellow :: String -> String
-- magenta = xmobarColor "#ff79c6" ""
-- blue = xmobarColor "#bd93f9" ""
-- white = xmobarColor "#f8f8f2" ""
-- yellow = xmobarColor "#f1fa8c" ""
-- red = xmobarColor "#ff5555" ""
-- lowWhite = xmobarColor "#bbbbbb" ""

View file

@ -14,5 +14,8 @@
};
};
# control backlight
config.environment.systemPackages = [ pkgs.xorg.xbacklight pkgs.scrot ];
config.systemd.services.upower.enable = true;
}