{config, pkgs, lib, ... }:
let
	# Theme/Mode
	THEME = "gruvbox";
	MODE = "dark";

	# Colours
	inherit (import ./themes/${THEME}_${MODE}.nix) BG FG GRAY DARK_GRAY RED DARK_RED GREEN DARK_GREEN YELLOW DARK_YELLOW BLUE DARK_BLUE PURPLE DARK_PURPLE CYAN DARK_CYAN GTK_THEME GTK_THEME_NAME GTK_ICONS GTK_ICONS_NAME GTK_CURSOR GTK_CURSOR_NAME;
	ACCENT = "${CYAN}";
	SECOND_ACCENT = "${PURPLE}";
	ACTIVE_BORDER_COLOR = "${ACCENT}";
	INACTIVE_BORDER_COLOR = "${FG}";
	SHADOW_COLOR = "00000000";

	# Programs
	MENU = "fuzzel";
	TERMINAL = "kitty";
	BROWSER = "firefox";

	# Numbers
	GAPS_IN = "0";
	GAPS_OUT = "40";
	BORDER_WIDTH = "2";
	CORNER_RADIUS = "0";
	WAYBAR_CORNER_RADIUS = "0";
	TERMINAL_OPACITY = "0.8";
	SCREEN_HEIGHT = 1440;
	SCREEN_WIDTH = 2560;
	FUZZEL_WIDTH = "25";
	FUZZEL_HEIGHT = "15";
	FUZZEL_OPACITY = "aa";

	# Other
	HOME = "/home/deadvey";
	#WALLPAPER = "wallpaper.png";
	WALLPAPER_PATH = "${HOME}/.config/home-manager/wallpapers/gruvbox/";
	FONT = "VictorMono Nerd Font Mono";
	FONT_PACKAGE = "victor-mono";
	FUZZEL_PROMPT = " >>     ";
	DUNST_ORIGIN = "top-center";
in
{
  # Home Manager needs a bit of information about you and the paths it should
  # manage.
  
  home = {
	username = "deadvey";
	homeDirectory = "/home/deadvey";
	enableNixpkgsReleaseCheck = false;
  	stateVersion = "24.11";
	packages = with pkgs; [
		anki
		claws-mail
		dunst
		esphome
		entr
		fastfetch
		firefox
		fractal
		fuzzel
		gimp
		gnome-feeds
		htop
		hyprland
		hyprpicker
		hyprlock
		hypridle
		iamb
		imagemagick
		irssi
		keepassxc
		killall
		kitty
		libreoffice
		lm_sensors
		metar
		minetest
		mpv
		newsboat
		pavucontrol
		tor-browser
		transmission_4-gtk
		waybar
		unzip
		w3m
		wl-clipboard
		wpaperd
		zip
  	];
	# Required for Hyprpicker to work
	pointerCursor = {
	  	gtk.enable = true;
	  	package = pkgs.${GTK_CURSOR};
	  	name = "${GTK_CURSOR_NAME}";
	  	size = 16;
	};
	file = {
		"theme.conf" = {
			text = ''
				THEME="${THEME}";
				MODE="${MODE}";

				# Colors
				BG="${BG}"
				FG="${RED}"
				GRAY="${GRAY}"
				DARK_GRAY="${DARK_GRAY}"
				RED="${RED}"
				DARK_RED="${DARK_RED}"
				GREEN="${GREEN}"
				DARK_GREEN="${DARK_GREEN}"
				YELLOW="${YELLOW}"
				DARK_YELLOW="${DARK_YELLOW}"
				BLUE="${BLUE}"
				DARK_BLUE="${DARK_BLUE}"
				PURPLE="${PURPLE}"
				DARK_PURPLE="${DARK_PURPLE}"
				CYAN="${CYAN}"
				DARK_CYAN="${DARK_CYAN}"
				ACCENT="${ACCENT}"

				# GTK
				GTK_THEME="${GTK_THEME}";
				GTK_THEME_NAME="${GTK_THEME_NAME}"
				GTK_ICONS="${GTK_ICONS}"
				GTK_CURSOR="${GTK_CURSOR}"
			'';
		};
		"scripts/wallpaper-updater.sh" = {
			text = ''
				file="";
				while sleep 1; do
					new_file=$(cat $HOME/theme.sh)
					if [[ "$new_file" != "$file" ]]; then
						source $HOME/theme.sh
						magick ${WALLPAPER_PATH} \
							-fuzz 10% -fill "#$BG" -opaque "$(convert ${WALLPAPER_PATH} -format "%[pixel:u.p{0,0}]" info:-)" \
							-fuzz 10% -fill "#$ACCENT" -opaque "$(convert ${WALLPAPER_PATH} -format "%[pixel:u.p{3475,1627}]" info:-)" \
							${WALLPAPER_PATH}
						oldid=$(pgrep wpaperd)
						wpaperd &
						kill $oldid
					fi
					file=$new_file
				done
			'';
			executable = true;
		};
		"scripts/theme-switcher.sh" = {
			text = ''
				echo theme = $1
				echo mode = $2
				sed -i "s/THEME\ =\ ".*";/THEME\ =\ \"''${1}\";/" $HOME/.config/home-manager/home.nix
				sed -i "s/MODE\ =\ ".*";/MODE\ =\ \"''${2}\";/" $HOME/.config/home-manager/home.nix
				home-manager switch
			'';
			executable = true;
		};
		"scripts/time.sh" = {
			text = ''
				if [ "$1" = "--help" ]; then
					echo " + '
					\$span = span
					\$day = day
					\$year = year
					time.sh + '%span %day/%year'"
				fi 
				#date
				month=$(date +"%m")
				dayofmonth=$(date +"%d")
				year_den=$(date +"%Y")
				if [ $((($year_den % 4))) == 0 ]; then
				    leapyear=1
				elif [ $((($year_den % 4))) > 0 ]; then
				    leapyear=0
				fi
				totalday=0
				if (( $month > 1 )); then
				    totalday=$((($totalday+31)));
				fi

				if (( $month > 2 )); then
				    totalday=$((($totalday+28+$leapyear))); # add value for leap year in february
				fi

				if (( $month > 3 )); then
				    totalday=$((($totalday+31)));
				fi

				if (( $month > 4 )); then
				    totalday=$((($totalday+30)));
				fi

				if (( $month > 5 )); then
				    totalday=$((($totalday+31)));
				fi

				if (( $month > 6 )); then
				    totalday=$((($totalday+30)));
				fi

				if (( $month > 7 )); then
				    totalday=$((($totalday+31)));
				fi

				if (( $month > 8 )); then
				    totalday=$((($totalday+31)));
				fi

				if (( $month > 9 )); then
				    totalday=$((($totalday+30)));
				fi

				if (( $month > 10 )); then
				    totalday=$((($totalday+31)));
				fi

				if (( $month > 11 )); then
				    totalday=$((($totalday+30)));
				fi
				day_den=$(((10#$totalday+10#$dayofmonth)))
				day_hex=$(printf "%x\n" $day_den)
				# Time
				second=$(date +"%S")
				minute=$(date +"%M")
				hour=$(date +"%H")
				nanosecond=$(date +"%N")
				second_of_the_day=$(bc -l <<< "($hour * 3600) + ($minute * 60) + $second")
				span_den=$(bc -l <<< "$second_of_the_day / (86400/65536)")
				span_den=$(echo $span_den | awk '{printf("%d\n",$1 + 0.5)}'  )
				span_hex=$(printf "%x\n" $span_den)
				year_hex=$(printf "%x\n" $year_den)

				if [ "$1" = "--den" ]; then
					echo $span_den $day_den/$year_den
				elif [ "$1" = "--hex" ]; then
					echo $span_hex $day_hex/$year_hex
				else
					echo "specify hex or den with --hex or --den"
				fi
			'';
			executable = true;
		};
	};
  };
  gtk = {
	enable = true;
	font = {
		name = "${FONT}";
		package = pkgs.${FONT_PACKAGE};
	};
	iconTheme = {
		name = "${GTK_ICONS_NAME}";
		package = pkgs.${GTK_ICONS};
	};
	theme = {
		name = "${GTK_THEME_NAME}";
		package = pkgs.${GTK_THEME};
	};
	cursorTheme = {
		name = "${GTK_CURSOR_NAME}";
		package = pkgs.${GTK_CURSOR};
	};
  };
  programs = {
  	irssi = {
		enable = true;
		networks = {
			tuxcord = {
				nick = "deadvey";
				server = {
					autoConnect = true;
					address = "irc.tuxcord.net";
					port = 6697;
					ssl = {
						enable = true;
						verify = true;
					};
				};
				channels = {
					general = {
						autoJoin = true;
					};
					chatbot = {
						autoJoin = true;
					};
					memes = {
						autoJoin = true;
					};
					rust = {
						autoJoin = true;
					};
					testing = {
						autoJoin = true;
					};
					linux = {
						autoJoin = true;
					};
				};
			};
		};
	};
  	newsboat = {
		enable = true;
		urls = [
			{
				url = "https://deadvey.com/blogs/feed.xml";
			}
			{
				url = "https://explosm.net/rss.xml";
			}
			{
				url = "https://letterboxd.com/besscuit/rss/";
			}
			{
				url = "https://www.oglaf.com/feeds/rss/";
			}
			{
				url = "http://sdomi.pl/weblog/atom/";
			}
			{
				url = "https://feeds.fireside.fm/thelinuxcast/rss";
			}
			{
				url = "https://warandpeas.com/rss";
			}
			{
				url = "https://www.cyberciti.com/feed/";
			}
			{
				url = "https://www.cyberciti.com/atom/atom.xml";
			}
		];
	};
  	wpaperd = {
		enable = true;
		settings = {
			HDMI-A-1 = {
				path = "${WALLPAPER_PATH}";
				duration = "1m";
				transition-time = "100";
				initial-transition = true;
			};
		};
	};
  	neovim = {
	  	defaultEditor = true;
	  	enable = true;
		vimAlias = true;
		extraConfig = ''
			set clipboard=unnamedplus
			set relativenumber 
		'';
		plugins = with pkgs.vimPlugins; [
			chadtree
		];
	  };
	  bash = {
	    enable = true;
	    shellAliases = {
		ls="ls -l";
		ssh="kitten ssh";
	    };
	    bashrcExtra=''
	    	PS1="[\[\033[32m\]\w]\[\033[0m\]\n\[\033[1;36m\]\u\[\033[1;33m\] => \[\033[0m\]"
	    '';
	  };
	  git = {
	    enable = true;
	    userName  = "deadvey";
	    userEmail = "deadvey@nixos";
	  }; 
	  kitty = {
		enable = true;
		settings = {
			confirm_os_window_close = 0;
			background_opacity = "${TERMINAL_OPACITY}";
			foreground = "#${FG}";
			background = "#${BG}";
			selection_foreground = "#${BG}";
			selection_background = "#${FG}";
			color0 = "#${GRAY}";
			color8 = "#${BG}";
			color1 = "#${RED}";
			color9 = "#${DARK_RED}";
			color2 = "#${GREEN}";
			color10 = "#${DARK_GREEN}";
			color3 = "#${YELLOW}";
			color11 = "#${DARK_YELLOW}";
			color4 = "#${BLUE}";
			color12 = "#${DARK_BLUE}";
			color5 = "#${PURPLE}";
			color13 = "#${DARK_PURPLE}";
			color6 = "#${BLUE}";
			color14 = "#${DARK_BLUE}";
			color7 = "#${GRAY}";
			color15 = "#${DARK_GRAY}";

			bold_font = "auto";
			italic_font = "auto";
			bold_italic_font = "auto";
		};
		font = {
			name = "VictorMono Nerd Font Mono";
			package = pkgs.${FONT_PACKAGE};
			size = 8;
		};
	  };
	  hyprlock = {
		enable = true;
		settings = {
			general = {
				disable_loading_bar = true;
				grace = 1;
				no_fade_in = false;
			};
			background = [
				{
					path = "${WALLPAPER_PATH}";
				}
			];
			input-field = [
				{
				      rounding = "${CORNER_RADIUS}";
				      size = "200, 50";
				      position = "0, 0";
				      dots_rounding = "${CORNER_RADIUS}";
				      dots_center = true;
				      fade_on_empty = true;
				      font_color = "${FG}";
				      inner_color = "${FG}";
				      outer_color = "${ACCENT}";
				      outline_thickness = "${BORDER_WIDTH}";
				      placeholder_text = "Password...";
				      fail_text = "😬 Oooooh that was wrong mate!⚠️";
			    	}
			];
		};	
	  };
	  fuzzel = {
		enable = true;
		settings = {
			main = {
				prompt = "${FUZZEL_PROMPT}";
				width = "${FUZZEL_WIDTH}";
				lines = "${FUZZEL_HEIGHT}";
				icons-enabled = "no";
				font = "${FONT}";
			};
			colors = {
				background = "${BG}${FUZZEL_OPACITY}";
				border = "${ACCENT}ff";
				match = "${RED}ff";
				selection = "${FG}ff";
				selection-text = "${BG}ff";
				text = "${FG}ff";
				prompt = "${FG}ff";
				input = "${FG}ff";
			};
			border = {
				width = "${BORDER_WIDTH}";
				radius = "${CORNER_RADIUS}";
			};
		};
	  };
	  waybar = {
		enable = true;
		settings = {
			screenBorder = {
				mode = "overlay";
				layer = "bottom";
				name = "screenBorder";
				position = "top";
				height = SCREEN_HEIGHT;
				width = SCREEN_WIDTH;
				modules-center = ["custom/empty"];
				"custom/empty" = {
					format = " ";
					interval = 1;
				};
			};
			top = {
				exclusive = false;
				layer = "top";
				name = "top";
				position = "top";
				height = 20;
				width = SCREEN_WIDTH;
				modules-left = [ "cpu" "memory" "disk" "temperature"];
				modules-center = ["custom/clock"];
				modules-right = ["custom/metar"];			
				"custom/clock" = {
					format = " {}  ";
					exec = "bash /home/deadvey/scripts/time.sh --hex";
					interval = 1;
				};
				"custom/metar" = {
					format = "METAR {}=";
					exec = "metar egbb";
					interval = 30;
				};
				"custom/caway" = {
					format = "{}";
					exec = "ssh max@media bash /home/max/caway.sh";
				};
				"cpu" = {
					format = "{}%  ";
				};
				"memory" = {
					format = "{}%  ";
				};
				"disk" = {
					format = "{}%  /";
				};
				"temperature" = {
					format = "{temperatureC}°C";
					interval = 1;
				};
			};

			right = {
				exclusive = false;
				layer = "top";
				name = "right";
				position = "right";
				modules-center = [ "hyprland/workspaces" ];
			};
			left = {	
				exclusive = false;
				layer = "top";
				name = "right";
				position = "left";
				modules-center = [ "custom/browser" "custom/terminal" "custom/website" "custom/anki" "custom/keepassxc" "custom/gimp" "custom/writer" "custom/luanti" "custom/nixpkgs"];
				"custom/browser" = {
					format = "";
					on-click = "${BROWSER}";
				};
				"custom/terminal" = {
					format = "";
					on-click = "${TERMINAL} --hold fastfetch";
				};
				"custom/website" = {
					format = "";
					on-click = "${BROWSER} https://deadvey.com";
				};
				"custom/anki" = {
					format = "?";
					on-click = "anki";
				};
				"custom/keepassxc" = {
					format = "";
					on-click = "keepassxc";
				};
				"custom/gimp" = {
					format = "";
					on-click = "gimp";
				};
				"custom/writer" = {
					format = "";
					on-click = "swriter";
				};
				"custom/luanti" = {
					format = "";
					on-click = "minetest";
				};
				"custom/nixpkgs" = {
					format = "";
					on-click = "${BROWSER} https://search.nixos.org/packages";
				};
			};
			bottom = {
				exclusive = false;
				layer = "top";
				name = "bottom";
				position = "bottom";
				height = 20;
				width = SCREEN_WIDTH;
				modules-left = [ "custom/uptime" ];
				modules-right = [ "pulseaudio" ];
				#modules-center = ["custom/gruvbox" "custom/nord" "custom/solarized" "custom/dracula" "custom/mocha" "custom/macchiato"];
				modules-center = ["custom/clock"];
				"network" = {
					interface = "enp42s0";
					interval = 10;
					family = "ipv4";
					format-ethernet = "{ifname}: {ipaddr} ";
					format-disconnected = "No Connection... ";
				};
				"custom/uptime" = {
					exec = "uptime";
					format = "{}";
					interval = 1;
				};
				"custom/clock" = {
					format = "{}";
					exec = "date +'%Y%m%dT%H%M%SZ'";
					interval = 1;
				};
				"custom/gruvbox" = {
					on-click = "$HOME/scripts/theme-switcher.sh gruvbox ${MODE}";
					format = "";
				};
				"custom/nord" = {
					on-click = "$HOME/scripts/theme-switcher.sh nord ${MODE}";
					format = "";
				};
				"custom/solarized" = {
					on-click = "$HOME/scripts/theme-switcher.sh solarized ${MODE}";
					format = "";
				};
				"custom/dracula" = {
					on-click = "$HOME/scripts/theme-switcher.sh dracula ${MODE}";
					format = "🧛";
				};
				"custom/mocha" = {
					on-click = "$HOME/scripts/theme-switcher.sh mocha ${MODE}";
					format = "🌿";
				};
				"custom/macchiato" = {
					on-click = "$HOME/scripts/theme-switcher.sh macchiato ${MODE}";
					format = "🌺";
				};
				"pulseaudio" = {
					format = "{icon} {volume}%";
					format-muted = "X";
					format-icons = {
						default = [ "" "" "" ];
					};
					on-click = "pavucontrol";
					on-scroll-up = "pactl set-sink-volume @DEFAULT_SINK@ +10% && ssh max@media pactl set-sink-volume @DEFAULT_SINK@ +10%";
					on-scroll-down = "pactl set-sink-volume @DEFAULT_SINK@ -10% && ssh max@media pactl set-sink-volume @DEFAULT_SINK@ -10%";
					on-click-right = "pactl set-sink-volume @DEFAULT_SINK@ 0% && ssh max@media pactl set-sink-volume @DEFAULT_SINK@ 0%";
					scroll-step = 1;
				};
			};
		};
		style = ''
			window#waybar.screenBorder {
				border: ${BORDER_WIDTH}px solid #${ACCENT};
				background-color: transparent;
				box-shadow: 0px 0px 0px 60px black, 0px 0px 0px 0.5px #${FG};
				border-radius: ${WAYBAR_CORNER_RADIUS}px;
				margin: 20px;
			}
			window#waybar.top,
			window#waybar.bottom,
			window#waybar.right,
			window#waybar.left {
				background-color: transparent;
			}
			#workspaces button {
				padding: 0px;
				color: #${FG};
				background: #${BG};
			}
			#workspaces button:hover {
				color: #${ACCENT};
			}
			#workspaces button.active {
				color: #${SECOND_ACCENT};
			}
			#workspaces button.focuced {
				color: #${BG};
				background: #${FG};
			}
			#workspaces {
				border: ${BORDER_WIDTH}px solid #${ACCENT};
				border-radius: ${WAYBAR_CORNER_RADIUS};
				box-shadow: 12px 12px 0px 2px #${SHADOW_COLOR};
				padding: 0px;
				margin: 6px;
				padding: 0px 5px 0px 5px;
				background: #${BG};
			}
			#custom-caway {
				color: #${FG};
				background: #${BG};
				border: ${BORDER_WIDTH}px solid #${ACCENT};
				border-radius: ${WAYBAR_CORNER_RADIUS};
				box-shadow: 12px 12px 0px 2px #${SHADOW_COLOR};
				margin: 6px;
			}
			#custom-clock,
			#network,
			#custom-weather,
			#custom-browser,
			#custom-terminal,
			#custom-anki,
			#custom-keepassxc,
			#custom-gimp,
			#custom-writer,
			#custom-luanti,
			#custom-nixpkgs,
			#disk,
			#memory,
			#cpu,
			#custom-website,
			#pulseaudio,
			#custom-gruvbox,
			#custom-nord,
			#custom-solarized,
			#custom-dracula,
			#custom-mocha,
			#custom-macchiato,
			#custom-metar,
			#custom-uptime,
			#temperature {
				color: #${FG};
				background: #${BG};
				border: ${BORDER_WIDTH}px solid #${ACCENT};
				border-radius: ${WAYBAR_CORNER_RADIUS};
				box-shadow: 12px 12px 0px 2px #${SHADOW_COLOR};
				padding: 3px;
				margin: 6px;
			}
		'';
	  };
  };
  services = {
	  hyprpaper = {
		enable = true;
		settings = {
			ipc = "on";
			preload = [ "${WALLPAPER_PATH}" ];
			wallpaper = [ "HDMI-A-1,${WALLPAPER_PATH}" ];
		};
	  };
	  hypridle = {
		enable = true;
		settings = {
			listener = [
				{
					timeout = 10000;
					on-timeout = "hyprlock";
				}
			];
		};
	  };
	  dunst = {
	  	enable = true;
		settings = {
			global = {
				width = 300;
				height = 300;
				offset = "${GAPS_OUT}x${GAPS_OUT}";
				origin = "${DUNST_ORIGIN}";
				font = "${FONT}";
				corner_radius = "${CORNER_RADIUS}";
				foreground = "#${BG}";
				frame_color = "#${ACCENT}";
				frame_width = "${BORDER_WIDTH}";
			};
			urgency_low = {
				background = "#${GREEN}";
				timeout=3;
			};
			urgency_normal = {
				background = "#${BLUE}";
				timeout=6;
			};
			urgency_critical = {
				background = "#${RED}";
				timeout=12;
			};
		};
	  };
  };
  wayland = {
  	windowManager = {
		hyprland = {
			enable = true;
			plugins = with pkgs; [
				#hyprlandPlugins.hyprbars
				hyprlandPlugins.hyprexpo
			];
			extraConfig = ''
				exec-once="waybar"; 
				exec-once="dunst";
				exec-once="wpaperd";
				exec-once="hypridle";
			'';
			settings = {
				"$mod" = "SUPER";
				plugin = {
					hyprexpo = {
						columns = 3;
						gap_size = 5;
						bg_col = "rgb(${BG})";
						workspace_method = "center current";
					};
					hyprbars = {
						bar_height = 25;
						bar_color = "rgb(${BG})";
						"col.text" = "rgb(${FG})";
						hyprbars-button = "rgb(${RED}), 10, X, hyprctl dispatch killactive";
					};
				};
				general = {
					gaps_in = "${GAPS_IN}";
					gaps_out = "${GAPS_OUT}";
					border_size = "${BORDER_WIDTH}";
					"col.active_border" = "rgb(${ACCENT})";
					"col.inactive_border" = "rgb(${INACTIVE_BORDER_COLOR})";
					resize_on_border = false;
					layout = "dwindle";
				};
				decoration = {
					rounding="${CORNER_RADIUS}";
				
					#drop_shadow = true;
					#"col.shadow" = "rgb(${SHADOW_COLOR})";
					#shadow_offset = "12 12";
					#shadow_range = "0";
				};
				dwindle = {
					pseudotile = "yes";
					preserve_split = "yes";
				};
				animations = {
					"bezier" = "easeInOutBack, 0.68, -0.55, 0.265, 1.55";
					animation = [
						"workspaces, 1, 7, easeInOutBack"
						"windowsOut, 1, 7, easeInOutBack"
						"windowsIn, 1, 7, easeInOutBack"
						"windowsMove, 1, 7, easeInOutBack"
					];
				};
				input = {
					kb_layout = "gb";
					kb_options = "caps:escape";
				};
				bindm = [
					"$mod, mouse:272, movewindow"
					"$mod, mouse:273, resizewindow"
				];
				bind = [
					"$mod, Space, exec, ${MENU}"
					"$mod, Q, exec, ${TERMINAL} --hold fastfetch"
					"$mod, B, exec, ${BROWSER}"
					"$mod ALT, up, exec, pactl set-sink-volume 0 +5%"
					"$mod ALT, down, exec, pactl set-sink-volume 0 -5%"
					"$mod, grave, hyprexpo:expo, toggle"
					"$mod, P, exec, grimshot savecopy area ~/pictures/screenshots/$(date +'%Y-%m-%d--%H-%M-%S').png"
					"$mod, L, exec, hyprlock"
					"$mod, C, killactive"
					"$mod, O, exec, hyprpicker -a"
					"$mod, M, fullscreen, 1"
					"$mod SHIFT, M, fullscreen, 0"
					"$mod SHIFT, E, exit"
					"$mod, J, togglesplit,"
					"$mod, V, toggleFloating,"
					"$mod, U, pseudo,"
					"$mod SHIFT, Q, exit"
					"$mod, left, movefocus, l"
					"$mod, right, movefocus, r"
					"$mod, up, movefocus, u"
					"$mod, down, movefocus, d"
					"$mod SHIFT, left, movewindow, l"
					"$mod SHIFT, right, movewindow, r"
					"$mod SHIFT, up, movewindow, u"
					"$mod SHIFT, down, movewindow, d"
					"$mod, 1, workspace, 1"
					"$mod, 2, workspace, 2"
					"$mod, 3, workspace, 3"
					"$mod, 4, workspace, 4"
					"$mod, 5, workspace, 5"
					"$mod, 6, workspace, 6"
					"$mod, 7, workspace, 7"
					"$mod, 8, workspace, 8"
					"$mod, 9, workspace, 9"
					"$mod, 0, workspace, 10"
					"$mod SHIFT, 1, movetoworkspace, 1"
					"$mod SHIFT, 2, movetoworkspace, 2"
					"$mod SHIFT, 3, movetoworkspace, 3"
					"$mod SHIFT, 4, movetoworkspace, 4"
					"$mod SHIFT, 5, movetoworkspace, 5"
					"$mod SHIFT, 6, movetoworkspace, 6"
					"$mod SHIFT, 7, movetoworkspace, 7"
					"$mod SHIFT, 8, movetoworkspace, 8"
					"$mod SHIFT, 9, movetoworkspace, 9"
					"$mod SHIFT, 0, movetoworkspace, 10"
				];
				
			};
		};
  	};
  };
  # Home Manager is pretty good at managing dotfiles. The primary way to manage
  # plain files is through 'home.file'.
  home.file = {
    # # Building this configuration will create a copy of 'dotfiles/screenrc' in
    # # the Nix store. Activating the configuration will then make '~/.screenrc' a
    # # symlink to the Nix store copy.
    # ".screenrc".source = dotfiles/screenrc;

    # # You can also set the file content immediately.
    # ".gradle/gradle.properties".text = ''
    #   org.gradle.console=verbose
    #   org.gradle.daemon.idletimeout=3600000
    # '';
  };

  # Home Manager can also manage your environment variables through
  # 'home.sessionVariables'. These will be explicitly sourced when using a
  # shell provided by Home Manager. If you don't want to manage your shell
  # through Home Manager then you have to manually source 'hm-session-vars.sh'
  # located at either
  #
  #  ~/.nix-profile/etc/profile.d/hm-session-vars.sh
  #
  # or
  #
  #  ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh
  #
  # or
  #
  #  /etc/profiles/per-user/deadvey/etc/profile.d/hm-session-vars.sh
  #
  home.sessionVariables = {
    # EDITOR = "emacs";
  };

  # Let Home Manager install and manage itself.
  programs.home-manager.enable = true;
}