aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbozo.kopic <bozo@kopic.xyz>2021-07-06 01:13:01 +0200
committerbozo.kopic <bozo@kopic.xyz>2021-07-06 01:13:01 +0200
commit4f89b9c71f78a102b28c7538d0673148572814e6 (patch)
tree1c46037bdd14980f21ca121c2134b22b63be7d85
parent69ac4caeb4b369d1fce2bd5ad331abc5f0172e45 (diff)
.
-rwxr-xr-xinstall.sh44
-rwxr-xr-xpython/install.sh39
-rw-r--r--shell/.profile20
-rw-r--r--vim/plug.vim14
4 files changed, 62 insertions, 55 deletions
diff --git a/install.sh b/install.sh
index 430f3b7..848a9d1 100755
--- a/install.sh
+++ b/install.sh
@@ -13,7 +13,38 @@ install_packages() {
"(pacman -Q {} &> /dev/null) || echo {}")
}
+install_python() {
+ LONG=$1
+ SHORT=${LONG//\./}
+
+ PYTHON_BIN=$(command -v "python$LONG")
+ if [ ! -z $PYTHON_BIN ]; then
+
+ PYTHON_DIR=~/opt/python$SHORT
+ PIP_BIN=$PYTHON_DIR/bin/pip$LONG
+ REQUIREMENTS=~/.dotfiles/python/requirements.pip$SHORT.txt
+ LOCAL_PYTHON_BIN=~/bin/python$LONG
+ LOCAL_PIP_BIN=~/bin/pip$LONG
+ LOCAL_DOIT_BIN=~/bin/doit$LONG
+
+ [ ! -d $PYTHON_DIR ] && \
+ $PYTHON_BIN -m venv --system-site-packages $PYTHON_DIR
+
+ $PIP_BIN -q install -U -r $REQUIREMENTS
+
+ echo "#!/bin/sh" > $LOCAL_PYTHON_BIN
+ echo "exec $(cd $PYTHON_DIR; pwd)/bin/python$LONG \"\$@\"" >> $LOCAL_PYTHON_BIN
+ chmod +x $LOCAL_PYTHON_BIN
+
+ symlink $PIP_BIN $LOCAL_PIP_BIN
+ symlink $PYTHON_DIR/bin/doit $LOCAL_DOIT_BIN
+
+ fi
+}
+
mkdir -p ~/bin
+mkdir -p ~/opt
+mkdir -p ~/repos
symlink $(cd $(dirname "$0"); pwd -P) ~/.dotfiles
yay --save --sudo doas
install_packages ~/.dotfiles/packages.txt
@@ -37,6 +68,14 @@ symlink ~/.dotfiles/git/.gitconfig ~/.gitconfig
# i3
symlink ~/.dotfiles/i3 ~/.config/i3
+# janet
+if [ ! -d ~/repos/janet ]; then
+ (cd ~/repos; git clone https://github.com/janet-lang/janet.git)
+fi
+if [ ! -d ~/opt/janet ]; then
+ (cd ~/repos/janet; make install PREFIX=$(cd ~/opt; pwd -P)/janet)
+fi
+
# lein
symlink ~/.dotfiles/lein/lein ~/bin/lein
@@ -50,7 +89,10 @@ symlink ~/.dotfiles/pictures ~/.pictures
symlink ~/.dotfiles/polybar ~/.config/polybar
# python
-~/.dotfiles/python/install.sh
+install_python 3.8
+install_python 3.9
+symlink ~/bin/python3.9 ~/bin/python3
+symlink ~/bin/python3 ~/bin/python
# qutebrowser
mkdir -p ~/.config/qutebrowser
diff --git a/python/install.sh b/python/install.sh
deleted file mode 100755
index 1d7fa82..0000000
--- a/python/install.sh
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/sh
-
-set -e
-
-symlink () {
- ln -sfT "$@"
-}
-
-install_python() {
- LONG=$1
- SHORT=${LONG//\./}
-
- PYTHON_BIN=$(command -v "python$LONG")
- if [ ! -z $PYTHON_BIN ]; then
-
- PYTHON_DIR=~/python$SHORT
- PIP_BIN=$PYTHON_DIR/bin/pip$LONG
- REQUIREMENTS=~/.dotfiles/python/requirements.pip$SHORT.txt
- LOCAL_PYTHON_BIN=~/bin/python$LONG
- LOCAL_PIP_BIN=~/bin/pip$LONG
- LOCAL_DOIT_BIN=~/bin/doit$LONG
-
- [ ! -d $PYTHON_DIR ] && \
- $PYTHON_BIN -m venv --system-site-packages $PYTHON_DIR
-
- $PIP_BIN -q install -U -r $REQUIREMENTS
-
- echo "#!/bin/sh" > $LOCAL_PYTHON_BIN
- echo "exec $(cd $PYTHON_DIR; pwd)/bin/python$LONG \"\$@\"" >> $LOCAL_PYTHON_BIN
- chmod +x $LOCAL_PYTHON_BIN
-
- symlink $PIP_BIN $LOCAL_PIP_BIN
- symlink $PYTHON_DIR/bin/doit $LOCAL_DOIT_BIN
-
- fi
-}
-
-install_python 3.8
-install_python 3.9
diff --git a/shell/.profile b/shell/.profile
index 6d2d0f2..579109f 100644
--- a/shell/.profile
+++ b/shell/.profile
@@ -1,12 +1,12 @@
-#export CHICKEN_REPOSITORY=~/programs/chicken_repository
-#export GDK_BACKEND=wayland
-#export QT_AUTO_SCREEN_SCALE_FACTOR=1
-#export QT_ENABLE_HIGHDPI_SCALING=1
-#export QT_QPA_PLATFORM=wayland
-#export QT_WAYLAND_FORCE_DPI=120
-#export SDL_VIDEODRIVER=wayland
-#export WLR_DRM_NO_MODIFIERS=1
-export ATOM_NODE_URL=http://gh-contractor-zcbenz.s3.amazonaws.com/atom-shell/dist
-export PATH=~/bin:~/python39/bin:$PATH
+# export ATOM_NODE_URL=http://gh-contractor-zcbenz.s3.amazonaws.com/atom-shell/dist
+# export CHICKEN_REPOSITORY=~/programs/chicken_repository
+# export GDK_BACKEND=wayland
+# export QT_AUTO_SCREEN_SCALE_FACTOR=1
+# export QT_ENABLE_HIGHDPI_SCALING=1
+# export QT_QPA_PLATFORM=wayland
+# export QT_WAYLAND_FORCE_DPI=120
+# export SDL_VIDEODRIVER=wayland
+# export WLR_DRM_NO_MODIFIERS=1
+export PATH=~/bin:~/opt/python39/bin:~/opt/janet/bin:$PATH
export QT_QPA_PLATFORMTHEME=qt5ct
export VISUAL=nvim
diff --git a/vim/plug.vim b/vim/plug.vim
index 2b89b5a..6a958cb 100644
--- a/vim/plug.vim
+++ b/vim/plug.vim
@@ -116,6 +116,10 @@ let s:TYPE = {
let s:loaded = get(s:, 'loaded', {})
let s:triggers = get(s:, 'triggers', {})
+function! s:is_powershell(shell)
+ return a:shell =~# 'powershell\(\.exe\)\?$' || a:shell =~# 'pwsh\(\.exe\)\?$'
+endfunction
+
function! s:isabsolute(dir) abort
return a:dir =~# '^/' || (has('win32') && a:dir =~? '^\%(\\\|[A-Z]:\)')
endfunction
@@ -263,7 +267,7 @@ function! s:define_commands()
endif
if has('win32')
\ && &shellslash
- \ && (&shell =~# 'cmd\(\.exe\)\?$' || &shell =~# 'powershell\(\.exe\)\?$')
+ \ && (&shell =~# 'cmd\(\.exe\)\?$' || s:is_powershell(&shell))
return s:err('vim-plug does not support shell, ' . &shell . ', when shellslash is set.')
endif
if !has('nvim')
@@ -503,7 +507,7 @@ if s:is_win
let batchfile = s:plug_tempname().'.bat'
call writefile(s:wrap_cmds(a:cmd), batchfile)
let cmd = plug#shellescape(batchfile, {'shell': &shell, 'script': 0})
- if &shell =~# 'powershell\(\.exe\)\?$'
+ if s:is_powershell(&shell)
let cmd = '& ' . cmd
endif
return [batchfile, cmd]
@@ -984,7 +988,7 @@ function! s:chsh(swap)
set shell=sh
endif
if a:swap
- if &shell =~# 'powershell\(\.exe\)\?$' || &shell =~# 'pwsh$'
+ if s:is_powershell(&shell)
let &shellredir = '2>&1 | Out-File -Encoding UTF8 %s'
elseif &shell =~# 'sh' || &shell =~# 'cmd\(\.exe\)\?$'
set shellredir=>%s\ 2>&1
@@ -2225,7 +2229,7 @@ function! plug#shellescape(arg, ...)
let script = get(opts, 'script', 1)
if shell =~# 'cmd\(\.exe\)\?$'
return s:shellesc_cmd(a:arg, script)
- elseif shell =~# 'powershell\(\.exe\)\?$' || shell =~# 'pwsh$'
+ elseif s:is_powershell(shell)
return s:shellesc_ps1(a:arg)
endif
return s:shellesc_sh(a:arg)
@@ -2277,7 +2281,7 @@ function! s:system(cmd, ...)
return system(a:cmd)
endif
let cmd = join(map(copy(a:cmd), 'plug#shellescape(v:val, {"shell": &shell, "script": 0})'))
- if &shell =~# 'powershell\(\.exe\)\?$'
+ if s:is_powershell(&shell)
let cmd = '& ' . cmd
endif
else