helm/modules/desktop/bspwm.nix

99 lines
2.4 KiB
Nix
Raw Normal View History

2019-08-06 10:56:54 -07:00
{ config, lib, pkgs, ... }:
{
imports = [
./.
./rofi.nix
];
2019-08-06 10:56:54 -07:00
environment = {
systemPackages = with pkgs; [
lightdm
bspwm
dunst
libnotify
(polybar.override {
pulseSupport = true;
nlSupport = true;
})
xst # st + nice-to-have extensions
(makeDesktopItem {
name = "xst";
desktopName = "Suckless Terminal";
genericName = "Default terminal";
2019-12-09 00:50:45 -08:00
icon = "utilities-terminal";
exec = "${xst}/bin/xst";
categories = "Development;System;Utility";
})
(writeScriptBin "st-scratch" ''
#!${stdenv.shell}
SCRID=st-scratch
focused=$(xdotool getactivewindow)
scratch=$(xdotool search --onlyvisible --classname $SCRID)
if [[ -n $scratch ]]; then
if [[ $focused == $scratch ]]; then
xdotool windowkill $scratch
else
xdotool windowactivate $scratch
fi
else
xst -t $SCRID -n $SCRID -c $SCRID \
-f "$(xrdb -query | grep 'st-scratch\.font' | cut -f2)" \
-g 100x26 \
-e $SHELL
fi
'')
(writeScriptBin "st-calc" ''
#!${stdenv.shell}
SCRID=st-calc
scratch=$(xdotool search --onlyvisible --classname $SCRID)
[ -n "$scratch" ] && xdotool windowkill $scratch
xst -t $SCRID -n $SCRID -c $SCRID \
-f "$(xrdb -query | grep 'st-scratch\.font' | cut -f2)" \
-g 80x12 \
-e $SHELL -c qalc
'')
(makeDesktopItem {
name = "st-calc";
desktopName = "Calculator";
icon = "calc";
exec = "st-calc";
categories = "Development";
})
2019-08-06 10:56:54 -07:00
];
};
fonts.fonts = [ pkgs.siji ];
programs.zsh.interactiveShellInit = "export TERM=xterm-256color";
2019-08-06 10:56:54 -07:00
services = {
xserver = {
desktopManager.xterm.enable = false;
windowManager.bspwm.enable = true;
displayManager.lightdm = {
enable = true;
greeters.mini = {
enable = true;
user = "hlissner";
};
};
2019-08-06 10:56:54 -07:00
};
compton = {
enable = true;
backend = "glx";
2019-10-17 16:57:00 -07:00
vSync = true;
2019-08-06 10:56:54 -07:00
};
};
home-manager.users.hlissner.xdg.configFile = {
"sxhkd".source = <config/sxhkd>;
# link recursively so other modules can link files in their folders
2019-08-06 10:56:54 -07:00
"bspwm" = { source = <config/bspwm>; recursive = true; };
};
}