Recover removed host-mode script
This commit is contained in:
		
							parent
							
								
									6da8d4336b
								
							
						
					
					
						commit
						876f11177d
					
				
					 1 changed files with 39 additions and 0 deletions
				
			
		
							
								
								
									
										39
									
								
								.bin/host-mode##hostname.portalo
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										39
									
								
								.bin/host-mode##hostname.portalo
									
										
									
									
									
										Executable file
									
								
							|  | @ -0,0 +1,39 @@ | ||||||
|  | #!/usr/bin/env bash | ||||||
|  | 
 | ||||||
|  | modes="monitor-std | ||||||
|  | monitor-single | ||||||
|  | monitor-single-sec | ||||||
|  | zellij" | ||||||
|  | 
 | ||||||
|  | portalo_mode_monitor () { | ||||||
|  |     echo "Loading portalo monitor layout ${1:-std}" | ||||||
|  |     yadm config --unset-all local.class monitor-* | ||||||
|  | 
 | ||||||
|  |     if [ -n "$1" ]; then | ||||||
|  |         yadm config --add local.class "$1" | ||||||
|  |     fi | ||||||
|  | 
 | ||||||
|  |     swaymsg reload | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | portalo_mode_zellij () { | ||||||
|  |     layout_dir="$HOME/.config/zellij/layouts" | ||||||
|  |     layouts=$(\ls -1 "$layout_dir") | ||||||
|  |     layout=$(echo "$layouts" | $DMENU -p "layout") | ||||||
|  |     if [ -n "$layout" ]; then | ||||||
|  |         $TERMINAL -e zellij --layout="$layout_dir/$layout" | ||||||
|  |     fi | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | if [ -z "$1" ]; then | ||||||
|  |     mode=$(echo "$modes" | $DMENU -p "mode") | ||||||
|  | else  | ||||||
|  |     mode=$1 | ||||||
|  | fi | ||||||
|  | 
 | ||||||
|  | case $mode in | ||||||
|  |     "monitor-std")  portalo_mode_monitor ;; | ||||||
|  |     "monitor-"*)    portalo_mode_monitor "$mode" ;; | ||||||
|  |     "zellij")       portalo_mode_zellij ;; | ||||||
|  |     *)              echo "'$mode' is not a valid mode (single, std)" ;; | ||||||
|  | esac | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue