File tree 3 files changed +41
-8
lines changed
3 files changed +41
-8
lines changed Original file line number Diff line number Diff line change 10
10
programs . autorandr = {
11
11
enable = true ;
12
12
profiles = {
13
- # Default single-screen setup, with builtin laptop screen as
14
- # primary.
13
+ # Default single-display setup, with builtin laptop display as primary.
15
14
default = {
16
15
fingerprint = { inherit ( fingerprints ) eDP-1 ; } ;
17
16
config = {
23
22
} ;
24
23
} ;
25
24
} ;
26
- # Double-screen setup with HDMI screen as primary and builtin
27
- # laptop screen as secondary.
25
+ # Double-display setup with HDMI display as primary and builtin laptop
26
+ # display as secondary.
28
27
doublescreen = {
29
28
fingerprint = { inherit ( fingerprints ) HDMI-1 eDP-1 ; } ;
30
29
config = {
46
45
postswitch = lib . optionalAttrs config . services . polybar . enable {
47
46
"polybar-restart" =
48
47
"${ config . services . polybar . package } /bin/polybar-msg cmd restart" ;
48
+ } // lib . optionalAttrs ( config . wallpaper . command != null ) {
49
+ "wallpaper" = config . wallpaper . command ;
49
50
} ;
50
51
} ;
51
52
} ;
Original file line number Diff line number Diff line change 16
16
'' ;
17
17
} ;
18
18
in {
19
+ imports = [ ../../modules/home/wallpaper.nix ] ;
20
+
19
21
home . packages = [ xmonad ] ;
20
22
21
23
xsession = {
22
24
enable = true ;
23
- initExtra = ''
24
- ${ pkgs . feh } /bin/feh --no-fehbg --bg-fill --geometry +0+0 ${ wallpaper }
25
- '' ;
26
-
27
25
windowManager . command = "${ xmonad } /bin/xmonad-${ targetSystem } " ;
28
26
} ;
27
+
28
+ wallpaper = {
29
+ enableXSession = true ;
30
+ command =
31
+ "${ pkgs . feh } /bin/feh --no-fehbg --bg-fill --geometry +0+0 ${ wallpaper } " ;
32
+ } ;
29
33
}
Original file line number Diff line number Diff line change
1
+ { config , lib , ... } :
2
+ with lib ;
3
+ let cfg = config . wallpaper ;
4
+ in {
5
+ options . wallpaper = {
6
+ enableXSession = mkOption {
7
+ type = types . bool ;
8
+ default = false ;
9
+ description = ''
10
+ Whether to enable setting the wallpaper using X Session.
11
+ '' ;
12
+ } ;
13
+
14
+ command = mkOption {
15
+ type = types . str ;
16
+ default = null ;
17
+ description = ''
18
+ Command to set wallpaper.
19
+ '' ;
20
+ } ;
21
+ } ;
22
+
23
+ config = mkIf cfg . enableXSession {
24
+ xsession . initExtra = ''
25
+ ${ cfg . command }
26
+ '' ;
27
+ } ;
28
+ }
You can’t perform that action at this time.
0 commit comments