From 4c79467426d7bf92718a647e6d7711a0df3fd5c7 Mon Sep 17 00:00:00 2001 From: derped Date: Sat, 26 Aug 2023 08:52:11 +0200 Subject: [PATCH] Nixify i3 config. --- config/etc/i3/{config => config.nix} | 67 ++++++++++++++-------------- services/desktop/i3.nix | 2 +- 2 files changed, 34 insertions(+), 35 deletions(-) rename config/etc/i3/{config => config.nix} (81%) diff --git a/config/etc/i3/config b/config/etc/i3/config.nix similarity index 81% rename from config/etc/i3/config rename to config/etc/i3/config.nix index 6b0b078..8b7d4c9 100644 --- a/config/etc/i3/config +++ b/config/etc/i3/config.nix @@ -1,3 +1,6 @@ +{ pkgs, ... }: + +(pkgs.writeText "config" '' # i3 config file (v4) # # Please see http://i3wm.org/docs/userguide.html for a complete reference! @@ -14,9 +17,9 @@ hide_edge_borders both exec setxkbmap de #exec compton -f -exec feh --bg-scale $(xdg-user-dir PICTURES)/wallpaper.jpg +exec ${pkgs.feh}/bin/feh --bg-scale $(xdg-user-dir PICTURES)/wallpaper.jpg #exec pulseaudio -D -#exec fcitx +exec fcitx5 #exec env=LC_CTYPE=zh_CN.UTF-8 emacs --daemon #exec conky -c $HOME/.my_little_conky/.conkyrc #exec xsnow -nosanta -norudolf -notrees @@ -30,16 +33,16 @@ exec feh --bg-scale $(xdg-user-dir PICTURES)/wallpaper.jpg ### START MEDIA BINDSYM ### -bindsym XF86AudioPlay exec playerctl play -bindsym XF86AudioPause exec playerctl pause -bindsym XF86AudioNext exec playerctl next -bindsym XF86AudioPrev exec playerctl previous +bindsym XF86AudioPlay exec ${pkgs.playerctl}/bin/playerctl play +bindsym XF86AudioPause exec ${pkgs.playerctl}/bin/playerctl pause +bindsym XF86AudioNext exec ${pkgs.playerctl}/bin/playerctl next +bindsym XF86AudioPrev exec ${pkgs.playerctl}/bin/playerctl previous -bindsym $mod+Mod1+space exec playerctl play-pause -bindsym $mod+Mod1+Left exec playerctl position 10- -bindsym $mod+Mod1+Right exec playerctl position 10+ -bindsym $mod+Mod1+Down exec playerctl next -bindsym $mod+Mod1+Up exec playerctl previous +bindsym $mod+Mod1+space exec ${pkgs.playerctl}/bin/playerctl play-pause +bindsym $mod+Mod1+Left exec ${pkgs.playerctl}/bin/playerctl position 10- +bindsym $mod+Mod1+Right exec ${pkgs.playerctl}/bin/playerctl position 10+ +bindsym $mod+Mod1+Down exec ${pkgs.playerctl}/bin/playerctl next +bindsym $mod+Mod1+Up exec ${pkgs.playerctl}/bin/playerctl previous bindsym $mod+Shift+w sticky toggle bindsym $mod+Shift+B floating enable; border none; resize set 900 600; move position 1020 19 @@ -55,22 +58,23 @@ bindsym $mod+y move container to output left bindsym $mod+x move container to output right bindsym $mod+Shift+y move workspace to output left bindsym $mod+Shift+x move workspace to output right -bindsym $mod+minus exec amixer -c 0 sset Master 1%- -bindsym $mod+plus exec amixer -c 0 sset Master 1%+ -bindsym $mod+Mod1+minus exec amixer -D pulse sset Master 1%- -bindsym $mod+Mod1+plus exec amixer -D pulse sset Master 1%+ -bindsym $mod+Shift+minus exec xbacklight -5 -bindsym $mod+Shift+plus exec xbacklight +5 -bindsym $mod+Ctrl+0 exec xbacklight -set 0 -bindsym $mod+Ctrl+1 exec xbacklight -set 10 -bindsym $mod+Ctrl+2 exec xbacklight -set 20 -bindsym $mod+Ctrl+3 exec xbacklight -set 30 -bindsym $mod+Ctrl+4 exec xbacklight -set 40 -bindsym $mod+Ctrl+5 exec xbacklight -set 50 -bindsym $mod+Ctrl+6 exec xbacklight -set 60 -bindsym $mod+Ctrl+7 exec xbacklight -set 70 -bindsym $mod+Ctrl+8 exec xbacklight -set 80 -bindsym $mod+Ctrl+9 exec xbacklight -set 90 +bindsym $mod+l exec ${pkgs.i3lock}/bin/i3lock -efc 000000 +bindsym $mod+minus exec ${pkgs.alsa-utils}/bin/amixer -c 0 sset Master 1%- +bindsym $mod+plus exec ${pkgs.alsa-utils}/bin/amixer -c 0 sset Master 1%+ +bindsym $mod+Mod1+minus exec ${pkgs.alsa-utils}/bin/amixer -D pulse sset Master 1%- +bindsym $mod+Mod1+plus exec ${pkgs.alsa-utils}/bin/amixer -D pulse sset Master 1%+ +bindsym $mod+Shift+minus exec ${pkgs.acpilight}/bin/xbacklight -5 +bindsym $mod+Shift+plus exec ${pkgs.acpilight}/bin/xbacklight +5 +bindsym $mod+Ctrl+0 exec ${pkgs.acpilight}/bin/xbacklight -set 0 +bindsym $mod+Ctrl+1 exec ${pkgs.acpilight}/bin/xbacklight -set 10 +bindsym $mod+Ctrl+2 exec ${pkgs.acpilight}/bin/xbacklight -set 20 +bindsym $mod+Ctrl+3 exec ${pkgs.acpilight}/bin/xbacklight -set 30 +bindsym $mod+Ctrl+4 exec ${pkgs.acpilight}/bin/xbacklight -set 40 +bindsym $mod+Ctrl+5 exec ${pkgs.acpilight}/bin/xbacklight -set 50 +bindsym $mod+Ctrl+6 exec ${pkgs.acpilight}/bin/xbacklight -set 60 +bindsym $mod+Ctrl+7 exec ${pkgs.acpilight}/bin/xbacklight -set 70 +bindsym $mod+Ctrl+8 exec ${pkgs.acpilight}/bin/xbacklight -set 80 +bindsym $mod+Ctrl+9 exec ${pkgs.acpilight}/bin/xbacklight -set 90 bindsym $mod+p move scratchpad bindsym $mod+Shift+p scratchpad show bindsym --release $mod+Ctrl+s exec scrot @@ -152,13 +156,6 @@ bindsym $mod+d exec dmenu_run -fn 'Droid Sans Mono-8' # installed. # bindsym $mod+d exec --no-startup-id i3-dmenu-desktop -# change focus -bindsym $mod+j focus left -bindsym $mod+k focus down -bindsym $mod+l focus up -bindsym $mod+odiaeresis focus right -#bindsym $mod+semicolon focus right - # alternatively, you can use the cursor keys: bindsym $mod+Left focus left bindsym $mod+Down focus down @@ -266,6 +263,7 @@ bindsym $mod+r mode "resize" bar { position top status_command py3status -c /etc/i3/py3status + tray_output primary # status_command i3status colors { separator #586e75 @@ -286,3 +284,4 @@ client.urgent #aa0000 y#990000 #ffffff #client.focused_inactive #073642 #073642 #93a1a1 #002b36 #client.unfocused #002b36 #002b36 #586e75 #002b36 #client.urgent #dc322f #dc322f #fdf6e3 #dc322f +'') diff --git a/services/desktop/i3.nix b/services/desktop/i3.nix index a4856e8..2482344 100644 --- a/services/desktop/i3.nix +++ b/services/desktop/i3.nix @@ -6,7 +6,7 @@ # i3 = { enable = true; - configFile = ../../config/etc/i3/config; + configFile = (import ../../config/etc/i3/config.nix { inherit pkgs; }); extraPackages = with pkgs; [ dmenu file