33 lines
		
	
	
	
		
			710 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable file
		
	
	
	
	
			
		
		
	
	
			33 lines
		
	
	
	
		
			710 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable file
		
	
	
	
	
#!/bin/bash
 | 
						|
 | 
						|
# Check to see if nyxt is running
 | 
						|
if pgrep -x nyxt > /dev/null; then
 | 
						|
    echo running
 | 
						|
 | 
						|
    if [ $XDG_SESSION_TYPE = "x11" ]; then
 | 
						|
        #X11
 | 
						|
        nyxtrg=$(wmctrl -lx | rg nyxt | awk '{print $1}')
 | 
						|
        # echo $emacsrg
 | 
						|
 | 
						|
        if [ -z $nyxtrg ]; then
 | 
						|
            env GDK_SCALE=2 GDK_DPI_SCALE=0.5 nyxt
 | 
						|
            exit
 | 
						|
        else
 | 
						|
            wmctrl -ia $nyxtrg
 | 
						|
            exit
 | 
						|
        fi
 | 
						|
    else
 | 
						|
        echo wayland
 | 
						|
        # WAYLAND
 | 
						|
        nyxtrg=$(wlrctl window list | rg nyxt:)
 | 
						|
 | 
						|
        nyxtwin=$(echo $nyxtrg | sed 's/.*\: //')
 | 
						|
        # echo $nyxtwin
 | 
						|
 | 
						|
        wlrctl toplevel focus nyxt
 | 
						|
        exit
 | 
						|
    fi
 | 
						|
else
 | 
						|
    echo not running
 | 
						|
    env GDK_SCALE=2 GDK_DPI_SCALE=0.5 nyxt
 | 
						|
fi
 |