diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9c595a6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +temp diff --git a/danos-preseed.cfg b/danos-preseed.cfg new file mode 100644 index 0000000..a462c04 --- /dev/null +++ b/danos-preseed.cfg @@ -0,0 +1,534 @@ +# See https://www.debian.org/releases/stable/example-preseed + +d-i passwd/root-login boolean false +#d-i passwd/root-password-crypted password [$6$uehw3S3GCRTtQe/7$U2peDvJOACWpmfxZLlSFLqF2HRZArooVadfEkK0dFkRVk/HPpZ89gybIirr3n4/DPqoYyjm0qzCPerDAkAkGO1] + +d-i finish-install/reboot_in_progress note +d-i cdrom-detect/eject boolean false +popularity-contest popularity-contest/participate boolean false + +d-i apt-setup/use_mirror boolean true +d-i apt-setup/cdrom/set-first boolean false +d-i apt-setup/disable-cdrom-entries boolean true +d-i apt-setup/non-free-firmware boolean true +d-i apt-setup/non-free boolean true +d-i apt-setup/contrib boolean true + +d-i mirror/country string manual +d-i mirror/http/hostname string deb.debian.org +d-i mirror/http/directory string /debian +d-i mirror/http/proxy string + +# When disk encryption is enabled, skip wiping the partitions beforehand. +d-i partman-auto-crypto/erase_disks boolean false + +# Only works if the system is installed on disk /dev/sda +d-i grub-installer/bootdev string default + +# This is fairly safe to set, it makes grub install automatically to the UEFI +# partition/boot record if no other operating system is detected on the machine. +#d-i grub-installer/only_debian boolean true + +### Package selection +#tasksel tasksel/first multiselect standard, web-server, kde-desktop +tasksel tasksel/first multiselect standard, ssh-server + +# Or choose to not get the tasksel dialog displayed at all (and don't install +# any packages): +#d-i pkgsel/run_tasksel boolean false + +# Individual additional packages to install +#d-i pkgsel/include string bash-completion git + +# Include the QMADE post installation script from Github. +d-i preseed/late_command string \ +apt-install grep wget curl bash; \ +USER_HOME=$(grep ":1000:" /target/etc/passwd | cut -d: -f6) && echo "[ -f ~/.first-login_RENAME ] \ +&& curl -sfL https://raw.githubusercontent.com/ITmail-dk/qmade/main/install.sh | bash" >> /target/$USER_HOME/.profile \ +&& touch /target/$USER_HOME/.first-login && NEW_USERNAME=$(grep ":1000:" /target/etc/passwd | cut -d: -f1) \ +&& chown $NEW_USERNAME:$NEW_USERNAME /target/$USER_HOME/.first-login; \ +in-target wget -O /usr/local/bin/qmade-install https://raw.githubusercontent.com/ITmail-dk/qmade/main/install.sh; \ +in-target chmod +x /usr/local/bin/qmade-install; \ +in-target wget -O /tmp/install-qmade.sh https://raw.githubusercontent.com/ITmail-dk/qmade/main/preseed-install-qmade.sh; \ +in-target chmod +x /tmp/install-qmade.sh;\ +in-target /bin/sh /tmp/install-qmade.sh + +# --------------------------------------------------------------------------- # + +#_preseed_V1 +#### Contents of the preconfiguration file (for bookworm) +### Localization +# Preseeding only locale sets language, country and locale. +#d-i debian-installer/locale string en_US + +# The values can also be preseeded individually for greater flexibility. +#d-i debian-installer/language string en +#d-i debian-installer/country string NL +#d-i debian-installer/locale string en_GB.UTF-8 +# Optionally specify additional locales to be generated. +#d-i localechooser/supported-locales multiselect en_US.UTF-8, nl_NL.UTF-8 + +# Keyboard selection. +#d-i keyboard-configuration/xkb-keymap select us +# d-i keyboard-configuration/toggle select No toggling + +### Network configuration +# Disable network configuration entirely. This is useful for cdrom +# installations on non-networked devices where the network questions, +# warning and long timeouts are a nuisance. +#d-i netcfg/enable boolean false + +# netcfg will choose an interface that has link if possible. This makes it +# skip displaying a list if there is more than one interface. +#d-i netcfg/choose_interface select auto + +# To pick a particular interface instead: +#d-i netcfg/choose_interface select eth1 + +# To set a different link detection timeout (default is 3 seconds). +# Values are interpreted as seconds. +#d-i netcfg/link_wait_timeout string 10 + +# If you have a slow dhcp server and the installer times out waiting for +# it, this might be useful. +#d-i netcfg/dhcp_timeout string 60 +#d-i netcfg/dhcpv6_timeout string 60 + +# Automatic network configuration is the default. +# If you prefer to configure the network manually, uncomment this line and +# the static network configuration below. +#d-i netcfg/disable_autoconfig boolean true + +# If you want the preconfiguration file to work on systems both with and +# without a dhcp server, uncomment these lines and the static network +# configuration below. +#d-i netcfg/dhcp_failed note +#d-i netcfg/dhcp_options select Configure network manually + +# Static network configuration. +# +# IPv4 example +#d-i netcfg/get_ipaddress string 192.168.1.42 +#d-i netcfg/get_netmask string 255.255.255.0 +#d-i netcfg/get_gateway string 192.168.1.1 +#d-i netcfg/get_nameservers string 192.168.1.1 +#d-i netcfg/confirm_static boolean true +# +# IPv6 example +#d-i netcfg/get_ipaddress string fc00::2 +#d-i netcfg/get_netmask string ffff:ffff:ffff:ffff:: +#d-i netcfg/get_gateway string fc00::1 +#d-i netcfg/get_nameservers string fc00::1 +#d-i netcfg/confirm_static boolean true + +# Any hostname and domain names assigned from dhcp take precedence over +# values set here. However, setting the values still prevents the questions +# from being shown, even if values come from dhcp. +#d-i netcfg/get_hostname string unassigned-hostname +#d-i netcfg/get_domain string unassigned-domain + +# If you want to force a hostname, regardless of what either the DHCP +# server returns or what the reverse DNS entry for the IP is, uncomment +# and adjust the following line. +#d-i netcfg/hostname string somehost + +# Disable that annoying WEP key dialog. +#d-i netcfg/wireless_wep string +# The wacky dhcp hostname that some ISPs use as a password of sorts. +#d-i netcfg/dhcp_hostname string radish + +# If you want to completely disable firmware lookup (i.e. not use firmware +# files or packages that might be available on installation images): +#d-i hw-detect/firmware-lookup string never + +# If non-free firmware is needed for the network or other hardware, you can +# configure the installer to always try to load it, without prompting. Or +# change to false to disable asking. +#d-i hw-detect/load_firmware boolean true + +### Network console +# Use the following settings if you wish to make use of the network-console +# component for remote installation over SSH. This only makes sense if you +# intend to perform the remainder of the installation manually. +#d-i anna/choose_modules string network-console +#d-i network-console/authorized_keys_url string http://10.0.0.1/openssh-key +#d-i network-console/password password r00tme +#d-i network-console/password-again password r00tme + +### Mirror settings +# Mirror protocol: +# If you select ftp, the mirror/country string does not need to be set. +# Default value for the mirror protocol: http. +#d-i mirror/protocol string ftp +#d-i mirror/country string manual +#d-i mirror/http/hostname string http.us.debian.org +#d-i mirror/http/directory string /debian +#d-i mirror/http/proxy string + +# Suite to install. +#d-i mirror/suite string testing +# Suite to use for loading installer components (optional). +#d-i mirror/udeb/suite string testing + +### Account setup +# Skip creation of a root account (normal user account will be able to +# use sudo). +#d-i passwd/root-login boolean false +# Alternatively, to skip creation of a normal user account. +#d-i passwd/make-user boolean false + +# Root password, either in clear text +#d-i passwd/root-password password r00tme +#d-i passwd/root-password-again password r00tme +# or encrypted using a crypt(3) hash. +#d-i passwd/root-password-crypted password [crypt(3) hash] + +# To create a normal user account. +#d-i passwd/user-fullname string Debian User +#d-i passwd/username string debian +# Normal user's password, either in clear text +#d-i passwd/user-password password insecure +#d-i passwd/user-password-again password insecure +# or encrypted using a crypt(3) hash. +#d-i passwd/user-password-crypted password [crypt(3) hash] +# Create the first user with the specified UID instead of the default. +#d-i passwd/user-uid string 1010 + +# The user account will be added to some standard initial groups. To +# override that, use this. +#d-i passwd/user-default-groups string audio cdrom video + +### Clock and time zone setup +# Controls whether or not the hardware clock is set to UTC. +#d-i clock-setup/utc boolean true + +# You may set this to any valid setting for $TZ; see the contents of +# /usr/share/zoneinfo/ for valid values. +#d-i time/zone string US/Eastern + +# Controls whether to use NTP to set the clock during the install +#d-i clock-setup/ntp boolean true +# NTP server to use. The default is almost always fine here. +#d-i clock-setup/ntp-server string ntp.example.com + +### Partitioning +## Partitioning example +# If the system has free space you can choose to only partition that space. +# This is only honoured if partman-auto/method (below) is not set. +#d-i partman-auto/init_automatically_partition select biggest_free + +# Alternatively, you may specify a disk to partition. If the system has only +# one disk the installer will default to using that, but otherwise the device +# name must be given in traditional, non-devfs format (so e.g. /dev/sda +# and not e.g. /dev/discs/disc0/disc). +# For example, to use the first SCSI/SATA hard disk: +#d-i partman-auto/disk string /dev/sda +# In addition, you'll need to specify the method to use. +# The presently available methods are: +# - regular: use the usual partition types for your architecture +# - lvm: use LVM to partition the disk +# - crypto: use LVM within an encrypted partition +#d-i partman-auto/method string lvm + +# You can define the amount of space that will be used for the LVM volume +# group. It can either be a size with its unit (eg. 20 GB), a percentage of +# free space or the 'max' keyword. +#d-i partman-auto-lvm/guided_size string max + +# If one of the disks that are going to be automatically partitioned +# contains an old LVM configuration, the user will normally receive a +# warning. This can be preseeded away... +#d-i partman-lvm/device_remove_lvm boolean true +# The same applies to pre-existing software RAID array: +#d-i partman-md/device_remove_md boolean true +# And the same goes for the confirmation to write the lvm partitions. +#d-i partman-lvm/confirm boolean true +#d-i partman-lvm/confirm_nooverwrite boolean true + +# You can choose one of the three predefined partitioning recipes: +# - atomic: all files in one partition +# - home: separate /home partition +# - multi: separate /home, /var, and /tmp partitions +#d-i partman-auto/choose_recipe select atomic + +# Or provide a recipe of your own... +# If you have a way to get a recipe file into the d-i environment, you can +# just point at it. +#d-i partman-auto/expert_recipe_file string /hd-media/recipe + +# If not, you can put an entire recipe into the preconfiguration file in one +# (logical) line. This example creates a small /boot partition, suitable +# swap, and uses the rest of the space for the root partition: +#d-i partman-auto/expert_recipe string \ +# boot-root :: \ +# 40 50 100 ext3 \ +# $primary{ } $bootable{ } \ +# method{ format } format{ } \ +# use_filesystem{ } filesystem{ ext3 } \ +# mountpoint{ /boot } \ +# . \ +# 500 10000 1000000000 ext3 \ +# method{ format } format{ } \ +# use_filesystem{ } filesystem{ ext3 } \ +# mountpoint{ / } \ +# . \ +# 64 512 300% linux-swap \ +# method{ swap } format{ } \ +# . + +# The full recipe format is documented in the file partman-auto-recipe.txt +# included in the 'debian-installer' package or available from D-I source +# repository. This also documents how to specify settings such as file +# system labels, volume group names and which physical devices to include +# in a volume group. + +## Partitioning for EFI +# If your system needs an EFI partition you could add something like +# this to the recipe above, as the first element in the recipe: +# 538 538 1075 free \ +# $iflabel{ gpt } \ +# $reusemethod{ } \ +# method{ efi } \ +# format{ } \ +# . \ +# +# The fragment above is for the amd64 architecture; the details may be +# different on other architectures. The 'partman-auto' package in the +# D-I source repository may have an example you can follow. + +# This makes partman automatically partition without confirmation, provided +# that you told it what to do using one of the methods above. +#d-i partman-partitioning/confirm_write_new_label boolean true +#d-i partman/choose_partition select finish +#d-i partman/confirm boolean true +#d-i partman/confirm_nooverwrite boolean true + +# Force UEFI booting ('BIOS compatibility' will be lost). Default: false. +#d-i partman-efi/non_efi_system boolean true +# Ensure the partition table is GPT - this is required for EFI +#d-i partman-partitioning/choose_label select gpt +#d-i partman-partitioning/default_label string gpt + +# When disk encryption is enabled, skip wiping the partitions beforehand. +#d-i partman-auto-crypto/erase_disks boolean false + +## Partitioning using RAID +# The method should be set to "raid". +#d-i partman-auto/method string raid +# Specify the disks to be partitioned. They will all get the same layout, +# so this will only work if the disks are the same size. +#d-i partman-auto/disk string /dev/sda /dev/sdb + +# Next you need to specify the physical partitions that will be used. +#d-i partman-auto/expert_recipe string \ +# multiraid :: \ +# 1000 5000 4000 raid \ +# $primary{ } method{ raid } \ +# . \ +# 64 512 300% raid \ +# method{ raid } \ +# . \ +# 500 10000 1000000000 raid \ +# method{ raid } \ +# . + +# Last you need to specify how the previously defined partitions will be +# used in the RAID setup. Remember to use the correct partition numbers +# for logical partitions. RAID levels 0, 1, 5, 6 and 10 are supported; +# devices are separated using "#". +# Parameters are: +# \ +# + +#d-i partman-auto-raid/recipe string \ +# 1 2 0 ext3 / \ +# /dev/sda1#/dev/sdb1 \ +# . \ +# 1 2 0 swap - \ +# /dev/sda5#/dev/sdb5 \ +# . \ +# 0 2 0 ext3 /home \ +# /dev/sda6#/dev/sdb6 \ +# . + +# For additional information see the file partman-auto-raid-recipe.txt +# included in the 'debian-installer' package or available from D-I source +# repository. + +# This makes partman automatically partition without confirmation. +#d-i partman-md/confirm boolean true +#d-i partman-partitioning/confirm_write_new_label boolean true +#d-i partman/choose_partition select finish +#d-i partman/confirm boolean true +#d-i partman/confirm_nooverwrite boolean true + +## Controlling how partitions are mounted +# The default is to mount by UUID, but you can also choose "traditional" to +# use traditional device names, or "label" to try filesystem labels before +# falling back to UUIDs. +#d-i partman/mount_style select uuid + +### Base system installation +# Configure APT to not install recommended packages by default. Use of this +# option can result in an incomplete system and should only be used by very +# experienced users. +#d-i base-installer/install-recommends boolean false + +# The kernel image (meta) package to be installed; "none" can be used if no +# kernel is to be installed. +#d-i base-installer/kernel/image string linux-image-686 + +### Apt setup +# Choose, if you want to scan additional installation media +# (default: false). +#d-i apt-setup/cdrom/set-first boolean false +# You can choose to install non-free firmware. +#d-i apt-setup/non-free-firmware boolean true +# You can choose to install non-free and contrib software. +#d-i apt-setup/non-free boolean true +#d-i apt-setup/contrib boolean true +# Uncomment the following line, if you don't want to have the sources.list +# entry for a DVD/BD installation image active in the installed system +# (entries for netinst or CD images will be disabled anyway, regardless of +# this setting). +#d-i apt-setup/disable-cdrom-entries boolean true +# Uncomment this if you don't want to use a network mirror. +#d-i apt-setup/use_mirror boolean false +# Select which update services to use; define the mirrors to be used. +# Values shown below are the normal defaults. +#d-i apt-setup/services-select multiselect security, updates +#d-i apt-setup/security_host string security.debian.org + +# Additional repositories, local[0-9] available +#d-i apt-setup/local0/repository string \ +# http://local.server/debian stable main +#d-i apt-setup/local0/comment string local server +# Enable deb-src lines +#d-i apt-setup/local0/source boolean true +# URL to the public key of the local repository; you must provide a key or +# apt will complain about the unauthenticated repository and so the +# sources.list line will be left commented out. +#d-i apt-setup/local0/key string http://local.server/key +# or one can provide it in-line by base64 encoding the contents of the +# key file (with `base64 -w0`) and specifying it thus: +#d-i apt-setup/local0/key string base64://LS0tLS1CRUdJTiBQR1AgUFVCTElDIEtFWSBCTE9DSy0tLS0tCi4uLgo= +# The content of the key file is checked to see if it appears to be ASCII-armoured. +# If so it will be saved with an ".asc" extension, otherwise it gets a '.gpg' extension. +# "keybox database" format is currently not supported. (see generators/60local in apt-setup's source) + +# By default the installer requires that repositories be authenticated +# using a known gpg key. This setting can be used to disable that +# authentication. Warning: Insecure, not recommended. +#d-i debian-installer/allow_unauthenticated boolean true + +# Uncomment this to add multiarch configuration for i386 +#d-i apt-setup/multiarch string i386 + + +### Package selection +#tasksel tasksel/first multiselect standard, web-server, kde-desktop + +# Or choose to not get the tasksel dialog displayed at all (and don't install +# any packages): +#d-i pkgsel/run_tasksel boolean false + +# Individual additional packages to install +#d-i pkgsel/include string openssh-server build-essential +# Whether to upgrade packages after debootstrap. +# Allowed values: none, safe-upgrade, full-upgrade +#d-i pkgsel/upgrade select none + +# You can choose, if your system will report back on what software you have +# installed, and what software you use. The default is not to report back, +# but sending reports helps the project determine what software is most +# popular and should be included on the first CD/DVD. +#popularity-contest popularity-contest/participate boolean false + +### Boot loader installation +# Grub is the boot loader (for x86). + +# This is fairly safe to set, it makes grub install automatically to the UEFI +# partition/boot record if no other operating system is detected on the machine. +#d-i grub-installer/only_debian boolean true + +# This one makes grub-installer install to the UEFI partition/boot record, if +# it also finds some other OS, which is less safe as it might not be able to +# boot that other OS. +#d-i grub-installer/with_other_os boolean true + +# Due notably to potential USB sticks, the location of the primary drive can +# not be determined safely in general, so this needs to be specified: +#d-i grub-installer/bootdev string /dev/sda +# To install to the primary device (assuming it is not a USB stick): +#d-i grub-installer/bootdev string default + +# Alternatively, if you want to install to a location other than the UEFI +# parition/boot record, uncomment and edit these lines: +#d-i grub-installer/only_debian boolean false +#d-i grub-installer/with_other_os boolean false +#d-i grub-installer/bootdev string (hd0,1) +# To install grub to multiple disks: +#d-i grub-installer/bootdev string (hd0,1) (hd1,1) (hd2,1) + +# Optional password for grub, either in clear text +#d-i grub-installer/password password r00tme +#d-i grub-installer/password-again password r00tme +# or encrypted using an MD5 hash, see grub-md5-crypt(8). +#d-i grub-installer/password-crypted password [MD5 hash] + +# Use the following option to add additional boot parameters for the +# installed system (if supported by the bootloader installer). +# Note: options passed to the installer will be added automatically. +#d-i debian-installer/add-kernel-opts string nousb + +### Finishing up the installation +# During installations from serial console, the regular virtual consoles +# (VT1-VT6) are normally disabled in /etc/inittab. Uncomment the next +# line to prevent this. +#d-i finish-install/keep-consoles boolean true + +# Avoid that last message about the install being complete. +#d-i finish-install/reboot_in_progress note + +# This will prevent the installer from ejecting the CD during the reboot, +# which is useful in some situations. +#d-i cdrom-detect/eject boolean false + +# This is how to make the installer shutdown when finished, but not +# reboot into the installed system. +#d-i debian-installer/exit/halt boolean true +# This will power off the machine instead of just halting it. +#d-i debian-installer/exit/poweroff boolean true + +### Preseeding other packages +# Depending on what software you choose to install, or if things go wrong +# during the installation process, it's possible that other questions may +# be asked. You can preseed those too, of course. To get a list of every +# possible question that could be asked during an install, do an +# installation, and then run these commands: +# debconf-get-selections --installer > file +# debconf-get-selections >> file + + +#### Advanced options +### Running custom commands during the installation +# d-i preseeding is inherently not secure. Nothing in the installer checks +# for attempts at buffer overflows or other exploits of the values of a +# preconfiguration file like this one. Only use preconfiguration files from +# trusted locations! To drive that home, and because it's generally useful, +# here's a way to run any shell command you'd like inside the installer, +# automatically. + +# This first command is run as early as possible, just after +# preseeding is read. +#d-i preseed/early_command string anna-install some-udeb +# This command is run immediately before the partitioner starts. It may be +# useful to apply dynamic partitioner preseeding that depends on the state +# of the disks (which may not be visible when preseed/early_command runs). +#d-i partman/early_command \ +# string debconf-set partman-auto/disk "$(list-devices disk | head -n1)" +# This command is run just before the install finishes, but when there is +# still a usable /target directory. You can chroot to /target and use it +# directly, or use the apt-install and in-target commands to easily install +# packages and run commands in the target system. +#d-i preseed/late_command string apt-install zsh; in-target chsh -s /bin/zsh diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..ffca53f --- /dev/null +++ b/install.sh @@ -0,0 +1,1819 @@ +#!/usr/bin/env bash + +# Installation Start *_:*:_*:*:_*_*:*:_*::*_*::*_*:_*::*_*:*:_:*:*_*:*:_*:*_:*:# + +function start_installation() { + + # Set Echo colors + # for c in {0..255}; do tput setaf $c; tput setaf $c | cat -v; echo =$c; done + # shellcheck disable=SC2034 + NC="\033[0m" + # shellcheck disable=SC2034 + RED="\033[0;31m" + # shellcheck disable=SC2034 + RED2="\033[38;5;196m" + # shellcheck disable=SC2034 + GREEN="\033[0;32m" + # shellcheck disable=SC2034 + YELLOW="\033[0;33m" + # shellcheck disable=SC2034 + BLUE="\033[0;94m" + # Function to check and exit on error use, check_error "TXT" + #set -euo pipefail # Can be good, but can also cause errors in things that are incorrectly aligned versions bash + + check_error() { + if [ $? -ne 0 ]; then + echo -e "${RED} An error occurred during installation and has been stopped. ${NC}" + echo -e "${RED} Or you have pressed CTRL + C to cancel. ${NC}" + echo -e "${RED} Error occurred during $1 ${NC}" + exit 1 + fi + } + + clear #Clear the screen + # Check if it's a Debian system installation and get the version codename. + # shellcheck disable=SC1091 + if [ -f /etc/debian_version ]; then + . /etc/os-release #Get the VERSION_CODENAME + # shellcheck disable=SC2034 + VERSION_CODENAME_SHOULD_NOT_BE=codename-her + else + echo -e "${RED} This installation should only be run on a Debian Linux System. ${NC}" + echo -e "${RED} See more at https://github.com/ITmail-dk/danos/ ${NC}" + exit 1 + fi + # shellcheck disable=SC1091 + echo -e "${GREEN} ${NC}" + echo -e "${GREEN} " + echo -e "${GREEN} Starting the DanOS installation" + echo -e "${GREEN} See more info at https://github.com/ITmail-dk/danos/" + echo -e "${GREEN} Enter your user password, to continue if necessary" + echo -e "${GREEN} Or CTRL + C to cancel the installation" + echo -e "${GREEN} " + echo -e "${GREEN} ${NC}" + + # Run APT Update + sudo apt update || exit 1 + + clear #Clear the screen + check_error "APT Update Nr. 1" + + # DanOS Git install + clone + # Check if the GIT is installed + if ! dpkg -s git >/dev/null 2>&1; then + echo "Git is not installed, Installing git now..." + sudo DEBIAN_FRONTEND=noninteractive apt install -y git + fi + + # DanOS git clone + cd /tmp/ || exit + git clone --depth 1 https://github.com/ITmail-dk/danos.git + + # danos to usr/bin + sudo cp -fu danos/install.sh /usr/bin/danos + sudo chmod +x /usr/bin/danos + sudo sed -i 's/start_installation #main-run/help_wiki #main-run/g' /usr/bin/danos + sudo sed -i 's/sudo reboot #main-run/#sudo reboot #main-run/g' /usr/bin/danos + + # Qtile Config file + if [ -f danos/src/config/qtile-config.py ]; then + mkdir -p ~/.config/qtile/ + cat danos/src/config/qtile-config.py >~/.config/qtile/config.py + else + echo "Qtile config file already exists." + fi + clear #Clear the screen + check_error "Qtile Config file" + + # Qtile Autostart.sh file + mkdir -p ~/.config/qtile/ + if [ -f danos/src/config/qtile-autostart.sh ]; then + cat danos/src/config/qtile-autostart.sh >~/.config/qtile/autostart.sh + chmod +x ~/.config/qtile/autostart.sh + fi + clear #Clear the screen + check_error "Qtile Autostart.sh file" + + # ADD ETC Environment + if [ -f danos/src/etc/environment ]; then + # shellcheck disable=SC2002 + cat "danos/src/etc/environment" | sudo tee /etc/environment + fi + check_error "etc environment file copy" + + # ADD CONFIG FILES TO ETC + if [ -f danos/src/etc/modprobe.d/audio_disable_powersave.conf ]; then + # shellcheck disable=SC2002 + cat danos/src/etc/modprobe.d/audio_disable_powersave.conf | sudo tee /etc/modprobe.d/audio_disable_powersave.conf + fi + check_error "audio_disable_powersave.conf file copy" + + if [ -f danos/src/etc/pipewire/pipewire.conf.d/pipewire.conf ]; then + sudo mkdir -p /etc/pipewire/pipewire.conf.d + # shellcheck disable=SC2002 + cat danos/src/etc/pipewire/pipewire.conf.d/pipewire.conf | sudo tee /etc/pipewire/pipewire.conf.d/pipewire.conf + fi + check_error "pipewire.conf file copy" + + if [ -f danos/src/etc/wireplumber/wireplumber.conf.d/51-disable-suspension.conf ]; then + sudo mkdir -p /etc/wireplumber/wireplumber.conf.d + # shellcheck disable=SC2002 + cat danos/src/etc/wireplumber/wireplumber.conf.d/51-disable-suspension.conf | sudo tee /etc/wireplumber/wireplumber.conf.d/51-disable-suspension.conf + fi + check_error "51-disable-suspension.conf copy" + + if [ -f danos/src/config/kitty.conf ]; then + mkdir -p ~/.config/kitty/themes + # shellcheck disable=SC2002 + cat danos/src/config/kitty.conf >~/.config/kitty/kitty.conf + fi + check_error "Kitty config file copy" + + # auto-new-wallpaper-and-colors BIN + if [ -f danos/src/usr/bin/auto-new-wallpaper-and-colors.sh ]; then + # shellcheck disable=SC2002 + cat danos/src/usr/bin/auto-new-wallpaper-and-colors.sh | sudo tee /usr/bin/auto-new-wallpaper-and-colors + sudo chmod +x /usr/bin/auto-new-wallpaper-and-colors + fi + clear #Clear the screen + check_error "auto-new-wallpaper-and-colors bin" + + # Add Wallpapers + if [ ! -d ~/Wallpapers ]; then + mkdir -p ~/Wallpapers + cp -rfu danos/wallpapers/* ~/Wallpapers/ + else + echo "Wallpapers folder already exists." + fi + + # Check and Copy APT Sources List + if [ -f /etc/apt/sources.list ]; then + sudo mv /etc/apt/sources.list /etc/apt/old-type-sources.list.bak + fi + + # Copy in new APT files + sudo cp -rfu danos/src/apt/* /etc/apt/ + check_error "Copy APT Sources list files" + + #Get the VERSION_CODENAME to determine changes to be made in APT source list. + OS_VERSION_FOR_APT=$(lsb_release -cs) + case "$OS_VERSION_FOR_APT" in + bookworm) + echo "Bookworm Detected." + sudo sed -i 's/APTLISTOS/bookworm/g' /etc/apt/sources.list.d/debian.sources + ;; + trixie) + echo "Trixie Detected." + sudo sed -i 's/APTLISTOS/trixie/g' /etc/apt/sources.list.d/debian.sources + ;; + forky) + echo "Forky Detected." + sudo sed -i "s/Suites: APTLISTOS APTLISTOS-updates APTLISTOS-backports/Suites: sid trixie-updates trixie-backports/g" "/etc/apt/sources.list.d/debian.sources" + sudo sed -i "s/Suites: APTLISTOS-security/Suites: trixie-security/g" "/etc/apt/sources.list.d/debian.sources" + ;; + *) + echo "Unknown Debian release: $OS_VERSION_FOR_APT. Stop action taken." + exit 1 + ;; + esac + # this IF statement will be replaced by the CASE... + #if [ "$VERSION_CODENAME" == "trixie" ] || [ "$VERSION_CODENAME" == "sid" ]; then + # if grep -q "Suites: bookworm" "/etc/apt/sources.list.d/debian.sources"; then + # echo "Sentence found. Replacing..." + # sudo sed -i 's/APTLISTOSbookworm/trixie/g' /etc/apt/sources.list.d/debian.sources + # #sudo sed -i "s/Suites: bookworm bookworm-updates bookworm-backports/Suites: sid bookworm-updates bookworm-backports/g" "/etc/apt/sources.list.d/debian.sources" + # else + # echo "APT Sources list, No changes made." + # fi + #fi + check_error "Check and replace APT Sources list distro" + + # Check for version of Debian and replace in source list of necessary + + # Sudoers ------------------------------------------------------------------------------------------------------------------------------------ + # Add User NOPASSWD to shutdown now and reboot + echo "$USER ALL=(ALL) NOPASSWD: /sbin/shutdown now, /sbin/reboot, /usr/bin/systemctl suspend, /usr/bin/systemctl hibernate, /usr/bin/yazi" | sudo tee -a /etc/sudoers.d/"$USER" && sudo visudo -c -f /etc/sudoers.d/"$USER" + check_error "Sudo User NOPASSWD to shutdown now and reboot" + + # Set sudo password timeout + echo "Defaults timestamp_timeout=25" | sudo tee -a /etc/sudoers.d/"$USER" && sudo visudo -c -f /etc/sudoers.d/"$USER" + check_error "Set sudo password timeout" + # Sudoers ------------------------------------------------------------------------------------------------------------------------------------ + + clear #Clear the screen + + sudo apt update + + clear #Clear the screen + check_error "APT Update Nr. 2" + + # ------------------------------------------------------------------------------------------------- + # Core System APT install + sudo DEBIAN_FRONTEND=noninteractive apt -y --ignore-missing install bash-completion xserver-xorg x11-utils xinit polkitd pkexec lxpolkit acl arandr autorandr picom fwupd colord mesa-utils htop wget curl git tmux numlockx kitty neovim xdg-utils ufw gufw cups cups-common lm-sensors fancontrol xbacklight brightnessctl unzip network-manager bind9-dnsutils dunst libnotify-bin notify-osd xsecurelock pm-utils rofi 7zip jq poppler-utils fd-find ripgrep zoxide imagemagick nsxiv mpv flameshot mc thunar gvfs gvfs-backends parted gparted mpd mpc ncmpcpp fzf ccrypt xarchiver notepadqq font-manager fontconfig fontconfig-config fonts-recommended fonts-liberation fonts-freefont-ttf fonts-noto-core libfontconfig1 pipewire pipewire-audio pipewire-alsa pipewire-pulse pipewire-jack wireplumber libspa-0.2-bluetooth pavucontrol playerctl alsa-utils qpwgraph sddm-theme-breeze ffmpeg build-essential dkms cmake remmina libreoffice linux-cpupower plymouth plymouth-themes keynav yt-dlp qalculate-gtk xss-lock power-profiles-daemon + + sudo DEBIAN_FRONTEND=noninteractive apt -y --ignore-missing install linux-headers-"$(uname -r)" + sudo DEBIAN_FRONTEND=noninteractive apt -y install sddm --no-install-recommends + check_error "Core System APT install" + + # APT install extra packages + #sudo DEBIAN_FRONTEND=noninteractive apt -y --ignore-missing install + + if [ "$VERSION_CODENAME" == "trixie" ] || [ "$VERSION_CODENAME" == "sid" ]; then + echo " " + else + sudo DEBIAN_FRONTEND=noninteractive apt -y --ignore-missing install freerdp2-x11 libfreerdp-client2-2 libfreerdp2-2 libwinpr2-2 + fi + + clear #Clear the screen + check_error "APT install extra packages" + + # Google Chrome install. + cd /tmp/ && wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && sudo DEBIAN_FRONTEND=noninteractive apt install -y /tmp/google-chrome-stable_current_amd64.deb && rm google-chrome-stable_current_amd64.deb + clear #Clear the screen + check_error "Google Chrome install" + + # Network Share Components + sudo DEBIAN_FRONTEND=noninteractive apt install -y ceph-common smbclient nfs-common && echo "# CEPH" | sudo tee -a /etc/fstab && echo "#:/ /mnt/cephfs ceph name=clientNAME,noatime,_netdev 0 0" | sudo tee -a /etc/fstab + clear #Clear the screen + check_error "Network Share Components" + + # Check if the CPU is a QEMU Virtual CPU using lscpu + if lscpu | grep -iq "QEMU"; then + echo "QEMU Virtual CPU detected. Installing xrdp and restarting service..." + sudo apt update + sudo DEBIAN_FRONTEND=noninteractive apt install -y xrdp + sudo systemctl restart xrdp.service + fi + clear #Clear the screen + check_error "Check if the CPU is a QEMU Virtual CPU and install xrdp" + + # Check for Bluetooth hardware using lsusb + if lsusb | grep -iq bluetooth; then + echo "Bluetooth detected, Installing required packages..." + sudo DEBIAN_FRONTEND=noninteractive apt install -y bluetooth bluez bluez-cups bluez-obexd bluez-meshd pulseaudio-module-bluetooth bluez-firmware blueman + fi + clear #Clear the screen + check_error "Check for Bluetooth hardware and install" + + # Check for Logitech hardware using lsusb + # Solaar - Logitech Unifying Receiver - Accessory management for Linux. + if lsusb | grep -iq Logitech; then + echo "Logitech detected, Installing required packages..." + sudo DEBIAN_FRONTEND=noninteractive apt install -y solaar + fi + clear #Clear the screen + check_error "Check for Logitech hardware and install" + + # Audio Start - https://alsa.opensrc.org - https://wiki.debian.org/ALSA + # See hardware run: "pacmd list-sinks" or "lspci | grep -i audio" or... sudo dmesg | grep 'snd\|firmware\|audio' + # Run.: "pw-cli info" provides detailed information about the PipeWire nodes and devices, including ALSA devices. + # Test file run: "aplay /usr/share/sounds/alsa/Front_Center.wav" + # sudo adduser $USER audio + + # PipeWire Sound Server "Audio" - https://pipewire.org/ + + # More Audio tools + # sudo DEBIAN_FRONTEND=noninteractive apt install -y alsa-tools + + # sudo alsactl init + + clear #Clear the screen + check_error "Audio Core System APT install" + + # CPU Microcode install + export LC_ALL=C # All subsequent command output will be in English + CPUVENDOR=$(lscpu | grep "Vendor ID:" | awk '{print $3}') + + if [ "$CPUVENDOR" == "GenuineIntel" ]; then + if ! dpkg -s intel-microcode >/dev/null 2>&1; then + sudo DEBIAN_FRONTEND=noninteractive apt install -y intel-microcode + fi + else + echo -e "${GREEN} Intel Microcode OK ${NC}" + fi + + if [ "$CPUVENDOR" == "AuthenticAMD" ]; then + if ! dpkg -s amd64-microcode >/dev/null 2>&1; then + sudo DEBIAN_FRONTEND=noninteractive apt install -y amd64-microcode + fi + else + echo -e "${GREEN} Amd64 Microcode OK ${NC}" + fi + unset LC_ALL # unset the LC_ALL=C + + clear #Clear the screen + check_error "CPU Microcode install" + + # Alias echo to ~/.bashrc or ~/.bash_aliases + BASHALIASFILE=~/.bashrc + # shellcheck disable=SC2129 + echo 'alias ls="ls --color=auto --group-directories-first -v -lah"' >>$BASHALIASFILE + # shellcheck disable=SC2129 + echo 'alias ll="ls --color=auto --group-directories-first -v -lah"' >>$BASHALIASFILE + + echo 'alias df="df -h"' >>$BASHALIASFILE + + echo 'alias neofetch="fastfetch"' >>$BASHALIASFILE + + echo 'alias upup="sudo apt update && sudo apt upgrade -y && sudo apt clean && sudo apt autoremove -y"' >>$BASHALIASFILE + # shellcheck disable=SC2028,SC2016 + echo 'bind '"'"'"\C-f":"open "$(fzf)"\n"'"'" >>$BASHALIASFILE + echo 'alias lsman="compgen -c | fzf | xargs man"' >>$BASHALIASFILE + + echo 'alias qtileconfig="nano ~/.config/qtile/config.py"' >>$BASHALIASFILE + echo 'alias qtileconfig-test="python3 ~/.config/qtile/config.py"' >>$BASHALIASFILE + echo 'alias qtileconfig-test-venv="source /opt/qtile_venv/bin/activate && python3 ~/.config/qtile/config.py && deactivate"' >>$BASHALIASFILE + echo 'alias autostart-edit="nano ~/.config/qtile/autostart.sh"' >>$BASHALIASFILE + echo 'alias vi="nvim"' >>$BASHALIASFILE + echo 'alias vim="nvim"' >>$BASHALIASFILE + # shellcheck disable=SC2026 + echo 'alias ytdl="yt-dlp -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best'"' >>$BASHALIASFILE + echo 'alias ytdl-ao="yt-dlp --extract-audio --audio-format mp3 --audio-quality 7 --embed-thumbnail"' >>$BASHALIASFILE + clear #Clear the screen + check_error "Bash Alias Echo" + + #PROFILESFILE=~/.profile + #echo "export color_prompt=yes" >>$PROFILESFILE + + # Set User folders via xdg-user-dirs-update & xdg-mime default. + # ls /usr/share/applications/ Find The Default run.: "xdg-mime query default inode/directory" + + xdg-user-dirs-update + + xdg-mime default kitty.desktop text/x-shellscript + xdg-mime default nsxiv.desktop image/jpeg + xdg-mime default nsxiv.desktop image/png + xdg-mime default thunar.desktop inode/directory + + mkdir -p ~/Screenshots + + check_error "xdg-user-dirs-update and xdg-mime" + + sudo rm /usr/share/sddm/faces/.face.icon + sudo rm /usr/share/sddm/faces/root.face.icon + + sudo cp -fu src/home/root.face.icon /usr/share/sddm/faces/root.face.icon + sudo cp -fu src/home/.face.icon /usr/share/sddm/faces/.face.icon + cp -fu src/home/.face.icon ~/.face.icon + + setfacl -m u:sddm:x ~/ + setfacl -m u:sddm:r ~/.face.icon + + sudo setfacl -m u:sddm:x /usr/share/sddm/faces/ + sudo setfacl -m u:sddm:r /usr/share/sddm/faces/.face.icon + sudo setfacl -m u:sddm:r /usr/share/sddm/faces/root.face.icon + + check_error "Set User .face.icon file" + + sudo mkdir -p /etc/sddm.conf.d + sudo bash -c 'cat << "SDDMCONFIG" >> /etc/sddm.conf.d/default.conf +[Theme] +# Set Current theme "name" breeze, maui etc. +Current=breeze + +[Wayland] +EnableHiDPI=true + +[X11] +EnableHiDPI=true + +SDDMCONFIG' + + # Set login wallpape under background=/ in /usr/share/sddm/themes/breeze/theme.conf + #/usr/share/wallpapers/login-wallpape.jpg + + clear #Clear the screen + check_error "Setup SDDM Login" + + # Midnight-Commander ini file + mkdir -p ~/.config/mc + cat <<"MCINI" >~/.config/mc/ini +[Midnight-Commander] +skin=nicedark + +MCINI + check_error "Setup Midnight-Commander ini file" + + # Qtile Core Dependencies apt install + sudo DEBIAN_FRONTEND=noninteractive apt install -y feh python3-full python3-pip python3-venv pipx libxkbcommon-dev libxkbcommon-x11-dev libcairo2-dev pkg-config + curl -LsSf https://astral.sh/uv/install.sh | sh # Install UV Python package and project manager. + # shellcheck disable=SC1091 + source "$HOME"/.local/bin/env # Activate UV after install + clear #Clear the screen + check_error "Qtile Core Dependencies apt install" + + # Install Qtile from source via github and Pip + cd ~ || exit + mkdir -p ~/.local/bin + mkdir -p ~/.local/src + + # Python3 venv Qtile install + # Upgrade run: python3 -m venv --upgrade qtile_venv + cd /opt || exit + if [ "$VERSION_CODENAME" == "bookworm" ]; then + if [ -d qtile_venv ]; then + sudo rm -rf qtile_venv + fi + sudo python3 -m venv qtile_venv + sudo chmod -R 777 qtile_venv + cd qtile_venv || exit + git clone --depth 1 https://github.com/ITmail-dk/danos.git + git clone --depth 1 https://github.com/qtile/qtile.git --branch v0.32.0 # Specific version of Qtile + # shellcheck disable=SC1091 + source /opt/qtile_venv/bin/activate + pip install dbus-next psutil wheel pyxdg + pip install -r qtile/requirements.txt + bin/pip install qtile/. + # PyWAL install via pip3 for auto-generated color themes + #pip3 install pywal16[all] + # shellcheck disable=SC2102 + pip3 install pywal16[colorz] + deactivate + sudo cp -fu danos/install.sh /usr/bin/danos + sudo chmod +x /usr/bin/danos + sudo cp -fu bin/qtile /usr/bin/ + sudo cp -fu bin/wal /usr/bin/ + else + sudo mkdir qtile_venv + sudo chmod -R 777 qtile_venv && cd qtile_venv || exit + #git clone --depth 1 https://github.com/qtile/qtile.git # The latest version of Qtile + git clone --depth 1 https://github.com/ITmail-dk/danos.git + sudo cp -fu danos/install.sh /usr/bin/danos + sudo chmod +x /usr/bin/danos + uv tool install qtile # The latest version of Qtile via UV + # shellcheck disable=SC2102 + uv tool install pywal16[colorz] + sudo cp -fu ~/.local/bin/qtile /usr/bin/ + sudo cp -fu ~/.local/bin/wal /usr/bin/ + fi + + clear #Clear the screen + check_error "Install Qtile and PyWAL from qtile_venv" + + mkdir -p ~/.cache/wal + cat <<"PYWALCOLORSJSON" >~/.cache/wal/colors.json +{ + "checksum": "85abc768e55abc92396e0c76280093cc", + "wallpaper": "/home/username/Wallpapers/default_wallpaper.jpg", + "alpha": "100", + + "special": { + "background": "#06090c", + "foreground": "#c0c1c2", + "cursor": "#c0c1c2" + }, + "colors": { + "color0": "#06090c", + "color1": "#1f384b", + "color2": "#304d5c", + "color3": "#375d6e", + "color4": "#4e5b61", + "color5": "#526870", + "color6": "#66767a", + "color7": "#899195", + "color8": "#555f68", + "color9": "#2a4b64", + "color10": "#40677b", + "color11": "#4a7d93", + "color12": "#687a82", + "color13": "#6e8b96", + "color14": "#889ea3", + "color15": "#c0c1c2" + } +} + +PYWALCOLORSJSON + clear #Clear the screen + check_error "pywal colors json" + + mkdir -p ~/.config/kitty/themes + mkdir -p ~/.cache/wal/ + cat <<"PYWALCOLORSKITTY" >~/.cache/wal/colors-kitty.conf +foreground #c0c1c2 +background #06080b +background_opacity 0.98 +cursor #c0c1c2 + +active_tab_foreground #06080b +active_tab_background #c0c1c2 +inactive_tab_foreground #c0c1c2 +inactive_tab_background #06080b + +active_border_color #c0c1c2 +inactive_border_color #06080b +bell_border_color #1b394e + +color0 #06080b +color8 #555b67 +color1 #1b394e +color9 #244d68 +color2 #245067 +color10 #306b8a +color3 #33667f +color11 #4589aa +color4 #4e606e +color12 #698193 +color5 #557384 +color13 #729ab0 +color6 #6c818e +color14 #91adbe +color7 #898d95 +color15 #c0c1c2 + +PYWALCOLORSKITTY + + ln -s ~/.cache/wal/colors-kitty.conf ~/.config/kitty/themes/current-theme.conf + + # PyWal kitty template + mkdir -p ~/.config/wal/templates/ + cat <<"PYWALCOLORSTEMPALETKITTY" >~/.config/wal/templates/colors-kitty.conf +foreground {foreground} +background {background} +background_opacity 0.98 +cursor {cursor} + +active_tab_foreground {background} +active_tab_background {foreground} +inactive_tab_foreground {foreground} +inactive_tab_background {background} + +active_border_color {foreground} +inactive_border_color {background} +bell_border_color {color1} + +color0 {color0} +color8 {color8} +color1 {color1} +color9 {color9} +color2 {color2} +color10 {color10} +color3 {color3} +color11 {color11} +color4 {color4} +color12 {color12} +color5 {color5} +color13 {color13} +color6 {color6} +color14 {color14} +color7 {color7} +color15 {color15} + +PYWALCOLORSTEMPALETKITTY + clear #Clear the screen + check_error "pywal colors kitty" + + cat <<"PYWALCOLORSTEMPALETROFI" >~/.config/wal/templates/colors-rofi-dark.rasi +* {{ + active-background: {color2}; + active-foreground: @foreground; + normal-background: @background; + normal-foreground: @foreground; + urgent-background: {color1}; + urgent-foreground: @foreground; + + alternate-active-background: @background; + alternate-active-foreground: @foreground; + alternate-normal-background: @background; + alternate-normal-foreground: @foreground; + alternate-urgent-background: @background; + alternate-urgent-foreground: @foreground; + + selected-active-background: {color1}; + selected-active-foreground: @foreground; + selected-normal-background: {color2}; + selected-normal-foreground: @foreground; + selected-urgent-background: {color3}; + selected-urgent-foreground: @foreground; + + background-color: @background; + background: {background}; + foreground: {foreground}; + border-color: @background; + spacing: 2; +}} + +#window {{ + width: 30%; + background-color: @background; + border: 0; + padding: 2.5ch; +}} + +#mainbox {{ + border: 0; + padding: 0; + background-color: @background; + children: [inputbar, listview]; +}} + +#message {{ + border: 2px 0px 0px; + border-color: @border-color; + padding: 1px; +}} + +#textbox {{ + text-color: @foreground; +}} + +#inputbar {{ + children: [ prompt,textbox-prompt-colon,entry,case-indicator ]; +}} + +#textbox-prompt-colon {{ + expand: false; + str: ":"; + margin: 0px 0.3em 0em 0em; + text-color: @normal-foreground; +}} + +#listview {{ + fixed-height: 0; + border: 2px 0px 0px; + border-color: @border-color; + spacing: 2px; + scrollbar: true; + padding: 2px 0px 0px; +}} + +#element {{ + border: 0; + padding: 8 0; +}} + +#element-text {{ + background-color: inherit; + text-color: inherit; +}} + +#element-icon {{ + size: 30; +}} + +#element.normal.normal {{ + background-color: @normal-background; + text-color: @normal-foreground; +}} + +#element.normal.urgent {{ + background-color: @urgent-background; + text-color: @urgent-foreground; +}} + +#element.normal.active {{ + background-color: @active-background; + text-color: @active-foreground; +}} + +#element.selected.normal {{ + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +}} + +#element.selected.urgent {{ + background-color: @selected-urgent-background; + text-color: @selected-urgent-foreground; +}} + +#element.selected.active {{ + background-color: @selected-active-background; + text-color: @selected-active-foreground; +}} + +#element.alternate.normal {{ + background-color: @alternate-normal-background; + text-color: @alternate-normal-foreground; +}} + +#element.alternate.urgent {{ + background-color: @alternate-urgent-background; + text-color: @alternate-urgent-foreground; +}} + +#element.alternate.active {{ + background-color: @alternate-active-background; + text-color: @alternate-active-foreground; +}} + +#scrollbar {{ + width: 4px; + border: 0; + handle-width: 8px; + padding: 0; +}} + +#sidebar {{ + border: 2px 0px 0px; + border-color: @border-color; +}} + +#button {{ + text-color: @normal-foreground; +}} + +#button.selected {{ + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +}} + +#inputbar {{ + spacing: 0; + text-color: @normal-foreground; + padding: 1px; +}} + +#case-indicator {{ + spacing: 0; + text-color: @normal-foreground; +}} + +#entry {{ + spacing: 0; + text-color: @normal-foreground; +}} + +#prompt {{ + spacing: 0; + text-color: @normal-foreground; +}} + +PYWALCOLORSTEMPALETROFI + clear #Clear the screen + check_error "pywal colors rofi" + + # Set xdg-desktop-portal prefer dark mode. + gsettings set org.gnome.desktop.interface color-scheme prefer-dark + clear #Clear the screen + check_error "gsettings set color-scheme" + + #Midnight Commander + mkdir -p ~/.config/mc + echo "skin=dark" >>~/.config/mc/ini + clear #Clear the screen + check_error "Midnight Commander config" + + # ------------------------------------------------------------------------ + + # Wireplumber disable suspension + sudo mkdir -p /etc/wireplumber/wireplumber.conf.d/ + sudo bash -c 'cat << "WIREPLUMERDISSUS" >> /etc/wireplumber/wireplumber.conf.d/51-disable-suspension.conf +monitor.alsa.rules = [ + { + matches = [ + { + # Matches all sources + node.name = "~alsa_input.*" + }, + { + # Matches all sinks + node.name = "~alsa_output.*" + } + ] + actions = { + update-props = { + session.suspend-timeout-seconds = 0 + } + } + } +] +# bluetooth devices +monitor.bluez.rules = [ + { + matches = [ + { + # Matches all sources + node.name = "~bluez_input.*" + }, + { + # Matches all sinks + node.name = "~bluez_output.*" + } + ] + actions = { + update-props = { + session.suspend-timeout-seconds = 0 + } + } + } +] +WIREPLUMERDISSUS' + + clear #Clear the screen + check_error "Wireplumber disable suspension" + + # Qtile xsessions file + sudo mkdir -p /usr/share/xsessions/ + sudo bash -c 'cat << "QTILEDESKTOP" >> /usr/share/xsessions/qtile.desktop +[Desktop Entry] +Name=Qtile +Comment=Qtile Session +Exec=/etc/sddm/Xsession +Type=Application +Keywords=wm;tiling +QTILEDESKTOP' + + # Add to user .xsession + echo "exec /usr/bin/qtile start" >~/.xsession + echo "exec /usr/bin/qtile start" | sudo tee -a "/etc/skel/.xsession" >/dev/null + clear #Clear the screen + check_error "Add Qtile .xsession" + + # Synaptics devices + if grep -iq 'synaptics|synap' /proc/bus/input/devices; then + echo "Synaptics touchpad detected. Installing xserver-xorg-input-synaptics and configuring autostart..." + sudo DEBIAN_FRONTEND=noninteractive apt install -y xserver-xorg-input-synaptics + check_error "Failed to install xserver-xorg-input-synaptics" + + cat </dev/null +# Synaptics - Touchpad left click and right click. +synclient TapButton1=1 TapButton2=3 & +EOF + fi + clear #Clear the screen + check_error "Add Synaptics Autostart.sh file" + + # MPD Setup & config START + + mkdir -p ~/.config/mpd/playlists + mkdir -p ~/.local/state/mpd + if [ ! -f ~/.config/mpd/mpd.conf ]; then + touch ~/.config/mpd/database + cat <~/.config/mpd/mpd.conf +# ~/.config/mpd/mpd.conf or /etc/mpd.conf +# Example: /usr/share/doc/mpd/mpdconf.example + +# Recommended location for database +db_file "~/.config/mpd/database" + +# If running mpd using systemd, delete this line to log directly to systemd. +# syslog or ~/.config/mpd/log +log_file "~/.config/mpd/log" + +# The music directory is by default the XDG directory, uncomment to amend and choose a different directory +#music_directory "~/Music" + +# MPD Server network +bind_to_address "127.0.0.1" +port "6600" + +# Suppress all messages below the given threshold. Use "verbose" for +# troubleshooting. Available setting arguments are "notice", "info", "verbose", "warning" and "error". +log_level "error" + +# Setting "restore_paused" to "yes" puts MPD into pause mode instead of starting playback after startup. +restore_paused "yes" + +# Uncomment to refresh the database whenever files in the music_directory are changed +auto_update "yes" + +# Uncomment to enable the functionalities +playlist_directory "~/.config/mpd/playlists" +pid_file "~/.config/mpd/pid" +state_file "~/.local/state/mpd/state" +sticker_file "~/.config/mpd/sticker.sql" +follow_inside_symlinks "yes" +# save_absolute_paths_in_playlists "no" + + +decoder { + plugin "wildmidi" + config_file "/etc/timidity/timidity.cfg" + enabled "no" +} + +# Audio output + +audio_output { + type "pipewire" + name "PipeWire Sound Server" + enabled "yes" +} +audio_output { + type "pulse" + name "Local PulseAudio Server" + enabled "no" +} + +MPDCONFIG + + else + echo "mpd.conf already exists." + fi + + # sudo systemctl enable mpd + #systemctl enable --now --user mpd.service + #systemctl enable --now --user mpd + # systemctl status mpd.service + + #systemctl enable --now --user mpd.socket + #systemctl enable --now --user mpd.service + + # mpd --version + # mpd --stderr --no-daemon --verbose + # aplay --list-pcm + clear #Clear the screen + check_error "MPD Setup & config" + + # Nano config START + if [ ! -f ~/.nanorc ]; then + cp /etc/nanorc ~/.nanorc + #sed -i 's/^# set linenumbers/set linenumbers/' ~/.nanorc + sed -i 's/^# set minibar/set minibar/' ~/.nanorc + sed -i 's/^# set softwrap/set softwrap/' ~/.nanorc + sed -i 's/^# set atblanks/set atblanks/' ~/.nanorc + else + echo "File .nanorc already exists." + fi + check_error "Nano config" + + # Neovim setup config Start + #git clone --depth 1 https://github.com/LazyVim/starter ~/.config/nvim + #rm -rf ~/.config/nvim/.git + + if [ ! -f ~/.config/nvim/init.vim ]; then + mkdir -p ~/.config/nvim + cat <<"NEOVIMCONFIG" >~/.config/nvim/init.vim +syntax on +set number +set numberwidth=5 +set relativenumber +set ignorecase +NEOVIMCONFIG + + else + echo "Neovim config file already exists." + fi + clear #Clear the screen + check_error "Neovim config" + + # Kitty theme.conf Start + + if [ ! -f ~/.cache/wal/colors-kitty.conf ]; then + mkdir -p ~/.cache/wal + cat <<"KITTYTHEMECONF" >~/.cache/wal/colors-kitty.conf +background #1e3143 +foreground #cec7bc +color0 #1e3143 +color1 #708191 +color2 #bcc2be +color3 #9ea5a3 +color4 #717c7a +color5 #a9a5a8 +color6 #788483 +color7 #c1c6c3 +color8 #254657 +color9 #496c80 +color10 #28415a +color11 #b1aea6 +color12 #849aa3 +color13 #c6c0b6 +color14 #648896 +color15 #cec7bc + +KITTYTHEMECONF + + else + echo "kittytheme.conf file already exists." + fi + clear #Clear the screen + check_error "Kitty config" + + # Tmux config Start + + if [ ! -f ~/.config/tmux/tmux.conf ]; then + mkdir -p ~/.config/tmux + cat <<"TMUXCONFIG" >~/.config/tmux/tmux.conf +unbind r +bind r source-file ~/.config/tmux/tmux.conf + +TMUXCONFIG + + else + echo "Tmux config file already exists." + fi + clear #Clear the screen + check_error "Tmux config" + + # ------------------------------------------------------------------------------------------------- + + #echo -e "${YELLOW} Xresources config Start ${NC}" + + #if [ ! -f ~/.Xresources ]; then + + #cat << "XRCONFIG" > ~/.Xresources + + #XRCONFIG + + #else + # echo ".Xresources config file already exists." + #fi + + # Themes START + # Nerd Fonts - https://www.nerdfonts.com/font-downloads - https://www.nerdfonts.com/cheat-sheet + # RUN "fc-list" to list the fonts install on the system. + if [ ! -d /usr/share/fonts ]; then + sudo mkdir -p /usr/share/fonts + + else + echo "fonts folder already exists." + fi + + #JetBrainsMono (The default front in the configuration) + curl -OL "https://github.com/ryanoasis/nerd-fonts/releases/latest/download/JetBrainsMono.zip" + sudo unzip -n "JetBrainsMono.zip" -d "/usr/share/fonts/JetBrainsMono/" + rm JetBrainsMono.zip + sudo rm -f /usr/share/fonts/JetBrainsMono/*.md + sudo rm -f /usr/share/fonts/JetBrainsMono/*.txt + sudo rm -f /usr/share/fonts/JetBrainsMono/LICENSE + + #RobotoMono + curl -OL "https://github.com/ryanoasis/nerd-fonts/releases/latest/download/RobotoMono.zip" + sudo unzip -n "RobotoMono.zip" -d "/usr/share/fonts/RobotoMono/" + rm RobotoMono.zip + sudo rm -f /usr/share/fonts/RobotoMono/*.md + sudo rm -f /usr/share/fonts/RobotoMono/*.txt + sudo rm -f /usr/share/fonts/RobotoMono/LICENSE + + sudo rm -f /usr/share/fonts/*.md + sudo rm -f /usr/share/fonts/*.txt + sudo rm -f /usr/share/fonts/LICENSE + clear #Clear the screen + check_error "Themes Nerd Fonts" + + # Set the default font family to Noto in the /etc/fonts/local.conf file. + if [ ! -f /etc/fonts/local.conf ]; then + sudo mkdir -p /etc/fonts + sudo bash -c 'cat << "FONTSLOCALCONFIG" >> /etc/fonts/local.conf + + + + + Noto Sans + + + serif + Noto Serif + + + sans-serif + Noto Sans + + + monospace + Noto Mono + + + Source Code Pro + false + + + +FONTSLOCALCONFIG' + + else + echo "fonts local.conf file already exists." + fi + clear #Clear the screen + check_error "Themes Fonts local.conf" + + if [ -d /usr/share/xsessions/ ]; then + # shellcheck disable=SC2061 + find /usr/share/xsessions/ -name plasma* -exec sudo rm -f {} \; + sudo update-alternatives --remove x-session-manager /usr/bin/startplasma-x11 + fi + if [ -d /usr/share/wayland-sessions/ ]; then + # shellcheck disable=SC2061 + find /usr/share/wayland-sessions/ -name plasma* -exec sudo rm -f {} \; + sudo update-alternatives --remove x-session-manager /usr/bin/startplasma-x11 + fi + + check_error "Remove plasma sessions .desktop" + + sudo rm -rf /tmp/EliverLara-Nordic + sudo git clone --depth 1 https://github.com/EliverLara/Nordic /tmp/EliverLara-Nordic + sudo cp -r /tmp/EliverLara-Nordic /usr/share/themes/ + + sudo mkdir -p /usr/share/sddm/themes/Nordic-darker/ + sudo cp -r /tmp/EliverLara-Nordic/kde/sddm/Nordic-darker/* /usr/share/sddm/themes/Nordic-darker/ + + # Nordzy-cursors -------------------------------------------------------- + + # https://github.com/alvatip/Nordzy-cursors + + cd /tmp/ || exit + if [ -d Nordzy-cursors ]; then + sudo rm -rf Nordzy-cursors + fi + + git clone --depth 1 https://github.com/alvatip/Nordzy-cursors + cd Nordzy-cursors || exit + sudo ./install.sh + cd /tmp/ || exit + + # .Xresources + # Xcursor.theme: Nordzy-cursors + # Xcursor.size: 22 + + # Nordzy-icon -------------------------------------------------------- + # https://github.com/alvatip/Nordzy-icon + + cd /tmp/ || exit + + if [ -d Nordzy-icon ]; then + sudo rm -rf Nordzy-icon + fi + + git clone --depth 1 https://github.com/alvatip/Nordzy-icon + cd Nordzy-icon/ || exit + sudo ./install.sh + cd /tmp/ || exit + + # GTK Settings START -------------------------------------------------------- + # /etc/gtk-3.0/settings.ini + # https://docs.gtk.org/gtk4/property.Settings.gtk-cursor-theme-name.html + if [ ! -d /etc/gtk-3.0 ]; then + sudo kdir -p /etc/gtk-3.0 + + else + echo "/etc/gtk-3.0 already exists." + fi + + sudo bash -c 'cat << "GTK3SETTINGS" >> /etc/gtk-3.0/settings.ini +[Settings] +gtk-theme-name=EliverLara-Nordic +gtk-fallback-icon-theme=default +gtk-toolbar-style=GTK_TOOLBAR_BOTH +gtk-font-name=JetBrainsMono Nerd Font 10 +gtk-application-prefer-dark-theme=1 +gtk-cursor-theme-name=Nordzy-cursors +gtk-cursor-theme-size=0 +gtk-icon-theme-name=Nordzy-icon +gtk-enable-event-sounds=0 +gtk-enable-input-feedback-sounds=0 +GTK3SETTINGS' + + if [ ! -d /etc/gtk-4.0 ]; then + sudo mkdir -p /etc/gtk-4.0 + + else + echo "/etc/gtk-4.0 already exists." + fi + + sudo bash -c 'cat << "GTK4SETTINGS" >> /etc/gtk-4.0/settings.ini +[Settings] +gtk-theme-name=EliverLara-Nordic +gtk-fallback-icon-theme=default +gtk-toolbar-style=GTK_TOOLBAR_BOTH +gtk-font-name=JetBrainsMono Nerd Font 10 +gtk-application-prefer-dark-theme=1 +gtk-cursor-theme-name=Nordzy-cursors +gtk-cursor-theme-size=0 +gtk-icon-theme-name=Nordzy-icon +gtk-enable-event-sounds=0 +gtk-enable-input-feedback-sounds=0 +GTK4SETTINGS' + + sudo sed -i 's/Adwaita/Nordzy-cursors/g' /usr/share/icons/default/index.theme + + # GTK Settings END -------------------------- + + sudo fc-cache -fv + clear #Clear the screen + check_error "GTK Settings & Fonts" + + # ------------------------------------------------------------------------------------------------- + + # xrandr-set-max + Xsession START + + if [ ! -f /usr/bin/xrandr-set-max ]; then + xrandrsetmaxcontent=$( + cat <<"XRANDRSETMAX" +#!/usr/bin/env bash + +# Get the names of all connected displays +displays=$(xrandr | awk '/ connected/{print $1}') + +# Loop through each connected display and set its resolution to the maximum supported resolution +for display in $displays; do + # Get the maximum supported resolution for the current display + max_resolution=$(xrandr | awk '/'"$display"'/ && / connected/{getline; print $1}') + + # Set the screen resolution to the maximum supported resolution for the current display + xrandr --output "$display" --mode "$max_resolution" +done +XRANDRSETMAX + ) + + # Write the script content to the target file using sudo + echo "$xrandrsetmaxcontent" | sudo tee /usr/bin/xrandr-set-max >/dev/null + + # SDDM Before Login - /usr/share/sddm/scripts/Xsetup and After Login - /usr/share/sddm/scripts/Xsession + #sudo sed -i '$a\. /usr/bin/xrandr-set-max' /usr/share/sddm/scripts/Xsetup + #sudo sed -i '$a\. /usr/bin/xrandr-set-max' /usr/share/sddm/scripts/Xsession #Old + + sudo chmod +x /usr/bin/xrandr-set-max + + else + echo "xrandr-set-max already exists." + fi + + #if [ ! -f /etc/X11/Xsession.d/90_xrandr-set-max ]; then + # sudo cp /usr/bin/xrandr-set-max /etc/X11/Xsession.d/90_xrandr-set-max + # # Run at Login /etc/X11/Xsession.d/FILENAME + #else + # echo "/etc/X11/Xsession.d/90_xrandr-set-max already exists." + #fi + + clear #Clear the screen + check_error "xrandr-set-max file" + # ------------------------------------------------------------------------------------------------- + + # ------------------------------------------------------------------------------------------------- + + # Rofi Run menu START + if [ ! -d ~/.config/rofi ]; then + mkdir -p ~/.config/rofi + + else + echo "Rofi folder already exists." + fi + + if [ ! -f ~/.config/rofi/config.rasi ]; then + #touch ~/.config/rofi/config.rasi + cat <<"ROFICONFIG" >~/.config/rofi/config.rasi +configuration { + display-drun: "Applications:"; + display-window: "Windows:"; + drun-display-format: "{name}"; + font: "JetBrainsMono Nerd Font Propo 11"; + modi: "window,run,drun"; +} + +/* The Theme */ +@import "~/.cache/wal/colors-rofi-dark.rasi" + +// Theme location is "/usr/share/rofi/themes/name.rasi" +//@theme "/usr/share/rofi/themes/Arc-Dark.rasi" + +ROFICONFIG + + else + echo "Rofi config file already exists." + fi + + # Rofi Wifi menu + # https://github.com/ericmurphyxyz/rofi-wifi-menu/tree/master + + if [ ! -f ~/.config/rofi/rofi-wifi-menu.sh ]; then + cat <<"ROFIWIFI" >~/.config/rofi/rofi-wifi-menu.sh +#!/usr/bin/env bash + +notify-send "Getting list of available Wi-Fi networks..." +# Get a list of available wifi connections and morph it into a nice-looking list +wifi_list=$(nmcli --fields "SECURITY,SSID" device wifi list | sed 1d | sed 's/ */ /g' | sed -E "s/WPA*.?\S/ /g" | sed "s/^--/ /g" | sed "s/ //g" | sed "/--/d") + +connected=$(nmcli -fields WIFI g) +if [[ "$connected" =~ "enabled" ]]; then + toggle="󰖪 Disable Wi-Fi" +elif [[ "$connected" =~ "disabled" ]]; then + toggle="󰖩 Enable Wi-Fi" +fi + +# Use rofi to select wifi network +chosen_network=$(echo -e "$toggle\n$wifi_list" | uniq -u | rofi -dmenu -i -selected-row 1 -p "Wi-Fi SSID: " ) +# Get name of connection +read -r chosen_id <<< "${chosen_network:3}" + +if [ "$chosen_network" = "" ]; then + exit +elif [ "$chosen_network" = "󰖩 Enable Wi-Fi" ]; then + nmcli radio wifi on +elif [ "$chosen_network" = "󰖪 Disable Wi-Fi" ]; then + nmcli radio wifi off +else + # Message to show when connection is activated successfully + success_message="You are now connected to the Wi-Fi network \"$chosen_id\"." + # Get saved connections + saved_connections=$(nmcli -g NAME connection) + if [[ $(echo "$saved_connections" | grep -w "$chosen_id") = "$chosen_id" ]]; then + nmcli connection up id "$chosen_id" | grep "successfully" && notify-send "Connection Established" "$success_message" + else + if [[ "$chosen_network" =~ "" ]]; then + wifi_password=$(rofi -dmenu -p "Password: " ) + fi + nmcli device wifi connect "$chosen_id" password "$wifi_password" | grep "successfully" && notify-send "Connection Established" "$success_message" + fi +fi + +ROFIWIFI + + chmod +x ~/.config/rofi/rofi-wifi-menu.sh + + else + echo "Rofi WiFi menu file already exists." + fi + clear #Clear the screen + check_error "Rofi Run menu" + + if [ ! -f ~/.config/rofi/powermenu.sh ]; then + mkdir -p ~/.config/rofi + cat <<"ROFIPOWERMENU" >~/.config/rofi/powermenu.sh +#!/usr/bin/env bash +chosen=$(printf " System Shutdown\n󰒲 Suspend System\n󰤄 Hibernate System\n Lockdown Mode\n Reboot" | rofi -dmenu -i -theme-str '@import "powermenu.rasi"') + +case "$chosen" in + "󰒲 Suspend System") sudo systemctl suspend ;; + " System Shutdown") sudo shutdown now ;; + "󰤄 Hibernate System") sudo systemctl hibernate ;; + " Lockdown Mode") xsecurelock ;; + " Reboot") sudo reboot ;; + *) exit 1 ;; +esac + +ROFIPOWERMENU + + else + echo "powermenu.sh file already exists." + fi + + chmod +x ~/.config/rofi/powermenu.sh + clear #Clear the screen + check_error "Rofi Powermenu" + + if [ ! -f ~/.config/rofi/powermenu.rasi ]; then + mkdir -p ~/.config/rofi + cat <<"ROFIPOWERMENURASI" >~/.config/rofi/powermenu.rasi + +inputbar { + children: [entry]; +} + +listview { + lines: 5; +} + +ROFIPOWERMENURASI + + else + echo "powermenu.rasi file already exists." + fi + clear #Clear the screen + check_error "Rofi Powermenu rasi" + + # Add xfce4 file helpers + if [ ! -f ~/.config/xfce4/helpers.rc ]; then + mkdir -p ~/.config/xfce4 + cat <<"XFCE4HELPER" >~/.config/xfce4/helpers.rc +FileManager=Thunar +TerminalEmulator=kitty +WebBrowser=google-chrome +MailReader= + +XFCE4HELPER + + else + echo "xfce4 helper config file already exists." + fi + clear #Clear the screen + check_error "xfce4 helpers.rc" + + # Add kitty to open nvim and vim. + if [ -f /usr/share/applications/nvim.desktop ]; then + sudo sed -i 's/Exec=nvim %F/Exec=kitty -e nvim %F/' /usr/share/applications/nvim.desktop + else + echo "no nvim.desktop file" + fi + + if [ -f /usr/share/applications/vim.desktop ]; then + sudo sed -i 's/Exec=vim %F/Exec=kitty -e vim %F/' /usr/share/applications/vim.desktop + else + echo "no vim.desktop file" + fi + clear #Clear the screen + check_error "Add kitty to open nvim and vim" + + # SDDM SDDM LOGIN WALLPAPER + + sudo mkdir -p /usr/share/wallpapers + sudo chmod 777 /usr/share/wallpapers + sudo cp "$(find /tmp/danos/wallpapers -type f -name "*.jpg" | shuf -n 1)" /usr/share/wallpapers/login-wallpape.jpg + sudo chmod 777 /usr/share/wallpapers/login-wallpape.jpg + + # SDDM New login wallpaper + sudo chmod 777 /usr/share/sddm/themes/breeze + sudo chmod 777 /usr/share/sddm/themes/breeze/theme.conf + + NEW_LOGIN_WALLPAPER="/usr/share/wallpapers/login-wallpape.jpg" + + # Check if the breeze/theme.conf file exists + if [ -f "/usr/share/sddm/themes/breeze/theme.conf" ]; then + # Use sed to replace the background line + sed -i "s|background=.*$|background=$NEW_LOGIN_WALLPAPER|" "/usr/share/sddm/themes/breeze/theme.conf" + echo "Updated background image in /usr/share/sddm/themes/breeze/theme.conf" + else + echo "Error: File /usr/share/sddm/themes/breeze/theme.conf not found" + fi + check_error "NEW SDDM LOGIN WALLPAPER" + + # --------------------------------------------------------------------------------------- + cd /tmp/ || exit + + # FastFetch Install. + FASTFETCH_VERSION=$(curl -s "https://api.github.com/repos/fastfetch-cli/fastfetch/releases/latest" | grep '"tag_name"' | awk -F'"' '{print $4}') + wget https://github.com/fastfetch-cli/fastfetch/releases/download/"$FASTFETCH_VERSION"/fastfetch-linux-amd64.deb && sudo dpkg -i fastfetch-linux-amd64.deb && rm fastfetch-linux-amd64.deb + clear #Clear the screen + check_error "FastFetch install" + + # WaterFox install - https://www.waterfox.net/download/ + WATERFOX_VERSION=$(curl -s "https://api.github.com/repos/BrowserWorks/waterfox/releases/latest" | grep '"tag_name"' | awk -F'"' '{print $4}') + wget -O waterfox.tar.bz2 https://cdn1.waterfox.net/waterfox/releases/"$WATERFOX_VERSION"/Linux_x86_64/waterfox-"$WATERFOX_VERSION".tar.bz2 + tar -xvf waterfox.tar.bz2 + sudo mv waterfox /opt/ + sudo chown -R root:root /opt/waterfox/ + + cat </dev/null +[Desktop Entry] +Name=Waterfox +Exec=/opt/waterfox/waterfox +Icon=/opt/waterfox/browser/chrome/icons/default/default128.png +Type=Application +Categories=Network;WebBrowser; +EOF + + sudo ln -s /opt/waterfox/waterfox /usr/bin/waterfox + + clear #Clear the screen + check_error "WaterFox install" + + # Yazi File Manager + # https://github.com/sxyazi/yazi/releases/latest + YAZI_VERSION=$(curl -s "https://api.github.com/repos/sxyazi/yazi/releases/latest" | grep '"tag_name"' | awk -F'"' '{print $4}') + wget https://github.com/sxyazi/yazi/releases/download/"$YAZI_VERSION"/yazi-x86_64-unknown-linux-musl.zip + unzip yazi-x86_64-unknown-linux-musl.zip + sudo cp -fu yazi-x86_64-unknown-linux-musl/yazi /usr/bin/ + sudo chown root:root /usr/bin/yazi + sudo chmod +x /usr/bin/yazi + + clear #Clear the screen + check_error "Yazi File Manager install" + + # Systemctl enable --user + # See list run: systemctl list-unit-files --state=enabled + if [ "$(whoami)" != "root" ]; then + # Sound systemctl enable --user + systemctl enable --user --now pipewire.socket pipewire-pulse.socket wireplumber.service + else + echo "#!/usr/bin/env bash" >>~/.first-login-user-setup + echo "systemctl enable --user --now pipewire.socket pipewire-pulse.socket wireplumber.service" >>~/.first-login-user-setup + fi + check_error "Systemctl enable for user" + + # LM-Sensors config + sudo sensors-detect --auto + + # Remove .first-login file -------------------------------------------------------------- + if [ -f ~/.first-login ]; then + sudo rm -f ~/.first-login + fi + + # Check for Nvidia graphics card and install drivers + if lsmod | grep -iq nouveau; then + #sudo rmmod -f nouveau #remove test + echo "blacklist nouveau" | sudo tee -a /etc/modprobe.d/nouveau-blacklist.conf + fi + + if lsmod | grep -iq nvidia; then + sudo rmmod -f nvidia_modeset + sudo rmmod -f nvidia_drm + sudo rmmod -f nvidia + fi + + if lspci | grep -i nvidia; then + echo "Installing required packages..." + sudo apt -y install linux-headers-"$(uname -r)" + sudo apt -y install gcc make acpid dkms libglvnd-core-dev libglvnd0 libglvnd-dev + check_error "Nvidia installing required packages" + + echo "Removing old NVIDIA drivers..." + sudo apt remove -y nvidia-* && sudo apt autoremove -y + # OLD sudo apt remove -y nvidia-* && sudo apt autoremove -y "$(dpkg -l nvidia-driver* | grep ii | awk '{print $2}')" + check_error "removal of old NVIDIA drivers" + + echo "Enabling i386 architecture and installing 32-bit libraries..." + sudo dpkg --add-architecture i386 && sudo apt update && sudo apt install -y libc6:i386 + check_error "installation of i386 libraries" + + #NVIDIAGETVERSION=570.133.07 + #NVIDIAGETVERSION="$(curl -s "https://www.nvidia.com/en-us/drivers/unix/" | grep "Latest Production Branch Version:" | awk -F'"> ' '{print $2}' | cut -d'<' -f1 | awk 'NR==1')" + NVIDIAGETVERSION="$(curl -s "https://api.github.com/repos/NVIDIA/open-gpu-kernel-modules/releases/latest" | grep '"tag_name"' | awk -F'"' '{print $4}')" + echo "Downloading and installing NVIDIA $NVIDIAGETVERSION driver..." + wget https://us.download.nvidia.com/XFree86/Linux-x86_64/"$NVIDIAGETVERSION"/NVIDIA-Linux-x86_64-"$NVIDIAGETVERSION".run + check_error "downloading NVIDIA driver" + + chmod +x NVIDIA-Linux-x86_64-"$NVIDIAGETVERSION".run + # echo 'nvidia-settings --assign CurrentMetaMode="nvidia-auto-select +0+0 { ForceFullCompositionPipeline = On }"' >> ~/.config/qtile/autostart.sh + sudo ./NVIDIA-Linux-x86_64-"$NVIDIAGETVERSION".run --silent --no-questions --disable-nouveau --allow-installation-with-running-driver -M proprietary --skip-module-load + # --run-nvidia-xconfig + if command -v docker &>/dev/null; then + if [ ! -f "/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg" ]; then + curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --yes --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg + fi + + if [ ! -f "/etc/apt/sources.list.d/nvidia-container-toolkit.list" ]; then + curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list + fi + sudo apt update + sudo apt install -y nvidia-container-toolkit + sudo nvidia-ctk runtime configure --runtime=docker + sudo systemctl restart docker || sudo systemctl --user restart docker + fi + fi + clear #Clear the screen + check_error "NVIDIA driver installation" + + # Edit GRUB BOOT TIMEOUT AND SPLASH + sudo sed -i 's+GRUB_TIMEOUT=5+GRUB_TIMEOUT=1+g' /etc/default/grub + sudo sed -i '0,/"quiet"/ s/"quiet"/"quiet splash"/' /etc/default/grub + sudo update-grub + + # List boot themes run: sudo plymouth-set-default-theme -l + sudo plymouth-set-default-theme -R tribar + + clear #Clear the screen + check_error "GRUB BOOT TIMEOUT AND SPLASH" + + sudo reboot # Install done + # --------------------------------------------------------------------------------------- + # Install Done ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ## + # --------------------------------------------------------------------------------------- + + # Test Qtile config file. + # Run qtileconfig-test-venv or qtileconfig-test for no python venv. + + # End of function start_installation +} + +# Start of update_danos function +function update_danos() { + cd /opt || exit + # shellcheck disable=SC1091 + if [[ -f /etc/os-release ]]; then + . /etc/os-release #Get the VERSION_CODENAME + fi + # shellcheck disable=SC1091 + if command -v uv &>/dev/null; then + echo "UV is installed..." + else + curl -LsSf https://astral.sh/uv/install.sh | sh # Install UV Python package manager. + source "$HOME"/.local/bin/env + fi + cd /opt || exit + + #Get the VERSION_CODENAME + OS_VERSION_FOR_APT=$(lsb_release -cs) + case "$OS_VERSION_FOR_APT" in + bookworm) + echo "Bookworm Detected." + ;; + trixie) + echo "Trixie Detected." + ;; + sid) + echo "Sid Detected." + ;; + *) + echo "Unknown Debian release: $OS_VERSION_FOR_APT. Stop action taken." + exit 1 + ;; + esac + + if [ "$VERSION_CODENAME" == "bookworm" ]; then + cd /opt || exit + if [ -d qtile_venv ]; then + sudo rm -rf qtile_venv + fi + sudo python3 -m venv qtile_venv + sudo chmod -R 777 qtile_venv + cd qtile_venv || exit + git clone --depth 1 https://github.com/ITmail-dk/danos.git + git clone --depth 1 https://github.com/qtile/qtile.git --branch v0.32.0 # Specific version of Qtile + # shellcheck disable=SC1091 + source /opt/qtile_venv/bin/activate + pip install dbus-next psutil wheel pyxdg + pip install -r qtile/requirements.txt + bin/pip install qtile/. + # PyWAL install via pip3 for auto-generated color themes + #pip3 install pywal16[all] + # shellcheck disable=SC2102 + pip3 install pywal16[colorz] + deactivate + sudo cp -fu danos/install.sh /usr/bin/danos + sudo chmod +x /usr/bin/danos + sudo cp -fu bin/qtile /usr/bin/ + sudo cp -fu bin/wal /usr/bin/ + else + cd /opt || exit + if [ -d qtile_venv ]; then + sudo rm -rf qtile_venv + fi + sudo mkdir qtile_venv + sudo chmod -R 777 qtile_venv && cd qtile_venv || exit + #git clone --depth 1 https://github.com/qtile/qtile.git # The latest version of Qtile + git clone --depth 1 https://github.com/ITmail-dk/danos.git + sudo cp -fu danos/install.sh /usr/bin/danos + sudo chmod +x /usr/bin/danos + uv tool install qtile --force # The latest version of Qtile via UV + # shellcheck disable=SC2102 + uv tool install pywal16[colorz] --force # if you want all the options for color generation use [all] instead of [colorz] + sudo cp -fu ~/.local/bin/qtile /usr/bin/ + sudo cp -fu ~/.local/bin/wal /usr/bin/ + fi + + # SDDM New login wallpaper + sudo chmod 777 /usr/share/sddm/themes/breeze + sudo chmod 777 /usr/share/sddm/themes/breeze/theme.conf + + sudo mkdir -p /usr/share/wallpapers + sudo chmod 777 /usr/share/wallpapers + sudo cp "$(find danos/wallpapers -type f -name "*.jpg" | shuf -n 1)" /usr/share/wallpapers/login-wallpape.jpg + + NEW_LOGIN_WALLPAPER="/usr/share/wallpapers/login-wallpape.jpg" + + if [ -f "/usr/share/sddm/themes/breeze/theme.conf" ]; then + # Use sed to replace the background line + sed -i "s|background=.*$|background=$NEW_LOGIN_WALLPAPER|" "/usr/share/sddm/themes/breeze/theme.conf" + echo "Updated background image in /usr/share/sddm/themes/breeze/theme.conf" + else + echo "Error: File /usr/share/sddm/themes/breeze/theme.conf not found" + fi + + if [ -d /usr/share/xsessions/ ]; then + # shellcheck disable=SC2061 + if find /usr/share/xsessions/ -maxdepth 1 -type f -name "plasma*" -print -quit | grep -q .; then + find /usr/share/xsessions/ -name plasma* -exec sudo rm -f {} \; + find /usr/share/wayland-sessions/ -name plasma* -exec sudo rm -f {} \; + sudo update-alternatives --remove x-session-manager /usr/bin/startplasma-x11 + fi + fi + + # if [ -d /usr/share/wayland-sessions/ ]; then + # # shellcheck disable=SC2061 + # if find /usr/share/wayland-sessions/ -maxdepth 1 -type f -name "plasma*" -print -quit | grep -q .; then + # find /usr/share/wayland-sessions/ -name plasma* -exec sudo rm -f {} \; + # sudo update-alternatives --remove x-session-manager /usr/bin/startplasma-x11 + # fi + # fi + # OLD + # if [ -d /usr/share/xsessions/ ]; then + # # shellcheck disable=SC2061 + # find /usr/share/xsessions/ -name plasma* -exec sudo rm -f {} \; + # sudo update-alternatives --remove x-session-manager /usr/bin/startplasma-x11 + # fi + # if [ -d /usr/share/wayland-sessions/ ]; then + # # shellcheck disable=SC2061 + # find /usr/share/wayland-sessions/ -name plasma* -exec sudo rm -f {} \; + # sudo update-alternatives --remove x-session-manager /usr/bin/startplasma-x11 + # fi + # End of update_danos function +} + +function update_waterfox() { + cd /tmp/ || exit + sudo rm -rf /opt/waterfox + + # WaterFox update - https://www.waterfox.net/download/ + #echo -en "Enter the new version number of WaterFox: " + #read WATERFOX_VERSION + WATERFOX_VERSION=$(curl -s "https://api.github.com/repos/BrowserWorks/waterfox/releases/latest" | grep '"tag_name"' | awk -F'"' '{print $4}') + + wget -O waterfox.tar.bz2 https://cdn1.waterfox.net/waterfox/releases/"$WATERFOX_VERSION"/Linux_x86_64/waterfox-"$WATERFOX_VERSION".tar.bz2 + tar -xvf waterfox.tar.bz2 + sudo mv waterfox /opt/ + sudo chown -R root:root /opt/waterfox/ + # sudo ln -s /opt/waterfox/waterfox /usr/bin/waterfox +} + +function nvidia_install_upgrade() { + check_error() { + if [ $? -ne 0 ]; then + echo -e "${RED} An error occurred during installation and has been stopped. ${NC}" + echo -e "${RED} Or you have pressed CTRL + C to cancel. ${NC}" + echo -e "${RED} Error occurred during $1 ${NC}" + exit 1 + fi + } + + if [ ! -f "/etc/modprobe.d/nouveau-blacklist.conf" ]; then + echo "blacklist nouveau" | sudo tee -a /etc/modprobe.d/nouveau-blacklist.conf + fi + + if lspci | grep -i nvidia; then + echo "Nvidia install / Update." + echo "Installing required packages..." + sudo apt -y install linux-headers-"$(uname -r)" + sudo apt -y install gcc make acpid dkms libglvnd-core-dev libglvnd0 libglvnd-dev + check_error "Installing required package" + + echo "Removing old NVIDIA drivers..." + sudo apt remove -y nvidia-* && sudo apt autoremove -y + # OLD sudo apt remove -y nvidia-* && sudo apt autoremove -y "$(dpkg -l nvidia-driver* | grep ii | awk '{print $2}')" + check_error "removal of old NVIDIA drivers" + + echo "Enabling i386 architecture and installing 32-bit libraries..." + sudo dpkg --add-architecture i386 && sudo apt update && sudo apt install -y libc6:i386 + check_error "installation of i386 libraries" + + #NVIDIAGETVERSION=570.133.07 + #NVIDIAGETVERSION="$(curl -s "https://www.nvidia.com/en-us/drivers/unix/" | grep "Latest Production Branch Version:" | awk -F'"> ' '{print $2}' | cut -d'<' -f1 | awk 'NR==1')" + # Latest Nvidia Beta driver version + NVIDIAGETVERSION="$(curl -s "https://api.github.com/repos/NVIDIA/open-gpu-kernel-modules/releases/latest" | grep '"tag_name"' | awk -F'"' '{print $4}')" + echo "Downloading and installing NVIDIA $NVIDIAGETVERSION driver..." + wget https://us.download.nvidia.com/XFree86/Linux-x86_64/"$NVIDIAGETVERSION"/NVIDIA-Linux-x86_64-"$NVIDIAGETVERSION".run + check_error "downloading NVIDIA driver" + chmod +x NVIDIA-Linux-x86_64-"$NVIDIAGETVERSION".run + # echo 'nvidia-settings --assign CurrentMetaMode="nvidia-auto-select +0+0 { ForceFullCompositionPipeline = On }"' >> ~/.config/qtile/autostart.sh + sudo ./NVIDIA-Linux-x86_64-"$NVIDIAGETVERSION".run --silent --no-questions --disable-nouveau --allow-installation-with-running-driver -M proprietary --skip-module-load + # --run-nvidia-xconfig + sudo update-grub + if command -v docker &>/dev/null; then + if [ ! -f "/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg" ]; then + curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --yes --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg + fi + + if [ ! -f "/etc/apt/sources.list.d/nvidia-container-toolkit.list" ]; then + curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list + fi + sudo apt update + sudo apt install -y nvidia-container-toolkit + sudo nvidia-ctk runtime configure --runtime=docker + sudo systemctl restart docker || sudo systemctl --user restart docker + fi + fi + clear #Clear the screen + check_error "NVIDIA driver installation" + # End of nvidia_install_upgrad function +} + +function help_wiki() { + echo "Help / WiKi for DanOS" +} + +main() { + if [ -z "$1" ]; then + start_installation #main-run + fi + + case $1 in + "help" | "--help" | "-h") + echo "Help..!" + help_wiki + exit 0 + ;; + "update" | "--update" | "-u") + echo "Update DanOS" + update_danos + auto-new-wallpaper-and-colors + sleep 0.25 + sudo sed -i 's/start_installation #main-run/help_wiki #main-run/g' /usr/bin/danos + clear #Clear the screen + echo "DanOS Update is finished" + exit 0 + ;; + "system-update" | "--system-update" | "-su") + echo -e "System APT Update / Upgrade + QTILE / DanOS Upgrade." + sudo apt update && sudo apt upgrade -y && sudo apt clean && sudo apt autoremove -y + update_danos + nvidia_install_upgrade + sudo dkms autoinstall + sudo update-initramfs -u -k all + clear #Clear the screen + echo -e "We are finished with the System Update / Upgrade + QTILE & DanOS.\nYou should consider rebooting after a system update." + exit 0 + ;; + "system-dist-upgrade" | "--system-dist-upgrade" | "-sdu") + echo "Full System Distro Update and Upgrade" + sudo apt update && sudo apt full-upgrade -y && sudo apt dist-upgrade + update_danos + update_waterfox + nvidia_install_upgrade + sudo dkms autoinstall + sudo update-initramfs -u -k all + clear #Clear the screen + echo -e "We are finished with the Full System Update / Upgrade\nYou should consider rebooting after a system update." + exit 0 + ;; + "update-waterfox" | "-uwf") + echo "Updating Waterfox" + update_waterfox + clear #Clear the screen + echo "Waterfox update is finished." + exit 0 + ;; + *) + echo -e "Unknown function: $1 \n - Available functions are: help, update or -u, system-update or -su, system-dist-upgrade or -sdu, update-waterfox or -uwf" + exit 1 + ;; + esac +} + +main "$@" diff --git a/preseed-install-danos.sh b/preseed-install-danos.sh new file mode 100755 index 0000000..4206442 --- /dev/null +++ b/preseed-install-danos.sh @@ -0,0 +1,2041 @@ +#!/bin/sh + +# $USER_HOME to $USER_HOME and $NEW_USERNAME to $NEW_USERNAME +USER_HOME=$(grep ":1000:" /etc/passwd | cut -d: -f6) +NEW_USERNAME=$(grep ":1000:" /etc/passwd | cut -d: -f1) + +# REMOVE all '' and '' and 'check_error "GRUB BOOT TIMEOUT"' + +# Check and Copy Default APT Sources List +if [ ! -f /etc/apt/sources.list ]; then + cp /usr/share/doc/apt/examples/sources.list /etc/apt/sources.list +fi + + +# Sudoers ------------------------------------------------------------------------------------------------------------------------------------ +# Add User NOPASSWD to shutdown now and reboot +echo "$NEW_USERNAME ALL=(ALL) NOPASSWD: /sbin/shutdown now, /sbin/reboot" | tee -a /etc/sudoers.d/$NEW_USERNAME && vi-c -f /etc/sudoers.d/$NEW_USERNAME + +# Set password timeout +echo "Defaults timestamp_timeout=25" | tee -a /etc/sudoers.d/$NEW_USERNAME && vi-c -f /etc/sudoers.d/$NEW_USERNAME +# ----------------------------------------------------------------------------------------------------------------------------------------- + +# APT Add - contrib non-free" to the sources list +if [ -f /etc/apt/sources.list ]; then + if ! grep -q "deb .* contrib non-free" /etc/apt/sources.list; then + sed -i 's/^deb.* main/& contrib non-free/g' /etc/apt/sources.list + else + echo "contrib non-free is already present in /etc/apt/sources.list" + fi +fi + +if [ -f /etc/apt/sources.list.d/debian.sources ]; then + if ! grep -q "Components:.* contrib non-free non-free-firmware" /etc/apt/sources.list.d/debian.sources; then + sed -i 's/^Components:* main/& contrib non-free non-free-firmware/g' /etc/apt/sources.list.d/debian.sources + else + echo "contrib non-free non-free-firmware is already present in /etc/apt/sources.list.d/debian.sources" + fi +fi + + +# APT Add - apt-transport-https +if ! dpkg -s apt-transport-https >/dev/null 2>&1; then + DEBIAN_FRONTEND=noninteractive apt install -y apt-transport-https + sed -i 's+http:+https:+g' /etc/apt/sources.list +fi + +# APT Git install +if ! dpkg -s git >/dev/null 2>&1; then + DEBIAN_FRONTEND=noninteractive apt install -y git +fi + +apt update + +# ------------------------------------------------------------------------------------------------- +# Core System APT install +for i in bash-completion xserver-xorg x11-utils xinit acl arandr autorandr picom fwupd colord mesa-utils htop wget curl git tmux numlockx kitty neovim xdg-utils cups cups-common lm-sensors fancontrol xbacklight brightnessctl unzip network-manager dnsutils dunst libnotify-bin notify-osd xsecurelock pm-utils rofi 7zip jq poppler-utils fd-find ripgrep zoxide imagemagick nsxiv mpv flameshot mc thunar gvfs gvfs-backends parted gparted mpd mpc ncmpcpp fzf ccrypt xarchiver notepadqq font-manager fontconfig fontconfig-config fonts-recommended fonts-liberation fonts-freefont-ttf fonts-noto-core libfontconfig1 pipewire pipewire-audio pipewire-alsa pipewire-pulse pipewire-jack wireplumber libspa-0.2-bluetooth pavucontrol alsa-utils qpwgraph sddm-theme-breeze sddm-theme-maui ffmpeg cmake policykit-1 policykit-1-gnome remmina libreoffice keynav; do + DEBIAN_FRONTEND=noninteractive apt -y --ignore-missing install $i +done + +DEBIAN_FRONTEND=noninteractive apt -y --ignore-missing install linux-headers-$(uname -r) +DEBIAN_FRONTEND=noninteractive apt -y install sddm --no-install-recommends + + +# APT install extra packages + +# Google Chrome install. +cd /tmp/ && wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && DEBIAN_FRONTEND=noninteractive apt install -y /tmp/google-chrome-stable_current_amd64.deb && rm google-chrome-stable_current_amd64.deb + + +# Network Share Components +DEBIAN_FRONTEND=noninteractive apt install -y ceph-common smbclient nfs-common && echo "# CEPH" | tee -a /etc/fstab && echo "#:/ /mnt/cephfs ceph name=clientNAME,noatime,_netdev 0 0" | tee -a /etc/fstab + + +# Check if the CPU is a QEMU Virtual CPU using lscpu +if lscpu | grep -iq "QEMU"; then + echo "QEMU Virtual CPU detected. Installing xrdp and restarting service..." + apt update + DEBIAN_FRONTEND=noninteractive apt install -y xrdp + systemctl restart xrdp.service +fi + + +# Check for Bluetooth hardware using lsusb +if lsusb | grep -iq bluetooth; then + echo "Bluetooth detected, Installing required packages..." + DEBIAN_FRONTEND=noninteractive apt install -y bluetooth bluez bluez-cups bluez-obexd bluez-meshd pulseaudio-module-bluetooth bluez-firmware blueman +fi + + +# Check for Logitech hardware using lsusb +# Solaar - Logitech Unifying Receiver - Accessory management for Linux. +if lsusb | grep -iq Logitech; then + echo "Logitech detected, Installing required packages..." + DEBIAN_FRONTEND=noninteractive apt install -y solaar +fi + + +# CPU Microcode install +export LC_ALL=C # All subsequent command output will be in English +CPUVENDOR=$(lscpu | grep "Vendor ID:" | awk '{print $3}') + +if [ "$CPUVENDOR" == "GenuineIntel" ]; then + if ! dpkg -s intel-microcode >/dev/null 2>&1; then + DEBIAN_FRONTEND=noninteractive apt install -y intel-microcode + fi +else + echo -e "${GREEN} Intel Microcode OK ${NC}" +fi + +if [ "$CPUVENDOR" == "AuthenticAMD" ]; then + if ! dpkg -s amd64-microcode >/dev/null 2>&1; then + DEBIAN_FRONTEND=noninteractive apt install -y amd64-microcode + fi +else + echo -e "${GREEN} Amd64 Microcode OK ${NC}" +fi +unset LC_ALL # unset the LC_ALL=C + + + +# Alias echo to $USER_HOME/.bashrc or $USER_HOME/.bash_aliases +BASHALIASFILE=$USER_HOME/.bashrc + +echo 'alias ls="ls --color=auto --group-directories-first -v -lah"' >> $BASHALIASFILE +echo 'alias ll="ls --color=auto --group-directories-first -v -lah"' >> $BASHALIASFILE + +echo 'alias df="df -h"' >> $BASHALIASFILE + +echo 'alias neofetch="fastfetch"' >> $BASHALIASFILE + +echo 'alias upup="sudo apt update && sudo apt upgrade -y && sudo apt clean && sudo apt autoremove -y"' >> $BASHALIASFILE + +echo 'bind '"'"'"\C-f":"open "$(fzf)"\n"'"'" >> $BASHALIASFILE +echo 'alias lsman="compgen -c | fzf | xargs man"' >> $BASHALIASFILE + +echo 'alias qtileconfig="nano ~/.config/qtile/config.py"' >> $BASHALIASFILE +echo 'alias qtileconfig-test="python3 ~/.config/qtile/config.py"' >> $BASHALIASFILE +echo 'alias qtileconfig-test-venv="source /opt/qtile_venv/bin/activate && python3 ~/.config/qtile/config.py && deactivate"' >> $BASHALIASFILE +echo 'alias autostart-edit="nano ~/.config/qtile/autostart.sh"' >> $BASHALIASFILE +echo 'alias vi="nvim"' >> $BASHALIASFILE + + + + +# Set User folders via xdg-user-dirs-update & xdg-mime default. +# ls /usr/share/applications/ Find The Default run.: "xdg-mime query default inode/directory" + +rm /usr/share/sddm/faces/.face.icon +rm /usr/share/sddm/faces/root.face.icon + +wget -O /usr/share/sddm/faces/root.face.icon https://github.com/ITmail-dk/qmade/blob/main/root.face.icon?raw=true +wget -O /usr/share/sddm/faces/.face.icon https://github.com/ITmail-dk/qmade/blob/main/.face.icon?raw=true +wget -O $USER_HOME/.face.icon https://github.com/ITmail-dk/qmade/blob/main/.face.icon?raw=true + +setfacl -m u:sddm:x $USER_HOME/ +setfacl -m u:sddm:r $USER_HOME/.face.icon + +setfacl -m u:sddm:x /usr/share/sddm/faces/ +setfacl -m u:sddm:r /usr/share/sddm/faces/.face.icon +setfacl -m u:sddm:r /usr/share/sddm/faces/root.face.icon + + +mkdir -p /etc/sddm.conf.d +bash -c 'cat << "SDDMCONFIG" >> /etc/sddm.conf.d/default.conf +[Theme] +# Set Current theme "name" breeze, maui +Current=breeze + +[Wayland] +EnableHiDPI=true + +[X11] +EnableHiDPI=true + +SDDMCONFIG' + +# Set login wallpape under background=/ in /usr/share/sddm/themes/breeze/theme.conf +#/usr/share/wallpapers/login-wallpape.jpg + + + +# Midnight-Commander ini file +mkdir -p $USER_HOME/.config/mc +cat << "MCINI" > $USER_HOME/.config/mc/ini +[Midnight-Commander] +skin=nicedark + +MCINI + +# Qtile Core Dependencies apt install +DEBIAN_FRONTEND=noninteractive apt install -y feh python3-full python3-pip python3-venv pipx libxkbcommon-dev libxkbcommon-x11-dev libcairo2-dev pkg-config + + +# Install Qtile from source via github and Pip +cd $USER_HOME +mkdir -p $USER_HOME/.local/bin +mkdir -p $USER_HOME/.local/src +mkdir -p $USER_HOME/.cache/pip +chmod -R 777 $USER_HOME/.cache/pip +mkdir -p $USER_HOME/.cache/wal +chmod -R 777 $USER_HOME/.cache/wal + +# Python3 venv Qtile install +# Upgrade run: python3 -m venv --upgrade qtile_venv + +cd /opt/ +python3 -m venv qtile_venv +chmod -R 777 /opt/qtile_venv +cd /opt/qtile_venv + +if [ -d qtile ]; then + rm -rf qtile +fi + +git clone https://github.com/qtile/qtile.git + +source /opt/qtile_venv/bin/activate +pip install dbus-next psutil wheel pyxdg +pip install -r qtile/requirements.txt +bin/pip install qtile/. +# PyWAL install via pip3 for auto-generated color themes +pip3 install pywal16[all] --break-system-packages +deactivate + +cp bin/qtile /usr/bin/ +cp bin/wal /usr/bin/ + + +mkdir -p $USER_HOME/.cache/wal +cat << "PYWALCOLORSJSON" > $USER_HOME/.cache/wal/colors.json +{ + "checksum": "85abc768e55abc92396e0c76280093cc", + "wallpaper": "/home/mara/Wallpapers/default_wallpaper.jpg", + "alpha": "100", + + "special": { + "background": "#06090c", + "foreground": "#c0c1c2", + "cursor": "#c0c1c2" + }, + "colors": { + "color0": "#06090c", + "color1": "#1f384b", + "color2": "#304d5c", + "color3": "#375d6e", + "color4": "#4e5b61", + "color5": "#526870", + "color6": "#66767a", + "color7": "#899195", + "color8": "#555f68", + "color9": "#2a4b64", + "color10": "#40677b", + "color11": "#4a7d93", + "color12": "#687a82", + "color13": "#6e8b96", + "color14": "#889ea3", + "color15": "#c0c1c2" + } +} + +PYWALCOLORSJSON + + +mkdir -p $USER_HOME/.config/kitty/themes +mkdir -p $USER_HOME/.cache/wal/ +cat << "PYWALCOLORSKITTY" > $USER_HOME/.cache/wal/colors-kitty.conf +foreground #c0c1c2 +background #06080b +background_opacity 0.98 +cursor #c0c1c2 + +active_tab_foreground #06080b +active_tab_background #c0c1c2 +inactive_tab_foreground #c0c1c2 +inactive_tab_background #06080b + +active_border_color #c0c1c2 +inactive_border_color #06080b +bell_border_color #1b394e + +color0 #06080b +color8 #555b67 +color1 #1b394e +color9 #244d68 +color2 #245067 +color10 #306b8a +color3 #33667f +color11 #4589aa +color4 #4e606e +color12 #698193 +color5 #557384 +color13 #729ab0 +color6 #6c818e +color14 #91adbe +color7 #898d95 +color15 #c0c1c2 + +PYWALCOLORSKITTY + +ln -s $USER_HOME/.cache/wal/colors-kitty.conf $USER_HOME/.config/kitty/themes/current-theme.conf + +# PyWal kitty template +mkdir -p $USER_HOME/.config/wal/templates/ +cat << "PYWALCOLORSTEMPALETKITTY" > $USER_HOME/.config/wal/templates/colors-kitty.conf +foreground {foreground} +background {background} +background_opacity 0.98 +cursor {cursor} + +active_tab_foreground {background} +active_tab_background {foreground} +inactive_tab_foreground {foreground} +inactive_tab_background {background} + +active_border_color {foreground} +inactive_border_color {background} +bell_border_color {color1} + +color0 {color0} +color8 {color8} +color1 {color1} +color9 {color9} +color2 {color2} +color10 {color10} +color3 {color3} +color11 {color11} +color4 {color4} +color12 {color12} +color5 {color5} +color13 {color13} +color6 {color6} +color14 {color14} +color7 {color7} +color15 {color15} + +PYWALCOLORSTEMPALETKITTY + + +cat << "PYWALCOLORSTEMPALETROFI" > $USER_HOME/.config/wal/templates/colors-rofi-dark.rasi +* {{ + active-background: {color2}; + active-foreground: @foreground; + normal-background: @background; + normal-foreground: @foreground; + urgent-background: {color1}; + urgent-foreground: @foreground; + + alternate-active-background: @background; + alternate-active-foreground: @foreground; + alternate-normal-background: @background; + alternate-normal-foreground: @foreground; + alternate-urgent-background: @background; + alternate-urgent-foreground: @foreground; + + selected-active-background: {color1}; + selected-active-foreground: @foreground; + selected-normal-background: {color2}; + selected-normal-foreground: @foreground; + selected-urgent-background: {color3}; + selected-urgent-foreground: @foreground; + + background-color: @background; + background: {background}; + foreground: {foreground}; + border-color: @background; + spacing: 2; +}} + +#window {{ + width: 30%; + background-color: @background; + border: 0; + padding: 2.5ch; +}} + +#mainbox {{ + border: 0; + padding: 0; + background-color: @background; + children: [inputbar, listview]; +}} + +#message {{ + border: 2px 0px 0px; + border-color: @border-color; + padding: 1px; +}} + +#textbox {{ + text-color: @foreground; +}} + +#inputbar {{ + children: [ prompt,textbox-prompt-colon,entry,case-indicator ]; +}} + +#textbox-prompt-colon {{ + expand: false; + str: ":"; + margin: 0px 0.3em 0em 0em; + text-color: @normal-foreground; +}} + +#listview {{ + fixed-height: 0; + border: 2px 0px 0px; + border-color: @border-color; + spacing: 2px; + scrollbar: true; + padding: 2px 0px 0px; +}} + +#element {{ + border: 0; + padding: 8 0; +}} + +#element-text {{ + background-color: inherit; + text-color: inherit; +}} + +#element-icon {{ + size: 30; +}} + +#element.normal.normal {{ + background-color: @normal-background; + text-color: @normal-foreground; +}} + +#element.normal.urgent {{ + background-color: @urgent-background; + text-color: @urgent-foreground; +}} + +#element.normal.active {{ + background-color: @active-background; + text-color: @active-foreground; +}} + +#element.selected.normal {{ + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +}} + +#element.selected.urgent {{ + background-color: @selected-urgent-background; + text-color: @selected-urgent-foreground; +}} + +#element.selected.active {{ + background-color: @selected-active-background; + text-color: @selected-active-foreground; +}} + +#element.alternate.normal {{ + background-color: @alternate-normal-background; + text-color: @alternate-normal-foreground; +}} + +#element.alternate.urgent {{ + background-color: @alternate-urgent-background; + text-color: @alternate-urgent-foreground; +}} + +#element.alternate.active {{ + background-color: @alternate-active-background; + text-color: @alternate-active-foreground; +}} + +#scrollbar {{ + width: 4px; + border: 0; + handle-width: 8px; + padding: 0; +}} + +#sidebar {{ + border: 2px 0px 0px; + border-color: @border-color; +}} + +#button {{ + text-color: @normal-foreground; +}} + +#button.selected {{ + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +}} + +#inputbar {{ + spacing: 0; + text-color: @normal-foreground; + padding: 1px; +}} + +#case-indicator {{ + spacing: 0; + text-color: @normal-foreground; +}} + +#entry {{ + spacing: 0; + text-color: @normal-foreground; +}} + +#prompt {{ + spacing: 0; + text-color: @normal-foreground; +}} + +PYWALCOLORSTEMPALETROFI + + +# auto-new-wallpaper-and-colors BIN +bash -c 'cat << "AUTONEWWALLPAPERANDCOLORSBIN" >> /usr/bin/auto-new-wallpaper-and-colors +#!/usr/bin/env bash + +if command -v wal > /dev/null 2>&1; then wal --cols16 darken -q -i ~/Wallpapers --backend haishoku; else pip3 install pywal16[all] --break-system-packages && wal --cols16 darken -q -i ~/Wallpapers --backend haishoku; fi +#wal --cols16 darken -q -i ~/Wallpapers --backend haishoku +# Backends: colorz, colorthief, fast_colorthief, okthief, schemer2, haishoku, modern_colorthief, wal + +notify-send -u low "Automatically new background and color theme" "Please wait while i find a new background image and some colors to match" + +qtile cmd-obj -o cmd -f reload_config +kitty +kitten themes --reload-in=all Current-theme + +cp $(cat "$HOME/.cache/wal/wal") /usr/share/wallpapers/login-wallpape.jpg + +notify-send -u low "Automatically new background and color theme" "The background image and colors has been updated." + +AUTONEWWALLPAPERANDCOLORSBIN' + +chmod +x /usr/bin/auto-new-wallpaper-and-colors + + +#Midnight Commander +mkdir -p $USER_HOME/.config/mc +echo "skin=dark" >> $USER_HOME/.config/mc/ini + + +# ------------------------------------------------------------------------ + +mkdir -p /usr/share/xsessions/ +bash -c 'cat << "QTILEDESKTOP" >> /usr/share/xsessions/qtile.desktop +[Desktop Entry] +Name=Qtile +Comment=Qtile Session +Exec=/etc/sddm/Xsession +Type=Application +Keywords=wm;tiling +QTILEDESKTOP' + +# Add to user .xsession +echo "exec /usr/bin/qtile start" > $USER_HOME/.xsession +echo "exec /usr/bin/qtile start" | tee -a "/etc/skel/.xsession" > /dev/null + + +# Qtile Autostart.sh file +mkdir -p $USER_HOME/.config/qtile/ +if [ ! -f $USER_HOME/.config/qtile/autostart.sh ]; then +cat << "QTILEAUTOSTART" > $USER_HOME/.config/qtile/autostart.sh +#!/usr/bin/env bash +# Picom - https://manpages.debian.org/stable/picom/picom.1.en.html +pgrep -x picom > /dev/null || picom --backend xrender --vsync --no-fading-openclose --no-fading-destroyed-argb & +# Picom use... --backend glx or xrender, --vsync --no-vsync --no-fading-openclose --no-fading-destroyed-argb etc. + +exec /usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1 & # Graphical authentication agent + +autorandr --change && + +# This here if statement sets your background image, with feh... +# and is also used for the auto-generation of the background image and colors. +if [ -f ~/.fehbg ]; then + . ~/.fehbg +else + auto-new-wallpaper-and-colors + #feh --bg-scale $(find ~/Wallpapers -type f | shuf -n 1) +fi + +wpctl set-volume @DEFAULT_AUDIO_SINK@ 10% & +dunst & +numlockx on & +mpd & +xrdb ~/.Xresources & +xset r rate 200 35 & +xset b off & + +keynav & + +# This if statement can be removed if you don't intend to make more users on this computer +if [ -f ~/.first-login ]; then + xdg-user-dirs-update + xdg-mime default kitty.desktop text/x-shellscript + xdg-mime default nsxiv.desktop image/jpeg + xdg-mime default nsxiv.desktop image/png + xdg-mime default thunar.desktop inode/directory + gsettings set org.gnome.desktop.interface color-scheme prefer-dark + rm ~/.first-login +fi + + +QTILEAUTOSTART + +chmod +x $USER_HOME/.config/qtile/autostart.sh + +else + echo "File autostart.sh already exists." +fi + + +# Synaptics devices +if grep -iq 'synaptics|synap' /proc/bus/input/devices; then + echo "Synaptics touchpad detected. Installing xserver-xorg-input-synaptics and configuring autostart..." + DEBIAN_FRONTEND=noninteractive apt install -y xserver-xorg-input-synaptics + + cat << EOF | tee -a "$USER_HOME/.config/qtile/autostart.sh" > /dev/null +# Synaptics - Touchpad left click and right click. +synclient TapButton1=1 TapButton2=3 & +EOF +fi + + + +# APT install under Unstable and Testing +if [[ "$VERSION_CODENAME" == "$VERSION_CODENAME_SHOULD_NOT_BE" ]]; then + echo "Your version of Debian is not compatible with This package" +else + DEBIAN_FRONTEND=noninteractive apt install -y freerdp2-x11 libfreerdp-client2-2 libfreerdp2-2 libwinpr2-2 + DEBIAN_FRONTEND=noninteractive apt -y --ignore-missing install xautolock speedcrunch fonts-arkpandora + echo "# Lock the computer automatically after X time of minutes, using xautolock and xsecurelock." | tee -a $USER_HOME/.config/qtile/autostart.sh + echo 'xautolock -time 120 -locker "xsecurelock" -detectsleep -secure &' | tee -a $USER_HOME/.config/qtile/autostart.sh +fi + + + +# MPD Setup & config START + +mkdir -p $USER_HOME/.config/mpd/playlists +mkdir -p $USER_HOME/.local/state/mpd +if [ ! -f $USER_HOME/.config/mpd/mpd.conf ]; then +touch $USER_HOME/.config/mpd/database +cat << MPDCONFIG > $USER_HOME/.config/mpd/mpd.conf +# ~/.config/mpd/mpd.conf or /etc/mpd.conf +# Example: /usr/share/doc/mpd/mpdconf.example + +# Recommended location for database +db_file "~/.config/mpd/database" + +# If running mpd using systemd, delete this line to log directly to systemd. +# syslog or ~/.config/mpd/log +log_file "~/.config/mpd/log" + +# The music directory is by default the XDG directory, uncomment to amend and choose a different directory +#music_directory "~/Music" + +# MPD Server network +bind_to_address "127.0.0.1" +port "6600" + +# Suppress all messages below the given threshold. Use "verbose" for +# troubleshooting. Available setting arguments are "notice", "info", "verbose", "warning" and "error". +log_level "error" + +# Setting "restore_paused" to "yes" puts MPD into pause mode instead of starting playback after startup. +restore_paused "yes" + +# Uncomment to refresh the database whenever files in the music_directory are changed +auto_update "yes" + +# Uncomment to enable the functionalities +playlist_directory "~/.config/mpd/playlists" +pid_file "~/.config/mpd/pid" +state_file "~/.local/state/mpd/state" +sticker_file "~/.config/mpd/sticker.sql" +follow_inside_symlinks "yes" +# save_absolute_paths_in_playlists "no" + + +decoder { + plugin "wildmidi" + config_file "/etc/timidity/timidity.cfg" + enabled "no" +} + +# Audio output + +audio_output { + type "pipewire" + name "PipeWire Sound Server" + enabled "yes" +} +audio_output { + type "pulse" + name "Local PulseAudio Server" + enabled "no" +} + +MPDCONFIG + +else + echo "mpd.conf already exists." +fi + +# systemctl enable mpd +#systemctl enable --now --user mpd.service +#systemctl enable --now --user mpd +# systemctl status mpd.service + +#systemctl enable --now --user mpd.socket +#systemctl enable --now --user mpd.service + +# mpd --version +# mpd --stderr --no-daemon --verbose +# aplay --list-pcm + + +# Nano config START +if [ ! -f $USER_HOME/.nanorc ]; then + cp /etc/nanorc $USER_HOME/.nanorc + #sed -i 's/^# set linenumbers/set linenumbers/' $USER_HOME/.nanorc + sed -i 's/^# set minibar/set minibar/' $USER_HOME/.nanorc + sed -i 's/^# set softwrap/set softwrap/' $USER_HOME/.nanorc + sed -i 's/^# set atblanks/set atblanks/' $USER_HOME/.nanorc +else + echo "File .nanorc already exists." +fi + + +# Neovim config Start + +if [ ! -f $USER_HOME/.config/nvim/init.vim ]; then +mkdir -p $USER_HOME/.config/nvim +cat << "NEOVIMCONFIG" > $USER_HOME/.config/nvim/init.vim +syntax on +set number +set numberwidth=5 +set relativenumber +set ignorecase +NEOVIMCONFIG + +else + echo "Neovim config file already exists." +fi + + +# Kitty theme.conf Start + +if [ ! -f $USER_HOME/.cache/wal/colors-kitty.conf ]; then +mkdir -p $USER_HOME/.cache/wal +cat << "KITTYTHEMECONF" > $USER_HOME/.cache/wal/colors-kitty.conf +background #1e3143 +foreground #cec7bc +color0 #1e3143 +color1 #708191 +color2 #bcc2be +color3 #9ea5a3 +color4 #717c7a +color5 #a9a5a8 +color6 #788483 +color7 #c1c6c3 +color8 #254657 +color9 #496c80 +color10 #28415a +color11 #b1aea6 +color12 #849aa3 +color13 #c6c0b6 +color14 #648896 +color15 #cec7bc + +KITTYTHEMECONF + +else + echo "kittytheme.conf file already exists." +fi + + +# Tmux config Start + +if [ ! -f $USER_HOME/.config/tmux/tmux.conf ]; then +mkdir -p $USER_HOME/.config/tmux +cat << "TMUXCONFIG" > $USER_HOME/.config/tmux/tmux.conf +unbind r +bind r source-file ~/.config/tmux/tmux.conf + +TMUXCONFIG + +else + echo "Tmux config file already exists." +fi + + +# ------------------------------------------------------------------------------------------------- + +#echo -e "${YELLOW} Xresources config Start ${NC}" + +#if [ ! -f $USER_HOME/.Xresources ]; then + +#cat << "XRCONFIG" > $USER_HOME/.Xresources + +#XRCONFIG + +#else +# echo ".Xresources config file already exists." +#fi + + +# Themes START +# Nerd Fonts - https://www.nerdfonts.com/font-downloads - https://www.nerdfonts.com/cheat-sheet +# RUN "fc-list" to list the fonts install on the system. +if [ ! -d /usr/share/fonts ]; then +mkdir -p /usr/share/fonts + +else + echo "fonts folder already exists." +fi + +#JetBrainsMono (The default front in the configuration) +curl -OL "https://github.com/ryanoasis/nerd-fonts/releases/latest/download/JetBrainsMono.zip" +unzip -n "JetBrainsMono.zip" -d "/usr/share/fonts/JetBrainsMono/" +rm JetBrainsMono.zip +rm -f /usr/share/fonts/JetBrainsMono/*.md +rm -f /usr/share/fonts/JetBrainsMono/*.txt +rm -f /usr/share/fonts/JetBrainsMono/LICENSE + +#RobotoMono +curl -OL "https://github.com/ryanoasis/nerd-fonts/releases/latest/download/RobotoMono.zip" +unzip -n "RobotoMono.zip" -d "/usr/share/fonts/RobotoMono/" +rm RobotoMono.zip +rm -f /usr/share/fonts/RobotoMono/*.md +rm -f /usr/share/fonts/RobotoMono/*.txt +rm -f /usr/share/fonts/RobotoMono/LICENSE + +rm -f /usr/share/fonts/*.md +rm -f /usr/share/fonts/*.txt +rm -f /usr/share/fonts/LICENSE + + +# Set the default font family to Noto in the /etc/fonts/local.conf file. +if [ ! -f /etc/fonts/local.conf ]; then +mkdir -p /etc/fonts +bash -c 'cat << "FONTSLOCALCONFIG" >> /etc/fonts/local.conf + + + + + Noto Sans + + + serif + Noto Serif + + + sans-serif + Noto Sans + + + monospace + Noto Mono + + + Source Code Pro + false + + + +FONTSLOCALCONFIG' + +else + echo "fonts local.conf file already exists." +fi + + +if [ -d /usr/share/xsessions/ ]; then + find /usr/share/xsessions/ -name plasma* -exec sudo rm -f {} \; + sudo update-alternatives --remove x-session-manager /usr/bin/startplasma-x11 +fi +if [ -d /usr/share/wayland-sessions/ ]; then + find /usr/share/wayland-sessions/ -name plasma* -exec sudo rm -f {} \; + sudo update-alternatives --remove x-session-manager /usr/bin/startplasma-x11 +fi + + +rm -rf /tmp/EliverLara-Nordic +git clone https://github.com/EliverLara/Nordic /tmp/EliverLara-Nordic +cp -r /tmp/EliverLara-Nordic /usr/share/themes/ + +mkdir -p /usr/share/sddm/themes/Nordic-darker/ +cp -r /tmp/EliverLara-Nordic/kde/sddm/Nordic-darker/* /usr/share/sddm/themes/Nordic-darker/ + + +# Nordzy-cursors -------------------------------------------------------- + +# https://github.com/alvatip/Nordzy-cursors + +cd /tmp/ +if [ -d Nordzy-cursors ]; then + rm -rf Nordzy-cursors +fi + +git clone https://github.com/alvatip/Nordzy-cursors +cd Nordzy-cursors +./install.sh +cd /tmp/ + +# .Xresources +# Xcursor.theme: Nordzy-cursors +# Xcursor.size: 22 + +# Nordzy-icon -------------------------------------------------------- +# https://github.com/alvatip/Nordzy-icon + +cd /tmp/ + +if [ -d Nordzy-icon ]; then + rm -rf Nordzy-icon +fi + +git clone https://github.com/alvatip/Nordzy-icon +cd Nordzy-icon/ +./install.sh +cd /tmp/ + + +# GTK Settings START -------------------------------------------------------- +# /etc/gtk-3.0/settings.ini +# https://docs.gtk.org/gtk4/property.Settings.gtk-cursor-theme-name.html +if [ ! -d /etc/gtk-3.0 ]; then +kdir -p /etc/gtk-3.0 + +else + echo "/etc/gtk-3.0 already exists." +fi + +bash -c 'cat << "GTK3SETTINGS" >> /etc/gtk-3.0/settings.ini +[Settings] +gtk-theme-name=EliverLara-Nordic +gtk-fallback-icon-theme=default +gtk-toolbar-style=GTK_TOOLBAR_BOTH +gtk-font-name=JetBrainsMono Nerd Font 10 +gtk-application-prefer-dark-theme=1 +gtk-cursor-theme-name=Nordzy-cursors +gtk-cursor-theme-size=0 +gtk-icon-theme-name=Nordzy-icon +gtk-enable-event-sounds=0 +gtk-enable-input-feedback-sounds=0 +GTK3SETTINGS' + +if [ ! -d /etc/gtk-4.0 ]; then +mkdir -p /etc/gtk-4.0 + +else + echo "/etc/gtk-4.0 already exists." +fi + +bash -c 'cat << "GTK4SETTINGS" >> /etc/gtk-4.0/settings.ini +[Settings] +gtk-theme-name=EliverLara-Nordic +gtk-fallback-icon-theme=default +gtk-toolbar-style=GTK_TOOLBAR_BOTH +gtk-font-name=JetBrainsMono Nerd Font 10 +gtk-application-prefer-dark-theme=1 +gtk-cursor-theme-name=Nordzy-cursors +gtk-cursor-theme-size=0 +gtk-icon-theme-name=Nordzy-icon +gtk-enable-event-sounds=0 +gtk-enable-input-feedback-sounds=0 +GTK4SETTINGS' + + +sed -i 's/Adwaita/Nordzy-cursors/g' /usr/share/icons/default/index.theme + +# GTK Settings END -------------------------- + +fc-cache -fv + + +# ------------------------------------------------------------------------------------------------- + +# xrandr-set-max + Xsession START + +if [ ! -f /usr/bin/xrandr-set-max ]; then +# Define the content of the script +xrandrsetmaxcontent=$(cat << "XRANDRSETMAX" +#!/usr/bin/env bash + +# Get the names of all connected displays +displays=$(xrandr | awk '/ connected/{print $1}') + +# Loop through each connected display and set its resolution to the maximum supported resolution +for display in $displays; do + # Get the maximum supported resolution for the current display + max_resolution=$(xrandr | awk '/'"$display"'/ && / connected/{getline; print $1}') + + # Set the screen resolution to the maximum supported resolution for the current display + xrandr --output "$display" --mode "$max_resolution" +done +XRANDRSETMAX +) + +# Write the script content to the target file using sudo +echo "$xrandrsetmaxcontent" | tee /usr/bin/xrandr-set-max >/dev/null + +# SDDM Before Login - /usr/share/sddm/scripts/Xsetup and After Login - /usr/share/sddm/scripts/Xsession +sed -i '$a\. /usr/bin/xrandr-set-max' /usr/share/sddm/scripts/Xsetup +#sed -i '$a\. /usr/bin/xrandr-set-max' /usr/share/sddm/scripts/Xsession + +chmod +x /usr/bin/xrandr-set-max + +else + echo "xrandr-set-max already exists." +fi + +#if [ ! -f /etc/X11/Xsession.d/90_xrandr-set-max ]; then +# cp /usr/bin/xrandr-set-max /etc/X11/Xsession.d/90_xrandr-set-max +# # Run at Login /etc/X11/Xsession.d/FILENAME +#else +# echo "/etc/X11/Xsession.d/90_xrandr-set-max already exists." +#fi + +# ------------------------------------------------------------------------------------------------- + +# Rofi Run menu START +if [ ! -d $USER_HOME/.config/rofi ]; then +mkdir -p $USER_HOME/.config/rofi + +else + echo "Rofi folder already exists." +fi + +if [ ! -f $USER_HOME/.config/rofi/config.rasi ]; then +#touch $USER_HOME/.config/rofi/config.rasi +cat << "ROFICONFIG" > $USER_HOME/.config/rofi/config.rasi +configuration { + display-drun: "Applications:"; + display-window: "Windows:"; + drun-display-format: "{name}"; + font: "JetBrainsMono Nerd Font Propo 11"; + modi: "window,run,drun"; +} + +/* The Theme */ +@import "~/.cache/wal/colors-rofi-dark.rasi" + +// Theme location is "/usr/share/rofi/themes/name.rasi" +//@theme "/usr/share/rofi/themes/Arc-Dark.rasi" + +ROFICONFIG + +else + echo "Rofi config file already exists." +fi + + +# Rofi Wifi menu +# https://github.com/ericmurphyxyz/rofi-wifi-menu/tree/master + +if [ ! -f $USER_HOME/.config/rofi/rofi-wifi-menu.sh ]; then +cat << "ROFIWIFI" > $USER_HOME/.config/rofi/rofi-wifi-menu.sh +#!/usr/bin/env bash + +notify-send "Getting list of available Wi-Fi networks..." +# Get a list of available wifi connections and morph it into a nice-looking list +wifi_list=$(nmcli --fields "SECURITY,SSID" device wifi list | sed 1d | sed 's/ */ /g' | sed -E "s/WPA*.?\S/ /g" | sed "s/^--/ /g" | sed "s/ //g" | sed "/--/d") + +connected=$(nmcli -fields WIFI g) +if [[ "$connected" =~ "enabled" ]]; then + toggle="󰖪 Disable Wi-Fi" +elif [[ "$connected" =~ "disabled" ]]; then + toggle="󰖩 Enable Wi-Fi" +fi + +# Use rofi to select wifi network +chosen_network=$(echo -e "$toggle\n$wifi_list" | uniq -u | rofi -dmenu -i -selected-row 1 -p "Wi-Fi SSID: " ) +# Get name of connection +read -r chosen_id <<< "${chosen_network:3}" + +if [ "$chosen_network" = "" ]; then + exit +elif [ "$chosen_network" = "󰖩 Enable Wi-Fi" ]; then + nmcli radio wifi on +elif [ "$chosen_network" = "󰖪 Disable Wi-Fi" ]; then + nmcli radio wifi off +else + # Message to show when connection is activated successfully + success_message="You are now connected to the Wi-Fi network \"$chosen_id\"." + # Get saved connections + saved_connections=$(nmcli -g NAME connection) + if [[ $(echo "$saved_connections" | grep -w "$chosen_id") = "$chosen_id" ]]; then + nmcli connection up id "$chosen_id" | grep "successfully" && notify-send "Connection Established" "$success_message" + else + if [[ "$chosen_network" =~ "" ]]; then + wifi_password=$(rofi -dmenu -p "Password: " ) + fi + nmcli device wifi connect "$chosen_id" password "$wifi_password" | grep "successfully" && notify-send "Connection Established" "$success_message" + fi +fi + +ROFIWIFI + +chmod +x $USER_HOME/.config/rofi/rofi-wifi-menu.sh + +else + echo "Rofi WiFi menu file already exists." +fi + + +if [ ! -f /location/powermenu.sh ]; then +mkdir -p $USER_HOME/.config/rofi +cat << "ROFIPOWERMENU" > $USER_HOME/.config/rofi/powermenu.sh +#!/usr/bin/env bash +chosen=$(printf "󰒲 Suspend System\n System Shutdown\n󰤄 Hibernate System\n Lockdown Mode\n Reboot" | rofi -dmenu -i -theme-str '@import "powermenu.rasi"') + +case "$chosen" in + "󰒲 Suspend System") sudo systemctl suspend ;; + " System Shutdown") sudo shutdown now ;; + "󰤄 Hibernate System") sudo systemctl hibernate ;; + " Lockdown Mode") xsecurelock ;; + " Reboot") sudo reboot ;; + *) exit 1 ;; +esac + +ROFIPOWERMENU + +else + echo "powermenu.sh file already exists." +fi + +chmod +x $USER_HOME/.config/rofi/powermenu.sh + + +if [ ! -f $USER_HOME/.config/rofi/powermenu.rasi ]; then +mkdir -p $USER_HOME/.config/rofi +cat << "ROFIPOWERMENURASI" > $USER_HOME/.config/rofi/powermenu.rasi + +inputbar { + children: [entry]; +} + +listview { + lines: 5; +} + +ROFIPOWERMENURASI + +else + echo "powermenu.rasi file already exists." +fi + + +# Add xfce4 file helpers +if [ ! -f $USER_HOME/.config/xfce4/helpers.rc ]; then +mkdir -p $USER_HOME/.config/xfce4 +cat << "XFCE4HELPER" > $USER_HOME/.config/xfce4/helpers.rc +FileManager=Thunar +TerminalEmulator=kitty +WebBrowser=google-chrome +MailReader= + +XFCE4HELPER + +else + echo "xfce4 helper config file already exists." +fi + + +# Add kitty to open nvim and vim. +if [ -f /usr/share/applications/nvim.desktop ]; then +sed -i 's/Exec=nvim %F/Exec=kitty -e nvim %F/' /usr/share/applications/nvim.desktop +else + echo "no nvim.desktop file" +fi + +if [ -f /usr/share/applications/vim.desktop ]; then +sed -i 's/Exec=vim %F/Exec=kitty -e vim %F/' /usr/share/applications/vim.desktop +else + echo "no vim.desktop file" +fi + + +# # # # # # # # # # # +# Kitty config file. + +if [ ! -f $USER_HOME/.config/kitty/kitty.conf ]; then +mkdir -p $USER_HOME/.config/kitty/themes +cat << "KITTYCONFIG" > $USER_HOME/.config/kitty/kitty.conf +# A default configuration file can also be generated by running: +# kitty +runpy 'from kitty.config import *; print(commented_out_default_config())' +# +# The following command will bring up the interactive terminal GUI +# kitty +kitten themes +# +# kitty +kitten themes Catppuccin-Mocha +# kitty +kitten themes --reload-in=all Catppuccin-Mocha + +background_opacity 0.98 + +font_family JetBrainsMono Nerd Font Mono +bold_font auto +italic_font auto +bold_italic_font auto + +font_size 14 +force_ltr no + +adjust_line_height 0 +adjust_column_width 0 + +adjust_baseline 0 + +disable_ligatures never + +box_drawing_scale 0.001, 1, 1.5, 2 + +cursor #f2f2f2 + +cursor_text_color #f2f2f2 + +cursor_shape underline + +cursor_beam_thickness 1.5 + +cursor_underline_thickness 2.0 + +cursor_blink_interval -1 + +cursor_stop_blinking_after 99.0 + +scrollback_lines 5000 + +scrollback_pager less --chop-long-lines --RAW-CONTROL-CHARS +INPUT_LINE_NUMBER + +scrollback_pager_history_size 0 + +scrollback_fill_enlarged_window no + +wheel_scroll_multiplier 5.0 + +touch_scroll_multiplier 1.0 + +mouse_hide_wait 3.0 + +#mouse_map right click paste_from_clipboard + +url_color #0087bd +url_style curly + +open_url_with default + +url_prefixes http https file ftp gemini irc gopher mailto news git + +detect_urls yes + +#url_excluded_characters + +copy_on_select yes + +strip_trailing_spaces never + +select_by_word_characters @-./_~?&=%+# + +click_interval -1.0 + +focus_follows_mouse no + +pointer_shape_when_grabbed arrow + +default_pointer_shape beam + +pointer_shape_when_dragging beam + +mouse_map left click ungrabbed mouse_click_url_or_select +mouse_map shift+left click grabbed,ungrabbed mouse_click_url_or_select +mouse_map ctrl+shift+left release grabbed,ungrabbed mouse_click_url + +mouse_map ctrl+shift+left press grabbed discard_event + +mouse_map middle release ungrabbed paste_from_selection +mouse_map left press ungrabbed mouse_selection normal +mouse_map ctrl+alt+left press ungrabbed mouse_selection rectangle +mouse_map left doublepress ungrabbed mouse_selection word +mouse_map left triplepress ungrabbed mouse_selection line + +mouse_map ctrl+alt+left triplepress ungrabbed mouse_selection line_from_point + +#mouse_map right press ungrabbed mouse_selection extend +mouse_map shift+middle release ungrabbed,grabbed paste_selection +mouse_map shift+left press ungrabbed,grabbed mouse_selection normal +mouse_map shift+ctrl+alt+left press ungrabbed,grabbed mouse_selection rectangle +mouse_map shift+left doublepress ungrabbed,grabbed mouse_selection word +mouse_map shift+left triplepress ungrabbed,grabbed mouse_selection line + +mouse_map shift+ctrl+alt+left triplepress ungrabbed,grabbed mouse_selection line_from_point + +repaint_delay 10 + +input_delay 5 + +sync_to_monitor yes + +enable_audio_bell no + +visual_bell_duration 0.0 + +window_alert_on_bell no + +bell_on_tab no + +command_on_bell none + +remember_window_size yes +initial_window_width 800 +initial_window_height 500 + +enabled_layouts * + +window_resize_step_cells 2 +window_resize_step_lines 2 + +window_border_width 0.0pt + +draw_minimal_borders yes + +window_margin_width 0 + +single_window_margin_width -1 + +window_padding_width 3 + +placement_strategy center + +active_border_color #f2f2f2 + +inactive_border_color #cccccc + +bell_border_color #ff5a00 + +inactive_text_alpha 1.0 + +hide_window_decorations no + +resize_debounce_time 0.1 + +#resize_draw_strategy static + +resize_in_steps no + +confirm_os_window_close 0 + +tab_bar_edge bottom + +tab_bar_margin_width 0.0 + +tab_bar_margin_height 0.0 0.0 + +tab_bar_style fade + +tab_bar_min_tabs 2 + +tab_switch_strategy previous + +tab_fade 0.25 0.5 0.75 1 + +tab_separator " |" + +tab_powerline_style angled + +tab_activity_symbol none + +tab_title_template "{title}" + +active_tab_title_template none + +active_tab_foreground #000 +active_tab_background #eee +active_tab_font_style bold-italic +inactive_tab_foreground #444 +inactive_tab_background #999 +inactive_tab_font_style normal + +tab_bar_background none + +background_image none + +background_image_layout tiled + +background_image_linear no + +dynamic_background_opacity no + +background_tint 0.0 + +dim_opacity 0.75 + +selection_foreground #000000 + +selection_background #fffacd + +mark1_foreground black + +mark1_background #98d3cb + +mark2_foreground black + +mark2_background #f2dcd3 + +mark3_foreground black + +mark3_background #f274bc + +shell . + +editor . + +close_on_child_death no + +allow_remote_control yes + +listen_on none + +update_check_interval 0 + +startup_session none + +clipboard_control write-clipboard write-primary + +allow_hyperlinks yes + +term xterm-kitty + +wayland_titlebar_color system + +macos_titlebar_color system + +macos_option_as_alt no + +macos_hide_from_tasks no + +macos_quit_when_last_window_closed no + +macos_window_resizable yes + +macos_thicken_font 0 + +macos_traditional_fullscreen no + +macos_show_window_title_in all + +macos_custom_beam_cursor no + +linux_display_server auto + +kitty_mod ctrl+shift + +clear_all_shortcuts no +map kitty_mod+c copy_to_clipboard +map kitty_mod+v paste_from_clipboard +map kitty_mod+up scroll_line_up +map kitty_mod+down scroll_line_down +map kitty_mod+page_up scroll_page_up +map kitty_mod+page_down scroll_page_down +map kitty_mod+home scroll_home +map kitty_mod+end scroll_end +map kitty_mod+h show_scrollback +map kitty_mod+w close_window +map kitty_mod+] next_window +map kitty_mod+[ previous_window +map kitty_mod+f move_window_forward +map kitty_mod+b move_window_backward +map kitty_mod+` move_window_to_top +map kitty_mod+r start_resizing_window +map kitty_mod+1 first_window +map kitty_mod+2 second_window +map kitty_mod+3 third_window +map kitty_mod+4 fourth_window +map kitty_mod+5 fifth_window +map kitty_mod+6 sixth_window +map kitty_mod+7 seventh_window +map kitty_mod+8 eighth_window +map kitty_mod+9 ninth_window +map kitty_mod+0 tenth_window +map kitty_mod+right next_tab +map kitty_mod+left previous_tab +map kitty_mod+t new_tab +map kitty_mod+q close_tab +map shift+cmd+w close_os_window +map kitty_mod+. move_tab_forward +map kitty_mod+, move_tab_backward +map kitty_mod+alt+t set_tab_title +map kitty_mod+l next_layout +map kitty_mod+equal change_font_size all +2.0 +map kitty_mod+minus change_font_size all -2.0 +map kitty_mod+backspace change_font_size all 0 +map kitty_mod+e kitten hints +map kitty_mod+p>f kitten hints --type path --program - +map kitty_mod+p>shift+f kitten hints --type path +map kitty_mod+p>l kitten hints --type line --program - +map kitty_mod+p>w kitten hints --type word --program - +map kitty_mod+p>h kitten hints --type hash --program - +map kitty_mod+p>n kitten hints --type linenum +map kitty_mod+p>y kitten hints --type hyperlink +map kitty_mod+f11 toggle_fullscreen +map kitty_mod+f10 toggle_maximized +map kitty_mod+u kitten unicode_input +map kitty_mod+f2 edit_config_file +map kitty_mod+escape kitty_shell window +map kitty_mod+a>m set_background_opacity +0.1 +map kitty_mod+a>l set_background_opacity -0.1 +map kitty_mod+a>1 set_background_opacity 1 +map kitty_mod+a>d set_background_opacity default +map kitty_mod+delete clear_terminal reset active +map kitty_mod+f5 load_config_file +map kitty_mod+f6 debug_config + +include ~/.cache/wal/colors-kitty.conf + +KITTYCONFIG + +else + echo "Kitty config already exists." +fi + + +# ------------------------------------------------------------------------------------------------- +# Check for Nvidia graphics card and install drivers ---------------------------------------------- + +if lspci | grep -i nvidia; then + + echo "Installing required packages..." + apt -y install linux-headers-$(uname -r) + apt -y install gcc make acpid dkms libglvnd-core-dev libglvnd0 libglvnd-dev + + echo "Blacklisting nouveau..." + BLACKLIST_CONF="/etc/modprobe.d/blacklist.conf" + echo "blacklist nouveau" | tee -a $BLACKLIST_CONF + + echo "Removing old NVIDIA drivers..." + apt remove -y nvidia-* && apt autoremove -y $(dpkg -l nvidia-driver* | grep ii | awk '{print $2}') + + echo "Enabling i386 architecture and installing 32-bit libraries..." + dpkg --add-architecture i386 && apt update && apt install -y libc6:i386 + + echo "Updating GRUB configuration..." + GRUB_CONF="/etc/default/grub" + sed -i '/^GRUB_CMDLINE_LINUX_DEFAULT=/ s/"$/ rd.driver.blacklist=nouveau"/' $GRUB_CONF + + update-grub + + #NVIDIAGETVERSION=570.133.07 + NVIDIAGETVERSION="$(curl -s "https://www.nvidia.com/en-us/drivers/unix/" | grep "Latest Production Branch Version:" | awk -F'"> ' '{print $2}' | cut -d'<' -f1 | awk 'NR==1')" + echo "Downloading and installing NVIDIA $NVIDIAGETVERSION driver..." + wget https://us.download.nvidia.com/XFree86/Linux-x86_64/$NVIDIAGETVERSION/NVIDIA-Linux-x86_64-$NVIDIAGETVERSION.run + + chmod +x NVIDIA-Linux-x86_64-$NVIDIAGETVERSION.run + ./NVIDIA-Linux-x86_64-$NVIDIAGETVERSION.run --no-questions --run-nvidia-xconfig + echo 'nvidia-settings --assign CurrentMetaMode="nvidia-auto-select +0+0 { ForceFullCompositionPipeline = On }"' >> $USER_HOME/.config/qtile/autostart.sh +fi + + +# Qtile Config file + +if [ ! -f $USER_HOME/.config/qtile/config.py ]; then + +cat << "QTILECONFIG" > $USER_HOME/.config/qtile/config.py +# Qtile Config - Start +# https://docs.qtile.org/en/latest/index.html +# -',.-'-,.'-,'.-',.-',-.'-,.'-,.'-,.'-,'.-',.-'- + +import os +import subprocess +import json +from libqtile import bar, layout, qtile, widget, hook +from libqtile.config import Click, Drag, Group, Key, Match, Screen, ScratchPad, DropDown, re +from libqtile.lazy import lazy +from libqtile.utils import guess_terminal # terminal = guess_terminal() + + +# Custom code start ---------------------------------------------------- + +def guess_browser(): + """Guess the default web browser.""" + # Define a list of common web browsers + browsers = ["google-chrome", "firefox", "chromium", "vivaldi", "opera", "brave-browser", "safari"] + + # Loop through the list of browsers and check if they exist in PATH + for browser in browsers: + try: + subprocess.run(["which", browser], check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + return browser + except subprocess.CalledProcessError: + continue + + # If no browser is found, return None + return None + + + +# Custom code end ------------------------------------------------------ + +#Pywal Colors +colors = os.path.expanduser("~/.cache/wal/colors.json") +colordict = json.load(open(colors)) +Color0 = colordict["colors"]["color0"] +Color1 = colordict["colors"]["color1"] +Color2 = colordict["colors"]["color2"] +Color3 = colordict["colors"]["color3"] +Color4 = colordict["colors"]["color4"] +Color5 = colordict["colors"]["color5"] +Color6 = colordict["colors"]["color6"] +Color7 = colordict["colors"]["color7"] +Color8 = colordict["colors"]["color8"] +Color9 = colordict["colors"]["color9"] +Color10 = colordict["colors"]["color10"] +Color11 = colordict["colors"]["color11"] +Color12 = colordict["colors"]["color12"] +Color13 = colordict["colors"]["color13"] +Color14 = colordict["colors"]["color14"] +Color15 = colordict["colors"]["color15"] + +# Colors use example active=Color1, + + +mod = "mod4" +terminal = "kitty -o background_opacity=0.95" +browser = guess_browser() +fileexplorer = "thunar" +runmenu = 'rofi -modi "drun,run,window,filebrowser" -show drun' # Switch between -modi... Default key CTRL+TAB + + +keys = [ + # A list of available commands that can be bound to keys can be found + # at https://docs.qtile.org/en/latest/manual/config/lazy.html + # + # Examples: + # a key binding that can run an external Script or Command + # Key([mod], "l", lazy.spawn(os.path.expanduser("xsecurelock")), desc='Computer Lockdown'), + # + # a normal key binding that pulls from a variable + # Key([mod], "Return", lazy.spawn(terminal), desc="Launch Terminal"), + + # Keybindings + Key([mod], "Return", lazy.spawn(terminal), desc="Terminal"), + Key([mod], "b", lazy.spawn(browser), desc="Web Browser"), + Key([mod], "e", lazy.spawn(fileexplorer), desc="File Explorer"), + Key([mod], "r", lazy.spawn(runmenu), desc="Run Menu"), + Key([mod, "shift"], "r", lazy.spawncmd(), desc="Spawn a command using a prompt widget"), + Key([mod, "mod1"], "l", lazy.spawn(os.path.expanduser("xsecurelock")), desc="Computer Lockdown"), + Key([mod, "control", "mod1"], "t", lazy.spawn(os.path.expanduser("auto-new-wallpaper-and-colors")), desc="Random Color Theme from Wallpapers"), + Key([mod, "control", "mod1"], "w", lazy.spawn(os.path.expanduser("~/.config/rofi/rofi-wifi-menu.sh")), desc="WiFi Manager"), + Key([mod, "control", "mod1"], "p", lazy.spawn(os.path.expanduser("~/.config/rofi/powermenu.sh")), desc="Power Menu"), + Key([mod, "control", "mod1"], "n", lazy.spawn(os.path.expanduser("kitty -e nmtui")), desc="Network Manager"), + + # Default + Key([mod], "h", lazy.layout.left(), desc="Move focus to left"), + Key([mod], "l", lazy.layout.right(), desc="Move focus to right"), + Key([mod], "j", lazy.layout.down(), desc="Move focus down"), + Key([mod], "k", lazy.layout.up(), desc="Move focus up"), + Key([mod], "space", lazy.layout.next(), desc="Move window focus to other window"), + + # Move windows between left/right columns or move up/down in current stack. + # Moving out of range in Columns layout will create new column. + Key([mod, "shift"], "h", lazy.layout.shuffle_left(), desc="Move window to the left"), + Key([mod, "shift"], "l", lazy.layout.shuffle_right(), desc="Move window to the right"), + Key([mod, "shift"], "j", lazy.layout.shuffle_down(), desc="Move window down"), + Key([mod, "shift"], "k", lazy.layout.shuffle_up(), desc="Move window up"), + + # Grow windows. If current window is on the edge of screen and direction + # will be to screen edge - window would shrink. + Key([mod, "control"], "h", lazy.layout.grow_left(), lazy.layout.grow(), desc="Grow window to the left"), + Key([mod, "control"], "l", lazy.layout.grow_right(), lazy.layout.shrink(), desc="Grow window to the right"), + Key([mod, "control"], "j", lazy.layout.grow_down(), desc="Grow window down"), + Key([mod, "control"], "k", lazy.layout.grow_up(), desc="Grow window up"), + Key([mod, "control"], "n", lazy.layout.normalize(), lazy.layout.reset(), desc="Reset all window sizes"), + + # Toggle between split and unsplit sides of stack. + # Split = all windows displayed + # Unsplit = 1 window displayed, like Max layout, but still with + # multiple stack panes + Key( + [mod, "shift"], + "Return", + lazy.layout.toggle_split(), + desc="Toggle between split and unsplit sides of stack", + ), + + # Toggle between different layouts as defined below + Key([mod], "Tab", lazy.next_layout(), desc="Toggle between layouts"), + Key([mod], "w", lazy.window.kill(), desc="Kill focused window"), + Key( + [mod], + "f", + lazy.window.toggle_fullscreen(), + desc="Toggle fullscreen on the focused window", + ), + Key([mod], "t", lazy.window.toggle_floating(), desc="Toggle floating on the focused window"), + Key([mod, "mod1", "control"], "r", lazy.reload_config(), desc="Reload the config"), + Key([mod, "mod1", "control"], "q", lazy.shutdown(), desc="Shutdown Qtile"), + + # Audio + Key([mod, "mod1"], "Up", lazy.spawn("wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%+"), desc='Volume Up'), + Key([mod, "mod1"], "Down", lazy.spawn("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"), desc='Volume Down'), + Key([mod, "mod1"], "m", lazy.spawn("wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"), desc='Volume Mute Toggle'), + + # XF86 Audio & Brightness keys + Key([], "XF86AudioRaiseVolume", lazy.spawn("wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%+"), desc='Volume Up'), + Key([], "XF86AudioLowerVolume", lazy.spawn("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"), desc='Volume Down'), + Key([], "XF86AudioMute", lazy.spawn("wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"), desc='Volume Mute Toggle'), +# mute/unmute the microphone - wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle +# Show volume level - wpctl get-volume @DEFAULT_AUDIO_SINK@ + + Key([], "XF86AudioPlay", lazy.spawn("playerctl play-pause"), desc='Play-Pause'), + Key([], "XF86AudioPrev", lazy.spawn("playerctl previous"), desc='Previous'), + Key([], "XF86AudioNext", lazy.spawn("playerctl next"), desc='Next'), + Key([], "XF86MonBrightnessUp", lazy.spawn("brightnessctl set +10%"), desc='Brightness UP'), + Key([], "XF86MonBrightnessDown", lazy.spawn("brightnessctl set 10%-"), desc='Brightness Down'), + Key([], "Print", lazy.spawn("bash -c 'flameshot gui --path ~/Screenshots'"), desc='Screenshot'), +] + +# Add key bindings to switch VTs in Wayland. +# We can't check qtile.core.name in default config as it is loaded before qtile is started +# We therefore defer the check until the key binding is run by using .when(func=...) +for vt in range(1, 8): + keys.append( + Key( + ["control", "mod1"], + f"f{vt}", + lazy.core.change_vt(vt).when(func=lambda: qtile.core.name == "wayland"), + desc=f"Switch to VT{vt}", + ) + ) + + +# Create labels for groups and assign them a default layout. +# Find icons here - https://www.nerdfonts.com/cheat-sheet +# nf-linux-debian  nf-md-rocket_launch 󱓞 nf-cod-rocket  nf-cod-settings  nf-dev-android  nf-dev-chrome  nf-dev-terminal  +# nf-dev-prolog  nf-fa-apple  nf-fa-earlybirds  nf-fa-egg  nf-fa-grav  nf-fa-linux  nf-fa-snapchat  +# nf-fa-steam  nf-fa-terminal  nf-fa-wifi  nf-fae-pi  nf-md-recycle 󰑌 nf-md-symbol 󱔁 nf-fa-mug_hot  +# nf-fa-thermometer_2  nf-md-battery_medium 󱊢 nf-md-battery_charging 󰂄 +# nf-fa-volume_high  nf-fa-volume_low  nf-fa-volume_xmark  +# nf-md-pac_man 󰮯 nf-md-ghost 󰊠 nf-fa-circle  nf-cod-circle_large  nf-cod-circle_filled  nf-md-circle_small 󰧟 nf-md-circle_medium 󰧞 + +# Group Match example: +# Group("1", label="", layout="monadtall", matches=[Match(wm_class=re.compile(r"^(Google\-chrome)$"))]), + +groups = [ + Group("1", label="", layout="monadtall"), + Group("2", label="", layout="monadtall"), + Group("3", label="", layout="monadtall"), + Group("4", label="", layout="monadtall"), + Group("5", label="", layout="monadtall"), + Group("6", label="", layout="monadtall"), + Group("7", label="", layout="monadtall"), + Group("8", label="", layout="monadtall"), + Group("9", label="", layout="monadtall"), + Group("0", label="", layout="monadtall"), +] + +for i in groups: + keys.extend( + [ + # mod + group number = switch to group + Key( + [mod], + i.name, + lazy.group[i.name].toscreen(), + desc="Switch to group {}".format(i.name), + ), + # mod + shift + group number = switch to & move focused window to group + Key( + [mod, "shift"], + i.name, + lazy.window.togroup(i.name, switch_group=True), + desc="Switch to & move focused window to group {}".format(i.name), + ), + # Or, use below if you prefer not to switch to that group. + # # mod + shift + group number = move focused window to group + # Key([mod, "shift"], i.name, lazy.window.togroup(i.name), + # desc="move focused window to group {}".format(i.name)), + ] + ) + +# ScratchPad Keybindings +keys.extend([ + Key([mod, "shift"], "Return", lazy.group['scratchpad'].dropdown_toggle('term')), + Key([mod, "shift"], "e", lazy.group['scratchpad'].dropdown_toggle('mc')), + Key([mod, "shift"], "a", lazy.group['scratchpad'].dropdown_toggle('audio')), + Key([mod, "shift"], "n", lazy.group['scratchpad'].dropdown_toggle('notes')), + Key([mod, "shift"], "m", lazy.group['scratchpad'].dropdown_toggle('music')), +]) + +# ScratchPads +groups.append(ScratchPad("scratchpad", [ + DropDown("term", "kitty --class=scratch", width=0.8, height=0.8, x=0.1, y=0.1, opacity=1), + DropDown("mc", "kitty --class=mc -e mc", width=0.8, height=0.8, x=0.1, y=0.1, opacity=1), + DropDown("audio", "kitty --class=volume -e alsamixer", width=0.8, height=0.8, x=0.1, y=0.1, opacity=1), + DropDown("notes", "notepadqq", width=0.6, height=0.6, x=0.2, y=0.2, opacity=1), + DropDown("music", "kitty --class=music -e ncmpcpp", width=0.8, height=0.8, x=0.1, y=0.1, opacity=1), +])) + +# Define layouts and layout themes +def init_layout_theme(): + return {"margin":5, + "border_width":1, + "border_focus": Color6, + "border_normal": Color2 + } + +layout_theme = init_layout_theme() + +layouts = [ + layout.MonadTall(ratio=0.65, **layout_theme), + layout.Max(**layout_theme), + #layout.Bsp(**layout_theme), + #layout.Columns(**layout_theme), + #layout.Stack(num_stacks=2), + #layout.Matrix(**layout_theme), + #layout.MonadWide(**layout_theme), + #layout.RatioTile(**layout_theme), + #layout.Tile(**layout_theme), + #layout.TreeTab(**layout_theme), + #layout.VerticalTile(**layout_theme), + #layout.Zoomy(**layout_theme), +] + +widget_defaults = dict( + font="JetBrainsMono Nerd Font", + fontsize=14, + padding=5, +) +extension_defaults = widget_defaults.copy() + +# Bar widgets - https://docs.qtile.org/en/latest/manual/ref/widgets.html + +screens = [ + Screen( + top=bar.Bar( + [ + widget.CurrentLayoutIcon(scale=0.7, padding=10), + widget.Spacer(length=5), + widget.GroupBox(fontsize=18, highlight_method="text", this_current_screen_border="#f7f7f7", highlight_color=Color14, this_screen_border=Color3, urgent_border=Color7, active=Color5, inactive=Color8, rounded="False", borderwidth=0), + widget.Spacer(length=9), + widget.Prompt(), + widget.Spacer(), + widget.WindowName(width=bar.CALCULATED, max_chars=120), + widget.Spacer(), + widget.Systray(fmt="󱊖 {}", icon_size=16), + # NB Wayland is incompatible with Systray, consider using StatusNotifier + # widget.StatusNotifier(icon_size=16), + #widget.Wallpaper(directory="~/Wallpapers/", label="", random_selection="True"), + #widget.NetGraph(type='line', line_width=1), + #widget.Net(prefix='M'), + #widget.ThermalSensor(format='CPU: {temp:.0f}{unit}'), + #widget.ThermalSensor(tag_sensor="CPU", update_interval=10), + widget.Volume(fmt=" {}"), + widget.Spacer(length=5), + widget.Clock(fmt=" {}",format="%A %d-%m-%Y %H:%M %p"), + widget.QuickExit(default_text='', countdown_format='{}', fontsize=16), + widget.Spacer(length=20), + ], 30, # Define bar height + background=Color0, opacity=0.90, # Bar background color can also take transparency with "hex color code" or 0.XX + margin=[5, 5, 0, 5], # Space around bar as int or list of ints [N E S W] + border_width=[0, 0, 0, 0], # Width of border as int of list of ints [N E S W] + border_color=[Color2, Color2, Color2, Color2] # Border colour as str or list of str [N E S W] + ), + # You can uncomment this variable if you see that on X11 floating resize/moving is laggy + # By default we handle these events delayed to already improve performance, however your system might still be struggling + # This variable is set to None (no cap) by default, but you can set it to 60 to indicate that you limit it to 60 events per second + # x11_drag_polling_rate = 60, + #wallpaper="~/Wallpapers/default-wallpaper.png", + #wallpaper_mode="fill" + ), +] + +# Drag floating layouts. +mouse = [ + Drag([mod], "Button1", lazy.window.set_position_floating(), start=lazy.window.get_position()), + Drag([mod], "Button3", lazy.window.set_size_floating(), start=lazy.window.get_size()), + Click([mod], "Button2", lazy.window.bring_to_front()), +] + +dgroups_key_binder = None +dgroups_app_rules = [] # type: list +follow_mouse_focus = True +bring_front_click = False +floats_kept_above = True +cursor_warp = False +floating_layout = layout.Floating(**layout_theme, + float_rules=[ + # Run the utility xprop to see the wm class and name of an X client. + *layout.Floating.default_float_rules, + Match(wm_class="confirmreset"), # gitk + Match(wm_class="makebranch"), # gitk + Match(wm_class="maketag"), # gitk + Match(wm_class="ssh-askpass"), # ssh-askpass + Match(title="branchdialog"), # gitk + Match(title="pinentry"), # GPG key password entry + ], + no_reposition_rules=[ + Match(wm_class="pavucontrol"), + ], +) + +auto_fullscreen = True +focus_on_window_activation = "smart" +reconfigure_screens = True + +# If things like steam games want to auto-minimize themselves when losing +# focus, should we respect this or not? +auto_minimize = True + +# Remember to add, "hook" "import os" "import subprocess" "Match" +@hook.subscribe.startup_once +def autostart(): + autostartscript = os.path.expanduser("~/.config/qtile/autostart.sh") + subprocess.run([autostartscript]) + +@hook.subscribe.client_new +def move_window_to_group(client): + for group in groups: + if any(client.match(match) for match in group.matches): + client.togroup(group.name) + client.qtile.groups_map[group.name].toscreen() + break + + +# When using the Wayland backend, this can be used to configure input devices. +wl_input_rules = None + +wmname = "Qtile" + +QTILECONFIG + +else + echo "Qtile config file already exists." +fi + + +# --------------------------------------------------------------------------------------- +cd /tmp/ +# QMADE Git clone install +git clone https://github.com/ITmail-dk/qmade + + +# Add Wallpapers +if [ ! -d $USER_HOME/Wallpapers ]; then +mkdir -p $USER_HOME/Wallpapers +cp qmade/wallpapers/* $USER_HOME/Wallpapers/ +else + echo "Wallpapers folder already exists." +fi + +chmod 777 /usr/share/wallpapers +cp $(find qmade/wallpapers -type f -name "*.jpg" | shuf -n 1) /usr/share/wallpapers/login-wallpape.jpg +chmod 777 /usr/share/wallpapers/login-wallpape.jpg + + + +# SDDM New login wallpaper +chmod 777 /usr/share/sddm/themes/breeze +chmod 777 /usr/share/sddm/themes/breeze/theme.conf + +NEW_LOGIN_WALLPAPER="/usr/share/wallpapers/login-wallpape.jpg" + +# Check if the file exists +if [ -f "/usr/share/sddm/themes/breeze/theme.conf" ]; then + # Use sed to replace the background line + sed -i "s|background=.*$|background=$NEW_LOGIN_WALLPAPER|" "/usr/share/sddm/themes/breeze/theme.conf" + echo "Updated background image in /usr/share/sddm/themes/breeze/theme.conf" +else + echo "Error: File /usr/share/sddm/themes/breeze/theme.conf not found" +fi + + +# FastFetch Install. +FASTFETCH_VERSION=2.40.3 +wget https://github.com/fastfetch-cli/fastfetch/releases/download/$FASTFETCH_VERSION/fastfetch-linux-amd64.deb && dpkg -i fastfetch-linux-amd64.deb && rm fastfetch-linux-amd64.deb + + + +# WaterFox install - https://www.waterfox.net/download/ +WATERFOX_VERSION=6.5.7 +wget -O waterfox.tar.bz2 https://cdn1.waterfox.net/waterfox/releases/$WATERFOX_VERSION/Linux_x86_64/waterfox-$WATERFOX_VERSION.tar.bz2 +tar -xvf waterfox.tar.bz2 +mv waterfox /opt/ +chown -R root:root /opt/waterfox/ + +cat << EOF | tee "/usr/share/applications/waterfox.desktop" > /dev/null +[Desktop Entry] +Name=Waterfox +Exec=/opt/waterfox/waterfox +Icon=/opt/waterfox/browser/chrome/icons/default/default128.png +Type=Application +Categories=Network;WebBrowser; +EOF + +ln -s /opt/waterfox/waterfox /usr/bin/waterfox + + +# Yazi File Manager +# https://github.com/sxyazi/yazi/releases/latest +YAZI_VERSION=v25.4.8 +wget https://github.com/sxyazi/yazi/releases/download/$YAZI_VERSION/yazi-x86_64-unknown-linux-musl.zip +unzip yazi-x86_64-unknown-linux-musl.zip +cp yazi-x86_64-unknown-linux-musl/yazi /usr/bin/ +chown root:root /usr/bin/yazi +chmod +x /usr/bin/yazi + + +# LM-Sensors config +sensors-detect --auto + +# Systemctl enable --user +# See list run: systemctl list-unit-files --state=enabled + +if [ $(whoami) != "root" ]; then + # Sound systemctl enable --user + systemctl enable --user --now pipewire.socket pipewire-pulse.socket wireplumber.service +else + echo "User is root" +fi + + +# chown new user files and folders +chown -R $NEW_USERNAME:$NEW_USERNAME $USER_HOME/.config +chown -R $NEW_USERNAME:$NEW_USERNAME $USER_HOME/.cache +chown -R $NEW_USERNAME:$NEW_USERNAME $USER_HOME/.local +chown -R $NEW_USERNAME:$NEW_USERNAME $USER_HOME/Wallpapers +chown $NEW_USERNAME:$NEW_USERNAME $USER_HOME/.face.icon +chown $NEW_USERNAME:$NEW_USERNAME $USER_HOME/.nanorc +chown $NEW_USERNAME:$NEW_USERNAME $USER_HOME/.xsession +chown $NEW_USERNAME:$NEW_USERNAME $USER_HOME/.first-login + +# Edit GRUB BOOT TIMEOUT ---------------------------------------------------------------- +sed -i 's+GRUB_TIMEOUT=5+GRUB_TIMEOUT=1+g' /etc/default/grub && update-grub + +# --------------------------------------------------------------------------------------- +# Install Done ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ## +# --------------------------------------------------------------------------------------- + diff --git a/preseed.cfg b/preseed.cfg new file mode 100644 index 0000000..8c49f9c --- /dev/null +++ b/preseed.cfg @@ -0,0 +1,528 @@ +# See https://www.debian.org/releases/stable/example-preseed + +d-i passwd/root-login boolean false +d-i finish-install/reboot_in_progress note +d-i cdrom-detect/eject boolean false +popularity-contest popularity-contest/participate boolean false + +d-i apt-setup/use_mirror boolean true +d-i apt-setup/cdrom/set-first boolean false +d-i apt-setup/disable-cdrom-entries boolean true +d-i apt-setup/non-free-firmware boolean true +d-i apt-setup/non-free boolean true +d-i apt-setup/contrib boolean true + +d-i mirror/country string manual +d-i mirror/http/hostname string deb.debian.org +d-i mirror/http/directory string /debian +d-i mirror/http/proxy string + +# When disk encryption is enabled, skip wiping the partitions beforehand. +d-i partman-auto-crypto/erase_disks boolean false + +# Only works if the system is installed on disk /dev/sda +#d-i grub-installer/bootdev string default + +# This is fairly safe to set, it makes grub install automatically to the UEFI +# partition/boot record if no other operating system is detected on the machine. +#d-i grub-installer/only_debian boolean true + +### Package selection +#tasksel tasksel/first multiselect standard, web-server, kde-desktop +tasksel tasksel/first multiselect standard, ssh-server + +# Or choose to not get the tasksel dialog displayed at all (and don't install +# any packages): +#d-i pkgsel/run_tasksel boolean false + +# Individual additional packages to install +#d-i pkgsel/include string bash-completion git + +# Include the QMADE post installation script from Github. +d-i preseed/late_command string \ +apt-install grep wget curl bash; \ +USER_HOME=$(grep ":1000:" /target/etc/passwd | cut -d: -f6) && echo "[ -f ~/.first-login ] && curl -sfL https://raw.githubusercontent.com/ITmail-dk/qmade/main/install.sh | bash" >> /target/$USER_HOME/.profile \ +&& touch /target/$USER_HOME/.first-login \ +&& NEW_USERNAME=$(grep ":1000:" /target/etc/passwd | cut -d: -f1) && chown $NEW_USERNAME:$NEW_USERNAME /target/$USER_HOME/.first-login; \ +in-target wget -O /usr/local/bin/qmade-install https://raw.githubusercontent.com/ITmail-dk/qmade/main/install.sh; \ +in-target chmod +x /usr/local/bin/qmade-install + +# --------------------------------------------------------------------------- # + +#_preseed_V1 +#### Contents of the preconfiguration file (for bookworm) +### Localization +# Preseeding only locale sets language, country and locale. +#d-i debian-installer/locale string en_US + +# The values can also be preseeded individually for greater flexibility. +#d-i debian-installer/language string en +#d-i debian-installer/country string NL +#d-i debian-installer/locale string en_GB.UTF-8 +# Optionally specify additional locales to be generated. +#d-i localechooser/supported-locales multiselect en_US.UTF-8, nl_NL.UTF-8 + +# Keyboard selection. +#d-i keyboard-configuration/xkb-keymap select us +# d-i keyboard-configuration/toggle select No toggling + +### Network configuration +# Disable network configuration entirely. This is useful for cdrom +# installations on non-networked devices where the network questions, +# warning and long timeouts are a nuisance. +#d-i netcfg/enable boolean false + +# netcfg will choose an interface that has link if possible. This makes it +# skip displaying a list if there is more than one interface. +#d-i netcfg/choose_interface select auto + +# To pick a particular interface instead: +#d-i netcfg/choose_interface select eth1 + +# To set a different link detection timeout (default is 3 seconds). +# Values are interpreted as seconds. +#d-i netcfg/link_wait_timeout string 10 + +# If you have a slow dhcp server and the installer times out waiting for +# it, this might be useful. +#d-i netcfg/dhcp_timeout string 60 +#d-i netcfg/dhcpv6_timeout string 60 + +# Automatic network configuration is the default. +# If you prefer to configure the network manually, uncomment this line and +# the static network configuration below. +#d-i netcfg/disable_autoconfig boolean true + +# If you want the preconfiguration file to work on systems both with and +# without a dhcp server, uncomment these lines and the static network +# configuration below. +#d-i netcfg/dhcp_failed note +#d-i netcfg/dhcp_options select Configure network manually + +# Static network configuration. +# +# IPv4 example +#d-i netcfg/get_ipaddress string 192.168.1.42 +#d-i netcfg/get_netmask string 255.255.255.0 +#d-i netcfg/get_gateway string 192.168.1.1 +#d-i netcfg/get_nameservers string 192.168.1.1 +#d-i netcfg/confirm_static boolean true +# +# IPv6 example +#d-i netcfg/get_ipaddress string fc00::2 +#d-i netcfg/get_netmask string ffff:ffff:ffff:ffff:: +#d-i netcfg/get_gateway string fc00::1 +#d-i netcfg/get_nameservers string fc00::1 +#d-i netcfg/confirm_static boolean true + +# Any hostname and domain names assigned from dhcp take precedence over +# values set here. However, setting the values still prevents the questions +# from being shown, even if values come from dhcp. +#d-i netcfg/get_hostname string unassigned-hostname +#d-i netcfg/get_domain string unassigned-domain + +# If you want to force a hostname, regardless of what either the DHCP +# server returns or what the reverse DNS entry for the IP is, uncomment +# and adjust the following line. +#d-i netcfg/hostname string somehost + +# Disable that annoying WEP key dialog. +#d-i netcfg/wireless_wep string +# The wacky dhcp hostname that some ISPs use as a password of sorts. +#d-i netcfg/dhcp_hostname string radish + +# If you want to completely disable firmware lookup (i.e. not use firmware +# files or packages that might be available on installation images): +#d-i hw-detect/firmware-lookup string never + +# If non-free firmware is needed for the network or other hardware, you can +# configure the installer to always try to load it, without prompting. Or +# change to false to disable asking. +#d-i hw-detect/load_firmware boolean true + +### Network console +# Use the following settings if you wish to make use of the network-console +# component for remote installation over SSH. This only makes sense if you +# intend to perform the remainder of the installation manually. +#d-i anna/choose_modules string network-console +#d-i network-console/authorized_keys_url string http://10.0.0.1/openssh-key +#d-i network-console/password password r00tme +#d-i network-console/password-again password r00tme + +### Mirror settings +# Mirror protocol: +# If you select ftp, the mirror/country string does not need to be set. +# Default value for the mirror protocol: http. +#d-i mirror/protocol string ftp +#d-i mirror/country string manual +#d-i mirror/http/hostname string http.us.debian.org +#d-i mirror/http/directory string /debian +#d-i mirror/http/proxy string + +# Suite to install. +#d-i mirror/suite string testing +# Suite to use for loading installer components (optional). +#d-i mirror/udeb/suite string testing + +### Account setup +# Skip creation of a root account (normal user account will be able to +# use sudo). +#d-i passwd/root-login boolean false +# Alternatively, to skip creation of a normal user account. +#d-i passwd/make-user boolean false + +# Root password, either in clear text +#d-i passwd/root-password password r00tme +#d-i passwd/root-password-again password r00tme +# or encrypted using a crypt(3) hash. +#d-i passwd/root-password-crypted password [crypt(3) hash] + +# To create a normal user account. +#d-i passwd/user-fullname string Debian User +#d-i passwd/username string debian +# Normal user's password, either in clear text +#d-i passwd/user-password password insecure +#d-i passwd/user-password-again password insecure +# or encrypted using a crypt(3) hash. +#d-i passwd/user-password-crypted password [crypt(3) hash] +# Create the first user with the specified UID instead of the default. +#d-i passwd/user-uid string 1010 + +# The user account will be added to some standard initial groups. To +# override that, use this. +#d-i passwd/user-default-groups string audio cdrom video + +### Clock and time zone setup +# Controls whether or not the hardware clock is set to UTC. +#d-i clock-setup/utc boolean true + +# You may set this to any valid setting for $TZ; see the contents of +# /usr/share/zoneinfo/ for valid values. +#d-i time/zone string US/Eastern + +# Controls whether to use NTP to set the clock during the install +#d-i clock-setup/ntp boolean true +# NTP server to use. The default is almost always fine here. +#d-i clock-setup/ntp-server string ntp.example.com + +### Partitioning +## Partitioning example +# If the system has free space you can choose to only partition that space. +# This is only honoured if partman-auto/method (below) is not set. +#d-i partman-auto/init_automatically_partition select biggest_free + +# Alternatively, you may specify a disk to partition. If the system has only +# one disk the installer will default to using that, but otherwise the device +# name must be given in traditional, non-devfs format (so e.g. /dev/sda +# and not e.g. /dev/discs/disc0/disc). +# For example, to use the first SCSI/SATA hard disk: +#d-i partman-auto/disk string /dev/sda +# In addition, you'll need to specify the method to use. +# The presently available methods are: +# - regular: use the usual partition types for your architecture +# - lvm: use LVM to partition the disk +# - crypto: use LVM within an encrypted partition +#d-i partman-auto/method string lvm + +# You can define the amount of space that will be used for the LVM volume +# group. It can either be a size with its unit (eg. 20 GB), a percentage of +# free space or the 'max' keyword. +#d-i partman-auto-lvm/guided_size string max + +# If one of the disks that are going to be automatically partitioned +# contains an old LVM configuration, the user will normally receive a +# warning. This can be preseeded away... +#d-i partman-lvm/device_remove_lvm boolean true +# The same applies to pre-existing software RAID array: +#d-i partman-md/device_remove_md boolean true +# And the same goes for the confirmation to write the lvm partitions. +#d-i partman-lvm/confirm boolean true +#d-i partman-lvm/confirm_nooverwrite boolean true + +# You can choose one of the three predefined partitioning recipes: +# - atomic: all files in one partition +# - home: separate /home partition +# - multi: separate /home, /var, and /tmp partitions +#d-i partman-auto/choose_recipe select atomic + +# Or provide a recipe of your own... +# If you have a way to get a recipe file into the d-i environment, you can +# just point at it. +#d-i partman-auto/expert_recipe_file string /hd-media/recipe + +# If not, you can put an entire recipe into the preconfiguration file in one +# (logical) line. This example creates a small /boot partition, suitable +# swap, and uses the rest of the space for the root partition: +#d-i partman-auto/expert_recipe string \ +# boot-root :: \ +# 40 50 100 ext3 \ +# $primary{ } $bootable{ } \ +# method{ format } format{ } \ +# use_filesystem{ } filesystem{ ext3 } \ +# mountpoint{ /boot } \ +# . \ +# 500 10000 1000000000 ext3 \ +# method{ format } format{ } \ +# use_filesystem{ } filesystem{ ext3 } \ +# mountpoint{ / } \ +# . \ +# 64 512 300% linux-swap \ +# method{ swap } format{ } \ +# . + +# The full recipe format is documented in the file partman-auto-recipe.txt +# included in the 'debian-installer' package or available from D-I source +# repository. This also documents how to specify settings such as file +# system labels, volume group names and which physical devices to include +# in a volume group. + +## Partitioning for EFI +# If your system needs an EFI partition you could add something like +# this to the recipe above, as the first element in the recipe: +# 538 538 1075 free \ +# $iflabel{ gpt } \ +# $reusemethod{ } \ +# method{ efi } \ +# format{ } \ +# . \ +# +# The fragment above is for the amd64 architecture; the details may be +# different on other architectures. The 'partman-auto' package in the +# D-I source repository may have an example you can follow. + +# This makes partman automatically partition without confirmation, provided +# that you told it what to do using one of the methods above. +#d-i partman-partitioning/confirm_write_new_label boolean true +#d-i partman/choose_partition select finish +#d-i partman/confirm boolean true +#d-i partman/confirm_nooverwrite boolean true + +# Force UEFI booting ('BIOS compatibility' will be lost). Default: false. +#d-i partman-efi/non_efi_system boolean true +# Ensure the partition table is GPT - this is required for EFI +#d-i partman-partitioning/choose_label select gpt +#d-i partman-partitioning/default_label string gpt + +# When disk encryption is enabled, skip wiping the partitions beforehand. +#d-i partman-auto-crypto/erase_disks boolean false + +## Partitioning using RAID +# The method should be set to "raid". +#d-i partman-auto/method string raid +# Specify the disks to be partitioned. They will all get the same layout, +# so this will only work if the disks are the same size. +#d-i partman-auto/disk string /dev/sda /dev/sdb + +# Next you need to specify the physical partitions that will be used. +#d-i partman-auto/expert_recipe string \ +# multiraid :: \ +# 1000 5000 4000 raid \ +# $primary{ } method{ raid } \ +# . \ +# 64 512 300% raid \ +# method{ raid } \ +# . \ +# 500 10000 1000000000 raid \ +# method{ raid } \ +# . + +# Last you need to specify how the previously defined partitions will be +# used in the RAID setup. Remember to use the correct partition numbers +# for logical partitions. RAID levels 0, 1, 5, 6 and 10 are supported; +# devices are separated using "#". +# Parameters are: +# \ +# + +#d-i partman-auto-raid/recipe string \ +# 1 2 0 ext3 / \ +# /dev/sda1#/dev/sdb1 \ +# . \ +# 1 2 0 swap - \ +# /dev/sda5#/dev/sdb5 \ +# . \ +# 0 2 0 ext3 /home \ +# /dev/sda6#/dev/sdb6 \ +# . + +# For additional information see the file partman-auto-raid-recipe.txt +# included in the 'debian-installer' package or available from D-I source +# repository. + +# This makes partman automatically partition without confirmation. +#d-i partman-md/confirm boolean true +#d-i partman-partitioning/confirm_write_new_label boolean true +#d-i partman/choose_partition select finish +#d-i partman/confirm boolean true +#d-i partman/confirm_nooverwrite boolean true + +## Controlling how partitions are mounted +# The default is to mount by UUID, but you can also choose "traditional" to +# use traditional device names, or "label" to try filesystem labels before +# falling back to UUIDs. +#d-i partman/mount_style select uuid + +### Base system installation +# Configure APT to not install recommended packages by default. Use of this +# option can result in an incomplete system and should only be used by very +# experienced users. +#d-i base-installer/install-recommends boolean false + +# The kernel image (meta) package to be installed; "none" can be used if no +# kernel is to be installed. +#d-i base-installer/kernel/image string linux-image-686 + +### Apt setup +# Choose, if you want to scan additional installation media +# (default: false). +#d-i apt-setup/cdrom/set-first boolean false +# You can choose to install non-free firmware. +#d-i apt-setup/non-free-firmware boolean true +# You can choose to install non-free and contrib software. +#d-i apt-setup/non-free boolean true +#d-i apt-setup/contrib boolean true +# Uncomment the following line, if you don't want to have the sources.list +# entry for a DVD/BD installation image active in the installed system +# (entries for netinst or CD images will be disabled anyway, regardless of +# this setting). +#d-i apt-setup/disable-cdrom-entries boolean true +# Uncomment this if you don't want to use a network mirror. +#d-i apt-setup/use_mirror boolean false +# Select which update services to use; define the mirrors to be used. +# Values shown below are the normal defaults. +#d-i apt-setup/services-select multiselect security, updates +#d-i apt-setup/security_host string security.debian.org + +# Additional repositories, local[0-9] available +#d-i apt-setup/local0/repository string \ +# http://local.server/debian stable main +#d-i apt-setup/local0/comment string local server +# Enable deb-src lines +#d-i apt-setup/local0/source boolean true +# URL to the public key of the local repository; you must provide a key or +# apt will complain about the unauthenticated repository and so the +# sources.list line will be left commented out. +#d-i apt-setup/local0/key string http://local.server/key +# or one can provide it in-line by base64 encoding the contents of the +# key file (with `base64 -w0`) and specifying it thus: +#d-i apt-setup/local0/key string base64://LS0tLS1CRUdJTiBQR1AgUFVCTElDIEtFWSBCTE9DSy0tLS0tCi4uLgo= +# The content of the key file is checked to see if it appears to be ASCII-armoured. +# If so it will be saved with an ".asc" extension, otherwise it gets a '.gpg' extension. +# "keybox database" format is currently not supported. (see generators/60local in apt-setup's source) + +# By default the installer requires that repositories be authenticated +# using a known gpg key. This setting can be used to disable that +# authentication. Warning: Insecure, not recommended. +#d-i debian-installer/allow_unauthenticated boolean true + +# Uncomment this to add multiarch configuration for i386 +#d-i apt-setup/multiarch string i386 + + +### Package selection +#tasksel tasksel/first multiselect standard, web-server, kde-desktop + +# Or choose to not get the tasksel dialog displayed at all (and don't install +# any packages): +#d-i pkgsel/run_tasksel boolean false + +# Individual additional packages to install +#d-i pkgsel/include string openssh-server build-essential +# Whether to upgrade packages after debootstrap. +# Allowed values: none, safe-upgrade, full-upgrade +#d-i pkgsel/upgrade select none + +# You can choose, if your system will report back on what software you have +# installed, and what software you use. The default is not to report back, +# but sending reports helps the project determine what software is most +# popular and should be included on the first CD/DVD. +#popularity-contest popularity-contest/participate boolean false + +### Boot loader installation +# Grub is the boot loader (for x86). + +# This is fairly safe to set, it makes grub install automatically to the UEFI +# partition/boot record if no other operating system is detected on the machine. +#d-i grub-installer/only_debian boolean true + +# This one makes grub-installer install to the UEFI partition/boot record, if +# it also finds some other OS, which is less safe as it might not be able to +# boot that other OS. +#d-i grub-installer/with_other_os boolean true + +# Due notably to potential USB sticks, the location of the primary drive can +# not be determined safely in general, so this needs to be specified: +#d-i grub-installer/bootdev string /dev/sda +# To install to the primary device (assuming it is not a USB stick): +#d-i grub-installer/bootdev string default + +# Alternatively, if you want to install to a location other than the UEFI +# parition/boot record, uncomment and edit these lines: +#d-i grub-installer/only_debian boolean false +#d-i grub-installer/with_other_os boolean false +#d-i grub-installer/bootdev string (hd0,1) +# To install grub to multiple disks: +#d-i grub-installer/bootdev string (hd0,1) (hd1,1) (hd2,1) + +# Optional password for grub, either in clear text +#d-i grub-installer/password password r00tme +#d-i grub-installer/password-again password r00tme +# or encrypted using an MD5 hash, see grub-md5-crypt(8). +#d-i grub-installer/password-crypted password [MD5 hash] + +# Use the following option to add additional boot parameters for the +# installed system (if supported by the bootloader installer). +# Note: options passed to the installer will be added automatically. +#d-i debian-installer/add-kernel-opts string nousb + +### Finishing up the installation +# During installations from serial console, the regular virtual consoles +# (VT1-VT6) are normally disabled in /etc/inittab. Uncomment the next +# line to prevent this. +#d-i finish-install/keep-consoles boolean true + +# Avoid that last message about the install being complete. +#d-i finish-install/reboot_in_progress note + +# This will prevent the installer from ejecting the CD during the reboot, +# which is useful in some situations. +#d-i cdrom-detect/eject boolean false + +# This is how to make the installer shutdown when finished, but not +# reboot into the installed system. +#d-i debian-installer/exit/halt boolean true +# This will power off the machine instead of just halting it. +#d-i debian-installer/exit/poweroff boolean true + +### Preseeding other packages +# Depending on what software you choose to install, or if things go wrong +# during the installation process, it's possible that other questions may +# be asked. You can preseed those too, of course. To get a list of every +# possible question that could be asked during an install, do an +# installation, and then run these commands: +# debconf-get-selections --installer > file +# debconf-get-selections >> file + + +#### Advanced options +### Running custom commands during the installation +# d-i preseeding is inherently not secure. Nothing in the installer checks +# for attempts at buffer overflows or other exploits of the values of a +# preconfiguration file like this one. Only use preconfiguration files from +# trusted locations! To drive that home, and because it's generally useful, +# here's a way to run any shell command you'd like inside the installer, +# automatically. + +# This first command is run as early as possible, just after +# preseeding is read. +#d-i preseed/early_command string anna-install some-udeb +# This command is run immediately before the partitioner starts. It may be +# useful to apply dynamic partitioner preseeding that depends on the state +# of the disks (which may not be visible when preseed/early_command runs). +#d-i partman/early_command \ +# string debconf-set partman-auto/disk "$(list-devices disk | head -n1)" +# This command is run just before the install finishes, but when there is +# still a usable /target directory. You can chroot to /target and use it +# directly, or use the apt-install and in-target commands to easily install +# packages and run commands in the target system. +#d-i preseed/late_command string apt-install zsh; in-target chsh -s /bin/zsh diff --git a/screenshots/screenshot_01.jpg b/screenshots/screenshot_01.jpg new file mode 100755 index 0000000..afcd4e3 Binary files /dev/null and b/screenshots/screenshot_01.jpg differ diff --git a/src/apt/preferences.d/99debian-backports b/src/apt/preferences.d/99debian-backports new file mode 100644 index 0000000..14d00e4 --- /dev/null +++ b/src/apt/preferences.d/99debian-backports @@ -0,0 +1,4 @@ +# Never prefer packages from the "bookworm-backports" repository (apt-cache policy) +Package: * +Pin: origin bookworm-backports +Pin-Priority: 100 diff --git a/src/apt/sources.list.d/debian.sources b/src/apt/sources.list.d/debian.sources new file mode 100644 index 0000000..d78c986 --- /dev/null +++ b/src/apt/sources.list.d/debian.sources @@ -0,0 +1,13 @@ +Types: deb deb-src +URIs: https://deb.debian.org/debian +Suites: APTLISTOS APTLISTOS-updates APTLISTOS-backports +Components: main contrib non-free non-free-firmware +Enabled: yes +Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg + +Types: deb deb-src +URIs: https://security.debian.org/debian-security +Suites: APTLISTOS-security +Components: main contrib non-free non-free-firmware +Enabled: yes +Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg \ No newline at end of file diff --git a/src/autogen-qtile-keybinding.sh b/src/autogen-qtile-keybinding.sh new file mode 100644 index 0000000..556ce7c --- /dev/null +++ b/src/autogen-qtile-keybinding.sh @@ -0,0 +1,421 @@ +#!/usr/bin/env python3 + +############################################## +# Auto Qtile keybindings - image generator # +# Qmade version of the configuration # +############################################## + +import getopt +import os +import sys + +import cairocffi as cairo +from cairocffi import ImageSurface + +this_dir = os.path.dirname(__file__) +base_dir = os.path.abspath(os.path.join(this_dir, "..")) +sys.path.insert(0, base_dir) + +BUTTON_NAME_Y = 65 +BUTTON_NAME_X = 10 + +COMMAND_Y = 20 +COMMAND_X = 10 + +LEGEND = ["modifiers", "layout", "group", "window", "other"] + +CUSTOM_KEYS = { + "Backspace": 2, + "Tab": 1.5, + "\\": 1.5, + "Return": 2.4533, + "shift": 2, + "space": 5, +} + +class Button: + def __init__(self, key, x, y, width, height): + self.key = key + self.x = x + self.y = y + self.width = width + self.height = height + + +class Pos: + WIDTH = 78 + HEIGHT = 70 + GAP = 5 + + def __init__(self, x, y): + self.x = x + self.row_x = x + self.y = y + self.custom_width = {} + for i, val in CUSTOM_KEYS.items(): + self.custom_width[i] = val * self.WIDTH + + def get_pos(self, name): + if name in self.custom_width: + width = self.custom_width[name] + else: + width = self.WIDTH + + info = Button(name, self.x, self.y, width, self.HEIGHT) + + self.x = self.x + self.GAP + width + + return info + + def skip_x(self, times=1): + self.x = self.x + self.GAP + times * self.WIDTH + + def next_row(self): + self.x = self.row_x + self.y = self.y + self.GAP + self.HEIGHT + + +class KeyboardPNGFactory: + def __init__(self, modifiers, keys): + self.keys = keys + self.modifiers = modifiers.split("-") + self.key_pos = self.calculate_pos(20, 140) + + def rgb_red(self, context): + context.set_source_rgb(0.8431372549, 0.3725490196, 0.3725490196) + + def rgb_green(self, context): + context.set_source_rgb(0.6862745098, 0.6862745098, 0) + + def rgb_yellow(self, context): + context.set_source_rgb(1, 0.6862745098, 0) + + def rgb_cyan(self, context): + context.set_source_rgb(0.5137254902, 0.6784313725, 0.6784313725) + + def rgb_violet(self, context): + context.set_source_rgb(0.831372549, 0.5215686275, 0.6784313725) + + def calculate_pos(self, x, y): + pos = Pos(x, y) + + key_pos = {} + for c in "`1234567890-=": + key_pos[c] = pos.get_pos(c) + + key_pos["Backspace"] = pos.get_pos("Backspace") + pos.next_row() + + key_pos["Tab"] = pos.get_pos("Tab") + for c in "qwertyuiop[]\\": + key_pos[c] = pos.get_pos(c) + pos.next_row() + + pos.skip_x(1.6) + for c in "asdfghjkl;'": + key_pos[c] = pos.get_pos(c) + key_pos["Return"] = pos.get_pos("Return") + pos.next_row() + + key_pos["shift"] = pos.get_pos("shift") + for c in "zxcvbnm": + key_pos[c] = pos.get_pos(c) + key_pos["period"] = pos.get_pos("period") + key_pos["comma"] = pos.get_pos("comma") + key_pos["/"] = pos.get_pos("/") + pos.next_row() + + key_pos["control"] = pos.get_pos("control") + pos.skip_x() + key_pos["mod4"] = pos.get_pos("mod4") + key_pos["mod1"] = pos.get_pos("mod1") + key_pos["space"] = pos.get_pos("space") + key_pos["Print"] = pos.get_pos("Print") + pos.skip_x(3) + key_pos["Up"] = pos.get_pos("Up") + + pos.next_row() + pos.skip_x(12.33) + key_pos["Left"] = pos.get_pos("Left") + key_pos["Down"] = pos.get_pos("Down") + key_pos["Right"] = pos.get_pos("Right") + + pos.next_row() + + for legend in LEGEND: + key_pos[legend] = pos.get_pos(legend) + + pos.skip_x(5) + key_pos["Button1"] = pos.get_pos("Button1") + key_pos["Button2"] = pos.get_pos("Button2") + key_pos["Button3"] = pos.get_pos("Button3") + + pos.next_row() + key_pos["FN_KEYS"] = pos.get_pos("FN_KEYS") + + return key_pos + + def render(self, filename): + surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, 1280, 800) + context = cairo.Context(surface) + with context: + context.set_source_rgb(1, 1, 1) + context.paint() + + context.move_to(40, 50) + context.set_font_size(34) + context.show_text("Qmade - Keybindings for Qtile") + + context.move_to(40, 80) + context.set_font_size(22) + if len([i for i in self.modifiers if i]): + context.show_text("Modifiers: " + ", ".join(self.modifiers)) + else: + context.show_text("No modifiers used.") + + for i in self.key_pos.values(): + if i.key in ["FN_KEYS"]: + continue + + self.draw_button(context, i.key, i.x, i.y, i.width, i.height) + + # draw functional + fn = [i for i in keys.values() if i.key[:4] == "XF86"] + if len(fn): + fn_pos = self.key_pos["FN_KEYS"] + x = fn_pos.x + for i in fn: + self.draw_button(context, i.key, x, fn_pos.y, fn_pos.width, fn_pos.height) + x += Pos.GAP + Pos.WIDTH + + # draw mouse base + context.rectangle(830, 670, 244, 90) + context.set_source_rgb(0, 0, 0) + context.stroke() + context.set_font_size(28) + context.move_to(900, 730) + context.show_text("MOUSE") + + surface.write_to_png(filename) + + def draw_button(self, context, key, x, y, width, height): + radius = 5 # Radius for the rounded corners + fn = False + if key[:4] == "XF86": + fn = True + + if key in LEGEND: + if key == "modifiers": + self.rgb_red(context) + elif key == "group": + self.rgb_green(context) + elif key == "layout": + self.rgb_cyan(context) + elif key == "window": + self.rgb_yellow(context) + else: + self.rgb_violet(context) + self.rounded_rectangle(context, x, y, width, height, radius) + context.fill() + + if key in self.modifiers: + self.rounded_rectangle(context, x, y, width, height, radius) + self.rgb_red(context) + context.fill() + + if key in self.keys: + k = self.keys[key] + self.rounded_rectangle(context, x, y, width, height, radius) + self.set_key_color(context, k) + context.fill() + + self.show_multiline(context, x + COMMAND_X, y + COMMAND_Y, k) + + self.rounded_rectangle(context, x, y, width, height, radius) + context.set_source_rgb(0, 0, 0) + context.stroke() + + if fn: + key = key[4:] + context.set_font_size(10) + else: + context.set_font_size(14) + + context.move_to(x + BUTTON_NAME_X, y + BUTTON_NAME_Y) + context.show_text(self.translate(key)) + + def rounded_rectangle(self, context, x, y, width, height, radius): + context.new_path() + context.arc(x + radius, y + radius, radius, 2 * (3.14 / 2), 3 * (3.14 / 2)) + context.arc(x + width - radius, y + radius, radius, 3 * (3.14 / 2), 4 * (3.14 / 2)) + context.arc(x + width - radius, y + height - radius, radius, 0, 3.14 / 2) + context.arc(x + radius, y + height - radius, radius, 3.14 / 2, 2 * (3.14 / 2)) + context.close_path() + + def show_multiline(self, context, x, y, key): + """Cairo doesn't support multiline. Added with word wrapping.""" + c_width = 14 + if key.key in CUSTOM_KEYS: + c_width *= CUSTOM_KEYS[key.key] + + context.set_font_size(10) + context.set_source_rgb(0, 0, 0) + context.move_to(x, y) + words = key.command.split(" ") + words.reverse() + printable = last_word = words.pop() + while len(words): + last_word = words.pop() + if len(printable + " " + last_word) < c_width: + printable += " " + last_word + continue + + context.show_text(printable) + y += 10 + context.move_to(x, y) + printable = last_word + + if last_word is not None: + context.show_text(printable) + + def set_key_color(self, context, key): + if key.scope == "group": + self.rgb_green(context) + elif key.scope == "layout": + self.rgb_cyan(context) + elif key.scope == "window": + self.rgb_yellow(context) + else: + self.rgb_violet(context) + + def translate(self, text): + dictionary = { + "period": ",", + "comma": ".", + "Left": "←", + "Down": "↓", + "Right": "→", + "Up": "↑", + "AudioRaiseVolume": "Volume up", + "AudioLowerVolume": "Volume down", + "AudioMute": "Audio mute", + "AudioMicMute": "Mic mute", + "MonBrightnessUp": "Brightness up", + "MonBrightnessDown": "Brightness down", + } + + if text not in dictionary: + return text + + return dictionary[text] + + +class KInfo: + NAME_MAP = { + "togroup": "to group", + "toscreen": "to screen", + } + + def __init__(self, key): + self.key = key.key + self.command = self.get_command(key) + self.scope = self.get_scope(key) + + def get_command(self, key): + if hasattr(key, "desc") and key.desc: + return key.desc + + cmd = key.commands[0] + command = cmd.name + if command in self.NAME_MAP: + command = self.NAME_MAP[command] + + command = command.replace("_", " ") + + if len(cmd.args): + if isinstance(cmd.args[0], str): + command += " " + cmd.args[0] + + return command + + def get_scope(self, key): + selectors = key.commands[0].selectors + if len(selectors): + return selectors[0][0] + + +class MInfo(KInfo): + def __init__(self, mouse): + self.key = mouse.button + self.command = self.get_command(mouse) + self.scope = self.get_scope(mouse) + + +def get_kb_map(config_path=None): + from libqtile.confreader import Config + + c = Config(config_path) + if config_path: + c.load() + + kb_map = {} + for key in c.keys: + mod = "-".join(key.modifiers) + if mod not in kb_map: + kb_map[mod] = {} + + info = KInfo(key) + kb_map[mod][info.key] = info + + for mouse in c.mouse: + mod = "-".join(mouse.modifiers) + if mod not in kb_map: + kb_map[mod] = {} + + info = MInfo(mouse) + kb_map[mod][info.key] = info + + return kb_map + + +help_doc = """ +usage: gen-keybinding-img [-h] [-c CONFIGFILE] [-o OUTPUT_DIR] + +Qtile keybindings image generator + +optional arguments: + -h, --help show this help message and exit + -c CONFIGFILE, --config CONFIGFILE + use specified configuration file. If no presented + default will be used + -o OUTPUT_DIR, --output-dir OUTPUT_DIR + set directory to export all images to +""" +if __name__ == "__main__": + config_path = os.path.expanduser("~/.config/qtile/config.py") # Set default config path + output_dir = "" + try: + opts, args = getopt.getopt(sys.argv[1:], "hc:o:", ["help=", "config=", "output-dir="]) + except getopt.GetoptError: + print(help_doc) + sys.exit(2) + + for opt, arg in opts: + if opt in ("-h", "--help"): + print(help_doc) + sys.exit() + elif opt in ("-c", "--config"): + config_path = arg + elif opt in ("-o", "--output-dir"): + output_dir = arg + + kb_map = get_kb_map(config_path) + for modifier, keys in kb_map.items(): + if not modifier: + filename = "keybinding_no_modifier.png" + else: + filename = "keybinding_{}.png".format(modifier) + + output_file = os.path.abspath(os.path.join(output_dir, filename)) + f = KeyboardPNGFactory(modifier, keys) + f.render(output_file) diff --git a/src/config/kitty.conf b/src/config/kitty.conf new file mode 100644 index 0000000..794de34 --- /dev/null +++ b/src/config/kitty.conf @@ -0,0 +1,329 @@ +# A default configuration file can also be generated by running: +# kitty +runpy 'from kitty.config import *; print(commented_out_default_config())' +# +# The following command will bring up the interactive terminal GUI +# kitty +kitten themes +# +# kitty +kitten themes Catppuccin-Mocha +# kitty +kitten themes --reload-in=all Catppuccin-Mocha + +background_opacity 0.98 + +font_family JetBrainsMono Nerd Font Mono +bold_font auto +italic_font auto +bold_italic_font auto + +font_size 14 +force_ltr no + +adjust_line_height 0 +adjust_column_width 0 + +adjust_baseline 0 + +disable_ligatures never + +box_drawing_scale 0.001, 1, 1.5, 2 + +cursor #f2f2f2 + +cursor_text_color #f2f2f2 + +cursor_shape underline + +cursor_beam_thickness 1.5 + +cursor_underline_thickness 2.0 + +cursor_blink_interval -1 + +cursor_stop_blinking_after 99.0 + +scrollback_lines 5000 + +scrollback_pager less --chop-long-lines --RAW-CONTROL-CHARS +INPUT_LINE_NUMBER + +scrollback_pager_history_size 0 + +scrollback_fill_enlarged_window no + +wheel_scroll_multiplier 5.0 + +touch_scroll_multiplier 1.0 + +mouse_hide_wait 3.0 + +#mouse_map right click paste_from_clipboard + +url_color #0087bd +url_style curly + +open_url_with default + +url_prefixes http https file ftp gemini irc gopher mailto news git + +detect_urls yes + +#url_excluded_characters + +copy_on_select yes + +strip_trailing_spaces never + +select_by_word_characters @-./_~?&=%+# + +click_interval -1.0 + +focus_follows_mouse no + +pointer_shape_when_grabbed arrow + +default_pointer_shape beam + +pointer_shape_when_dragging beam + +mouse_map left click ungrabbed mouse_click_url_or_select +mouse_map shift+left click grabbed,ungrabbed mouse_click_url_or_select +mouse_map ctrl+shift+left release grabbed,ungrabbed mouse_click_url + +mouse_map ctrl+shift+left press grabbed discard_event + +mouse_map middle release ungrabbed paste_from_selection +mouse_map left press ungrabbed mouse_selection normal +mouse_map ctrl+alt+left press ungrabbed mouse_selection rectangle +mouse_map left doublepress ungrabbed mouse_selection word +mouse_map left triplepress ungrabbed mouse_selection line + +mouse_map ctrl+alt+left triplepress ungrabbed mouse_selection line_from_point + +#mouse_map right press ungrabbed mouse_selection extend +mouse_map shift+middle release ungrabbed,grabbed paste_selection +mouse_map shift+left press ungrabbed,grabbed mouse_selection normal +mouse_map shift+ctrl+alt+left press ungrabbed,grabbed mouse_selection rectangle +mouse_map shift+left doublepress ungrabbed,grabbed mouse_selection word +mouse_map shift+left triplepress ungrabbed,grabbed mouse_selection line + +mouse_map shift+ctrl+alt+left triplepress ungrabbed,grabbed mouse_selection line_from_point + +repaint_delay 10 + +input_delay 5 + +sync_to_monitor yes + +enable_audio_bell no + +visual_bell_duration 0.0 + +window_alert_on_bell no + +bell_on_tab no + +command_on_bell none + +remember_window_size yes +initial_window_width 800 +initial_window_height 500 + +enabled_layouts * + +window_resize_step_cells 2 +window_resize_step_lines 2 + +window_border_width 0.0pt + +draw_minimal_borders yes + +window_margin_width 0 + +single_window_margin_width -1 + +window_padding_width 3 + +placement_strategy center + +active_border_color #f2f2f2 + +inactive_border_color #cccccc + +bell_border_color #ff5a00 + +inactive_text_alpha 1.0 + +hide_window_decorations no + +resize_debounce_time 0.1 + +#resize_draw_strategy static + +resize_in_steps no + +confirm_os_window_close 0 + +tab_bar_edge bottom + +tab_bar_margin_width 0.0 + +tab_bar_margin_height 0.0 0.0 + +tab_bar_style fade + +tab_bar_min_tabs 2 + +tab_switch_strategy previous + +tab_fade 0.25 0.5 0.75 1 + +tab_separator " |" + +tab_powerline_style angled + +tab_activity_symbol none + +tab_title_template "{title}" + +active_tab_title_template none + +active_tab_foreground #000 +active_tab_background #eee +active_tab_font_style bold-italic +inactive_tab_foreground #444 +inactive_tab_background #999 +inactive_tab_font_style normal + +tab_bar_background none + +background_image none + +background_image_layout tiled + +background_image_linear no + +dynamic_background_opacity no + +background_tint 0.0 + +dim_opacity 0.75 + +selection_foreground #000000 + +selection_background #fffacd + +mark1_foreground black + +mark1_background #98d3cb + +mark2_foreground black + +mark2_background #f2dcd3 + +mark3_foreground black + +mark3_background #f274bc + +shell . + +editor . + +close_on_child_death no + +allow_remote_control yes + +listen_on none + +update_check_interval 0 + +startup_session none + +clipboard_control write-clipboard write-primary + +allow_hyperlinks yes + +term xterm-kitty + +wayland_titlebar_color system + +macos_titlebar_color system + +macos_option_as_alt no + +macos_hide_from_tasks no + +macos_quit_when_last_window_closed no + +macos_window_resizable yes + +macos_thicken_font 0 + +macos_traditional_fullscreen no + +macos_show_window_title_in all + +macos_custom_beam_cursor no + +linux_display_server auto + +kitty_mod ctrl+shift + +clear_all_shortcuts no +map kitty_mod+c copy_to_clipboard +map kitty_mod+v paste_from_clipboard +map kitty_mod+up scroll_line_up +map kitty_mod+down scroll_line_down +map kitty_mod+page_up scroll_page_up +map kitty_mod+page_down scroll_page_down +map kitty_mod+home scroll_home +map kitty_mod+end scroll_end +map kitty_mod+h show_scrollback +map kitty_mod+w close_window +map kitty_mod+] next_window +map kitty_mod+[ previous_window +map kitty_mod+f move_window_forward +map kitty_mod+b move_window_backward +map kitty_mod+` move_window_to_top +map kitty_mod+r start_resizing_window +map kitty_mod+1 first_window +map kitty_mod+2 second_window +map kitty_mod+3 third_window +map kitty_mod+4 fourth_window +map kitty_mod+5 fifth_window +map kitty_mod+6 sixth_window +map kitty_mod+7 seventh_window +map kitty_mod+8 eighth_window +map kitty_mod+9 ninth_window +map kitty_mod+0 tenth_window +map kitty_mod+right next_tab +map kitty_mod+left previous_tab +map kitty_mod+t new_tab +map kitty_mod+q close_tab +map shift+cmd+w close_os_window +map kitty_mod+. move_tab_forward +map kitty_mod+, move_tab_backward +map kitty_mod+alt+t set_tab_title +map kitty_mod+l next_layout +map kitty_mod+equal change_font_size all +2.0 +map kitty_mod+minus change_font_size all -2.0 +map kitty_mod+backspace change_font_size all 0 +map kitty_mod+e kitten hints +map kitty_mod+p>f kitten hints --type path --program - +map kitty_mod+p>shift+f kitten hints --type path +map kitty_mod+p>l kitten hints --type line --program - +map kitty_mod+p>w kitten hints --type word --program - +map kitty_mod+p>h kitten hints --type hash --program - +map kitty_mod+p>n kitten hints --type linenum +map kitty_mod+p>y kitten hints --type hyperlink +map kitty_mod+f11 toggle_fullscreen +map kitty_mod+f10 toggle_maximized +map kitty_mod+u kitten unicode_input +map kitty_mod+f2 edit_config_file +map kitty_mod+escape kitty_shell window +map kitty_mod+a>m set_background_opacity +0.1 +map kitty_mod+a>l set_background_opacity -0.1 +map kitty_mod+a>1 set_background_opacity 1 +map kitty_mod+a>d set_background_opacity default +map kitty_mod+delete clear_terminal reset active +map kitty_mod+f5 load_config_file +map kitty_mod+f6 debug_config + +include ~/.cache/wal/colors-kitty.conf diff --git a/src/config/qtile-autostart.sh b/src/config/qtile-autostart.sh new file mode 100644 index 0000000..d7f6e7b --- /dev/null +++ b/src/config/qtile-autostart.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash +# Picom - https://manpages.debian.org/stable/picom/picom.1.en.html +pgrep -x picom >/dev/null || picom --backend xrender --vsync --no-fading-openclose --no-fading-destroyed-argb & +# Picom use... --backend glx or xrender, --vsync --no-vsync --no-fading-openclose --no-fading-destroyed-argb etc. + +exec /usr/bin/lxpolkit & # Graphical authentication agent + +autorandr --change & + +# This here if statement sets your background image, with feh... +# and is also used for the auto-generation of the background image and colors. +if [ -f ~/.fehbg ]; then + . ~/.fehbg +else + auto-new-wallpaper-and-colors + #feh --bg-scale $(find ~/Wallpapers -type f | shuf -n 1) +fi + +wpctl set-mute @DEFAULT_AUDIO_SINK@ 0 & +wpctl set-volume @DEFAULT_AUDIO_SINK@ 25% & +dunst & +numlockx on & +mpd & + +if [ -f ~/.Xresources ]; then + xrdb ~/.Xresources & +fi + +#keynav & +#kdeconnectd & + +# Turn off the Screen after X time in seconds +xset s 2700 & + +# Remove .first-login file -------------------------------------------------------------- +if [ -f ~/.first-login ]; then + rm ~/.first-login +fi diff --git a/src/config/qtile-config.py b/src/config/qtile-config.py new file mode 100644 index 0000000..a2a9cb7 --- /dev/null +++ b/src/config/qtile-config.py @@ -0,0 +1,365 @@ +# Qtile Config - Start +# https://docs.qtile.org/en/latest/index.html +# -',.-'-,.'-,'.-',.-',-.'-,.'-,.'-,.'-,'.-',.-'- + +import os +import subprocess +import json +from libqtile import bar, layout, qtile, widget, hook +from libqtile.config import Click, Drag, Group, Key, Match, Screen, ScratchPad, DropDown, re +from libqtile.lazy import lazy +from libqtile.utils import guess_terminal # terminal = guess_terminal() + + +# Custom code start ---------------------------------------------------- + +def guess_browser(): + """Guess the default web browser.""" + # Define a list of common web browsers + browsers = ["google-chrome", "firefox", "chromium", "vivaldi", "opera", "brave-browser", "safari"] + + # Loop through the list of browsers and check if they exist in PATH + for browser in browsers: + try: + subprocess.run(["which", browser], check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + return browser + except subprocess.CalledProcessError: + continue + + # If no browser is found, return None + return None + + + +# Custom code end ------------------------------------------------------ + +#Pywal Colors +colors = os.path.expanduser("~/.cache/wal/colors.json") +colordict = json.load(open(colors)) +Color0 = colordict["colors"]["color0"] +Color1 = colordict["colors"]["color1"] +Color2 = colordict["colors"]["color2"] +Color3 = colordict["colors"]["color3"] +Color4 = colordict["colors"]["color4"] +Color5 = colordict["colors"]["color5"] +Color6 = colordict["colors"]["color6"] +Color7 = colordict["colors"]["color7"] +Color8 = colordict["colors"]["color8"] +Color9 = colordict["colors"]["color9"] +Color10 = colordict["colors"]["color10"] +Color11 = colordict["colors"]["color11"] +Color12 = colordict["colors"]["color12"] +Color13 = colordict["colors"]["color13"] +Color14 = colordict["colors"]["color14"] +Color15 = colordict["colors"]["color15"] + +# Colors use example active=Color1, + + +mod = "mod4" +terminal = "kitty -o background_opacity=0.95" +browser = guess_browser() +fileexplorer = "thunar" +runmenu = 'rofi -modi "drun,run,window,filebrowser" -show drun' # Switch between -modi... Default key CTRL+TAB + + +keys = [ + # A list of available commands that can be bound to keys can be found + # at https://docs.qtile.org/en/latest/manual/config/lazy.html + # + # Examples: + # a key binding that can run an external Script or Command + # Key([mod], "l", lazy.spawn(os.path.expanduser("xsecurelock")), desc='Computer Lockdown'), + # + # a normal key binding that pulls from a variable + # Key([mod], "Return", lazy.spawn(terminal), desc="Launch Terminal"), + + # Keybindings + Key([mod], "Return", lazy.spawn(terminal), desc="Terminal"), + Key([mod], "b", lazy.spawn(browser), desc="Web Browser"), + Key([mod], "e", lazy.spawn(fileexplorer), desc="File Explorer"), + Key([mod], "r", lazy.spawn(runmenu), desc="Run Menu"), + Key([mod, "shift"], "r", lazy.spawncmd(), desc="Spawn a command using a prompt widget"), + Key([mod, "mod1"], "l", lazy.spawn(os.path.expanduser("xsecurelock")), desc="Computer Lockdown"), + Key([mod, "control", "mod1"], "t", lazy.spawn(os.path.expanduser("auto-new-wallpaper-and-colors")), desc="Random Color Theme from Wallpapers"), + Key([mod, "control", "mod1"], "w", lazy.spawn(os.path.expanduser("~/.config/rofi/rofi-wifi-menu.sh")), desc="WiFi Manager"), + Key([mod, "control", "mod1"], "p", lazy.spawn(os.path.expanduser("~/.config/rofi/powermenu.sh")), desc="Power Menu"), + Key([mod, "control", "mod1"], "n", lazy.spawn(os.path.expanduser("kitty -e sudo nmtui")), desc="Network Manager"), + + # Default + Key([mod], "h", lazy.layout.left(), desc="Move focus to left"), + Key([mod], "l", lazy.layout.right(), desc="Move focus to right"), + Key([mod], "j", lazy.layout.down(), desc="Move focus down"), + Key([mod], "k", lazy.layout.up(), desc="Move focus up"), + Key([mod], "space", lazy.layout.next(), desc="Move window focus to other window"), + + # Move windows between left/right columns or move up/down in current stack. + # Moving out of range in Columns layout will create new column. + Key([mod, "shift"], "h", lazy.layout.shuffle_left(), desc="Move window to the left"), + Key([mod, "shift"], "l", lazy.layout.shuffle_right(), desc="Move window to the right"), + Key([mod, "shift"], "j", lazy.layout.shuffle_down(), desc="Move window down"), + Key([mod, "shift"], "k", lazy.layout.shuffle_up(), desc="Move window up"), + + # Grow windows. If current window is on the edge of screen and direction + # will be to screen edge - window would shrink. + Key([mod, "control"], "h", lazy.layout.grow_left(), lazy.layout.grow(), desc="Grow window to the left"), + Key([mod, "control"], "l", lazy.layout.grow_right(), lazy.layout.shrink(), desc="Grow window to the right"), + Key([mod, "control"], "j", lazy.layout.grow_down(), desc="Grow window down"), + Key([mod, "control"], "k", lazy.layout.grow_up(), desc="Grow window up"), + Key([mod, "control"], "n", lazy.layout.normalize(), lazy.layout.reset(), desc="Reset all window sizes"), + + # Toggle between split and unsplit sides of stack. + # Split = all windows displayed + # Unsplit = 1 window displayed, like Max layout, but still with + # multiple stack panes + Key([mod, "shift"], "space", lazy.layout.toggle_split(), desc="Toggle between split and unsplit sides of stack"), + + # Toggle between different layouts as defined below + Key([mod], "Tab", lazy.next_layout(), desc="Toggle between layouts"), + Key([mod], "w", lazy.window.kill(), desc="Kill focused window"), + Key([mod], "f", lazy.window.toggle_fullscreen(), desc="Toggle fullscreen on the focused window"), + Key([mod], "t", lazy.window.toggle_floating(), desc="Toggle floating on the focused window"), + Key([mod, "mod1", "control"], "r", lazy.reload_config(), desc="Reload the config"), + Key([mod, "mod1", "control"], "q", lazy.shutdown(), desc="Shutdown Qtile"), + + # Audio + Key([mod, "mod1"], "Up", lazy.spawn("wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%+"), desc='Volume Up'), + Key([mod, "mod1"], "Down", lazy.spawn("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"), desc='Volume Down'), + Key([mod, "mod1"], "m", lazy.spawn("wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"), desc='Volume Mute Toggle'), + Key([mod, "mod1", "control"], "a", lazy.spawn("audio-toggle"), desc='Audio Source Toggle'), + + Key([mod, "mod1"], "s", lazy.spawn("playerctl play-pause"), desc='Play-Pause'), + Key([mod, "mod1"], "p", lazy.spawn("playerctl previous"), desc='Previous'), + Key([mod, "mod1"], "n", lazy.spawn("playerctl next"), desc='Next'), + + # XF86 Audio & Brightness keys + Key([mod, "shift"], "a", lazy.spawn("pavucontrol"), desc='Audio Control Panel'), + Key([], "XF86AudioRaiseVolume", lazy.spawn("wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%+"), desc='Volume Up'), + Key([], "XF86AudioLowerVolume", lazy.spawn("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"), desc='Volume Down'), + Key([], "XF86AudioMute", lazy.spawn("wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"), desc='Volume Mute Toggle'), +# mute/unmute the microphone - wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle +# Show volume level - wpctl get-volume @DEFAULT_AUDIO_SINK@ + + Key([], "XF86AudioPlay", lazy.spawn("playerctl play-pause"), desc='Play-Pause'), + Key([], "XF86AudioPrev", lazy.spawn("playerctl previous"), desc='Previous'), + Key([], "XF86AudioNext", lazy.spawn("playerctl next"), desc='Next'), + Key([], "XF86MonBrightnessUp", lazy.spawn("brightnessctl set +10%"), desc='Brightness UP'), + Key([], "XF86MonBrightnessDown", lazy.spawn("brightnessctl set 10%-"), desc='Brightness Down'), + Key([], "Print", lazy.spawn("bash -c 'flameshot gui --path ~/Screenshots'"), desc='Screenshot'), +] + +# Add key bindings to switch VTs in Wayland. +# We can't check qtile.core.name in default config as it is loaded before qtile is started +# We therefore defer the check until the key binding is run by using .when(func=...) +for vt in range(1, 8): + keys.append( + Key( + ["control", "mod1"], + f"f{vt}", + lazy.core.change_vt(vt).when(func=lambda: qtile.core.name == "wayland"), + desc=f"Switch to VT{vt}", + ) + ) + + +# Create labels for groups and assign them a default layout. +# Find icons here - https://www.nerdfonts.com/cheat-sheet +# nf-linux-debian  nf-md-rocket_launch 󱓞 nf-cod-rocket  nf-cod-settings  nf-dev-android  nf-dev-chrome  nf-dev-terminal  +# nf-dev-prolog  nf-fa-apple  nf-fa-earlybirds  nf-fa-egg  nf-fa-grav  nf-fa-linux  nf-fa-snapchat  +# nf-fa-steam  nf-fa-terminal  nf-fa-wifi  nf-fae-pi  nf-md-recycle 󰑌 nf-md-symbol 󱔁 nf-fa-mug_hot  +# nf-fa-thermometer_2  nf-md-battery_medium 󱊢 nf-md-battery_charging 󰂄 +# nf-fa-volume_high  nf-fa-volume_low  nf-fa-volume_xmark  +# nf-md-pac_man 󰮯 nf-md-ghost 󰊠 nf-fa-circle  nf-cod-circle_large  nf-cod-circle_filled  nf-md-circle_small 󰧟 nf-md-circle_medium 󰧞 + +# Group Match example: +# Group("1", label="", layout="monadtall", matches=[Match(wm_class=re.compile(r"^(Google\-chrome)$"))]), + +groups = [ + Group("1", label="", layout="monadtall"), + Group("2", label="", layout="monadtall"), + Group("3", label="", layout="monadtall"), + Group("4", label="", layout="monadtall"), + Group("5", label="", layout="monadtall"), + Group("6", label="", layout="monadtall"), + Group("7", label="", layout="monadtall"), + Group("8", label="", layout="monadtall"), + Group("9", label="", layout="max"), + Group("0", label="", layout="max"), +] + +for i in groups: + keys.extend( + [ + # mod + group number = switch to group + Key( + [mod], + i.name, + lazy.group[i.name].toscreen(), + desc="Switch to group {}".format(i.name), + ), + # mod + shift + group number = switch to & move focused window to group + Key( + [mod, "shift"], + i.name, + lazy.window.togroup(i.name, switch_group=True), + desc="Switch to & move focused window to group {}".format(i.name), + ), + # Or, use below if you prefer not to switch to that group. + # # mod + shift + group number = move focused window to group + # Key([mod, "shift"], i.name, lazy.window.togroup(i.name), + # desc="move focused window to group {}".format(i.name)), + ] + ) + +# ScratchPad Keybindings +keys.extend([ + Key([mod, "shift"], "Return", lazy.group['scratchpad'].dropdown_toggle('term1')), + Key([mod, "mod1", "control"], "Return", lazy.group['scratchpad'].dropdown_toggle('term2')), + Key([mod, "shift"], "e", lazy.group['scratchpad'].dropdown_toggle('file-explorer')), + Key([mod, "shift"], "n", lazy.group['scratchpad'].dropdown_toggle('notes')), + Key([mod, "shift"], "m", lazy.group['scratchpad'].dropdown_toggle('music')), +]) + +# ScratchPads +groups.append(ScratchPad("scratchpad", [ + DropDown("term1", "kitty --class=scratch", width=0.8, height=0.8, x=0.1, y=0.1, opacity=1), + DropDown("term2", "kitty --class=scratch", width=0.8, height=0.8, x=0.1, y=0.1, opacity=1), + DropDown("file-explorer", "kitty --class=yazi -e yazi", width=0.8, height=0.8, x=0.1, y=0.1, opacity=1), + DropDown("audio", "kitty --class=volume -e alsamixer", width=0.8, height=0.8, x=0.1, y=0.1, opacity=1), + DropDown("notes", "notepadqq", width=0.6, height=0.6, x=0.2, y=0.2, opacity=1), + DropDown("music", "kitty --class=music -e ncmpcpp", width=0.8, height=0.8, x=0.1, y=0.1, opacity=1), +])) + +# Define layouts and layout themes +def init_layout_theme(): + return {"margin":5, + "border_width":1, + "border_focus": Color6, + "border_normal": Color2 + } + +layout_theme = init_layout_theme() + +layouts = [ + layout.MonadTall(ratio=0.65, **layout_theme), + layout.Max(**layout_theme), + #layout.Bsp(**layout_theme), + #layout.Columns(**layout_theme), + #layout.Stack(num_stacks=2), + #layout.Matrix(**layout_theme), + #layout.MonadWide(**layout_theme), + #layout.RatioTile(**layout_theme), + #layout.Tile(**layout_theme), + #layout.TreeTab(**layout_theme), + #layout.VerticalTile(**layout_theme), + #layout.Zoomy(**layout_theme), +] + +widget_defaults = dict( + font="JetBrainsMono Nerd Font Propo", + fontsize=14, + background=Color0, + padding=1, +) +extension_defaults = widget_defaults.copy() + +# Bar widgets - https://docs.qtile.org/en/latest/manual/ref/widgets.html + +screens = [ + Screen( + top=bar.Bar( + [ + widget.CurrentLayout(scale=0.7, padding=5, mode="icon", icon_first=True), + widget.Spacer(length=2), + widget.GroupBox(fontsize=18, highlight_method="text", this_current_screen_border="#f7f7f7", highlight_color=Color14, this_screen_border=Color3, urgent_border=Color7, active=Color5, inactive=Color8, borderwidth=0), + widget.Spacer(length=2), + widget.Prompt(), + widget.Spacer(), # to get transparent background add background="#000000CC" + widget.WindowName(width=bar.CALCULATED, max_chars=130), + widget.Spacer(), # to get transparent background add background="#000000CC" + #widget.Systray(fmt="󱊖 {}", icon_size=16), + # NB Wayland is incompatible with Systray, consider using StatusNotifier + # widget.StatusNotifier(icon_size=16), + #widget.Wallpaper(directory="~/Wallpapers/", label="", random_selection="True"), + #widget.NetGraph(type='line', line_width=1), + #widget.Net(prefix='M'), + #widget.ThermalSensor(format='CPU: {temp:.0f}{unit}'), + widget.Volume(fmt=" {}"), + widget.Spacer(length=7), + widget.Systray(background=Color0, padding=5, icon_size=16), + widget.Spacer(length=1), + widget.Clock(fmt=" {}",format="%A %d-%m-%Y %H:%M %p"), + widget.QuickExit(default_text='', countdown_format='{}', fontsize=16, countdown_start=3), + widget.Spacer(length=10), + ], 30, # Define bar height + background="#000000CC", opacity=0.90, # Bar background color can also take transparency with "hex color code" or 0.XX + margin=[5, 5, 0, 5], # Space around bar as int or list of ints [N E S W] + border_width=[0, 0, 0, 0], # Width of border as int of list of ints [N E S W] + border_color=[Color2, Color2, Color2, Color2] # Border colour as str or list of str [N E S W] + ), + # You can uncomment this variable if you see that on X11 floating resize/moving is laggy + # By default we handle these events delayed to already improve performance, however your system might still be struggling + # This variable is set to None (no cap) by default, but you can set it to 60 to indicate that you limit it to 60 events per second + # x11_drag_polling_rate = 60, + #wallpaper="~/Wallpapers/default-wallpaper.png", + #wallpaper_mode="fill" + ), +] + +# Drag floating layouts. +mouse = [ + Drag([mod], "Button1", lazy.window.set_position_floating(), start=lazy.window.get_position()), + Drag([mod], "Button3", lazy.window.set_size_floating(), start=lazy.window.get_size()), + Click([mod], "Button2", lazy.window.bring_to_front()), +] + +dgroups_key_binder = None +dgroups_app_rules = [] # type: list +follow_mouse_focus = True +bring_front_click = False +floats_kept_above = True +cursor_warp = False +floating_layout = layout.Floating(**layout_theme, + float_rules=[ + # Run the utility xprop to see the wm class and name of an X client. + *layout.Floating.default_float_rules, + Match(wm_class="confirmreset"), # gitk + Match(wm_class="makebranch"), # gitk + Match(wm_class="maketag"), # gitk + Match(wm_class="ssh-askpass"), # ssh-askpass + Match(title="branchdialog"), # gitk + Match(title="pinentry"), # GPG key password entry + ], + no_reposition_rules=[ + Match(wm_class="pavucontrol"), + ], +) + +auto_fullscreen = True +focus_on_window_activation = "smart" +reconfigure_screens = True + +# If things like steam games want to auto-minimize themselves when losing +# focus, should we respect this or not? +auto_minimize = True + +# Remember to add, "hook" "import os" "import subprocess" "Match" +@hook.subscribe.startup_once +def autostart(): + autostartscript = os.path.expanduser("~/.config/qtile/autostart.sh") + subprocess.run([autostartscript]) + +@hook.subscribe.client_new +def move_window_to_group(client): + for group in groups: + if any(client.match(match) for match in group.matches): + client.togroup(group.name) + client.qtile.groups_map[group.name].toscreen() + break + + +# When using the Wayland backend, this can be used to configure input devices. +wl_input_rules = None + +wmname = "Qtile" + diff --git a/src/etc/environment b/src/etc/environment new file mode 100644 index 0000000..7c23f11 --- /dev/null +++ b/src/etc/environment @@ -0,0 +1,7 @@ +color_prompt="yes" +XDG_CURRENT_DESKTOP="Qtile (QMADE)" + +# QT +QT_QPA_PLATFORMTHEME="qt5ct" +QT_AUTO_SCREEN_SCALE_FACTOR="1" +#QT_SCALE_FACTOR="1" diff --git a/src/etc/modprobe.d/audio_disable_powersave.conf b/src/etc/modprobe.d/audio_disable_powersave.conf new file mode 100644 index 0000000..c02656f --- /dev/null +++ b/src/etc/modprobe.d/audio_disable_powersave.conf @@ -0,0 +1 @@ +options snd_hda_intel power_save=0 diff --git a/src/etc/pipewire/pipewire.conf.d/pipewire.conf b/src/etc/pipewire/pipewire.conf.d/pipewire.conf new file mode 100644 index 0000000..3ca9622 --- /dev/null +++ b/src/etc/pipewire/pipewire.conf.d/pipewire.conf @@ -0,0 +1 @@ +context.properties = {default.clock.min-quantum = 1024} diff --git a/src/etc/wireplumber/wireplumber.conf.d/51-disable-suspension.conf b/src/etc/wireplumber/wireplumber.conf.d/51-disable-suspension.conf new file mode 100644 index 0000000..a317985 --- /dev/null +++ b/src/etc/wireplumber/wireplumber.conf.d/51-disable-suspension.conf @@ -0,0 +1,39 @@ +monitor.alsa.rules = [ + { + matches = [ + { + # Matches all sources + node.name = "~alsa_input.*" + }, + { + # Matches all sinks + node.name = "~alsa_output.*" + } + ] + actions = { + update-props = { + session.suspend-timeout-seconds = 0 + } + } + } +] +# bluetooth devices +monitor.bluez.rules = [ + { + matches = [ + { + # Matches all sources + node.name = "~bluez_input.*" + }, + { + # Matches all sinks + node.name = "~bluez_output.*" + } + ] + actions = { + update-props = { + session.suspend-timeout-seconds = 0 + } + } + } +] diff --git a/src/home/.audio-toggle b/src/home/.audio-toggle new file mode 100644 index 0000000..35c39e6 --- /dev/null +++ b/src/home/.audio-toggle @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +# EDIT / SET +SPEAKERS="pactl set-card-profile alsa_card.pci-0000_0b_00.4 output:iec958-stereo+input:analog-stereo" +HEADPHONES="pactl set-card-profile alsa_card.pci-0000_0b_00.4 output:analog-stereo+input:analog-stereo" + +if [ -f /tmp/SETHEADPHONES ]; then + eval "$HEADPHONES" && rm /tmp/SETHEADPHONES +else + eval "$SPEAKERS" && touch /tmp/SETHEADPHONES +fi diff --git a/src/home/.face.icon b/src/home/.face.icon new file mode 100644 index 0000000..3c9eafb Binary files /dev/null and b/src/home/.face.icon differ diff --git a/src/home/README-QMADE.md b/src/home/README-QMADE.md new file mode 100644 index 0000000..3312816 --- /dev/null +++ b/src/home/README-QMADE.md @@ -0,0 +1,28 @@ +## QMADE Readme + + + +## Keybindings +Default Modkey is the Windows key (**MOD4**) and **MOD1** is Alt Left. + +**WIN + Enter** = Opens a Terminal. + +**WIN + B** = Opens a browser. + +**WIN + E** = Thunar File Explorer. + +**WIN + SHIFT + E** = Yazi File Explorer in a ScratchPads. + +**WIN + CTRL + ALT + P** = Power Menu for shutdown, reboot and lock screen. + +**WIN + SHIFT + A** = Pavucontrol, Audio Control Panel. + +**WIN + ALT + A** = Toggle between two sources like speaker and headphones. (Setup in file ~/.audio-toggle) + +**WIN + CTRL + ALT + T** = Autogenerate a new background image and color theme, +from the Wallpaper folder in your home directory. + + +For a quick reference to the keybindings used in Qmade, +check out the Qtile config file under Keybindings in "~/.config/qtile/config.py" or run "qtileconfig" to see them all. + diff --git a/src/home/root.face.icon b/src/home/root.face.icon new file mode 100644 index 0000000..62d2637 Binary files /dev/null and b/src/home/root.face.icon differ diff --git a/src/remaster-debian-iso-and-preseed.sh b/src/remaster-debian-iso-and-preseed.sh new file mode 100755 index 0000000..585a6ff --- /dev/null +++ b/src/remaster-debian-iso-and-preseed.sh @@ -0,0 +1,64 @@ +#!/usr/bin/env bash +# Debian ISO Remastering for QMADE - https://github.com/ITmail-dk/qmade/ +# sudo apt install -y wget git xorriso isolinux p7zip-full fakeroot binutils + +DEBIAN_ISO_URL=https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/ +GET_ISO_NAME=$(curl -s https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/ | grep -oP 'debian-\d+(?:\.\d+)+-amd64-netinst\.iso' | head -n 1) +PRESEED_ISO_NAME=QMADE-Debian +#WORK_DIR=$(pwd) +ISO_WORK_TMP=iso-extract + +# Setup the environment for creating the new ISO version. +function setup() { + sudo apt update && sudo apt install -y wget git xorriso isolinux p7zip-full fakeroot binutils + if [ ! -f Debian-source.iso ]; then + wget -O Debian-source.iso $DEBIAN_ISO_URL/"$GET_ISO_NAME" + fi + xorriso -osirrox on -indev Debian-source.iso -extract / $ISO_WORK_TMP + sudo chmod -R +w $ISO_WORK_TMP + sudo mkdir -p $ISO_WORK_TMP/var/cache/apt/archives + if [ ! -f preseed.cfg ]; then + wget https://raw.githubusercontent.com/ITmail-dk/qmade/refs/heads/main/preseed.cfg + fi + sudo cp preseed.cfg $ISO_WORK_TMP + sudo sed -i 's/append vga/append auto=true priority=critical vga/' $ISO_WORK_TMP/isolinux/gtk.cfg + sudo sed -i '/spkgtk\.cfg/d; /spk\.cfg/d' $ISO_WORK_TMP/isolinux/menu.cfg + sudo sed -i 's/--- quiet/--- quiet file=\/cdrom\/preseed.cfg/' $ISO_WORK_TMP/isolinux/gtk.cfg + sudo sed -i '0,/--- quiet/ s/--- quiet/--- quiet file=\/cdrom\/preseed.cfg/' $ISO_WORK_TMP/boot/grub/grub.cfg + sudo apt reinstall --download-only -y -o Dir::Cache="./" -o Dir::Cache::archives="iso-extract/var/cache/apt/archives" \ + bash-completion xserver-xorg x11-utils xinit acl arandr autorandr picom fwupd colord mesa-utils htop wget curl git tmux \ + numlockx kitty neovim xdg-utils cups cups-common lm-sensors fancontrol xbacklight brightnessctl unzip network-manager \ + dnsutils dunst libnotify-bin notify-osd xsecurelock pm-utils rofi 7zip jq poppler-utils fd-find ripgrep zoxide sddm \ + imagemagick nsxiv mpv flameshot mc thunar gvfs gvfs-backends parted gparted mpd mpc ncmpcpp fzf ccrypt xarchiver \ + notepadqq font-manager fontconfig fontconfig-config fonts-recommended fonts-liberation fonts-freefont-ttf \ + fonts-noto-core libfontconfig1 pipewire pipewire-audio pipewire-alsa pipewire-pulse pipewire-jack wireplumber \ + libspa-0.2-bluetooth pavucontrol alsa-utils qpwgraph sddm-theme-breeze sddm-theme-maui ffmpeg cmake \ + policykit-1-gnome remmina libreoffice keynav + sudo chmod -R +r iso-extract/var/ + make +} + +# Make a new ISO file after removing the old one if it exists. +function make() { + if [ -d $ISO_WORK_TMP ]; then + if [ -f $PRESEED_ISO_NAME.iso ]; then rm $PRESEED_ISO_NAME.iso; fi + xorriso -as mkisofs -o $PRESEED_ISO_NAME.iso -V "Debian QMADE" -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin -c isolinux/boot.cat -b isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -e boot/grub/efi.img -no-emul-boot -isohybrid-gpt-basdat $ISO_WORK_TMP + ls -lah ./*.iso + + else + echo "$ISO_WORK_TMP does not exist, runing setup..." + setup + fi +} + +function usb() { + lsblk + echo -en "Enter the name of the USB Disk so sda, sdb etc..: " + read -r USB_DISK + clear + sudo dd bs=4M status=progress conv=fsync oflag=direct if="$(pwd)"/$PRESEED_ISO_NAME.iso of=/dev/"$USB_DISK" + echo "ISO to USB All done." +} + +# Run the function by, function_name +"$@" make diff --git a/src/usr/bin/auto-new-wallpaper-and-colors.sh b/src/usr/bin/auto-new-wallpaper-and-colors.sh new file mode 100644 index 0000000..7401b0a --- /dev/null +++ b/src/usr/bin/auto-new-wallpaper-and-colors.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +wal --cols16 darken -q -i ~/Wallpapers --backend colorz +# Backends: colorz, haishoku, wal, colorthief, fast_colorthief, okthief, schemer2, modern_colorthief + +notify-send -u low "Automatically new background and color theme" "Please wait while i find a new background image and some colors to match" + +qtile cmd-obj -o cmd -f reload_config +kitty +kitten themes --reload-in=all Current-theme + +cp $(cat "$HOME/.cache/wal/wal") /usr/share/wallpapers/login-wallpape.jpg + +notify-send -u low "Automatically new background and color theme" "The background image and colors has been updated." diff --git a/wallpapers/BG101c9151-35a9-4d05-8e83-4c3748dc3352.jpg b/wallpapers/BG101c9151-35a9-4d05-8e83-4c3748dc3352.jpg new file mode 100644 index 0000000..53d9a07 Binary files /dev/null and b/wallpapers/BG101c9151-35a9-4d05-8e83-4c3748dc3352.jpg differ diff --git a/wallpapers/BG10253099-04de-42a4-b9ab-2ca348be6242.jpg b/wallpapers/BG10253099-04de-42a4-b9ab-2ca348be6242.jpg new file mode 100644 index 0000000..3d5a82d Binary files /dev/null and b/wallpapers/BG10253099-04de-42a4-b9ab-2ca348be6242.jpg differ diff --git a/wallpapers/BG19df40e2-3154-499f-8669-548e977c1f17.jpg b/wallpapers/BG19df40e2-3154-499f-8669-548e977c1f17.jpg new file mode 100755 index 0000000..75b9719 Binary files /dev/null and b/wallpapers/BG19df40e2-3154-499f-8669-548e977c1f17.jpg differ diff --git a/wallpapers/BG2dabf583-1897-42f6-a826-b78db6ec21d3.jpg b/wallpapers/BG2dabf583-1897-42f6-a826-b78db6ec21d3.jpg new file mode 100644 index 0000000..5e45f9f Binary files /dev/null and b/wallpapers/BG2dabf583-1897-42f6-a826-b78db6ec21d3.jpg differ diff --git a/wallpapers/BG33293df6-9b2a-4adf-9c8b-c7fba6884ed3.jpg b/wallpapers/BG33293df6-9b2a-4adf-9c8b-c7fba6884ed3.jpg new file mode 100755 index 0000000..572a421 Binary files /dev/null and b/wallpapers/BG33293df6-9b2a-4adf-9c8b-c7fba6884ed3.jpg differ diff --git a/wallpapers/BG3e4d4d32-433e-4a96-be55-19550a168200.jpg b/wallpapers/BG3e4d4d32-433e-4a96-be55-19550a168200.jpg new file mode 100644 index 0000000..4189142 Binary files /dev/null and b/wallpapers/BG3e4d4d32-433e-4a96-be55-19550a168200.jpg differ diff --git a/wallpapers/BG400d07b1-9533-4476-8ffd-640c74c01203.jpg b/wallpapers/BG400d07b1-9533-4476-8ffd-640c74c01203.jpg new file mode 100755 index 0000000..1c3805b Binary files /dev/null and b/wallpapers/BG400d07b1-9533-4476-8ffd-640c74c01203.jpg differ diff --git a/wallpapers/BG475dab50-18fa-429d-8645-7d4294b5321b.jpg b/wallpapers/BG475dab50-18fa-429d-8645-7d4294b5321b.jpg new file mode 100755 index 0000000..688e08c Binary files /dev/null and b/wallpapers/BG475dab50-18fa-429d-8645-7d4294b5321b.jpg differ diff --git a/wallpapers/BG5a37e659-6e76-4f6c-bae3-ccdc3893e20e.jpg b/wallpapers/BG5a37e659-6e76-4f6c-bae3-ccdc3893e20e.jpg new file mode 100644 index 0000000..fac5aad Binary files /dev/null and b/wallpapers/BG5a37e659-6e76-4f6c-bae3-ccdc3893e20e.jpg differ diff --git a/wallpapers/BG603bb1cb-377e-4498-a9d0-6d5d68151d65.jpg b/wallpapers/BG603bb1cb-377e-4498-a9d0-6d5d68151d65.jpg new file mode 100644 index 0000000..1acc9d5 Binary files /dev/null and b/wallpapers/BG603bb1cb-377e-4498-a9d0-6d5d68151d65.jpg differ diff --git a/wallpapers/BG6381d5b3-a1d0-4be5-addc-b91342b9589b.jpg b/wallpapers/BG6381d5b3-a1d0-4be5-addc-b91342b9589b.jpg new file mode 100755 index 0000000..de16fe7 Binary files /dev/null and b/wallpapers/BG6381d5b3-a1d0-4be5-addc-b91342b9589b.jpg differ diff --git a/wallpapers/BG8c3099cb-9ae7-4f3a-a28b-616be0e20089.jpg b/wallpapers/BG8c3099cb-9ae7-4f3a-a28b-616be0e20089.jpg new file mode 100644 index 0000000..556968a Binary files /dev/null and b/wallpapers/BG8c3099cb-9ae7-4f3a-a28b-616be0e20089.jpg differ diff --git a/wallpapers/BG_5467beeb-7aa2-4332-ae66-fdda016369d8.jpg b/wallpapers/BG_5467beeb-7aa2-4332-ae66-fdda016369d8.jpg new file mode 100644 index 0000000..f4ed02d Binary files /dev/null and b/wallpapers/BG_5467beeb-7aa2-4332-ae66-fdda016369d8.jpg differ diff --git a/wallpapers/BG_7ad38b59-3b95-4a2b-9f25-babf0166b409.jpg b/wallpapers/BG_7ad38b59-3b95-4a2b-9f25-babf0166b409.jpg new file mode 100644 index 0000000..108a5c7 Binary files /dev/null and b/wallpapers/BG_7ad38b59-3b95-4a2b-9f25-babf0166b409.jpg differ diff --git a/wallpapers/BGa64a360a-6e27-4da2-b311-8e2aa98f6f39.jpg b/wallpapers/BGa64a360a-6e27-4da2-b311-8e2aa98f6f39.jpg new file mode 100644 index 0000000..ee24980 Binary files /dev/null and b/wallpapers/BGa64a360a-6e27-4da2-b311-8e2aa98f6f39.jpg differ diff --git a/wallpapers/BGa7903f2d-2fcb-45ce-867f-1b3c1778907c.jpg b/wallpapers/BGa7903f2d-2fcb-45ce-867f-1b3c1778907c.jpg new file mode 100644 index 0000000..f754c9b Binary files /dev/null and b/wallpapers/BGa7903f2d-2fcb-45ce-867f-1b3c1778907c.jpg differ diff --git a/wallpapers/BGa8313f9a-0cc6-4787-8f81-7e2594152fce.jpg b/wallpapers/BGa8313f9a-0cc6-4787-8f81-7e2594152fce.jpg new file mode 100644 index 0000000..4b1409b Binary files /dev/null and b/wallpapers/BGa8313f9a-0cc6-4787-8f81-7e2594152fce.jpg differ diff --git a/wallpapers/BGaa94f567-14bf-4dd3-98af-4ee711d4dbe4.jpg b/wallpapers/BGaa94f567-14bf-4dd3-98af-4ee711d4dbe4.jpg new file mode 100755 index 0000000..7cd2018 Binary files /dev/null and b/wallpapers/BGaa94f567-14bf-4dd3-98af-4ee711d4dbe4.jpg differ diff --git a/wallpapers/BGacfaab65-493a-4292-97de-cbf3a661d052.jpg b/wallpapers/BGacfaab65-493a-4292-97de-cbf3a661d052.jpg new file mode 100644 index 0000000..ff9c8ea Binary files /dev/null and b/wallpapers/BGacfaab65-493a-4292-97de-cbf3a661d052.jpg differ diff --git a/wallpapers/BGbf43d307-ba9c-4796-bd99-a0e1075f1c74.jpg b/wallpapers/BGbf43d307-ba9c-4796-bd99-a0e1075f1c74.jpg new file mode 100644 index 0000000..119c9dd Binary files /dev/null and b/wallpapers/BGbf43d307-ba9c-4796-bd99-a0e1075f1c74.jpg differ diff --git a/wallpapers/BGc97d9f03-86d3-4d56-9395-bdce65f21bec.jpg b/wallpapers/BGc97d9f03-86d3-4d56-9395-bdce65f21bec.jpg new file mode 100644 index 0000000..7c07a0c Binary files /dev/null and b/wallpapers/BGc97d9f03-86d3-4d56-9395-bdce65f21bec.jpg differ diff --git a/wallpapers/BGd0ccb3a2-5464-4ed5-8790-7f7957a29569.jpg b/wallpapers/BGd0ccb3a2-5464-4ed5-8790-7f7957a29569.jpg new file mode 100755 index 0000000..7933c27 Binary files /dev/null and b/wallpapers/BGd0ccb3a2-5464-4ed5-8790-7f7957a29569.jpg differ diff --git a/wallpapers/BGd9906987-d6b1-4d2f-a249-22d7f2f1d081.jpg b/wallpapers/BGd9906987-d6b1-4d2f-a249-22d7f2f1d081.jpg new file mode 100755 index 0000000..627cd0d Binary files /dev/null and b/wallpapers/BGd9906987-d6b1-4d2f-a249-22d7f2f1d081.jpg differ diff --git a/wallpapers/BGf6958622-a90a-4e58-8815-63befd8a41b2.jpg b/wallpapers/BGf6958622-a90a-4e58-8815-63befd8a41b2.jpg new file mode 100644 index 0000000..99667f7 Binary files /dev/null and b/wallpapers/BGf6958622-a90a-4e58-8815-63befd8a41b2.jpg differ diff --git a/wallpapers/BGfba50d6f-1499-42d2-8c66-58495ddd2949.jpg b/wallpapers/BGfba50d6f-1499-42d2-8c66-58495ddd2949.jpg new file mode 100644 index 0000000..83d331b Binary files /dev/null and b/wallpapers/BGfba50d6f-1499-42d2-8c66-58495ddd2949.jpg differ diff --git a/wallpapers/default_wallpaper.jpg b/wallpapers/default_wallpaper.jpg new file mode 100755 index 0000000..1e4d298 Binary files /dev/null and b/wallpapers/default_wallpaper.jpg differ