···11+#!/bin/sh
22+# Some applications (namely java apps) get the home directory from /etc/passwd meaning that
33+# we can't easily prevent these apps from writing in the home directory by changing the HOME env
44+# var. Use bubblewrap to bind a random directory to /home/$USER instead.
55+66+# Make sure we have a command to execute
77+[ "$*" ] || {
88+ printf '%s\n' "Missing command to execute" 1>&2
99+ exit 1
1010+}
1111+1212+# If HOMEWRAP_HOME isn't set, make our own and ensure that it exists
1313+: "${HOMEWRAP_HOME:=${XDG_STATE_HOME:-$HOME/.local/state}/homewrap/default}"
1414+mkdir -p "$HOMEWRAP_HOME"
1515+1616+# Create sandbox with temporary home
1717+# This breaks if there is a broken symlink in the directory
1818+args="--dev-bind / / --dev-bind $HOMEWRAP_HOME $HOME "
1919+2020+# Recreate the home directory
2121+for i in "$HOME/"* "$HOME/".*
2222+do
2323+ case $i in
2424+ "$HOME/." ) continue ;;
2525+ "$HOME/.." ) continue ;;
2626+ esac
2727+ args="${args}--dev-bind $i $i "
2828+done
2929+3030+# shellcheck disable=SC2086
3131+exec bwrap $args "$@"
+67
data/shellscripts/info-fetch
···11+#!/bin/sh
22+# Print some information about the system. This script was written with gentoo systems in mind.
33+44+# Used Environment Variables
55+# $SHELL
66+# $USER
77+88+# Used Files
99+# /etc/os-release
1010+# /proc/sys/kernel/hostname
1111+# /proc/uptime
1212+# /proc/version
1313+1414+# Get the hostname of the computer
1515+read -r hostname < /proc/sys/kernel/hostname
1616+1717+# Source /etc/os-release if it exist
1818+# shellcheck source=/dev/null
1919+[ -f /etc/os-release ] && . /etc/os-release
2020+[ "$PRETTY_NAME" ] || PRETTY_NAME="Linux"
2121+2222+# Get the kernel version
2323+read -r _ _ kernel_version _ < /proc/version
2424+2525+# Read uptime
2626+read -r uptime _ < /proc/uptime
2727+2828+# Remove extra percision
2929+up=${uptime%.*}
3030+3131+# Calculate days, hours, minutes and seconds from the given output
3232+days=$((up / 86400))
3333+hours=$(((up % 86400) / 3600))
3434+min=$((((up % 86400) % 3600) / 60))
3535+sec=$((((up % 86400) % 3600) % 60))
3636+3737+# Only display the value if it is not zero
3838+[ $days = 0 ] || dout="${days}d "
3939+[ $hours = 0 ] || hout="${hours}h "
4040+[ $min = 0 ] || mout="${min}m "
4141+[ $sec = 0 ] || sout="${sec}s"
4242+pretty_uptime="$dout$hout$mout$sout"
4343+4444+# Calculate package count (Gentoo)
4545+set -- /var/db/pkg/*/*
4646+pkg_count=$#
4747+4848+# Color Showcase
4949+for i in 0 1 2 3 4 5 6 7
5050+do
5151+ normal_colors="$normal_colors\033[4${i}m\033[3${i}m "
5252+ bright_colors="$bright_colors\033[10${i}m\033[9${i}m "
5353+done
5454+5555+# Colors and Formatting
5656+color="\033[35;1m"
5757+nocolor="\033[m"
5858+underline="\033[4m"
5959+6060+printf '%b\n' "\n$color$underline$USER$nocolor@$underline$color$hostname$nocolor" \
6161+ "${color}os$nocolor $PRETTY_NAME" \
6262+ "${color}ke$nocolor $kernel_version" \
6363+ "${color}up$nocolor $pretty_uptime" \
6464+ "${color}sh$nocolor ${SHELL##*/}" \
6565+ "${color}pk$nocolor $pkg_count\n" \
6666+ "$normal_colors$nocolor" \
6767+ "$bright_colors$nocolor\n"
+61
data/shellscripts/moulog
···11+#!/bin/sh
22+# A much better way to handle my logging
33+44+#- Settings -#
55+# Place to store log files
66+: "${MOULOG_DIR:=${XDG_CACHE_HOME:-$HOME/.cache}/moulog}"
77+# Max number of old dirs to keep
88+: "${MOULOG_MAX:=5}"
99+1010+# TODO: Add option to name the log file.
1111+# As of right now, my wayfire logs aren't named anything related to wayfire.
1212+# This also extends to other logs.
1313+1414+usage() {
1515+ while read -r line
1616+ do printf '%b\n' "$line"
1717+ done <<-EOF
1818+ ${0##*/} [options] [command]
1919+ example: moulog -n
2020+ example: moulog wlsunset -l 0 -L 0
2121+2222+ options:
2323+ -h | --help - display this message
2424+ -n | --new - create a new logging directory
2525+ - useful if being run multiple times in the background
2626+2727+ environment vars:
2828+ MOULOG_DIR - place to store logs (default: $XDG_CACHE_HOME/moulog)
2929+ MOULOG_MAX - max number of old dirs to keep (default: 5)
3030+ EOF
3131+3232+ exit "${1:-1}"
3333+}
3434+3535+new_dir() {
3636+ touch /tmp/moulog
3737+ [ -d "$MOULOG_DIR.$MOULOG_MAX" ] && rm -r "$MOULOG_DIR.$MOULOG_MAX"
3838+3939+ i=$((MOULOG_MAX))
4040+ until [ $i = 1 ]
4141+ do
4242+ [ -d "$MOULOG_DIR.$((i-1))" ] && mv "$MOULOG_DIR.$((i-1))" "$MOULOG_DIR.$i"
4343+ i=$((i-1))
4444+ done
4545+4646+ [ -d "$MOULOG_DIR" ] && mv "$MOULOG_DIR" "$MOULOG_DIR.1"
4747+ mkdir -p "$MOULOG_DIR"
4848+}
4949+5050+case $1 in
5151+ -h|--help ) usage 0 ;;
5252+ -n|--new ) new_dir; exit 0 ;;
5353+ -N|--name ) program_name=$2; shift 2 ;;
5454+esac
5555+5656+# Using this file to decide if a new directory should be made
5757+[ -f /tmp/moulog ] || new_dir
5858+5959+6060+printf '%s\n' "#### moulog start time: $(date +%s) ####" >> "$MOULOG_DIR/${program_name:=$1}.log"
6161+exec "$@" >> "$MOULOG_DIR/${program_name:=$1}.log" 2>&1
+41
data/shellscripts/powermenu
···11+#!/bin/sh
22+33+# Required Commands
44+# bemenu - allow the user to pick options
55+# loginctl - perform actions
66+# pkill - send sway into idle state
77+88+# Needs to be edited to work with either systemctl or loginctl
99+1010+prompt="powermenu"
1111+options="hibernate\\nhybrid-sleep\\nlock\\npoweroff\\nreboot\\nsuspend\\nsuspend-then-hibernate"
1212+1313+confirm() {
1414+ c_prompt="Are you sure? [$action]"
1515+ c_input=$(printf '%b' "yes\\nno" | bemenu -p "$c_prompt")
1616+1717+ # Prevents selecting yes instantly waking up from suspend
1818+ sleep 1
1919+2020+ case $c_input in
2121+ Y*|y* ) return 0 ;;
2222+ N*|n* ) exit 0 ;;
2323+ * ) exit 1 ;;
2424+ esac
2525+}
2626+2727+sleep_task() {
2828+ pkill -USR1 swayidle
2929+}
3030+3131+action=$(printf '%b' "$options" | bemenu -p "$prompt")
3232+case $action in
3333+ hibernate ) confirm; loginctl hibernate ;;
3434+ hybrid-sleep ) confirm; loginctl hybrid-sleep ;;
3535+ lock ) confirm; loginctl lock-session ;;
3636+ poweroff ) confirm; loginctl poweroff ;;
3737+ reboot ) confirm; loginctl reboot ;;
3838+ suspend ) confirm; loginctl suspend ;;
3939+ suspend-then-hibernate ) confirm; loginctl suspend-then-hibernate ;;
4040+ * ) exit 1 ;;
4141+esac
···11-#!/bin/sh
22-# Automatically configure the kernel using a configure script. This script
33-# is meant to run as the root user. This script will not touch the kernel
44-# symlink and will build the kernel located at /usr/src/linux (AKU_DIR).
55-# Script inspired by https://github.com/gg7/gentoo-kernel-guide
66-77-# What it does
88-# - Generates the default config
99-# - Runs the config script $HOME/kernel-config.sh (AKU_CONFIG_SCRIPT)
1010-# - $HOME in this case should be the root user's home directory (usually /root)
1111-# - If the script does not exist, the script will exit immediately
1212-# - A sample of of a kernel-config.sh can be found in my dotfiles at
1313-# GitLab (https://gitlab.com/yemou/setup/-/blob/laptop/gentoo/root/kernel-config.sh) or
1414-# GitHub (https://github.com/yemouu/setup/blob/laptop/gentoo/root/kernel-config.sh)
1515-# - Compiles the kernel
1616-# - Copies bzImage to it's dest dir /boot/EFI/Gentoo/bzImage (AKU_DEST)
1717-# - If a file is already at this location, a backup will be made
1818-# within the directory
1919-# - If the AKU_DEST is set to `none` kernel files will not be copied
2020-2121-# TODO:
2222-# Remove stuff specific to Gentoo
2323-# Make it easier for the user to modify install behaviour
2424-# Make script more readable
2525-2626-# Exit on error
2727-set -e
2828-2929-# Set default values if environment variables aren't set
3030-: "${AKU_CONFIG_SCRIPT:=$HOME/kernel-config.sh}"
3131-: "${AKU_DIR:=/usr/src/linux}"
3232-: "${AKU_DEST:=/boot/EFI/Gentoo}"
3333-3434-info() { printf '%s\n' "${0##*/}: $*"; }
3535-warn() { printf '%s\n' "${0##*/}: $*" 1>&2; }
3636-erro() { printf '%s\n' "${0##*/}: $*" 1>&2; exit 1; }
3737-3838-# Sanity Checks
3939-[ -x "$AKU_CONFIG_SCRIPT" ] || { erro "$AKU_CONFIG_SCRIPT: doesn't exist or isn't an executable"; }
4040-[ -d "$AKU_DIR" ] || { erro "$AKU_DIR: does not exist"; }
4141-4242-# Check for `portageq`
4343-command -v portageq > /dev/null 2>&1 && AKU_PORTAGEQ=1
4444-4545-# Set MAKEOPTS if not already set
4646-[ "$MAKEOPTS" ] ||
4747- { [ "$AKU_PORTAGEQ" ] && MAKEOPTS="$(portageq envvar MAKEOPTS)" || MAKEOPTS="=j$(nproc)"; }
4848-4949-# If CC is set to clang in portage, enable LLVM, but
5050-# if LLVM is already set, don't change it. (LLVM_IAS is default to on if LLVM is on)
5151-[ "$AKU_PORTAGEQ" = 1 ] &&
5252- case $(portageq envvar CC) in
5353- *clang* )
5454- : "${LLVM=1}"
5555- export LLVM
5656- esac
5757-5858-info "Changing directory ($AKU_DIR)..."
5959-cd "$AKU_DIR"
6060-6161-info Cleaning build directory...
6262-# Clean any residue. Not doing this can sometimes cause errors when rebuilding
6363-# shellcheck disable=SC2086
6464-make ${MAKEOPTS} clean
6565-6666-info Applying default kernel configuration...
6767-# Generate default config
6868-# shellcheck disable=SC2086
6969-make ${MAKEOPTS} defconfig
7070-7171-info "Applying user's kernel configuration ($AKU_CONFIG_SCRIPT)..."
7272-# Run user's kernel configuration script
7373-"$AKU_CONFIG_SCRIPT"
7474-7575-info Validating kernel configuration...
7676-# Validate and fix the .config
7777-# shellcheck disable=SC2086
7878-make ${MAKEOPTS} olddefconfig
7979-8080-info Compiling kernel...
8181-# Compile the kenrel
8282-# shellcheck disable=SC2086
8383-make ${MAKEOPTS}
8484-8585-info Installing kernel modules...
8686-# Install kernel modules
8787-# shellcheck disable=SC2086
8888-make ${MAKEOPTS} modules_install
8989-9090-command -v emerge > /dev/null 2>&1 && {
9191- info Rebuilding kernel module packages...
9292- # Rebuilding kernel module packages
9393- emerge @module-rebuild
9494-}
9595-9696-[ "$AKU_DEST" = "none" ] || {
9797- # Edit this to work for how you want your kernels managed
9898- # I may just run another external script or just the config script with an argument
9999-100100- info "Moving kernel to destination ($AKU_DEST)..."
101101- # Ensure the destination directory exist
102102- mkdir -p "$AKU_DEST"
103103-104104-105105- kernel_version=$(make kernelversion)
106106-107107- update_boot_entries=1
108108- [ -e "$AKU_DEST/bzImage-$kernel_version" ] && update_boot_entries=0
109109-110110- # Copy new kernel to destination
111111- cp "$AKU_DIR/arch/x86/boot/bzImage" "$AKU_DEST/bzImage-$kernel_version"
112112-113113- [ "$update_boot_entries" = 0 ] && exit
114114-115115- command -v efibootmgr > /dev/null 2>&1 && {
116116- efibootmgr -c -d /dev/nvme0n1 -p 1 \
117117- -L "Gentoo GLIBC $kernel_version" -l "/EFI/Gentoo/bzImage-$kernel_version" \
118118- -u 'rootflags=subvolid=552' > /dev/null
119119-120120- efibootmgr -c -d /dev/nvme0n1 -p 1 \
121121- -L "Gentoo MUSL $kernel_version" -l "/EFI/Gentoo/bzImage-$kernel_version" \
122122- -u 'rootflags=subvolid=256' > /dev/null
123123-124124- }
125125-}
···11-#!/bin/sh
22-# Run an application inside another distro
33-44-# Make sure we have a command to execute
55-[ "$*" ] || {
66- printf '%s\n' "Missing command to execute" 1>&2
77- exit 1
88-}
99-1010-# There is no sane default for this
1111-[ "$DWRAP_DISTRO" ] ||
1212- { printf '%s\n' "Missing distro. Set DWRAP_DISTRO" 1>&2; exit 1; }
1313-1414-# Directory where rootfs are stored
1515-: "${DWRAP_ROOTFS_DIR:=/mnt}"
1616-1717-# Directories to use from the host machine
1818-: "${DWRAP_FROM_HOST:=dev home media mnt proc root run sys tmp}"
1919-2020-# Directories to use from the ROOTFS
2121-: "${DWRAP_FROM_ROOTFS:=bin etc lib lib64 opt sbin usr var}"
2222-2323-rootfs="$DWRAP_ROOTFS_DIR/$DWRAP_DISTRO"
2424-2525-# Populate the sandbox with host dirs
2626-for i in $DWRAP_FROM_HOST
2727-do args="${args}--dev-bind /$i /$i "
2828-done
2929-3030-# Populate the sandbox with rootfs dirs
3131-for i in $DWRAP_FROM_ROOTFS
3232-do args="${args}--dev-bind $rootfs/$i /$i "
3333-done
3434-3535-# Set these environment variables so my scripts and such know their environment
3636-args="${args}--setenv DWRAP_CURRENT_DISTRO $DWRAP_DISTRO --setenv DWRAP_WITHIN_SANDBOX true "
3737-3838-# shellcheck disable=SC2086
3939-exec bwrap $args "$@"
-13
home/bin/ffp
···11-#!/bin/sh
22-# Script to launch a specific firefox profile
33-44-# I don't have firefox store data at the root of my homedir
55-HOMEWRAP_HOME="/home/mou/tmp/homes/mozilla"
66-77-profile_location="$HOMEWRAP_HOME/.mozilla"
88-profile="$(grep Name= $profile_location/firefox/profiles.ini | sed 's/Name=//' | sort |
99- bemenu -p 'Pick a profile:')"
1010-1111-[ -z "$profile" ] && exit
1212-1313-exec moulog firefox -P "$profile"
···11-#!/bin/sh
22-# Script to chroot into the glibc chroot (/mnt/glibc64) and launch an application
33-# This script is symlinked to /usr/local/bin to easily be run by root/sudo
44-55-[ "$1" ] || { printf '%s\n' "${0##*/} requires a command to launch"; exit 1; }
66-77-# Check that the chroot is setup and set it up if it isn't
88-ghroot m /mnt/void
99-1010-TERM=xterm-256color
1111-1212-GEXEC_ENV="XDG_RUNTIME_DIR=/run/user/1000 WAYLAND_DISPLAY=wayland-1 XDG_SESSION_TYPE=wayland"
1313-GEXEC_ENV="$GEXEC_ENV DISPLAY=:0"
1414-1515-chroot /mnt/void su -c "$GEXEC_ENV $*" - mou
-104
home/bin/ghroot
···11-#!/bin/sh
22-# Mount what is needed for a chroot
33-44-usage() {
55- printf '%b\n' "usage: ${0##*/} command chroot_directory" \
66- "Commads:" \
77- "\tmount - setup the chroot" \
88- "\tumount - unmount the chroot"
99-}
1010-1111-info() {
1212- printf '%b\n' "${0##*/}: $1" 1>&2
1313-}
1414-1515-ghroot_check() {
1616- # Return 0 if we haven't already setup the chroot
1717- touch /tmp/ghroot
1818- grep -q "$1" /tmp/ghroot && return 1 || return 0
1919-}
2020-2121-ghroot_mount() {
2222- # If an entry in /etc/fstab exist for this location, mount it.
2323- # Otherwise create a rbind mount
2424- mount "$1" || mount -B "$1" "$1"
2525-2626- # Mount what is necessary for the chroot
2727- mount -t proc /proc "$1/proc" || { info "failed to mount /proc to $1/proc"; exit 1; }
2828- # shellcheck disable=SC2015
2929- mount -R /sys "$1/sys" \
3030- && mount --make-rslave "$1/sys" \
3131- || { info "failed to mount /sys to $1/sys"; exit 1; }
3232- # shellcheck disable=SC2015
3333- mount -R /dev "$1/dev" \
3434- && mount --make-rslave "$1/dev" \
3535- || { info "failed to mount /dev to $1/dev"; exit 1; }
3636-3737- # These are some extra stuff we can mount to get things like audio to work from the chroot
3838- mount -R /run "$1/run" || { info "failed to mount /run to $1/run"; exit 1; }
3939- mount -R /tmp "$1/tmp" || { info "failed to mount /tmp to $1/tmp"; exit 1; }
4040-4141- # Mount any home directories
4242- for home in /home/*
4343- do
4444- mkdir -p "$1/$home"
4545- mount -R "$home" "$1/$home" || {
4646- info "failed to mount $home to $1/$home"
4747- exit 1
4848- }
4949- done
5050-5151- # Mount any drives from /etc/fstab
5252- while read -r check_comment mount_point _
5353- do
5454- case $check_comment in \#* ) continue ;; esac
5555- case $mount_point in
5656- # Don't do an automatic mount for the chroot itself. We already did this
5757- $1* ) [ "$mount_point" != "$1" ] && mount "$mount_point" ;;
5858- * ) continue ;;
5959- esac
6060- done < /etc/fstab
6161-6262- printf '%s\n' "$1" >> /tmp/ghroot
6363-}
6464-6565-ghroot_umount() {
6666- # Unmount everything
6767- umount -R "$1/proc" || { info "failed to unmount $1/proc"; }
6868- umount -R "$1/sys" || { info "failed to unmount $1/sys"; }
6969- umount -R "$1/dev" || { info "failed to unmount $1/dev"; }
7070-7171- umount -R "$1/run" || { info "failed to unmount $1/run"; }
7272- umount -R "$1/tmp" || { info "failed to unmount $1/tmp"; }
7373-7474- for home in /home/*
7575- do
7676- umount -R "$1/$home" || { info "failed to unmount $1/$home"; }
7777- done
7878-7979- while read -r check_comment mount_point _
8080- do
8181- case $check_comment in \#* ) continue ;; esac
8282- case $mount_point in
8383- # Don't unmount the chroot itself. We do this later
8484- $1* ) [ "$mount_point" != "$1" ] && umount -R "$mount_point" ;;
8585- * ) continue ;;
8686- esac
8787- done < /etc/fstab
8888-8989- umount -R "$1"
9090-9191- # Deletes the line number the chroot is on
9292- sed "$(grep -n "$1" /tmp/ghroot | sed 's/:.*/d;/' | tr -d '\n' | sed 's/;$//')" \
9393- /tmp/ghroot > /tmp/ghrootn
9494- mv /tmp/ghrootn /tmp/ghroot
9595-}
9696-9797-[ "$2" ] || { info "2 arguments required"; usage; exit 1; }
9898-[ -d "$2" ] || { info "$2: directory does not exist"; exit 1; }
9999-[ "$2" = "/" ] && { info "$2: refusing to operate over /"; exit 1; }
100100-101101-case $1 in
102102- mount|m ) ghroot_check "${2%/}" && ghroot_mount "${2%/}" ;;
103103- umount|u ) ghroot_check "${2%/}" || ghroot_umount "${2%/}" ;;
104104-esac
···11-#!/bin/sh
22-# Create an environment for glibc applications to run (without root permissions)
33-44-# Make sure we have a command to execute
55-[ "$*" ] || {
66- printf '%s\n' "Missing command to execute" 1>&2
77- exit 1
88-}
99-1010-export DWRAP_DISTRO="gentoo-glibc"
1111-1212-export DWRAP_FROM_HOST="dev home media mnt proc root run sys"
1313-export DWRAP_FROM_ROOTFS="bin etc lib lib64 opt sbin tmp usr var"
1414-1515-#case $1 in --rootfs-run|-r)
1616-# shift
1717-#
1818-# export DWRAP_FROM_HOST="dev home proc sys"
1919-# export DWRAP_FROM_ROOTFS="bin etc lib lib64 opt run sbin tmp usr var"
2020-#
2121-# exec dwrap --dev-bind /run/NetworkManager/resolv.conf /resolv.conf "$@"
2222-#;; esac
2323-2424-exec dwrap --ro-bind /etc/resolv.conf /etc/resolv.conf "$@"
-31
home/bin/homewrap
···11-#!/bin/sh
22-# Some applications (namely java apps) get the home directory from /etc/passwd meaning that
33-# we can't easily prevent these apps from writing in the home directory by changing the HOME env
44-# var. Use bubblewrap to bind a random directory to /home/$USER instead.
55-66-# Make sure we have a command to execute
77-[ "$*" ] || {
88- printf '%s\n' "Missing command to execute" 1>&2
99- exit 1
1010-}
1111-1212-# If HOMEWRAP_HOME isn't set, make our own and ensure that it exists
1313-[ "$HOMEWRAP_HOME" ] || HOMEWRAP_HOME="$HOME/tmp/homes/fakehome"
1414-mkdir -p "$HOMEWRAP_HOME"
1515-1616-# Create sandbox with temporary home
1717-args="--dev-bind / / --dev-bind $HOMEWRAP_HOME $HOME "
1818-1919-# Recreate the home directory
2020-for i in "$HOME/"* "$HOME/".*
2121-do
2222- case $i in
2323- "$HOME/." ) continue ;;
2424- "$HOME/.." ) continue ;;
2525- esac
2626- args="${args}--dev-bind $i $i "
2727-done
2828-2929-# shellcheck disable=SC2086
3030-exec bwrap $args "$@"
3131-
-66
home/bin/info-fetch
···11-#!/bin/sh
22-# Print some information about the system. This script was written with gentoo systems in mind.
33-44-# Used Environment Variables
55-# $SHELL
66-# $USER
77-88-# Used Files
99-# /etc/os-release
1010-# /proc/sys/kernel/hostname
1111-# /proc/uptime
1212-# /proc/version
1313-1414-# Get the hostname of the computer
1515-read -r hostname < /proc/sys/kernel/hostname
1616-1717-# Source /etc/os-release if it exist
1818-[ -f /etc/os-release ] && . /etc/os-release
1919-[ "$PRETTY_NAME" ] || PRETTY_NAME="Linux"
2020-2121-# Get the kernel version
2222-read -r _ _ kernel_version _ < /proc/version
2323-2424-# Read uptime
2525-read -r uptime _ < /proc/uptime
2626-2727-# Remove extra percision
2828-up=${uptime%.*}
2929-3030-# Calculate days, hours, minutes and seconds from the given output
3131-days=$((up / 86400))
3232-hours=$(((up % 86400) / 3600))
3333-min=$((((up % 86400) % 3600) / 60))
3434-sec=$((((up % 86400) % 3600) % 60))
3535-3636-# Only display the value if it is not zero
3737-[ $days = 0 ] || dout="${days}d "
3838-[ $hours = 0 ] || hout="${hours}h "
3939-[ $min = 0 ] || mout="${min}m "
4040-[ $sec = 0 ] || sout="${sec}s"
4141-pretty_uptime="$dout$hout$mout$sout"
4242-4343-# Calculate package count (Gentoo)
4444-set -- /var/db/pkg/*/*
4545-pkg_count=$#
4646-4747-# Color Showcase
4848-for i in 0 1 2 3 4 5 6 7
4949-do
5050- normal_colors="$normal_colors\033[4${i}m\033[3${i}m "
5151- bright_colors="$bright_colors\033[10${i}m\033[9${i}m "
5252-done
5353-5454-# Colors and Formatting
5555-color="\033[35;1m"
5656-nocolor="\033[m"
5757-underline="\033[4m"
5858-5959-printf '%b\n' "\n$color$underline$USER$nocolor@$underline$color$hostname$nocolor" \
6060- "${color}os$nocolor $PRETTY_NAME" \
6161- "${color}ke$nocolor $kernel_version" \
6262- "${color}up$nocolor $pretty_uptime" \
6363- "${color}sh$nocolor ${SHELL##*/}" \
6464- "${color}pk$nocolor $pkg_count\n" \
6565- "$normal_colors$nocolor" \
6666- "$bright_colors$nocolor\n"
-160
home/bin/kupdater
···11-#!/bin/sh
22-# This script is made for Gentoo systems running EFISTUB but could be adapted
33-# for other systems
44-55-# Required commands:
66-# cp - copy compiled kernel to destination aswell as making a backup of the current kernel
77-# make - needed for perform clean, olddefconfig, menuconfig and to compile the kernel source
88-# nproc - find amount of cpu threads available if $KUPDATER_MAKEOPTS isn't specified
99-# zcat - copy currently running kernel config for use in new kernel
1010-# you will also need whatever is required to compile the kernel
1111-1212-# Exit the script on error
1313-set -e
1414-1515-# Compile kernel with LLVM toolchain
1616-export LLVM=1 LLVM_IAS=1
1717-1818-# If these variables are not set, set them
1919-[ "$KUPDATER_SRC_DIR" ] || KUPDATER_SRC_DIR=/usr/src/linux
2020-[ "$KUPDATER_MAKEOPTS" ] || KUPDATER_MAKEOPTS="-j$(nproc)"
2121-[ "$KUPDATER_DEST_DIR" ] || KUPDATER_DEST_DIR=/boot/EFI/Gentoo
2222-[ "$KUPDATER_NAME" ] || KUPDATER_NAME=bzImage
2323-2424-# Make sure the required directories are present before continuing
2525-[ -d "$KUPDATER_SRC_DIR" ] || { info f "$KUPDATER_SRC_DIR not found" 1>&2; exit 1; }
2626-[ -d "$KUPDATER_DEST_DIR" ] || { info f "$KUPDATER_DEST_DIR not found" 1>&2; exit 1; }
2727-2828-# Usage statement
2929-usage() {
3030- printf '%s\n' "usage: ${0##*/} [options]" \
3131- "options:" \
3232- " -a - do not move kernel to \$KUPDATER_DEST_DIR" \
3333- " -b - do not make a backup kernel" \
3434- " -c - do not compile the kernel" \
3535- " -e - edit kernel config (menuconfig)" \
3636- " -h - display this message" \
3737- " -l - set LLVM=0 LLVM_IAS=0" \
3838- " -o - do not apply old kernel config" \
3939- " -r - rollback the last update" \
4040- " -s script - configure kernel with a script (disables -o)"
4141-}
4242-4343-# Print status messages to the terminal
4444-info() {
4545- case $1 in
4646- f ) m="!!"; c="\033[31;1m" ;;
4747- i ) m="**"; c="\033[32;1m" ;;
4848- w ) m="??"; c="\033[33;1m" ;;
4949- esac; shift
5050-5151- printf "$c%s\033[m %s\n" "$m" "$*"
5252-}
5353-5454-# Restore the old kernel as the main kernel. This will keep the old kernel as a backup.
5555-kup_restore() {
5656- info i "cp $KUPDATER_DEST_DIR/$KUPDATER_NAME.bak $KUPDATER_DEST_DIR/$KUPDATER_NAME"
5757- cp "$KUPDATER_DEST_DIR/$KUPDATER_NAME.bak" "$KUPDATER_DEST_DIR/$KUPDATER_NAME" || \
5858- { info f "failed to backup kernel" 1>&2; exit 1; }
5959-}
6060-6161-# Preform some setup on the source
6262-kup_setup() {
6363- # Very rarely, compiling the kernel will fail without a clean
6464- info i "make clean"
6565- make clean || { info f "make clean failed" 1>&2; }
6666-6767- # Check for old configuration here
6868- [ -e /proc/config.gz ] || {
6969- info f "/proc/config.gz does not exist." 1>&2
7070- info w "The current kernel was most likely compiled without support for" 1>&2
7171- info w "IKCONFIG and IKCONFIG_PROC. Skipping application of old kernel" 1>&2
7272- info w "config." 1>&2
7373- return 1
7474- }
7575-7676- # Apply old kernel configuration
7777- info i "zcat /proc/config.gz > $KUPDATER_SRC_DIR/.config"
7878- zcat /proc/config.gz > "$KUPDATER_SRC_DIR/.config"
7979-8080- info i "make olddefconfig"
8181- make olddefconfig || { info f "failed to apply old kernel config" 1>&2; exit 1; }
8282-}
8383-8484-# Allow the user to configure the kernel before compilation
8585-kup_configure() {
8686- info i "make menuconfig"
8787- make menuconfig || { info f "configuration failed" 1>&2; exit 1; }
8888-}
8989-9090-# Compile the kernel
9191-kup_compile() {
9292- info i "make $KUPDATER_MAKEOPTS"
9393- # shellcheck disable=SC2086
9494- # This is favorable here
9595- make $KUPDATER_MAKEOPTS || { info f "failed to compile the kernel" 1>&2; exit 1; }
9696-}
9797-9898-# Move current kernel to a backup location
9999-kup_backup() {
100100- info i "cp $KUPDATER_DEST_DIR/$KUPDATER_NAME $KUPDATER_DEST_DIR/$KUPDATER_NAME.bak"
101101- cp "$KUPDATER_DEST_DIR/$KUPDATER_NAME" "$KUPDATER_DEST_DIR/$KUPDATER_NAME.bak" || \
102102- { info f "failed to backup kernel" 1>&2; exit 1; }
103103-}
104104-105105-# Move new kernel to the correct location
106106-kup_apply() {
107107- info i "cp $KUPDATER_SRC_DIR/arch/x86/boot/bzImage" "$KUPDATER_DEST_DIR"
108108- cp "$KUPDATER_SRC_DIR/arch/x86/boot/bzImage" "$KUPDATER_DEST_DIR" || \
109109- { info f "failed to move new kernel" 1>&2; exit 1; }
110110-}
111111-112112-# Handle arguments
113113-while [ "$*" ]
114114-do
115115- # Make sure argument start with '-' and is atleast 2 characters long
116116- case $1 in
117117- - ) shift; continue ;;
118118- -- ) shift; break ;;
119119- -* ) flag=${1#-}; shift ;;
120120- * ) shift; continue ;;
121121- esac
122122-123123- # Split the argument into letters to get options
124124- while [ "$flag" ]
125125- do
126126- arg=${flag%${flag#?}}
127127-128128- case $arg in
129129- a ) kup_skip_apply=true; shift ;;
130130- b ) kup_skip_backup=true; shift ;;
131131- c ) kup_skip_compile=true; shift ;;
132132- e ) kup_edit_cfg=true; shift ;;
133133- h ) usage; exit 0 ;;
134134- s ) kup_cfg_script=$1; shift ;;
135135- l ) export LLVM=0 LLVM_IAS=0; shift ;;
136136- o ) kup_skip_setup=true; shift ;;
137137- r ) kup_rollback=true; shift ;;
138138- * ) printf '%s\n' "${0##*/}: -$arg: is an invalid argument" 1>&2
139139- usage 1>&2; exit 1 ;;
140140- esac
141141-142142- flag=${flag#?}
143143- done
144144-done
145145-146146-147147-# Launch script functions based on options
148148-# If rollback is specified, we shouldn't try to do anything else
149149-[ $kup_rollback ] && { kup_restore; exit 0; }
150150-151151-# Change directories into $KUPDATER_SRC_DIR
152152-info i "cd $KUPDATER_SRC_DIR"
153153-cd "$KUPDATER_SRC_DIR" || { info f "failed to enter directory $KUPDATER_SRC_DIR" 1>&2; exit 1; }
154154-155155-[ $kup_skip_setup ] || kup_setup
156156-[ $kup_edit_cfg ] && kup_configure
157157-[ "$kup_cfg_script" ] && { [ -x "$kup_cfg_script" ] && "$kup_cfg_script" || exit 1; }
158158-[ $kup_skip_compile ] || kup_compile
159159-[ $kup_skip_backup ] || kup_backup
160160-[ $kup_skip_apply ] || kup_apply
-56
home/bin/moulog
···11-#!/bin/sh
22-# A much better way to handle my logging
33-44-#- Settings -#
55-# Place to store log files
66-: "${MOULOG_DIR:=${XDG_CACHE_HOME:-$HOME/.cache}/moulog}"
77-# Max number of old dirs to keep
88-: "${MOULOG_MAX:=5}"
99-1010-usage() {
1111- while read -r line
1212- do printf '%b\n' "$line"
1313- done <<-EOF
1414- ${0##*/} [options] [command]
1515- example: moulog -n
1616- example: moulog wlsunset -l 0 -L 0
1717-1818- options:
1919- -h | --help - display this message
2020- -n | --new - create a new logging directory
2121- - useful if being run multiple times in the background
2222-2323- environment vars:
2424- MOULOG_DIR - place to store logs (default: $XDG_CACHE_HOME/moulog)
2525- MOULOG_MAX - max number of old dirs to keep (default: 5)
2626- EOF
2727-2828- exit "${1:-1}"
2929-}
3030-3131-new_dir() {
3232- touch /tmp/moulog
3333- [ -d "$MOULOG_DIR.$MOULOG_MAX" ] && rm -r "$MOULOG_DIR.$MOULOG_MAX"
3434-3535- i=$((MOULOG_MAX))
3636- until [ $i = 1 ]
3737- do
3838- [ -d "$MOULOG_DIR.$((i-1))" ] && mv "$MOULOG_DIR.$((i-1))" "$MOULOG_DIR.$i"
3939- i=$((i-1))
4040- done
4141-4242- [ -d "$MOULOG_DIR" ] && mv "$MOULOG_DIR" "$MOULOG_DIR.1"
4343- mkdir -p "$MOULOG_DIR"
4444-}
4545-4646-case $1 in
4747- -h|--help ) usage 0 ;;
4848- -n|--new ) new_dir; exit 0 ;;
4949-esac
5050-5151-# I'm using this file to decide if i should make a new directory
5252-[ -f /tmp/moulog ] || new_dir
5353-5454-5555-printf '%s\n' "#### moulog start time: $(date +%s) ####" >> "$MOULOG_DIR/$1.log"
5656-exec "$@" >> "$MOULOG_DIR/$1.log" 2>&1
-9
home/bin/multimc
···11-#!/bin/sh
22-33-# Void Linux is stupid and creates a wrapper script for multimc which puts the
44-# data directory into the home directory. YUCK!
55-if [ "$CURRENT_DISTRO" = void ]
66-then exec /usr/libexec/multimc/multimc "$@"
77-else exec /usr/bin/multimc "$@"
88-fi
99-
-120
home/bin/perfmodes
···11-#!/bin/sh
22-# This script is meant to run as root
33-# Changes intel turbo boost state and thinkpad fan speed
44-# Why? My ThinkPad will sometimes overheat and thermal throttle when compiling or
55-# playing games. Turning off turbo boost is usually enough to fix it but turbo boost
66-# may be useful for some situations
77-88-# Default is to turn on turbo and set fans to auto (this is how your computer should boot)
99-# -t <on|off> to turn on turbo boost (alternatively, 1 or 0 can be used instead of on or off)
1010-# -f <full|auto> to change fan speed
1111-# Anything after `--` will be executed as a command. When that command finishes execution,
1212-# settings will be reverted to their previous or default state. The script will return the exit
1313-# code of the command.
1414-1515-usage() {
1616- while read -r line
1717- do
1818- [ "$1" = 0 ] &&
1919- printf '%b\n' "$line" ||
2020- printf '%b\n' "$line" 1>&2
2121- done <<-USAGE
2222- usage: ${0##*/} [OPTIONS]
2323-2424- options:
2525- \t-f [0-7|auto|disengaged|full] - determine the fan speed
2626- \t-t [on|off] - determine the state of turbo boost
2727- \t-r - revert to state before change
2828- USAGE
2929-3030- exit "$1"
3131-}
3232-3333-while [ "$*" ]
3434-do
3535- case $1 in
3636- - ) shift; continue ;;
3737- -- ) shift; break ;;
3838- -* ) flag=${1#-}; shift ;;
3939- * ) shift; continue ;;
4040- esac
4141-4242- while [ "$flag" ]
4343- do
4444- arg=${flag%"${flag#?}"}
4545-4646- case $arg in
4747- f ) fans=$1 ;;
4848- t ) turbo=$1 ;;
4949- r ) revert=yes ;;
5050- h ) usage 0 ;;
5151- * ) printf '%s\n' "${0##*/}: -$arg: invalid argument"; usage 1 ;;
5252- esac
5353-5454- flag=${flag#?}
5555- done
5656-done
5757-5858-[ "$revert" = yes ] && {
5959- read -r current_turbo < /sys/devices/system/cpu/intel_pstate/no_turbo
6060- [ "$current_turbo" ] || current_turbo=1
6161-6262- while read -r line
6363- do
6464- case $line in
6565- "level: 0" ) current_fan="0"; break ;;
6666- "level: 1" ) current_fan="1"; break ;;
6767- "level: 2" ) current_fan="2"; break ;;
6868- "level: 3" ) current_fan="3"; break ;;
6969- "level: 4" ) current_fan="4"; break ;;
7070- "level: 5" ) current_fan="5"; break ;;
7171- "level: 6" ) current_fan="6"; break ;;
7272- "level: 7" ) current_fan="7"; break ;;
7373- "level: auto" ) current_fan="auto"; break ;;
7474- "level: full-speed" ) current_fan="full-speed"; break ;;
7575- "level: disengaged" ) current_fan="full-speed"; break ;; # This is the reported level
7676- # when I set fan speed to
7777- # full-speed
7878- esac
7979- done < /proc/acpi/ibm/fan
8080- [ "$current_fan" ] || current_fan="auto"
8181-}
8282-8383-case $turbo in
8484- off|1 ) printf '%s' "1" > /sys/devices/system/cpu/intel_pstate/no_turbo ;;
8585- on|0 ) printf '%s' "0" > /sys/devices/system/cpu/intel_pstate/no_turbo ;;
8686- "" ) printf '%s' "0" > /sys/devices/system/cpu/intel_pstate/no_turbo ;;
8787- * ) printf '%s\n' "${0##*/}: $turbo: invalid option for turbo boost. Skipping..." 1>&2 ;;
8888-esac
8989-9090-case $fans in
9191- 0 ) printf '%s' "level 0" > /proc/acpi/ibm/fan ;;
9292- 1 ) printf '%s' "level 1" > /proc/acpi/ibm/fan ;;
9393- 2 ) printf '%s' "level 2" > /proc/acpi/ibm/fan ;;
9494- 3 ) printf '%s' "level 3" > /proc/acpi/ibm/fan ;;
9595- 4 ) printf '%s' "level 4" > /proc/acpi/ibm/fan ;;
9696- 5 ) printf '%s' "level 5" > /proc/acpi/ibm/fan ;;
9797- 6 ) printf '%s' "level 6" > /proc/acpi/ibm/fan ;;
9898- 7 ) printf '%s' "level 7" > /proc/acpi/ibm/fan ;;
9999- auto ) printf '%s' "level auto" > /proc/acpi/ibm/fan ;;
100100- disengaged ) printf '%s' "level disengaged" > /proc/acpi/ibm/fan ;;
101101- full ) printf '%s' "level full-speed" > /proc/acpi/ibm/fan ;;
102102- "" ) printf '%s' "level auto" > /proc/acpi/ibm/fan ;;
103103- * ) printf '%s\n' "${0##*/}: $fans: invalid option for fan speed. Skipping..." 1>&2 ;;
104104-esac
105105-106106-[ "$*" ] && {
107107- "$@"
108108- exitcode=$?
109109-110110- if [ "$revert" = yes ]
111111- then
112112- printf '%s' "$current_turbo" > /sys/devices/system/cpu/intel_pstate/no_turbo
113113- printf '%s' "level $current_fan" > /proc/acpi/ibm/fan
114114- else
115115- printf '%s' "0" > /sys/devices/system/cpu/intel_pstate/no_turbo
116116- printf '%s' "level auto" > /proc/acpi/ibm/fan
117117- fi
118118-119119- exit $exitcode
120120-}
···11-#!/bin/sh
22-# Script to start pipewire with extra sinks and sources
33-44-# Gentoo has their own pipewire launch script
55-gentoo-pipewire-launcher &
66-77-## Do this if pipewire is not already running
88-#pgrep -x 'pipewire' || {
99-# # Start pipewire in the background and wait a second
1010-# pipewire &
1111-#
1212-# # Void Linux does not enable pipewire-pulse by default
1313-# [ "$CURRENT_DISTRO" = void ] && pipewire-pulse &
1414-# sleep 1
1515-#
1616-# [ "$1" = normal ] || {
1717-# ## Create a null sink to easily run all audio through an equalizer
1818-# #pactl load-module module-null-sink object.linger=1 media.class=Audio/Sink \
1919-# # sink_name=PreEqualizer
2020-# #pactl set-default-sink PreEqualizer
2121-#
2222-# # Create a null sink to easily noise suppress microphone output
2323-# pactl load-module module-null-sink object.linger=1 \
2424-# media.class=Audio/Source/Virtual sink_name=PostNoiseSuppression channels=1
2525-# pactl set-default-source PostNoiseSuppression
2626-# }
2727-#}
···11-#AR="zigar"
22-#CC="zigcc"
33-#CXX="zigcxx"
44-AR="llvm-ar"
55-CC="clang"
66-CXX="clang++"
77-88-GOMODCACHE="$XDG_CACHE_HOME/go/pkg/mod"
99-GOPATH="$XDG_DATA_HOME/go"
1010-1111-#PATH="$GOPATH/bin:$HOME/bin/zigc:$PATH"
1212-PATH="$GOPATH/bin:$PATH"
1313-1414-export AR CC CXX GOMODCACHE GOPATH PATH
home/cfg/loksh/env.d/rust.env
This is a binary file and will not be displayed.
-18
home/cfg/loksh/env.d/zigc.env
···11-AR="zigar"
22-CC="zigcc"
33-#CPP="clang-cpp"
44-CXX="zigcxx"
55-#LD="ld.lld"
66-#STRINGS="llvm-strings"
77-#STRIP="llvm-strip"
88-#NM="llvm-nm"
99-#RANLIB="llvm-ranlib"
1010-#READELF="llvm-readelf"
1111-#OBJCOPY="llvm-objcopy"
1212-#OBJDUMP="llvm-objdump"
1313-1414-PATH="$HOME/bin/zigc:$PATH"
1515-1616-#export AR CC CPP CXX LD STRINGS STRIP NM RANLIB READELF OBJCOPY OBJDUMP CFLAGS CXXFLAGS
1717-export AR CC CXX PATH
1818-
-43
home/cfg/loksh/profile
···11-#!/bin/sh
22-33-# Place this file in /etc/profile.d
44-[ "$(id -u)" = "1000" ] || return 0
55-66-# Only continue if we are in ksh (i use loksh)
77-[ "$KSH_VERSION" ] || return 0
88-99-# Set XDG variables
1010-XDG_CACHE_HOME="$HOME/tmp/cache"
1111-XDG_CONFIG_HOME="$HOME/cfg"
1212-XDG_DATA_HOME="$HOME/data"
1313-1414-# KSH specific variables
1515-ENV="$XDG_CONFIG_HOME/loksh/rc"
1616-HISTCONTROL="ignoredups:ignorespace"
1717-HISTFILE="$XDG_CACHE_HOME/loksh_history"
1818-1919-# Prevent $HOME pollution
2020-GNUPGHOME="$XDG_DATA_HOME/gnupg"
2121-GRIPHOME="$XDG_CONFIG_HOME/grip"
2222-LESSHISTFILE="$XDG_CACHE_HOME/less_history"
2323-PASSWORD_STORE_DIR="$HOME/doc/.pws"
2424-XAUTHORITY="$XDG_CACHE_HOME/.Xauthority"
2525-2626-# Set default commands
2727-EDITOR="kak"
2828-PAGER="less"
2929-VISUAL="kak"
3030-3131-# Add local bin dirs to path
3232-PATH="$HOME/bin:$HOME/opt/bin:$PATH"
3333-3434-# Export all the variables
3535-export CURRENT_DISTRO \
3636- EDITOR ENV \
3737- GNUPGHOME GRIPHOME \
3838- HISTCONTROL HISTFILE HISTSIZE \
3939- LESSHISTFILE \
4040- PAGER PASSWORD_STORE_DIR PATH \
4141- VISUAL \
4242- WITHIN_KNOWN_CHROOT \
4343- XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME
+4-3
home/cfg/loksh/rc
data/configs/loksh/rc
···1818 PS1="\[\033[1;31m\]\u\[\033[32m\]@\[\033[33m\]\h \[\033[34m\]\W\[\033[m\] "
1919 PS2="\[\033[1;36m\]>\[\033[m\] "
2020} || {
2121- case $(. "$(<"$HOME/tmp/cache/thm/current_thm")"; printf '%s' "$theme_type") in
2121+ # Try and get OSC-133;A working
2222+ case $(. "$(<"${XDG_CACHE_HOME:-$HOME/.cache}/thm/current_thm")"; printf '%s' "$theme_type") in
2223 dark ) PS1="\[\033[1;91m\]\u\[\033[92m\]@\[\033[93m\]\h \[\033[94m\]\W\[\033[m\] "
2324 PS2="\[\033[1;96m\]>\[\033[m\] " ;;
2425 * ) PS1="\[\033[1;31m\]\u\[\033[32m\]@\[\033[33m\]\h \[\033[34m\]\W\[\033[m\] "
···3132[ "$DWRAP_WITHIN_SANDBOX" = "true" ] && PS1="($DWRAP_CURRENT_DISTRO) $PS1"
32333334# Source completions
3434-. "$XDG_CONFIG_HOME/loksh/completions"
3535+. "${XDG_CONFIG_HOME:-$HOME/.config}/loksh/completions"
35363637# Source aliases
3737-. "$XDG_CONFIG_HOME/loksh/alias"
3838+. "${XDG_CONFIG_HOME:-$HOME/.config}/loksh/alias"
home/cfg/mpv/mpv.conf
data/configs/mpv/mpv.conf
+5-5
home/cfg/scr/config.sh
data/configs/scr/config.sh
···3344## general ##
55# defines were screenshots and recordings will be stored
66-scr_basedir="${HOME}/tmp/scr"
77-scr_pic_dir="${scr_basedir}/pic"
88-scr_rec_dir="${scr_basedir}/rec"
99-scr_aud_dir="${scr_basedir}/aud"
66+# scr_basedir="${HOME}/tmp/scr"
77+scr_pic_dir="${HOME}/pics/scr"
88+scr_rec_dir="${HOME}/vids/scr"
99+scr_aud_dir="${HOME}/aud/scr"
10101111## aud settings ##
1212# Audio devices to use for recording audio.
1313# These devices canbe found by executing `pactl list sinks | grep "Monitor Source"`
1414# for the sink and by executing `pactl list sources | grep Name:` for the source.
1515-aud_sink="$(pactl info | grep Default\ Sink)"
1515+aud_sink="$(pactl info | grep Default\ Sink)" # Is there a pipewire specific tool for this?
1616aud_sink="${aud_sink#Default\ Sink: }.monitor"
1717aud_source="$(pactl info | grep Default\ Source)"
1818aud_source="${aud_source#Default\ Source: }"
-235
home/cfg/sway/config
···11-# Include extra system config #
22-include /etc/sway/config.d/*
33-44-# Appearance #
55-include ${XDG_CACHE_HOME}/thm/sway-appearance
66-77-# Input #
88-input 1133:50503:Logitech_USB_Receiver {
99- accel_profile flat
1010- pointer_accel -0.92
1111-}
1212-1313-input 12136:130:Hoksi_Technology_DURGOD_Taurus_K320 {
1414- xkb_options compose:caps
1515- repeat_delay 300
1616- repeat_rate 50
1717-}
1818-1919-input 1386:782:Wacom_Intuos_S_Pen {
2020- map_to_output "BenQ Corporation BenQ PD2700U ET87K04288SL0"
2121-}
2222-2323-## Seats #
2424-#seat seat0 {
2525-# hide_cursor 8000
2626-# #xcursor_theme clicc
2727-#}
2828-2929-## Bar
3030-#bar swaybar_command waybar
3131-3232-exec wl-post
3333-exec_always pkill kanshi; exec kanshi
3434-3535-# Options #
3636-floating_maximum_size -1 x -1
3737-focus_follows_mouse yes
3838-focus_on_window_activation urgent
3939-focus_wrapping workspace
4040-hide_edge_borders --i3 smart
4141-show_marks yes
4242-tiling_drag disable
4343-4444-# Workspaces #
4545-# Variables
4646-set {
4747- $ws0 0
4848- $ws1 1
4949- $ws2 2
5050- $ws3 3
5151- $ws4 4
5252- $ws5 5
5353- $ws6 6
5454- $ws7 7
5555- $ws8 8
5656- $ws9 9
5757-}
5858-5959-# Options
6060-workspace_layout tabbed
6161-6262-## Assign workspaces to Displays
6363-#workspace {
6464-# $ws0 output DP-1
6565-# $ws1 output DP-2
6666-# $ws2 output DP-1
6767-# $ws3 output DP-2
6868-# $ws4 output DP-1
6969-# $ws5 output DP-2
7070-# $ws6 output DP-1
7171-# $ws7 output DP-2
7272-# $ws8 output DP-1
7373-# $ws9 output DP-2
7474-#}
7575-7676-# Keybinds #
7777-# Variables
7878-set {
7979- $W Mod4
8080- $A Mod1
8181- $C Control
8282- $S Shift
8383- $term foot
8484- $menu bemenu-run
8585- $file_manager pcmanfm
8686-}
8787-8888-# Binds
8989-bindsym {
9090- $W+Return exec $term
9191- $W+r exec $menu
9292- $A+F12 exec powermenu
9393- $W+$A+f exec $file_manager
9494- $W+$C+f exec ffp
9595-9696- #XF86AudioPlay exec playerctl play-pause
9797- XF86AudioPlay exec playerctl play
9898- XF86AudioPause exec playerctl pause
9999- XF86AudioStop exec playerctl stop
100100- XF86AudioPrev exec playerctl previous
101101- XF86AudioNext exec playerctl next
102102-103103- $W+e exec pactl set-source-mute @DEFAULT_SOURCE@ toggle
104104- XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle
105105- XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +2%
106106- XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -2%
107107-108108- # Brightness control
109109-110110- Print exec scr pic -c
111111- $W+Print exec scr pic -cd
112112-113113- $W+c exec colorgrab -co
114114- $W+$A+c exec colorgrab -cn
115115- $W+$C+c exec colorgrab -cor
116116- $W+$C+$A+c exec colorgrab -cnr
117117-118118- $W+space exec makoctl dismiss -a
119119-120120- $W+z focus next sibling
121121- $W+$A+z focus prev sibling
122122- $W+$C+z focus mode_toggle
123123-124124- $W+x move workspace to right
125125- $W+$A+x move workspace to left
126126-127127- $W+Left focus left
128128- $W+Down focus down
129129- $W+Up focus up
130130- $W+Right focus right
131131-132132- $W+1 workspace $ws0
133133- $W+2 workspace $ws1
134134- $W+3 workspace $ws2
135135- $W+4 workspace $ws3
136136- $W+5 workspace $ws4
137137- $W+6 workspace $ws5
138138- $W+7 workspace $ws6
139139- $W+8 workspace $ws7
140140- $W+9 workspace $ws8
141141- $W+0 workspace $ws9
142142-143143- $W+$S+1 move container to workspace $ws0
144144- $W+$S+2 move container to workspace $ws1
145145- $W+$S+3 move container to workspace $ws2
146146- $W+$S+4 move container to workspace $ws3
147147- $W+$S+5 move container to workspace $ws4
148148- $W+$S+6 move container to workspace $ws5
149149- $W+$S+7 move container to workspace $ws6
150150- $W+$S+8 move container to workspace $ws7
151151- $W+$S+9 move container to workspace $ws8
152152- $W+$S+0 move container to workspace $ws9
153153-154154- $W+$C+Escape exit
155155- $W+$A+Escape reload
156156- $W+q kill
157157-158158- $W+$S+s floating enable
159159- $W+$S+t floating disable
160160- $W+$S+f fullscreen toggle
161161- $W+l layout toggle split tabbed
162162- $W+o layout toggle split
163163- $W+p splitt
164164-165165- $W+d exec swaymsg seat seat0 hide_cursor 0
166166- $W+$A+d exec swaymsg seat seat0 hide_cursor 8000
167167-168168- $W+v border normal 2
169169- $W+b border pixel 2
170170- $W+n border none
171171-}
172172-173173-# Bindswitches
174174-bindswitch --locked lid:on output eDP-1 disable
175175-bindswitch --locked lid:off output eDP-1 enable
176176-177177-floating_modifier $W normal
178178-179179-# Window Rules #
180180-for_window {
181181- # Make all windows float by default
182182- # According to `swaymsg -m "['window']" -t subscribe`, windows get their title after
183183- # they get created. However, app_id, class and instace are all set when the window is
184184- # created.
185185- [app_id="."] floating enable
186186- [class="."] floating enable
187187- [instance="."] floating enable
188188-189189- # Make the title of each window bold
190190- [title="."] title_format "<b>%title</b>"
191191-192192- [app_id="mpv"] border none
193193-194194- ## Set Alacritty's size. Doing this through Alacritty's config causes the window contents
195195- ## to spill outside of the border when using multiple scaling factors and spawning
196196- ## the terminal on one lower than the highest. Sets the terminal to 120x36.
197197- #[app_id="Alacritty"] resize set width 976 px, resize set height 654 px
198198-199199- ## These apps should take up the entire screen and not have a border
200200- #[app_id="firefox-wayland" title=".*- Mozilla Firefox$"] floating disable, border none
201201- #[app_id="firefox-wayland" title="^Mozilla Firefox$"] floating disable, border none
202202- #[class="Element"] floating disable, border none
203203- #[class="discord"] floating disable, border none
204204-205205- #[class="csgo_linux64"] fullscreen enable
206206-}
207207-208208-## Move Windows when they launch
209209-#for_window {
210210-# # Web Browsers should be on the first workspace
211211-# [app_id="firefox-wayland"] move container to workspace 0
212212-213213-# # Chat Applications should be on the second workspace
214214-# [class="Element"] move container to workspace 1
215215-# [class="discord"] move container to workspace 1
216216-217217-# # Graphic Applications should be on the third workspace
218218-# [app_id="org.inkscape.Inkscape"] move container to workspace 2
219219-# [class="Gimp"] move container to workspace 2
220220-# [class="krita"] move container to workspace 2
221221-222222-# # Games and Game Launchers should be on the eighth workspace
223223-# [app_id="org.multimc.multimc"] move container to workspace 7
224224-# [class="Steam"] move container to workspace 7
225225-#
226226-# [class="csgo_linux64"] move container to workspace 7
227227-# [class="Minecraft.*"] move container to workspace 7
228228-229229-# # Rocket League
230230-# [class="steam_app_252950"] move container to workspace 7
231231-# # Deceit
232232-# [class="steam_app_466240"] move container to workspace 7
233233-# # TitanFall 2
234234-# [class="steam_app_1237970"] move container to workspace 7
235235-#}
···11-# This file is written by xdg-user-dirs-update
22-# If you want to change or add directories, just edit the line you're
33-# interested in. All local changes will be retained on the next run
44-# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
55-# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
66-# absolute path. No other format is supported.
77-#
88-XDG_DESKTOP_DIR="$HOME/tmp"
99-XDG_DOWNLOAD_DIR="$HOME/tmp"
1010-XDG_TEMPLATES_DIR="$HOME/tmp"
1111-XDG_PUBLICSHARE_DIR="$HOME/tmp"
1212-XDG_DOCUMENTS_DIR="$HOME/doc"
1313-XDG_MUSIC_DIR="$HOME/media/audio/music/unsorted"
1414-XDG_PICTURES_DIR="$HOME/media/images/unsorted"
1515-XDG_VIDEOS_DIR="$HOME/media/videos/unsorted"