| 
									
										
										
										
											2022-08-22 21:27:20 -06:00
										 |  |  | #!/bin/zsh | 
					
						
							| 
									
										
										
										
											2024-05-08 23:33:06 -06:00
										 |  |  | 
 | 
					
						
							|  |  |  | command -v scwrypts &>/dev/null || { | 
					
						
							|  |  |  | 	[ -f $HOME/.local/bin/scwrypts ] \ | 
					
						
							|  |  |  | 		&& scwrypts() { $HOME/.local/bin/scwrypts $@; } \ | 
					
						
							|  |  |  | 		|| scwrypts() { $HOME/.wryn/zsh/plugins/scwrypts/scwrypts $@; } \ | 
					
						
							|  |  |  | 		; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-08-22 21:27:20 -06:00
										 |  |  | case $1 in | 
					
						
							| 
									
										
										
										
											2024-05-07 16:38:40 -06:00
										 |  |  | 	( next | previous | play-pause ) playerctl $1 ;; | 
					
						
							|  |  |  | 	( fastforward ) playerctl position 5+ ;; | 
					
						
							|  |  |  | 	( rewind      ) playerctl position 5- ;; | 
					
						
							| 
									
										
										
										
											2022-08-22 21:27:20 -06:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-05-07 16:38:40 -06:00
										 |  |  | 	( volumedown ) scwrypts -n desktop pulseaudio -- sink down ;; | 
					
						
							|  |  |  | 	( volumeup   ) scwrypts -n desktop pulseaudio -- sink up ;; | 
					
						
							|  |  |  | 	( volumemute ) scwrypts -n desktop pulseaudio -- sink mute ;; | 
					
						
							|  |  |  | 	( micmute    ) scwrypts -n desktop pulseaudio -- source mute ;; | 
					
						
							| 
									
										
										
										
											2022-08-22 21:27:20 -06:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-05-07 16:38:40 -06:00
										 |  |  | 	( backlightup   ) scwrypts -n desktop backlight -- up ;; | 
					
						
							|  |  |  | 	( backlightdown ) scwrypts -n desktop backlight -- down ;; | 
					
						
							| 
									
										
										
										
											2022-08-22 21:27:20 -06:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-05-07 16:38:40 -06:00
										 |  |  | 	( lock ) scwrypts -n desktop lock i3 -- ;; | 
					
						
							| 
									
										
										
										
											2022-08-22 21:27:20 -06:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-05-07 16:38:40 -06:00
										 |  |  | 	( bgrandomize ) scwrypts desktop set i3 background -- random ;; | 
					
						
							| 
									
										
										
										
											2022-08-22 21:27:20 -06:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-05-07 16:38:40 -06:00
										 |  |  | 	( logout ) scwrypts desktop i3 logout -- ;; | 
					
						
							| 
									
										
										
										
											2022-08-22 21:27:20 -06:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-05-07 16:38:40 -06:00
										 |  |  | 	( launch ) | 
					
						
							| 
									
										
										
										
											2022-08-22 21:27:20 -06:00
										 |  |  | 		local PROGRAM | 
					
						
							|  |  |  | 		local ARGS=() | 
					
						
							|  |  |  | 		case $2 in | 
					
						
							| 
									
										
										
										
											2024-04-08 19:11:39 -06:00
										 |  |  | 			messages ) PROGRAM=slack ARGS+=(-c Slack --has-statusbar-icon) ;; | 
					
						
							| 
									
										
										
										
											2022-08-22 21:27:20 -06:00
										 |  |  | 			voice    ) PROGRAM=google-voice-desktop ;; | 
					
						
							|  |  |  | 			ytmusic  ) PROGRAM=youtubemusic-nativefier ;; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-06-27 16:53:59 -06:00
										 |  |  | 			1pass    ) PROGRAM=1password   ARGS+=(-c 1Password) ;; | 
					
						
							| 
									
										
										
										
											2023-07-07 05:30:33 -06:00
										 |  |  | 			discord  ) PROGRAM=discord     ARGS+=(--has-statusbar-icon) ;; | 
					
						
							| 
									
										
										
										
											2023-06-27 16:53:59 -06:00
										 |  |  | 			obs      ) PROGRAM=obs         ARGS+=(-c '^obs' -n -l --has-statusbar-icon) ;; | 
					
						
							| 
									
										
										
										
											2022-08-22 21:27:20 -06:00
										 |  |  | 			pavuctrl ) PROGRAM=pavucontrol ARGS+=(-s 0.5 -c '^Pavucontrol') ;; | 
					
						
							| 
									
										
										
										
											2023-06-27 16:53:59 -06:00
										 |  |  | 			scrcpy   ) PROGRAM=scrcpy      ARGS+=(-n -l) ;; | 
					
						
							|  |  |  | 			spotify  ) PROGRAM=spotify     ARGS+=(-c Spotify) ;; | 
					
						
							| 
									
										
										
										
											2022-08-22 21:27:20 -06:00
										 |  |  | 
 | 
					
						
							|  |  |  | 			*        ) PROGRAM=$2 ;; | 
					
						
							|  |  |  | 		esac | 
					
						
							| 
									
										
										
										
											2024-04-08 19:11:39 -06:00
										 |  |  | 		scwrypts i3 launch or show -- $PROGRAM ${ARGS[@]} | 
					
						
							| 
									
										
										
										
											2022-08-22 21:27:20 -06:00
										 |  |  | 		;; | 
					
						
							| 
									
										
										
										
											2023-11-11 07:27:41 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-05-07 16:38:40 -06:00
										 |  |  | 	( screenshot ) | 
					
						
							| 
									
										
										
										
											2023-11-11 07:27:41 -07:00
										 |  |  | 		command -v deepin-screen-recorder || notify-send "I3 UTILS" "no screenshot application available" | 
					
						
							|  |  |  | 		deepin-screen-recorder | 
					
						
							|  |  |  | 		DEEPIN_CONFIG="$HOME/.config/deepin/deepin-screen-recorder/deepin-screen-recorder.conf" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		: \ | 
					
						
							|  |  |  | 			&& echo "fixing stupid settings" \ | 
					
						
							|  |  |  | 			&& mv $DEEPIN_CONFIG $DEEPIN_CONFIG.bak \ | 
					
						
							|  |  |  | 			&& sed '/specifiedSavepath=.*home.*Pictures/d' $DEEPIN_CONFIG.bak > $DEEPIN_CONFIG \ | 
					
						
							|  |  |  | 			|| mv $DEEPIN_CONFIG.bak $DEEPIN_CONFIG.conf \ | 
					
						
							|  |  |  | 			; | 
					
						
							|  |  |  | 		;; | 
					
						
							| 
									
										
										
										
											2022-08-22 21:27:20 -06:00
										 |  |  | esac |