Add i3 installs, sddm
This commit is contained in:
parent
af7d8e0614
commit
e0456fde8d
3 changed files with 18 additions and 11 deletions
17
install.py
17
install.py
|
@ -6,7 +6,6 @@ Shamelessly copied from https://github.com/dmerejkowsky/dotfiles.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import shlex
|
|
||||||
import subprocess
|
import subprocess
|
||||||
from typing import List, Optional
|
from typing import List, Optional
|
||||||
from urllib.request import urlretrieve
|
from urllib.request import urlretrieve
|
||||||
|
@ -42,7 +41,7 @@ class Installer:
|
||||||
if condition in conditions.keys():
|
if condition in conditions.keys():
|
||||||
return conditions[condition]
|
return conditions[condition]
|
||||||
|
|
||||||
command = subprocess.run(shlex.split(condition), check=False)
|
command = subprocess.run(condition, check=False, shell=True)
|
||||||
|
|
||||||
return command.returncode == 0
|
return command.returncode == 0
|
||||||
|
|
||||||
|
@ -73,7 +72,7 @@ class Installer:
|
||||||
|
|
||||||
ui.info_2("Cloning", url, "->", pretty_dest)
|
ui.info_2("Cloning", url, "->", pretty_dest)
|
||||||
git_command = "git clone {} {} --branch {}".format(url, p_dest, branch)
|
git_command = "git clone {} {} --branch {}".format(url, p_dest, branch)
|
||||||
subprocess.run(shlex.split(git_command), check=True)
|
subprocess.run(git_command, check=True, shell=True)
|
||||||
|
|
||||||
def do_copy(self, src: str, dest: str) -> None:
|
def do_copy(self, src: str, dest: str) -> None:
|
||||||
"""Copy two files."""
|
"""Copy two files."""
|
||||||
|
@ -124,8 +123,9 @@ class Installer:
|
||||||
return
|
return
|
||||||
|
|
||||||
install = subprocess.run(
|
install = subprocess.run(
|
||||||
shlex.split(command),
|
command,
|
||||||
check=False,
|
check=False,
|
||||||
|
shell=True,
|
||||||
stdout=subprocess.DEVNULL,
|
stdout=subprocess.DEVNULL,
|
||||||
stderr=subprocess.DEVNULL,
|
stderr=subprocess.DEVNULL,
|
||||||
)
|
)
|
||||||
|
@ -144,7 +144,7 @@ class Installer:
|
||||||
|
|
||||||
ui.info(
|
ui.info(
|
||||||
ui.yellow,
|
ui.yellow,
|
||||||
"Please check if the package was really meant for {} systems."
|
"Are the packages really meant for {} systems?"
|
||||||
.format(self.operating_system)
|
.format(self.operating_system)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -156,7 +156,7 @@ class Installer:
|
||||||
return
|
return
|
||||||
|
|
||||||
ui.info_2("Running", "`{}`".format(command))
|
ui.info_2("Running", "`{}`".format(command))
|
||||||
subprocess.run(shlex.split(command), check=True)
|
subprocess.run(command, check=True, shell=True)
|
||||||
self.base_dir.chdir()
|
self.base_dir.chdir()
|
||||||
|
|
||||||
def do_symlink(self, src: str, dest: str) -> None:
|
def do_symlink(self, src: str, dest: str) -> None:
|
||||||
|
@ -270,9 +270,10 @@ def define_os() -> str:
|
||||||
|
|
||||||
if operating_system in ("debian", "ubuntu"):
|
if operating_system in ("debian", "ubuntu"):
|
||||||
subprocess.run(
|
subprocess.run(
|
||||||
shlex.split("sudo apt update"),
|
"sudo apt update",
|
||||||
stdout=subprocess.DEVNULL,
|
|
||||||
check=True,
|
check=True,
|
||||||
|
shell=True,
|
||||||
|
stdout=subprocess.DEVNULL,
|
||||||
)
|
)
|
||||||
return "debian based"
|
return "debian based"
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,9 @@ if [ -z "$GITHUB_DOTFILES" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Install required packages {{{
|
# Install required packages {{{
|
||||||
|
######
|
||||||
|
# OK #
|
||||||
|
######
|
||||||
|
|
||||||
if [ "$OS" = 'arch' ]; then
|
if [ "$OS" = 'arch' ]; then
|
||||||
pacman -Qe i3-gaps || sudo pacman -S --needed i3
|
pacman -Qe i3-gaps || sudo pacman -S --needed i3
|
||||||
|
@ -31,9 +34,9 @@ fi
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
# Add clones from GitHub {{{
|
# Add clones from GitHub {{{
|
||||||
############################
|
######
|
||||||
# OK NEED TO DO GIT UPDATE #
|
# OK #
|
||||||
############################
|
######
|
||||||
|
|
||||||
mkdir -p "$GITHUB_DOTFILES"
|
mkdir -p "$GITHUB_DOTFILES"
|
||||||
|
|
||||||
|
|
|
@ -306,6 +306,9 @@ setup_bash_git_prompt() { # {{{
|
||||||
} # }}}
|
} # }}}
|
||||||
|
|
||||||
setup_i3() { # {{{
|
setup_i3() { # {{{
|
||||||
|
######
|
||||||
|
# OK #
|
||||||
|
######
|
||||||
|
|
||||||
# Update i3 configuration
|
# Update i3 configuration
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue