Compare commits
	
		
			2 Commits
		
	
	
		
			5c69e922a7
			...
			1cfc6c52f3
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 1cfc6c52f3 | |||
| 62f4d9f948 | 
							
								
								
									
										17
									
								
								d1/f1.sh
									
									
									
									
									
								
							
							
								
								
								
								
								
									
									
								
							
						
						
									
										17
									
								
								d1/f1.sh
									
									
									
									
									
								
							| @ -1,17 +0,0 @@ | |||||||
| #!/bin/sh |  | ||||||
| 
 |  | ||||||
| mkdir -p ~/.local/bin |  | ||||||
| cp dotfiles/.local/bin/commands ~/.local/bin/commands |  | ||||||
| cp dotfiles/.local/bin/gnome-shortcuts-macbook-air ~/.local/bin/ |  | ||||||
| mkdir -p ~/.sway |  | ||||||
| cp dotfiles/.sway/config ~/.sway/config |  | ||||||
| cp dotfiles/.zshenv ~/.zshenv |  | ||||||
| cp dotfiles/.zshrc ~/.zshrc |  | ||||||
| cp dotfiles/.vimrc ~/.vimrc |  | ||||||
| cp dotfiles/.tmux.conf ~/.tmux.conf |  | ||||||
| cp dotfiles/.py3.vimrc ~/.py3.vimrc |  | ||||||
| cp dotfiles/.py3.vimrc ~/.py3.vimrc |  | ||||||
| cp dotfiles/.gitconfig ~/.gitconfig |  | ||||||
| cp -rp \ |  | ||||||
|     dotfiles/.ipython/profile_default/ipython_config.py \ |  | ||||||
|     ~/.ipython/profile_default/ipython_config.py |  | ||||||
| @ -3726,6 +3726,49 @@ def install(argv: list[str]) -> None: | |||||||
| 
 | 
 | ||||||
|     logger.info(dict(msg='done')) |     logger.info(dict(msg='done')) | ||||||
| 
 | 
 | ||||||
|  | def backup(argv: list[str]) -> None: | ||||||
|  |     parser = argparse.ArgumentParser() | ||||||
|  |     parser.add_argument( | ||||||
|  |         '-r', '--recipients', | ||||||
|  |         #type=list[str], | ||||||
|  |         action='append', | ||||||
|  |         default=[], | ||||||
|  |     ) | ||||||
|  |     parser.add_argument( | ||||||
|  |         '-o', '--output_dir', | ||||||
|  |         #type=list[str], | ||||||
|  |         required=True, | ||||||
|  |     ) | ||||||
|  | 
 | ||||||
|  |     options, args = parser.parse_known_args(argv) | ||||||
|  | 
 | ||||||
|  |     assert len(options.recipients) > 0 | ||||||
|  | 
 | ||||||
|  |     subprocess.check_call(r''' | ||||||
|  |         (\ | ||||||
|  |             mkdir -p ~/.cache/; \ | ||||||
|  |             P=~/.cache/"secrets-$(date -Iseconds).tar.xz.gpg"; \ | ||||||
|  |             tar -J -cvf - ~/.gnupg ~/.ssh ~/.histfile | \ | ||||||
|  |             gpg -e {GPG_ARGS} > $P; \ | ||||||
|  |             echo $P; \ | ||||||
|  |             sudo -E P=$P sh -c \ | ||||||
|  |                 '\ | ||||||
|  |                     mkdir -p {OUTPUT_DIR}; \ | ||||||
|  |                     cp $P {OUTPUT_DIR}; | ||||||
|  |                 ';\ | ||||||
|  |             sync; \ | ||||||
|  |         ) | ||||||
|  |     '''.replace( | ||||||
|  |         '{GPG_ARGS}', | ||||||
|  |         ' '.join([ | ||||||
|  |             '-r %s' % o | ||||||
|  |             for o in options.recipients | ||||||
|  |         ]), | ||||||
|  |     ).replace( | ||||||
|  |         '{OUTPUT_DIR}', | ||||||
|  |         options.output_dir, | ||||||
|  |     ), shell=True) | ||||||
|  | 
 | ||||||
| 
 | 
 | ||||||
| class Command(enum.StrEnum): | class Command(enum.StrEnum): | ||||||
|     media = 'media' |     media = 'media' | ||||||
| @ -3749,6 +3792,7 @@ class Command(enum.StrEnum): | |||||||
|     pm_service = 'pm-service' |     pm_service = 'pm-service' | ||||||
|     scrap_yt_music = 'scrap-yt-music' |     scrap_yt_music = 'scrap-yt-music' | ||||||
|     vpn = 'vpn' |     vpn = 'vpn' | ||||||
|  |     backup = 'backup' | ||||||
| 
 | 
 | ||||||
| def commands_cli() -> None: | def commands_cli() -> None: | ||||||
|     logging.getLogger().setLevel(logging.INFO) |     logging.getLogger().setLevel(logging.INFO) | ||||||
| @ -3824,6 +3868,8 @@ def commands_cli() -> None: | |||||||
|             desktop_services(args) |             desktop_services(args) | ||||||
|         elif options.command is Command.pm_service: |         elif options.command is Command.pm_service: | ||||||
|             pm_service(args) |             pm_service(args) | ||||||
|  |         elif options.command is Command.backup: | ||||||
|  |             backup(args) | ||||||
|         elif options.command is Command.scrap_yt_music: |         elif options.command is Command.scrap_yt_music: | ||||||
|             scrap_yt_music(args) |             scrap_yt_music(args) | ||||||
|         elif options.command is Command.vpn: |         elif options.command is Command.vpn: | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user