feature/waybar #15
@@ -45,6 +45,10 @@ forEachSystem (
 | 
			
		||||
        treefmt
 | 
			
		||||
        statix
 | 
			
		||||
        nixfmt-rfc-style
 | 
			
		||||
        jsonfmt
 | 
			
		||||
        mdformat
 | 
			
		||||
        shfmt
 | 
			
		||||
        yamlfmt
 | 
			
		||||
      ];
 | 
			
		||||
    };
 | 
			
		||||
  in
 | 
			
		||||
 
 | 
			
		||||
@@ -42,6 +42,7 @@
 | 
			
		||||
    kitty
 | 
			
		||||
    kubectl
 | 
			
		||||
    kubernetes-helm
 | 
			
		||||
    libreoffice-fresh
 | 
			
		||||
    libtool
 | 
			
		||||
    lsof
 | 
			
		||||
    lynis
 | 
			
		||||
 
 | 
			
		||||
@@ -16,6 +16,7 @@
 | 
			
		||||
      ./home/gammastep.nix
 | 
			
		||||
      ./home/doom
 | 
			
		||||
      ./home/hypr
 | 
			
		||||
      ./home/waybar.nix
 | 
			
		||||
      ./non-server.nix
 | 
			
		||||
    ];
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -8,6 +8,7 @@
 | 
			
		||||
{
 | 
			
		||||
  xdg.configFile = {
 | 
			
		||||
    "hypr/hyprland.conf".source = ./hyprland.conf;
 | 
			
		||||
    "hypr/show-hide.sh".source = ./show-hide.sh;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  imports = [
 | 
			
		||||
 
 | 
			
		||||
@@ -22,6 +22,9 @@ monitor=,preferred,auto,auto
 | 
			
		||||
# exec-once = waybar & hyprpaper & firefox
 | 
			
		||||
exec-once = wired &
 | 
			
		||||
 | 
			
		||||
exec-once = wired
 | 
			
		||||
exec-once = systemctl --user start polkit-gnome-authentication-agent-1.service
 | 
			
		||||
 | 
			
		||||
# Source a file (multi-file configs)
 | 
			
		||||
# source = ~/.config/hypr/myColors.conf
 | 
			
		||||
 | 
			
		||||
@@ -207,3 +210,7 @@ bind = $mainMod, P, exec, bwm
 | 
			
		||||
 | 
			
		||||
# lock screen
 | 
			
		||||
bind = $mainMod, L, exec, loginctl lock-session
 | 
			
		||||
# hide active window
 | 
			
		||||
bind = $mainMod,H,exec,/home/alice/config/hypr/hide_unhide_window.sh h
 | 
			
		||||
# show hide window
 | 
			
		||||
bind = $mainMod,I,exec,/home/alice/config/hypr/hide_unhide_window.sh s
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										25
									
								
								users/alice/home/hypr/show-hide.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								users/alice/home/hypr/show-hide.sh
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,25 @@
 | 
			
		||||
#!/usr/bin/env bash
 | 
			
		||||
 | 
			
		||||
stack_file="/tmp/hide_window_pid_stack.txt"
 | 
			
		||||
 | 
			
		||||
function hide_window() {
 | 
			
		||||
  pid=$(hyprctl activewindow -j | jq '.pid')
 | 
			
		||||
  hyprctl dispatch movetoworkspacesilent "88,pid:$pid"
 | 
			
		||||
  echo "$pid" >>$stack_file
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function show_window() {
 | 
			
		||||
  pid=$(tail -1 $stack_file && sed -i '$d' $stack_file)
 | 
			
		||||
  [ -z "$pid" ] && exit
 | 
			
		||||
 | 
			
		||||
  current_workspace=$(hyprctl activeworkspace -j | jq '.id')
 | 
			
		||||
  hyprctl dispatch movetoworkspacesilent "$current_workspace,pid:$pid"
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
if [ -n "$1" ]; then
 | 
			
		||||
  if [ "$1" == "h" ]; then
 | 
			
		||||
    hide_window >>/dev/null
 | 
			
		||||
  else
 | 
			
		||||
    show_window >>/dev/null
 | 
			
		||||
  fi
 | 
			
		||||
fi
 | 
			
		||||
							
								
								
									
										40
									
								
								users/alice/home/waybar.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										40
									
								
								users/alice/home/waybar.json
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,40 @@
 | 
			
		||||
[
 | 
			
		||||
  {
 | 
			
		||||
    "height": 20,
 | 
			
		||||
    "layer": "top",
 | 
			
		||||
    "position": "top",
 | 
			
		||||
    "output": [
 | 
			
		||||
      "eDP-2",
 | 
			
		||||
      "eDP-1",
 | 
			
		||||
      "HDMI-0",
 | 
			
		||||
      "DP-0"
 | 
			
		||||
    ],
 | 
			
		||||
    "hyprland/workspaces": {
 | 
			
		||||
      "active-only": true,
 | 
			
		||||
      "all-outputs": false,
 | 
			
		||||
      "show-special": true,
 | 
			
		||||
      "move-to-monitor": true,
 | 
			
		||||
      "format": "{icon} {windows}",
 | 
			
		||||
      "format-window-separator": " ",
 | 
			
		||||
      "format-icons": {
 | 
			
		||||
        "1": "",
 | 
			
		||||
        "2": "",
 | 
			
		||||
        "3": "",
 | 
			
		||||
        "default": "",
 | 
			
		||||
        "empty": "",
 | 
			
		||||
        "urgent": ""
 | 
			
		||||
      },
 | 
			
		||||
      "persistent-workspaces": {
 | 
			
		||||
        "1": "HDMI-0"
 | 
			
		||||
      },
 | 
			
		||||
      "on-scroll-down": "hyprctl dispatch workspace e-1",
 | 
			
		||||
      "on-scroll-up": "hyprctl dispatch workspace e+1",
 | 
			
		||||
      "window-rewrite": {
 | 
			
		||||
        "title<Steam>": ""
 | 
			
		||||
      },
 | 
			
		||||
      "window-rewrite-default": "",
 | 
			
		||||
      "window-rewrite-separator": " ",
 | 
			
		||||
      "sort-by": "number"
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
]
 | 
			
		||||
@@ -2,6 +2,6 @@
 | 
			
		||||
lib.mkIf (!machineConfig.server) {
 | 
			
		||||
  programs.waybar = {
 | 
			
		||||
    enable = true;
 | 
			
		||||
    #settings = builtins.fromJSON (import ./waybar.json);
 | 
			
		||||
    settings = builtins.fromJSON (builtins.readFile ./waybar.json);
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -64,5 +64,6 @@
 | 
			
		||||
    zathura
 | 
			
		||||
    obsidian
 | 
			
		||||
    libreoffice-qt-fresh
 | 
			
		||||
    wlr-randr
 | 
			
		||||
  ];
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user