Add dmenu bluetooth menu
							parent
							
								
									0c0a7e6672
								
							
						
					
					
						commit
						749fd7b3ac
					
				| 
						 | 
					@ -0,0 +1,10 @@
 | 
				
			||||||
 | 
					#!/usr/bin/env bash
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					options="Mouse\nHeadphones"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					selected="$(echo -e "$options" | dmenu -i)"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					case "$selected" in
 | 
				
			||||||
 | 
					  "Mouse")      toggle-bt-device E4:19:21:56:C8:70;;
 | 
				
			||||||
 | 
					  "Headphones") toggle-bt-device 38:18:4C:D4:74:42;;
 | 
				
			||||||
 | 
					esac
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,11 @@
 | 
				
			||||||
 | 
					#!/usr/bin/env bash
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					status="$(bluetoothctl info "$1" | grep Connected | cut -f 2 -d ':' | cut -f 2 -d ' ')"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if [ "$status" == "no" ]
 | 
				
			||||||
 | 
					then
 | 
				
			||||||
 | 
					  bluetoothctl connect "$1"
 | 
				
			||||||
 | 
					elif [ "$status" == "yes" ]
 | 
				
			||||||
 | 
					then
 | 
				
			||||||
 | 
					  bluetoothctl disconnect "$1"
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
		Loading…
	
		Reference in New Issue