From 512bd034c44186a69cd34474fd139b7df1ec77a6 Mon Sep 17 00:00:00 2001 From: david Date: Fri, 16 Jan 2026 02:39:39 -0600 Subject: [PATCH] Add initial xlibre/X11 configs and installs, add misc install programs --- copy_dotfiles.sh | 25 ++++++-- ...x11-xrandr-adding-new-resolutions-modes.md | 18 ++++++ docs/todo.md | 6 +- .../custom_openssh_linux_debian | 4 ++ installs_and_builds/custom_xlibre_default | 17 +++++ .../custom_xlibre_macos_default | 3 + installs_and_builds/programs_base.txt | 7 +++ make_dirs.sh | 3 +- src_files/.config/X11/xinit/.xinitrc | 38 +++++++++++ .../.config/nvim/lua/plugins_lazy/dap.lua | 10 +-- src_files/.config/zsh/.zshrc | 2 +- src_files/.local/scripts/display-manage | 63 +++++++++++++++++++ src_files/etc/47-elogind.conf | 2 + src_files/shell/rc | 2 + 14 files changed, 188 insertions(+), 12 deletions(-) create mode 100644 docs/installation-reference/x11-xrandr-adding-new-resolutions-modes.md create mode 100755 installs_and_builds/custom_openssh_linux_debian create mode 100755 installs_and_builds/custom_xlibre_default create mode 100755 installs_and_builds/custom_xlibre_macos_default create mode 100644 src_files/.config/X11/xinit/.xinitrc create mode 100755 src_files/.local/scripts/display-manage create mode 100644 src_files/etc/47-elogind.conf diff --git a/copy_dotfiles.sh b/copy_dotfiles.sh index 1eb5119..783e109 100755 --- a/copy_dotfiles.sh +++ b/copy_dotfiles.sh @@ -8,8 +8,12 @@ copy_file() { from=$1 to=$2 filename=$(basename "$from") - [ -e "$to/$filename" ] && rm "$to/$filename" - echo_and_execute cp -RPp "$from" "$to/$filename" + [ "$3" = "--sudo" ] && + echo_and_execute sudo cp -RPp "$from" "$to/$filename" || + { + [ -e "$to/$filename" ] && rm "$to/$filename" + echo_and_execute cp -RPp "$from" "$to/$filename" + } } copy_dir() { @@ -42,6 +46,8 @@ copy_file src_files/shell/.profile $HOME copy_file src_files/shell/profile $XDG_CONFIG_HOME copy_file src_files/shell/rc $XDG_CONFIG_HOME copy_file src_files/.config/zsh/.zshenv $HOME +# TODO: move this into xdg type dir if possible +copy_file src_files/.config/X11/xinit/.xinitrc $HOME # copy over configs, executables, and scripts copy_dir src_files/.config $XDG_CONFIG_HOME @@ -58,8 +64,19 @@ IFS=","; for obs_dir in $OBSIDIAN_WORKSPACES_TO_CONFIGURE; do done # TODO: get reaper config set up -# [[ "$OSTYPE" = *"darwin"* ]] && -# sym_link "$XDG_CONFIG_HOME/REAPER" "$HOME/Library/Application Support/REAPER" +# case "$OSTYPE" in +# (*darwin*) +# sym_link "$XDG_CONFIG_HOME/REAPER" "$HOME/Library/Application Support/REAPER" +# ;; +# esac + +# copy settings/configs to /etc locations +case "$OSTYPE" in + (*darwin*) + ;; + (*) copy_file src_files/etc/47-elogind.conf /etc/elogind/logind.conf.d --sudo + ;; +esac # set up themes and theme-switcher ! [ "$1" = "--skip-theme-config" ] && ./theme_config.sh diff --git a/docs/installation-reference/x11-xrandr-adding-new-resolutions-modes.md b/docs/installation-reference/x11-xrandr-adding-new-resolutions-modes.md new file mode 100644 index 0000000..3b5dbf2 --- /dev/null +++ b/docs/installation-reference/x11-xrandr-adding-new-resolutions-modes.md @@ -0,0 +1,18 @@ +# xlibre/x11 - adding xrandr modes + +## 2026-01-16, artix linux, framework 13in laptop + +### to add 1920x1280 resolution option: + +```sh +dispmanage_modeline=$(cvt 1920 1280 60 | sed -n '2p' | sed -E "s/^Modeline //g") +dispmanage_mode_id=$(printf "%s" "$dispmanage_modeline" | sed -E "s/^([^ ]+)\s.*$/\1/g") +printf "%s" "$modeline" | xargs xrandr --newmode +printf "%s" "$mode_id" | xargs xrandr --addmode eDP +# NOTE: the lines above have been added to .xinitrc, just leaving here for reference + +# then, add the $mode_id value to my display-manage script as the target mode: +DISPMANAGE_LAPTOP_MODE='"1920x1280_60.00"' +``` + + diff --git a/docs/todo.md b/docs/todo.md index d5ff64c..8f72e1f 100644 --- a/docs/todo.md +++ b/docs/todo.md @@ -6,15 +6,19 @@ - add dmenu - add st - xresources working? use from/within theme-changing logic? +- finish xlibre setup, including installing any needed packages and doing config - finished artix/dinit setup - include figuring out wiregaurd/vpn stuff -- web browsers config and install (primary: qutebrowser, alt1: brave, alt2: tor?) + - also include remapping ctrl, alt, and super keys as needed +- web browsers config and install (primary: qutebrowser, alt1: brave, alt2: tor) - config for mpd, and client(s), (mpd clients to consider: mpc, ncmpcpp, ncmpc, inori) - get find, xargs, and awk (use nawk) as unified as i can across system types ## optional - configured neomutt +- seems mpv install (maybe others?) bring in wayland, see if i can remove it +- figured out nvim debug options for linux and macos, then update nvim's dap.lua - picked and configured rss reader - newsboat? others? option with inbox and separate queues? - make all these scripts POSIX-compliant (or at least usable in ksh/oksh) diff --git a/installs_and_builds/custom_openssh_linux_debian b/installs_and_builds/custom_openssh_linux_debian new file mode 100755 index 0000000..607d057 --- /dev/null +++ b/installs_and_builds/custom_openssh_linux_debian @@ -0,0 +1,4 @@ +#!/bin/zsh + +# for debian, use package name `openssh-server` instead of `openssh` +${=BOX_SETUP_INSTALL_COMMAND} openssh-server diff --git a/installs_and_builds/custom_xlibre_default b/installs_and_builds/custom_xlibre_default new file mode 100755 index 0000000..1f0a675 --- /dev/null +++ b/installs_and_builds/custom_xlibre_default @@ -0,0 +1,17 @@ +#!/bin/zsh + +# change package name; on artix it is 'pandoc-bin' +${=BOX_SETUP_INSTALL_COMMAND} \ + xlibre-xserver \ + xlibre-video-amdgpu \ + xlibre-input-libinput \ + libx11 \ + libxft \ + libxinerama + +# `xlibre-video-amdgpu` depends on system gpu; ref lspci; maybe use `xlibre-drivers` instead +# if `xlibre-input-libinput` doesn't work, try `xlibre-input-evdev` (generic module) if libinput does not work + +${=BOX_SETUP_INSTALL_COMMAND} \ + xorg-xinit \ + xorg-xrandr diff --git a/installs_and_builds/custom_xlibre_macos_default b/installs_and_builds/custom_xlibre_macos_default new file mode 100755 index 0000000..9a7fd25 --- /dev/null +++ b/installs_and_builds/custom_xlibre_macos_default @@ -0,0 +1,3 @@ +#!/bin/sh + +echo "intentionally skipping build/installation for macos" diff --git a/installs_and_builds/programs_base.txt b/installs_and_builds/programs_base.txt index f27311c..f9bfbc2 100644 --- a/installs_and_builds/programs_base.txt +++ b/installs_and_builds/programs_base.txt @@ -2,9 +2,12 @@ gcc musl coreutils findutils +xlibre make mpv kitty +st +dmenu zsh ksh tmux @@ -14,6 +17,8 @@ curl grep ripgrep sed +less +openssh fzf jq parallel @@ -26,5 +31,7 @@ git calcurse zathura gimp +dwm +qutebrowser aerospace skhd diff --git a/make_dirs.sh b/make_dirs.sh index fc56793..210e263 100755 --- a/make_dirs.sh +++ b/make_dirs.sh @@ -18,8 +18,9 @@ echo "---- making system dirs ----------------" # additional directories for how i'm organizing my system ! [ -d "$DIR_HOME_BOX" ] && mkdir -p "$DIR_HOME_BOX" -! [ -d "$DIR_MUSIC" ] && mkdir -p "$DIR_MUSIC" +! [ -d "$DIR_INBOX" ] && mkdir -p "$DIR_INBOX" ! [ -d "$DIR_NOTES" ] && mkdir -p "$DIR_NOTES" +! [ -d "$DIR_MUSIC" ] && mkdir -p "$DIR_MUSIC" ! [ -d "$DIR_DEV" ] && mkdir -p "$DIR_DEV" ! [ -d "$DIR_GIT_PROJECTS" ] && mkdir -p "$DIR_GIT_PROJECTS" ! [ -d "$DIR_GIT_PROJECTS/me" ] && mkdir -p "$DIR_GIT_PROJECTS/me" diff --git a/src_files/.config/X11/xinit/.xinitrc b/src_files/.config/X11/xinit/.xinitrc new file mode 100644 index 0000000..6d379cb --- /dev/null +++ b/src_files/.config/X11/xinit/.xinitrc @@ -0,0 +1,38 @@ +#!/bin/sh + +prefix="/usr" +exec_prefix="${prefix}" +xrdb="xrdb" +xinitdir="/etc/X11/xinit" +xmodmap="xmodmap" + +userresources="$HOME/.Xresources" +usermodmap="$HOME/.Xmodmap" +sysresources="$xinitdir/.Xresources" +sysmodmap="$xinitdir/.Xmodmap" + +# merge in defaults and keymaps + +[ -x /usr/bin/cpp ] && xinit_nocpp_opt="" || xinit_nocpp_opt="-nocpp" +[ -f "$sysresources" ] && "$xrdb" "$xinit_nocpp_opt" -merge "$sysresources" +[ -f "$sysmodmap" ] && "$xmodmap" "$sysmodmap" +[ -f "$userresources" ] && "$xrdb" -nocpp -merge "$userresources" +[ -f "$usermodmap" ] && "$xmodmap" "$usermodmap" + +# source xinitdrc.d script files +[ -d "$xinitdir"/xinitrc.d ] && { + for f in "$xinitdir/xinitrc.d"/?*.sh ; do + [ -x "$f" ] && . "$f" + done + unset f +} + +# xrandr mode for laptop display (framework 13in), target 1920x1280 resolution +dispmanage_modeline=$(cvt 1920 1280 60 | sed -n '2p' | sed -E "s/^Modeline //g") +dispmanage_mode_id=$(printf "%s" "$dispmanage_modeline" | sed -E "s/^([^ ]+)\s.*$/\1/g") +printf "%s" "$dispmanage_modeline" | xargs xrandr --newmode +printf "%s" "$dispmanage_mode_id" | xargs xrandr --addmode eDP +xrandr --output eDP --mode "1920x1280_60.00" + +# start window manager +exec dwm diff --git a/src_files/.config/nvim/lua/plugins_lazy/dap.lua b/src_files/.config/nvim/lua/plugins_lazy/dap.lua index 4138639..f0dbe99 100644 --- a/src_files/.config/nvim/lua/plugins_lazy/dap.lua +++ b/src_files/.config/nvim/lua/plugins_lazy/dap.lua @@ -5,10 +5,10 @@ return { local dap = require("dap") dap.set_log_level("DEBUG") - dap.adapters.codelldb = { - type = "executable", - command = "codelldb", - } + -- dap.adapters.codelldb = { + -- type = "executable", + -- command = "codelldb", + -- } local dapConfigArgsInput = function() return vim.split(vim.fn.input("args: "), " ") @@ -104,7 +104,7 @@ return { config = function() require("mason-nvim-dap").setup({ ensure_installed = { - "codelldb", + -- "codelldb", -- "delve", }, automatic_installation = true, diff --git a/src_files/.config/zsh/.zshrc b/src_files/.config/zsh/.zshrc index 13d2f27..01c200a 100644 --- a/src_files/.config/zsh/.zshrc +++ b/src_files/.config/zsh/.zshrc @@ -1,5 +1,5 @@ [ -r "$HOME/.config/profile" ] && . "$HOME/.config/profile" [ -r "$XDG_CONFIG_HOME/rc" ] && . "$XDG_CONFIG_HOME/rc" -# overwrite PS1 here, since zsh to use different special chars +# overwrite PS1 here, since zsh decided to use different special chars export PS1="%n@%m %1~ %# " diff --git a/src_files/.local/scripts/display-manage b/src_files/.local/scripts/display-manage new file mode 100755 index 0000000..8ebb3af --- /dev/null +++ b/src_files/.local/scripts/display-manage @@ -0,0 +1,63 @@ +#!/bin/sh + +# NOTE: just use this for recurring cases; if i'm doing a one-off case such presenting at +# an event or temporarily using more than one external monitor, then i probably +# would be better off just writing a one-time script in prep for that case; +# example where one external is DisplayPort-1, another is HDMI-1, and laptop is eDP: +# xrandr --query # to get devices and status +# xrandr --output DisplayPort-1 --primary --auto --output HDMI-1 --auto --output eDP --auto + +DISPMANAGE_EXT_PORT_ID_PREFIX="DisplayPort" +DISPMANAGE_LAPTOP_ID="eDP" +DISPMANAGE_LAPTOP_MODE='"1920x1280_60.00"' + +non_primary_monitors_off() { + xrandr | + grep -v "^Screen" | + grep -v "^\s" | + grep -v "primary" | + while IFS="\n " read -r target_mon_id remaining_text; do + xrandr --output "$target_mon_id" --off + done +} + +solo_monitor_mode() { + mode_id="--auto" + [ "$1" = "$DISPMANAGE_LAPTOP_ID" ] && + [ -n "$DISPMANAGE_LAPTOP_MODE" ] && + mode_id="--mode $DISPMANAGE_LAPTOP_MODE" + echo "$mode_id" | xargs xrandr --output "$1" --primary + non_primary_monitors_off + ! [ "$2" = "--quiet" ] && echo "display-manage: solo monitor mode, $1" +} + +primary_mon_id="" +case "$1" in + (laptop | laptop-only) + primary_mon_id="$DISPMANAGE_LAPTOP_ID" + ;; + (ext | external) + primary_mon_id=$( + xrandr | + grep "^$DISPMANAGE_EXT_PORT_ID_PREFIX.*\sconnected" | + sed -n "1p" | + sed -E "s/^([^ ]+).*$/\1/g" + ) + ;; +esac + +[ -z "$primary_mon_id" ] && + echo "display-manage: target monitor not detected or not configured; using laptop" && + solo_monitor_mode "$DISPMANAGE_LAPTOP_ID" && + exit 0 + +case "$2" in + (m | mirror) + solo_monitor_mode "$primary_mon_id" --quiet + xrandr --output "$DISPMANAGE_LAPTOP_ID" --auto --same-as "$primary_mon_id" + echo "display-manage: $primary_mon_id monitor, primary; laptop monitor, mirror" + ;; + (*) + solo_monitor_mode "$primary_mon_id" + ;; +esac diff --git a/src_files/etc/47-elogind.conf b/src_files/etc/47-elogind.conf new file mode 100644 index 0000000..aab6879 --- /dev/null +++ b/src_files/etc/47-elogind.conf @@ -0,0 +1,2 @@ +[Login] +HandleLidSwitchDocked=ignore diff --git a/src_files/shell/rc b/src_files/shell/rc index 629591b..4a055fd 100644 --- a/src_files/shell/rc +++ b/src_files/shell/rc @@ -23,6 +23,8 @@ alias nv='nvim' alias ths='theme-set' alias thw='theme-update-wallpaper' alias tmi='tmux-session-init' +alias dme='display-manage external' +alias dml='display-manage laptop' # executable overrides alias ls='ls -F'