mirror of
				https://github.com/KevinMidboe/chsh.git
				synced 2025-10-29 12:30:13 +00:00 
			
		
		
		
	Configure fish func with omf
This commit is contained in:
		
							
								
								
									
										54
									
								
								deploy.sh
									
									
									
									
									
								
							
							
						
						
									
										54
									
								
								deploy.sh
									
									
									
									
									
								
							| @@ -18,6 +18,7 @@ get_input_df_true () { | |||||||
|             * ) echo "Please answer yes or no.";; |             * ) echo "Please answer yes or no.";; | ||||||
|         esac |         esac | ||||||
|      done |      done | ||||||
|  |      echo "" | ||||||
| } | } | ||||||
|  |  | ||||||
| get_input_df_false () { | get_input_df_false () { | ||||||
| @@ -30,6 +31,7 @@ get_input_df_false () { | |||||||
|             * ) echo "Please answer yes or no.";; |             * ) echo "Please answer yes or no.";; | ||||||
|         esac |         esac | ||||||
|      done |      done | ||||||
|  |      echo "" | ||||||
| } | } | ||||||
|  |  | ||||||
| install_font () { | install_font () { | ||||||
| @@ -37,18 +39,19 @@ install_font () { | |||||||
|     open $PWD/fonts/* |     open $PWD/fonts/* | ||||||
| } | } | ||||||
|  |  | ||||||
|  | macos_capslock_shortcut() { | ||||||
|  |     cp scripts/tbind.sh /usr/local/bin/tbind | ||||||
|  |     chmod +x /usr/local/bin/tbind | ||||||
|  |     echo "Created tmux capslock keymap command as tbind" | ||||||
|  | } | ||||||
|  |  | ||||||
| macos_capslock_keymap () { | macos_capslock_keymap () { | ||||||
|     CAPS_KEY=0x700000039 |     macos_capslock_shortcut | ||||||
|     F10_KEY=0x700000043 |     tbind | ||||||
|  |  | ||||||
|     DATA=$(printf '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":%s,"HIDKeyboardModifierMappingDst":%s}]}' $CAPS_KEY $F10_KEY) |  | ||||||
|     hidutil property --set $DATA |  | ||||||
|  |  | ||||||
|     echo "Successfully overwrote CAPS KEY to F10!" |  | ||||||
| } | } | ||||||
|  |  | ||||||
| get_config_files() { | get_config_files() { | ||||||
|   CONFIG_FILES=$(find * -type f -path "**/*" ! -path ".*" ! -path "fonts/*") |   CONFIG_FILES=$(find * -type f -path "**/*" ! -path ".*" ! -path "fonts/*" ! -path "scripts/*") | ||||||
| } | } | ||||||
|  |  | ||||||
| move_config_files () { | move_config_files () { | ||||||
| @@ -71,9 +74,33 @@ move_config_files () { | |||||||
| move_profile_file () { | move_profile_file () { | ||||||
|   cp .profile $HOME |   cp .profile $HOME | ||||||
|  |  | ||||||
|  |   source $HOME/.profile | ||||||
|   echo "Moved .profile file!" |   echo "Moved .profile file!" | ||||||
| } | } | ||||||
|  |  | ||||||
|  | install_packages_brew () { | ||||||
|  |     declare -a packages=("cmake" "tree" "wget" "jq" "ripgrep" "watch" "tmux" "fish" "gh") | ||||||
|  |     echo "Installing ${#packages[@]} packages from brew" | ||||||
|  |  | ||||||
|  |     brew install --quiet "${packages[@]}" | ||||||
|  | } | ||||||
|  |  | ||||||
|  | configure_fish () { | ||||||
|  |     brew install --quiet fish | ||||||
|  |  | ||||||
|  |     # oh-my-fish does not exist | ||||||
|  |     if [ ! -d "$HOME/.local/share/omf" ]; then | ||||||
|  |         curl -s "https://raw.githubusercontent.com/oh-my-fish/oh-my-fish/master/bin/install" > install | ||||||
|  |  | ||||||
|  |         fish install --noninteractive | ||||||
|  |         rm install | ||||||
|  |     else | ||||||
|  |         printf "oh-my-fish already configured!\n\n" | ||||||
|  |     fi | ||||||
|  |  | ||||||
|  |     source $HOME/.profile | ||||||
|  | } | ||||||
|  |  | ||||||
| # Promps for installing custom SF Mono font | # Promps for installing custom SF Mono font | ||||||
| # patched with devicons + more | # patched with devicons + more | ||||||
| get_input_df_false "Install custom font? (y/N) " install_font | get_input_df_false "Install custom font? (y/N) " install_font | ||||||
| @@ -83,10 +110,19 @@ if [ $MACOS ]; then | |||||||
|    get_input_df_false "Add custom caps-lock to F10 keymap? (y/N) " macos_capslock_keymap |    get_input_df_false "Add custom caps-lock to F10 keymap? (y/N) " macos_capslock_keymap | ||||||
| fi | fi | ||||||
|  |  | ||||||
|  | get_input_df_true "Add .profile file? (Y/n) " move_profile_file | ||||||
|  |  | ||||||
|  | # Installed common packages from brew | ||||||
|  | get_input_df_true "Install brew packages? (Y/n) " install_packages_brew | ||||||
|  |  | ||||||
|  | echo "Configurating fish shell" | ||||||
|  | configure_fish | ||||||
|  |  | ||||||
| # Get config files to copy info $HOME/.config | # Get config files to copy info $HOME/.config | ||||||
| get_config_files | get_config_files | ||||||
|  |  | ||||||
| # Prompt copy config files to $HOME | # Prompt copy config files to $HOME | ||||||
| get_input_df_true "Move config files to $HOME/.config? (Y/n) " move_config_files | get_input_df_true "Move config files to $HOME/.config? (Y/n) " move_config_files | ||||||
|  |  | ||||||
| move_profile_file |  | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user