From 1d214b23f3366b4ac976bf482aabeea822530f2f Mon Sep 17 00:00:00 2001 From: user Date: Tue, 15 Jul 2025 21:10:37 -0400 Subject: [PATCH] initial commit --- .config/sx/sxrc | 18 ++++++++++++ .config/sx/xresources | 35 +++++++++++++++++++++++ .config/yash/aliasrc | 42 ++++++++++++++++++++++++++++ .config/yash/profile | 38 +++++++++++++++++++++++++ .config/yash/rc | 59 +++++++++++++++++++++++++++++++++++++++ .config/zathura/zathurarc | 1 + .local/bin/screenshare | 21 ++++++++++++++ 7 files changed, 214 insertions(+) create mode 100755 .config/sx/sxrc create mode 100644 .config/sx/xresources create mode 100644 .config/yash/aliasrc create mode 100644 .config/yash/profile create mode 100644 .config/yash/rc create mode 100644 .config/zathura/zathurarc create mode 100755 .local/bin/screenshare diff --git a/.config/sx/sxrc b/.config/sx/sxrc new file mode 100755 index 0000000..e8530b2 --- /dev/null +++ b/.config/sx/sxrc @@ -0,0 +1,18 @@ +#!/bin/sh + +# configure monitors +xrandr --output DisplayPort-1 --mode 1920x1080 --rate 144 --primary --left-of HDMI-A-0 --output HDMI-A-0 --mode 1920x1080 --rate 60 +# increase key repeat rate +xset r rate 300 50 +# set the wallpaper +xwallpaper --zoom ~/.local/share/bg.jpg +# load xresources +xrdb ~/.config/sx/xresources & +xrdbpid=$! + +export _JAVA_AWT_WM_NONREPARENTING=1 # Fix for Java applications in dwm + +# Ensure that xrdb has finished running before moving on to start the WM/DE. +[ -n "$xrdbpid" ] && wait "$xrdbpid" + +dbus-launch --exit-with-session dwm diff --git a/.config/sx/xresources b/.config/sx/xresources new file mode 100644 index 0000000..d83f5c0 --- /dev/null +++ b/.config/sx/xresources @@ -0,0 +1,35 @@ +!! Transparency (0-1) +*.alpha: 0.7 + +/* name dark light */ +/* black 0 8 */ +/* red 1 9 */ +/* green 2 10 */ +/* yellow 3 11 */ +/* blue 4 12 */ +/* purple 5 13 */ +/* cyan 6 14 */ +/* white 7 15 */ + +*.foreground: #c8ccd4 +*.background: #1e222a +*.cursorColor: #c8ccd4 +*.color0: #1e222a +*.color1: #e06c75 +*.color2: #98c379 +*.color3: #e5c07b +*.color4: #61afef +*.color5: #c678dd +*.color6: #56b6c2 +*.color7: #abb2bf +*.color8: #545862 +*.color9: #e06c75 +*.color10: #98c379 +*.color11: #e5c07b +*.color12: #61afef +*.color13: #c678dd +*.color14: #56b6c2 +*.color15: #c8ccd4 + +*.font: mono:size=14 +*.blinktimeout: 600 diff --git a/.config/yash/aliasrc b/.config/yash/aliasrc new file mode 100644 index 0000000..6e2d6e2 --- /dev/null +++ b/.config/yash/aliasrc @@ -0,0 +1,42 @@ +#!/bin/sh + +# Use neovim for vim if present. +[ -x "$(command -v nvim)" ] && alias vim="nvim" vimdiff="nvim -d" + +# some useful shortcuts +alias -- -='cd -' +alias la='ls -a' ll='ls -l' lla='ll -a' +alias h='fc -l' +alias j='jobs' +alias r='fc -s' + +# Verbosity and interactive actions +alias \ + cp="cp -iv" \ + mv="mv -iv" \ + rm="rm -vI" \ + bc="bc -ql" \ + mkdir="mkdir -pv" \ + ffmpeg="ffmpeg -hide_banner" + +# Colorize commands when possible. +alias \ + ls="ls -hN --color=auto --group-directories-first" \ + grep="grep --color=auto" \ + diff="diff --color=auto" \ + ip="ip -color=auto" + +# Shorthands +alias \ + sudo="doas" \ + ka="killall" \ + g="git" \ + sdn="shutdown -h now" \ + e="$EDITOR" \ + o="xdg-open" \ + se="sudo $EDITOR" \ + ei="sudo emerge --ask" \ + er="sudo emerge -cv" \ + es="sudo emerge -q n -s" \ + eu="sudo emerge -avuDN @world" \ + z="zathura" diff --git a/.config/yash/profile b/.config/yash/profile new file mode 100644 index 0000000..9f35bc2 --- /dev/null +++ b/.config/yash/profile @@ -0,0 +1,38 @@ +#!/bin/bash + +# Adds `~/.local/bin` to $PATH +export PATH="$PATH:$(find ~/.local/bin -type d -printf %p:)" + +# Default programs: +export EDITOR="nvim" +export TERMINAL="st" +export BROWSER="chromium" + +# ~/ Clean-up: +export XDG_CONFIG_HOME="$HOME/.config" +export XDG_DATA_HOME="$HOME/.local/share" +export XDG_CACHE_HOME="$HOME/.cache" +export GTK2_RC_FILES="$XDG_CONFIG_HOME/gtk-2.0/gtkrc" +export ZDOTDIR="$XDG_CONFIG_HOME/zsh" +# export GNUPGHOME="$XDG_DATA_HOME/gnupg" +export XINITRC="$XDG_CONFIG_HOME/x11/xinitrc" +# export XAUTHORITY="$XDG_RUNTIME_DIR/Xauthority" # This line will break some DMs. +export WINEPREFIX="$XDG_DATA_HOME/wineprefixes/default" +export GOPATH="$XDG_DATA_HOME/go" +export HISTFILE="$XDG_DATA_HOME/history" +export _JAVA_AWT_WM_NONREPARENTING=1 # Fix for Java applications in dwm + +# Wayland +# export MOZ_ENABLE_WAYLAND=1 +# export SDL_VIDEODRIVEVER=wayland +# export ELECTRON_OZONE_PLATFORM_HINT=auto +# export QT_QPA_PLATFORM=wayland-egl +# export GDK_BACKEND=wayland,x11 + +# Other program settings: +export QT_QPA_PLATFORMTHEME="gtk2" # Have QT use gtk2 theme. +eval "$(ssh-agent -s)" >~/.ssh/agent.env +export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) + +# Start graphical server on user's current tty if not already running. +[ "$(tty)" = "/dev/tty1" ] && ! pidof -s Xorg >/dev/null 2>&1 && exec sx diff --git a/.config/yash/rc b/.config/yash/rc new file mode 100644 index 0000000..8207793 --- /dev/null +++ b/.config/yash/rc @@ -0,0 +1,59 @@ +# enable bash-like extended expansion +set --brace-expand + +# enable completion of hidden files +set --dot-glob + +# enable recursive pathname expansion +set --extended-glob + +# don't implicitly expand non-existent variables to empty strings +set --no-unset + +# don't save commands starting with a space in history +set --hist-space + +# emacs bindings +set --emacs + +# Load aliases +[ -f "$HOME/.config/yash/aliasrc" ] && . "$HOME/.config/yash/aliasrc" + +# define some basic variables if missing +SHELL=$(command -v yash) +: ${PAGER:=less} ${EDITOR:=nvim} +: ${LOGNAME:=$(logname)} ${HOSTNAME:=$(uname -n)} + +# variables needed for command history +if ! [ "${HISTFILE-}" ]; then + HISTFILE=$HOME/.local/state/yash/history +fi + +# create HISTFILE parent directory if missing +! [ -d "${HISTFILE%/*}" ] && mkdir -p "${HISTFILE%/*}" + +HISTSIZE=5000 + +# initialize event handlers +COMMAND_NOT_FOUND_HANDLER=() +PROMPT_COMMAND=() +POST_PROMPT_COMMAND=() +YASH_AFTER_CD=() + +YASH_PS1='\fg.$(whoami)\fc. ${PWD/#$HOME/\~} \fD.\$ ' + +# when a directory name is entered as a command, treat as "cd" +_autocd() +if [ -d "$1" ]; then + HANDLED=true + cd -- "$@" + break -i +fi +COMMAND_NOT_FOUND_HANDLER=("$COMMAND_NOT_FOUND_HANDLER" '_autocd "$@"') + +# print file type when executing non-executable files +_file_type() +if [ -e "$1" ] && ! [ -d "$1" ]; then + file -- "$1" +fi +COMMAND_NOT_FOUND_HANDLER=("$COMMAND_NOT_FOUND_HANDLER" '_file_type "$@"') diff --git a/.config/zathura/zathurarc b/.config/zathura/zathurarc new file mode 100644 index 0000000..ea10740 --- /dev/null +++ b/.config/zathura/zathurarc @@ -0,0 +1 @@ +set selection-clipboard clipboard diff --git a/.local/bin/screenshare b/.local/bin/screenshare new file mode 100755 index 0000000..1f71082 --- /dev/null +++ b/.local/bin/screenshare @@ -0,0 +1,21 @@ +#!/bin/bash + +if ! lsmod | grep -q v4l2loopback; then + echo "Loading v4l2loopback kernel module..." + sudo modprobe v4l2loopback devices=1 video_nr=10 card_label="Virtual Video Feed" exclusive_caps=1 +else + echo "v4l2loopback is already loaded." +fi + +if [ ! -e /dev/video10 ]; then + echo "/dev/video10 not found. Ensure the module loaded correctly." + exit 1 +fi + +echo "Setting permissions for /dev/video10..." +sudo chmod 666 /dev/video10 + +echo "Starting FFmpeg..." +ffmpeg -f x11grab -video_size 1920x1080 -framerate 60 -i :0.0+0,0 \ + -vf "scale=1280:720,format=yuv420p" \ + -f v4l2 /dev/video10