From f696949031abd311051aa5dfbcbe8079fe9b0667 Mon Sep 17 00:00:00 2001 From: nexy7574 Date: Thu, 30 May 2024 19:32:09 +0100 Subject: [PATCH] Add omz installs cript --- .config/mpv/scripts/paste.lua | 10 +++++++ .oh-my-zsh/custom/plugins/zsh-autosuggestions | 1 - .../custom/plugins/zsh-syntax-highlighting | 1 - scripts/install-omz.sh | 26 +++++++++++++++++++ scripts/install.py | 4 --- 5 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 .config/mpv/scripts/paste.lua delete mode 160000 .oh-my-zsh/custom/plugins/zsh-autosuggestions delete mode 160000 .oh-my-zsh/custom/plugins/zsh-syntax-highlighting create mode 100755 scripts/install-omz.sh delete mode 100644 scripts/install.py diff --git a/.config/mpv/scripts/paste.lua b/.config/mpv/scripts/paste.lua new file mode 100644 index 0000000..d179d40 --- /dev/null +++ b/.config/mpv/scripts/paste.lua @@ -0,0 +1,10 @@ +mp = require 'mp' +function paste() + local pasted = mp.command_native{ + name = 'subprocess', + args = 'wl-paste', + capture_stdout = true, + } + mp.commandv('loadfile', pasted.stdout:match('^%s*(.-)%s*$')) +end +mp.add_key_binding('Ctrl+v', 'paste', paste) diff --git a/.oh-my-zsh/custom/plugins/zsh-autosuggestions b/.oh-my-zsh/custom/plugins/zsh-autosuggestions deleted file mode 160000 index c3d4e57..0000000 --- a/.oh-my-zsh/custom/plugins/zsh-autosuggestions +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c3d4e576c9c86eac62884bd47c01f6faed043fc5 diff --git a/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting b/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting deleted file mode 160000 index e0165ea..0000000 --- a/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e0165eaa730dd0fa321a6a6de74f092fe87630b0 diff --git a/scripts/install-omz.sh b/scripts/install-omz.sh new file mode 100755 index 0000000..e83d7c3 --- /dev/null +++ b/scripts/install-omz.sh @@ -0,0 +1,26 @@ +#!/bin/env bash + +# Check if OMZ exists. If not, complain. +if [ ! -d "$HOME/.oh-my-zsh" ]; then + echo 'Installing Oh My Zsh (0/2)...' + OLD_PWD=$(pwd) + cd $HOME + sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh) --keep-zshrc --unattended" + cd $OLD_PWD + _S=$(awk -F: -v user="$USER" '$1 == user {print $NF}' /etc/passwd) + if [ "$_S" != "/bin/zsh" ] && [ "$_S" != "/usr/bin/zsh" ]; then + echo 'Changing shell to Zsh...' + sudo chsh -s "/bin/zsh" $USER + fi + echo 'Oh My Zsh installed.' +fi + +# Install syntax highlighting +echo 'Installing syntax highlighting (1/2)...' +git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting + +# Install autosuggestions +echo 'Installing auto-suggestions (2/2)...' +git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions + +echo 'Done. diff --git a/scripts/install.py b/scripts/install.py deleted file mode 100644 index 4c903d5..0000000 --- a/scripts/install.py +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/env python3 -import argparse -import subprocess -