Initial commit
This commit is contained in:
		
						commit
						db7e78dc9c
					
				| 
						 | 
					@ -0,0 +1,15 @@
 | 
				
			||||||
 | 
					#!/bin/bash
 | 
				
			||||||
 | 
					set -e
 | 
				
			||||||
 | 
					cat > /tmp/.dialogrc << EOL
 | 
				
			||||||
 | 
					# Item color
 | 
				
			||||||
 | 
					tag_color = (BLACK,WHITE,ON)
 | 
				
			||||||
 | 
					EOL
 | 
				
			||||||
 | 
					action=$(DIALOGRC=/tmp/.dialogrc dialog --stdout --erase-on-exit --menu "Choose the action for apt" 10 40 0 "Update" 1 "Upgrade" 2 "Install" 3 "Remove" 4)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if [[ $action == "Install" || $action == "Remove" ]]; then 
 | 
				
			||||||
 | 
					  package=$(apt list 2>/dev/null | awk -F'/' 'NR>1{print $1}' | fzf)
 | 
				
			||||||
 | 
					  sudo apt ${action,,} $package -y
 | 
				
			||||||
 | 
					elif [[ $action == "Update" || $action == "Upgrade" ]]; then 
 | 
				
			||||||
 | 
					  sudo apt ${action,,} -y
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,23 @@
 | 
				
			||||||
 | 
					mkdir -p gui-scripts_$(cat VERSION)-1/usr/local/bin
 | 
				
			||||||
 | 
					mkdir -p gui-scripts_$(cat VERSION)-1/DEBIAN
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					cat > gui-scripts_$(cat VERSION)-1/DEBIAN/control << EOL
 | 
				
			||||||
 | 
					Package: gui-scripts
 | 
				
			||||||
 | 
					Version: $(cat VERSION)-1
 | 
				
			||||||
 | 
					Section: base
 | 
				
			||||||
 | 
					Priority: optional
 | 
				
			||||||
 | 
					Architecture: amd64
 | 
				
			||||||
 | 
					Depends: fzf, dialog (>= 1.3), xdotool, x11-xkb-utils
 | 
				
			||||||
 | 
					Maintainer: Konstantin Shutkin <digitalstudium001@gmail.com>
 | 
				
			||||||
 | 
					Description: GUI scripts
 | 
				
			||||||
 | 
					 GUI scripts for popular cli tools, based on dialog and fzf
 | 
				
			||||||
 | 
					EOL
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					for script in a s g r; do
 | 
				
			||||||
 | 
					  cp $script gui-scripts_$(cat VERSION)-1/usr/local/bin
 | 
				
			||||||
 | 
					done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					dpkg-deb --build gui-scripts_$(cat VERSION)-1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,25 @@
 | 
				
			||||||
 | 
					#!/bin/bash
 | 
				
			||||||
 | 
					set -e
 | 
				
			||||||
 | 
					cat > /tmp/.dialogrc << EOL
 | 
				
			||||||
 | 
					# Item color
 | 
				
			||||||
 | 
					tag_color = (BLACK,WHITE,ON)
 | 
				
			||||||
 | 
					EOL
 | 
				
			||||||
 | 
					set +ex
 | 
				
			||||||
 | 
					action=$(DIALOGRC=/tmp/.dialogrc dialog --stdout --erase-on-exit --menu "Choose the action for git" 10 40 0 'Add all && Commit && Push' 1 "Add all" 2 "Commit" 3 "Push" 4)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#echo $action
 | 
				
			||||||
 | 
					#exit
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if [[ $action == "Add all && Commit && Push" ]]; then 
 | 
				
			||||||
 | 
					  git add .
 | 
				
			||||||
 | 
					  commit_message=$(DIALOGRC=/tmp/.dialogrc dialog --stdout --erase-on-exit --title "$action" --inputbox "Enter the commit message:" 8 40)
 | 
				
			||||||
 | 
					  git commit -"m $commit_message"
 | 
				
			||||||
 | 
					  git push
 | 
				
			||||||
 | 
					elif [[ $action == "Add all" ]]; then 
 | 
				
			||||||
 | 
					  git add .
 | 
				
			||||||
 | 
					elif [[ $action == "Commit" ]]; then 
 | 
				
			||||||
 | 
					  commit_message=$(DIALOGRC=/tmp/.dialogrc dialog --stdout --erase-on-exit --title "$action" --inputbox "Enter the commit message:" 8 40)
 | 
				
			||||||
 | 
					  git commit -"m $commit_message"
 | 
				
			||||||
 | 
					elif [[ $action == "Push" ]]; then 
 | 
				
			||||||
 | 
					  git push
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,3 @@
 | 
				
			||||||
 | 
					#!/bin/bash
 | 
				
			||||||
 | 
					setxkbmap
 | 
				
			||||||
 | 
					cat ~/.aliases.txt | fzf | cut -d : -f 2- | xargs -I _ xdotool type  _
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,14 @@
 | 
				
			||||||
 | 
					#!/bin/bash
 | 
				
			||||||
 | 
					set -e
 | 
				
			||||||
 | 
					cat > /tmp/.dialogrc << EOL
 | 
				
			||||||
 | 
					# Item color
 | 
				
			||||||
 | 
					tag_color = (BLACK,WHITE,ON)
 | 
				
			||||||
 | 
					EOL
 | 
				
			||||||
 | 
					service=$(systemctl list-units --type service --all --plain --quiet | awk '{ print $1 }' | fzf)
 | 
				
			||||||
 | 
					set +ex
 | 
				
			||||||
 | 
					action=$(DIALOGRC=/tmp/.dialogrc dialog --stdout --erase-on-exit --menu "Choose the action for $service" 10 40 0 "Status" 1 "Start" 2 "Stop" 3 "Disable" 4 "Enable" 5)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if [ ! -z $action ]; then 
 | 
				
			||||||
 | 
					  sudo systemctl ${action,,} $service
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
		Loading…
	
		Reference in New Issue