54 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			Nix
		
	
	
	
	
	
			
		
		
	
	
			54 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			Nix
		
	
	
	
	
	
| {
 | |
|   pkgs,
 | |
|   config,
 | |
|   ...
 | |
| }: {
 | |
|     programs.waybar = {
 | |
|         enable = true;
 | |
|         package = pkgs.waybar;
 | |
|         settings = {
 | |
|             mainBar = {
 | |
|                 layer = "top";
 | |
|                 position = "top";
 | |
|                 height = 30;
 | |
|                 output = [
 | |
|                     "eDP-1"
 | |
|                     "DP-1"
 | |
|                     "HDMI-A-1"
 | |
|                     "Virtual-1"
 | |
|                 ];
 | |
| 
 | |
|                 modules-left = [ ];
 | |
|                 modules-center = [ "custom/weather" ];
 | |
|                 modules-right = [ "custom/hello-from-waybar" ];
 | |
| 
 | |
|                 "sway/workspaces" = {
 | |
|                     disable-scroll = true;
 | |
|                     all-outputs = true;
 | |
|                 };
 | |
| 
 | |
|                 "custom/weather" = {
 | |
|                     exec = "python3 ~/.config/waybar/weather.py waybar";
 | |
|                     restart-interval = 900;
 | |
|                     return-type = "json";
 | |
|                 };
 | |
| 
 | |
|                 "custom/hello-from-waybar" = {
 | |
|                     format = "hello {}";
 | |
|                     max-length = 40;
 | |
|                     interval = "once";
 | |
|                     exec = pkgs.writeShellScript "hello-from-waybar" ''
 | |
|                         echo "from within waybar $USER"
 | |
|                     '';
 | |
|                 };
 | |
|             };
 | |
|         };
 | |
|     };
 | |
| 
 | |
|     home.file.".config/waybar" = {
 | |
|         source = ./configs;
 | |
|         # copy the scripts directory recursively
 | |
|         recursive = true;
 | |
|     };
 | |
| }
 |