This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import glob | |
import os | |
def get_kernel(mountpoint): | |
os.chdir(mountpoint) | |
kernels = [ file for file in glob.glob('*linux*') if os.path.isfile(os.path.join(mountpoint, f)) ] | |
return kernels |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
devices = ['/dev/sdc2'] | |
osprober = ['/dev/sda2:KaOS (rolling):KaOS:linux', '/dev/sda3:KaOS (rolling):KaOS1:linux', '/dev/sdc2:KaOS (rolling):KaOS2:linux', ''] | |
def write_conf(device): | |
title = '' | |
for l in osprober: | |
if device in l: | |
title = l | |
print(title) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import libcalamares | |
from libcalamares.utils import check_chroot_call | |
import subprocess | |
import os | |
install_path = libcalamares.globalstorage.value("rootMountPoint") | |
devices = [] | |
distributions = ['linux_os'] | |
osprober = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
perl-rename -n $@ | |
echo -en "\033[1;33m\nProceed? \033[m" | |
read yesno | |
case "$yesno" in | |
O*|o*|Y*|y*) perl-rename -v $@;; | |
*) echo -e "\033[1;31mCancel...\033[m" | |
esac | |
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
p = subprocess.Popen(["sddm", "--example-config"], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) | |
install_path = 'test' | |
sddm_conf_path = os.path.join(install_path, 'sddm.conf') | |
if p.stderr: | |
print('Unsuccessful command') | |
else: | |
lines = p.stdout.read().decode() | |
with open(sddm_conf_path, 'w') as f: | |
f.write(lines) | |
f.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create_conf(uuid, conf_path): | |
lines = [ | |
'## This is just an example config file.\n', | |
'## Please edit the paths and kernel parameters according to your system.\n', | |
'\n', | |
'title KaOS GNU/Linux, with Linux core repo kernel\n', | |
'linux /vmlinuz-linux\n', | |
'initrd /initramfs-linux.img\n', | |
'options root=%s quiet rw\n' % uuid, | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pkgname=mpv | |
pkgver=0.5.1 | |
pkgrel=1 | |
pkgdesc='Video player based on MPlayer/mplayer2' | |
arch=('x86_64') | |
license=('GPL') | |
url='http://mpv.io' | |
depends=( | |
'ffmpeg' 'lcms2' 'libdvdread' 'libcdio-paranoia' 'libgl' 'enca' | |
'libxinerama' 'mpg123' 'libxv' 'libxkbcommon' 'libva' 'wayland' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try: | |
self.chroot(['pacman', '-Rdd', '--noconfirm', 'xf86-video-nouveau']) | |
except Exception, e: | |
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For input | |
with open(path_to_file) as f: | |
has_synaptics, has_wacom = False, False | |
for line in f: | |
if not has_synaptics and "synaptics" in line: | |
has_synaptics = True | |
if not has_wacom and "wacom" in line: | |
has_wacom = True | |
if has_synaptics and has_wacom: | |
break |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print(listOfPkgsv) | |
# Remove the pkgs that do not have 'thisVideo' | |
for pkg in listOfPkgsv: | |
if pkg.find(thisVideo) == -1: | |
self.queue_event('info', _("Removing video drivers (packages)")) | |
self.chroot(['pacman', '-Rncs', '--noconfirm', 'xf86-video-%s' % (pkg)]) | |
# Cleanup input drivers | |
with open("/var/log/Xorg.0.log", "r") as searchfile: |