xmonad-projects #15

Merged
pleshevskiy merged 2 commits from xmonad-projects into main 2024-02-19 00:20:16 +03:00
6 changed files with 85 additions and 67 deletions

View file

@ -1,4 +1,4 @@
{ lib, config, pkgs, ... }: { lib, config, ... }:
let let
cfg = config.local.wezterm; cfg = config.local.wezterm;

View file

@ -1,51 +1,87 @@
{ config, lib, pkgs, ... }: { config, pkgs, lib, ... }:
let themeCfg = config.local.theme; in let
{ cfg = config.local.xmonad;
home.packages = with pkgs; [ themeCfg = config.local.theme;
xclip # access x clipboard from a console
dmenu # menu for x window system
nitrogen # wallpaper manager
];
xsession = { projectType = with lib; types.submodule {
enable = true; options = {
name = mkOption {
windowManager.xmonad = { type = types.str;
enable = true; };
enableContribAndExtras = true; startHook = mkOption {
type = types.lines;
haskellPackages = pkgs.unstable.haskellPackages;
extraPackages = (hp: [
hp.dbus
hp.monad-logger
]);
config = pkgs.substituteAll {
src = ./xmonad_config.hs;
inherit (themeCfg.bar) background mainText inactiveText;
inherit (themeCfg.window) activeBorder inactiveBorder;
inherit (themeCfg.highlights) critical warning success;
inherit (themeCfg.syntax) mark1 mark2 mark3;
kdbBrightnessScriptPath = "${./scripts/kdb_brightness.sh}";
}; };
}; };
initExtra = ''
${pkgs.nitrogen}/bin/nitrogen --restore &
'';
}; };
services.flameshot = { mkXmonadProject = { name, startHook }:
enable = true; ''
Project {
projectName = "${name}",
projectStartHook = ${startHook}
}
'';
# See: https://github.com/flameshot-org/flameshot/blob/master/flameshot.example.ini xmonadProjects = lib.concatStringsSep " , " (map mkXmonadProject cfg.projects);
settings = { in
General = { {
disabledTrayIcon = true; options.local.xmonad = with lib;
savePathFixed = true; {
showDesktopNotification = false; projects = mkOption {
showSidePanelButton = true; type = types.listOf projectType;
default = [ ];
};
};
config = {
home.packages = with pkgs; [
xclip # access x clipboard from a console
dmenu # menu for x window system
nitrogen # wallpaper manager
];
xsession = {
enable = true;
windowManager.xmonad = {
enable = true;
enableContribAndExtras = true;
haskellPackages = pkgs.unstable.haskellPackages;
extraPackages = (hp: [
hp.dbus
hp.monad-logger
]);
config = pkgs.substituteAll {
src = ./xmonad_config.hs;
projects = "\n " + xmonadProjects;
inherit (themeCfg.bar) background mainText inactiveText;
inherit (themeCfg.window) activeBorder inactiveBorder;
inherit (themeCfg.highlights) critical warning success;
inherit (themeCfg.syntax) mark1 mark2 mark3;
kdbBrightnessScriptPath = "${./scripts/kdb_brightness.sh}";
};
};
initExtra = ''
${pkgs.nitrogen}/bin/nitrogen --restore &
'';
};
services.flameshot = {
enable = true;
# See: https://github.com/flameshot-org/flameshot/blob/master/flameshot.example.ini
settings = {
General = {
disabledTrayIcon = true;
savePathFixed = true;
showDesktopNotification = false;
showSidePanelButton = true;
};
}; };
}; };
}; };

View file

@ -383,29 +383,7 @@ myMouseBindings (XConfig {XMonad.modMask = modm}) =
myProjects :: [Project] myProjects :: [Project]
myProjects = myProjects =
[ -- my work [ -- @projects@
Project
{ projectName = "bm-back",
projectStartHook = do
let workdir = "~/projects/binarymanagement/bm-back"
spawn $ terminal' workdir $ Just "docker-compose -f docker-compose.dev.yml up -d"
replicateM_ 3 $ spawn $ terminal workdir
},
Project
{ projectName = "bm-front",
projectStartHook = do
let workdir = "~/projects/binarymanagement/bm-front"
replicateM_ 3 $ spawn $ terminal workdir
},
-- personal
Project
{ projectName = "system",
projectStartHook = replicateM_ 2 $ spawn $ terminal "~/repos/mynix/system"
},
Project
{ projectName = "neovim",
projectStartHook = replicateM_ 2 $ spawn $ terminal "~/repos/mynix/neovim"
}
] ]
where where
terminal :: String -> String terminal :: String -> String

Binary file not shown.

View file

@ -27,15 +27,17 @@ in
specialArgs = { specialArgs = {
extraJanHomeModule = { lib, pkgs, ... }: { extraJanHomeModule = { lib, pkgs, ... }: {
imports = [ ./home/xmonad_projects.secret.nix ];
home.packages = lib.mkAfter (with pkgs.unstable; [ home.packages = lib.mkAfter (with pkgs.unstable; [
# 3d programs # 3d programs
blender blender
cura cura
godot_4
# electronics # electronics
kicad-small kicad-small
# godot
godot_4
]); ]);
}; };
}; };
}; };
@ -58,7 +60,9 @@ in
}; };
specialArgs = { specialArgs = {
extraJanHomeModule = { ... }: { }; extraJanHomeModule = { lib, ... }: {
imports = [ ./asus-gl553vd/xmonad_projects.secret.nix ];
};
}; };
}; };

Binary file not shown.