diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2022-03-29 11:47:10 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2022-03-30 11:41:58 -0700 |
commit | 02f29bd32b28fcc5636d9030f70013320cdf63b3 (patch) | |
tree | 561a8abb977b662222db4937b6f99d25884608e5 /archive | |
parent | addb330167ce1c35f911c6030e0467646fd23e49 (diff) | |
download | dotfiles-02f29bd32b28fcc5636d9030f70013320cdf63b3.tar.gz |
attempt to archive xfce+i3 setup
Now back using i3's own lightdm session on X11 workstations.
See also 955c3c09d78cdef2be60a68268759aa21e85f3c9.
Diffstat (limited to 'archive')
27 files changed, 431 insertions, 0 deletions
diff --git a/archive/.config/autostart/autostart/gnome-keyring-gpg.desktop b/archive/.config/autostart.old/autostart/gnome-keyring-gpg.desktop index 3f90ac7a..3f90ac7a 100644 --- a/archive/.config/autostart/autostart/gnome-keyring-gpg.desktop +++ b/archive/.config/autostart.old/autostart/gnome-keyring-gpg.desktop diff --git a/archive/.config/autostart/autostart/gnome-keyring-pkcs11.desktop b/archive/.config/autostart.old/autostart/gnome-keyring-pkcs11.desktop index 3f90ac7a..3f90ac7a 100644 --- a/archive/.config/autostart/autostart/gnome-keyring-pkcs11.desktop +++ b/archive/.config/autostart.old/autostart/gnome-keyring-pkcs11.desktop diff --git a/archive/.config/autostart/autostart/gnome-keyring-secrets.desktop b/archive/.config/autostart.old/autostart/gnome-keyring-secrets.desktop index 3f90ac7a..3f90ac7a 100644 --- a/archive/.config/autostart/autostart/gnome-keyring-secrets.desktop +++ b/archive/.config/autostart.old/autostart/gnome-keyring-secrets.desktop diff --git a/archive/.config/autostart/autostart/gnome-keyring-ssh.desktop b/archive/.config/autostart.old/autostart/gnome-keyring-ssh.desktop index 3f90ac7a..3f90ac7a 100644 --- a/archive/.config/autostart/autostart/gnome-keyring-ssh.desktop +++ b/archive/.config/autostart.old/autostart/gnome-keyring-ssh.desktop diff --git a/archive/.config/autostart/autostart/light-locker.desktop b/archive/.config/autostart.old/autostart/light-locker.desktop index 56730672..56730672 100644 --- a/archive/.config/autostart/autostart/light-locker.desktop +++ b/archive/.config/autostart.old/autostart/light-locker.desktop diff --git a/archive/.config/autostart/autostart/redshift-gtk.desktop b/archive/.config/autostart.old/autostart/redshift-gtk.desktop index 59ceb28c..59ceb28c 100644 --- a/archive/.config/autostart/autostart/redshift-gtk.desktop +++ b/archive/.config/autostart.old/autostart/redshift-gtk.desktop diff --git a/archive/.config/autostart/xstartup.desktop b/archive/.config/autostart.old/xstartup.desktop index 3038df87..3038df87 100644 --- a/archive/.config/autostart/xstartup.desktop +++ b/archive/.config/autostart.old/xstartup.desktop diff --git a/archive/.config/autostart.xfce+i3/Caffeine indicator.desktop b/archive/.config/autostart.xfce+i3/Caffeine indicator.desktop new file mode 100644 index 00000000..d1f25bdd --- /dev/null +++ b/archive/.config/autostart.xfce+i3/Caffeine indicator.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=0.9.4 +Type=Application +Name=Caffeine indicator +Comment= +Exec=caffeine-indicator +OnlyShowIn=XFCE; +StartupNotify=false +Terminal=false +Hidden=false + diff --git a/archive/.config/autostart.xfce+i3/Evolution.desktop b/archive/.config/autostart.xfce+i3/Evolution.desktop new file mode 100644 index 00000000..355c4709 --- /dev/null +++ b/archive/.config/autostart.xfce+i3/Evolution.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=0.9.4 +Type=Application +Name=Evolution +Comment= +Exec=evolution +OnlyShowIn=XFCE; +StartupNotify=false +Terminal=false +Hidden=false + diff --git a/archive/.config/autostart.xfce+i3/Workrave.desktop b/archive/.config/autostart.xfce+i3/Workrave.desktop new file mode 100644 index 00000000..17a92002 --- /dev/null +++ b/archive/.config/autostart.xfce+i3/Workrave.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=0.9.4 +Type=Application +Name=Workrave +Comment= +Exec=workrave +OnlyShowIn=XFCE; +StartupNotify=false +Terminal=false +Hidden=false + diff --git a/archive/.config/autostart.xfce+i3/light-locker.desktop b/archive/.config/autostart.xfce+i3/light-locker.desktop new file mode 100644 index 00000000..56730672 --- /dev/null +++ b/archive/.config/autostart.xfce+i3/light-locker.desktop @@ -0,0 +1,3 @@ +[Desktop Entry] +Hidden=true + diff --git a/archive/.config/autostart.xfce+i3/redshift-gtk.desktop b/archive/.config/autostart.xfce+i3/redshift-gtk.desktop new file mode 100644 index 00000000..aab22349 --- /dev/null +++ b/archive/.config/autostart.xfce+i3/redshift-gtk.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Version=1.0 +Name=Redshift +GenericName=Color temperature adjustment +Comment=Color temperature adjustment tool +Exec=redshift-gtk +Icon=redshift +Terminal=false +Type=Application +Categories=Utility; +StartupNotify=true +Hidden=false +X-GNOME-Autostart-enabled=false diff --git a/archive/.config/autostart.xfce+i3/xscreensaver.desktop b/archive/.config/autostart.xfce+i3/xscreensaver.desktop new file mode 100644 index 00000000..56730672 --- /dev/null +++ b/archive/.config/autostart.xfce+i3/xscreensaver.desktop @@ -0,0 +1,3 @@ +[Desktop Entry] +Hidden=true + diff --git a/archive/.config/systemd/user/i3-rotate-wallpaper.service b/archive/.config/systemd/user/i3-rotate-wallpaper.service new file mode 100644 index 00000000..2d805782 --- /dev/null +++ b/archive/.config/systemd/user/i3-rotate-wallpaper.service @@ -0,0 +1,6 @@ +[Unit] +Description=Rotate i3 wallpaper + +[Service] +Type=oneshot +ExecStart=%h/bin/i3-rotate-wallpaper diff --git a/archive/.config/systemd/user/i3-rotate-wallpaper.timer b/archive/.config/systemd/user/i3-rotate-wallpaper.timer new file mode 100644 index 00000000..55c0f820 --- /dev/null +++ b/archive/.config/systemd/user/i3-rotate-wallpaper.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Run i3-rotate-wallpaper daily + +[Timer] +OnCalendar=daily +Persistent=true + +[Install] +WantedBy=timers.target diff --git a/archive/.config/xfce4/helpers.rc b/archive/.config/xfce4/helpers.rc new file mode 100644 index 00000000..d5b3d574 --- /dev/null +++ b/archive/.config/xfce4/helpers.rc @@ -0,0 +1,3 @@ +WebBrowser=firefox +MailReader=mutt +TerminalEmulator=xfce4-terminal diff --git a/archive/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xfce+i3.xml b/archive/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xfce+i3.xml new file mode 100644 index 00000000..4821f30c --- /dev/null +++ b/archive/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xfce+i3.xml @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<channel name="xfce4-session" version="1.0"> + <property name="splash" type="empty"> + <property name="Engine" type="string" value=""/> + <property name="engines" type="empty"> + <property name="simple" type="empty"> + <property name="Font" type="empty"/> + <property name="BgColor" type="empty"/> + <property name="FgColor" type="empty"/> + <property name="Image" type="empty"/> + </property> + </property> + </property> + <property name="general" type="empty"> + <property name="FailsafeSessionName" type="empty"/> + <property name="SessionName" type="string" value="Default"/> + <property name="SaveOnExit" type="bool" value="false"/> + </property> + <property name="sessions" type="empty"> + <property name="Failsafe" type="empty"> + <property name="IsFailsafe" type="empty"/> + <property name="Count" type="empty"/> + <property name="Client0_Command" type="array"> + <value type="string" value="xfsettingsd"/> + </property> + <property name="Client0_PerScreen" type="empty"/> + <property name="Client1_Command" type="array"> + <value type="string" value="i3"/> + </property> + <property name="Client1_PerScreen" type="empty"/> + <property name="Client2_Command" type="array"> + <value type="string" value="true"/> + </property> + <property name="Client2_PerScreen" type="empty"/> + <property name="Client3_Command" type="empty"/> + <property name="Client3_PerScreen" type="empty"/> + <property name="Client4_Command" type="array"> + <value type="string" value="true"/> + </property> + <property name="Client4_PerScreen" type="empty"/> + </property> + </property> + <property name="compat" type="empty"> + <property name="LaunchGNOME" type="bool" value="true"/> + </property> +</channel> diff --git a/archive/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml b/archive/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xfce.xml index bee460f3..bee460f3 100644 --- a/archive/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml +++ b/archive/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xfce.xml diff --git a/archive/bin/i3-quit b/archive/bin/i3-quit new file mode 100755 index 00000000..b9bd09f9 --- /dev/null +++ b/archive/bin/i3-quit @@ -0,0 +1,9 @@ +#!/bin/sh + +if [ "$DESKTOP_SESSION" = "xfce" ]; then + xfce4-session-logout +else + i3-nagbar -t warning \ + -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' \ + -b 'Yes, exit i3' 'i3-msg exit' +fi diff --git a/archive/bin/i3-rotate-wallpaper b/archive/bin/i3-rotate-wallpaper new file mode 100755 index 00000000..b31bf91f --- /dev/null +++ b/archive/bin/i3-rotate-wallpaper @@ -0,0 +1,69 @@ +#!/usr/bin/perl + +use 5.028; +use strict; +use warnings; + +# dirs where wallpaper can be found +our @dirs = ("$ENV{HOME}/annex/wallpaper/pro"); + +# the user can request to freeze the current wallpaper by +# `touch $HOME/local/.norotate` +exit if -e "$ENV{HOME}/local/.norotate"; + +# The user can list wallpapers they want displayed in order of preference in +# this file. For example, listing one file will mean the primary output +# always gets that image, and any other outputs get outputs from the command +# line. +my @saved_choices; +if (-e "$ENV{HOME}/local/wallpapers") { + open my $fh, "<", "$ENV{HOME}/local/wallpapers"; + @saved_choices = <$fh>; +} + +# Could keep a log of recently used wallpapers and don't use those +# again (would need code to expire from the log, and if want this, +# should probably write a real, general program not just this +# Sean-specific script) +my @images; +push @images, + shift @saved_choices + || shift @ARGV + # https://stackoverflow.com/a/16758439 + || `find @dirs -exec file -L '{}' \\; | grep -o -P '^.+: \\w+ image' | shuf -n 1 | cut -d: -f1` + for 1 .. grep / connected /, `xrandr`; +chomp @images; + +system "resize-wallpapers-for-outputs", @images; +system "i3-startup-always" if $ENV{DISPLAY}; + +# if [ -n "$img" ]; then +# # this will just size up images with the correct aspect ratio. For +# # images with the wrong aspect ratio, it'll crop them. I find that's +# # usually better than adding borders (which is what the commented out +# # cmd does) +# convert "$img" \ +# -resize "$dims"^ -gravity center -extent "$dims" \ +# $HOME/local/wallpaper.png + +# # convert "$img" \ +# # -resize "$dims" -background black -gravity center -extent "$dims" \ +# # $HOME/local/wallpaper.png + +# # this calls feh +# [ -n "$DISPLAY" ] && i3-startup-always +# fi + +# # do develacc too, though we can't call i3-startup-always +# if [ -d "$HOME/local/develacc/local" ]; then +# if [ "x$2" = "x" ]; then +# img2="$(find $dirs -name '*' -exec file -L {} \; | grep -o -P '^.+: \w+ image' | shuf -n 1 | cut -d: -f1)" +# else +# img2="$2" +# fi +# if [ -n "$img2" ]; then +# convert "$img2" \ +# -resize "$dims"^ -gravity center -extent "$dims" \ +# $HOME/local/develacc/local/wallpaper.png +# fi +# fi diff --git a/archive/bin/i3-startup-i3lock b/archive/bin/i3-startup-i3lock new file mode 100755 index 00000000..000861ea --- /dev/null +++ b/archive/bin/i3-startup-i3lock @@ -0,0 +1,12 @@ +#!/bin/sh + +set -e + +pkill -u "$USER" xss-lock ||: +if i3-wallpaper --check-have; then + i3lock_arg="--image=$HOME/local/wallpaper.png" +else + i3lock_arg="--color=FFFFF6" +fi +setsid -f xss-lock --transfer-sleep-lock -- \ + i3lock --pointer=win --nofork --ignore-empty-password "$i3lock_arg" diff --git a/archive/bin/i3-startup-i3lock-inner b/archive/bin/i3-startup-i3lock-inner new file mode 100755 index 00000000..02c59c90 --- /dev/null +++ b/archive/bin/i3-startup-i3lock-inner @@ -0,0 +1,59 @@ +#!/bin/bash + +# From /usr/share/doc/xss-lock/transfer-sleep-lock-i3lock.sh on Debian stretch + +## CONFIGURATION ############################################################## + +# Options to pass to i3lock +# i3-rotate-wallpaper only ever generates a wallpaper.png suitable for +# a single monitor, so just ignore wallpaper.png if more than one +# monitor is plugged in +monitors="$(xrandr -q | grep ' connected' | wc -l)" +if [ -e "$HOME/local/wallpaper.png" ] \ + && ! [ $monitors -gt 1 ]; then + i3lock_options="-i $HOME/local/wallpaper.png" +else + i3lock_options="-c 3f3f3f" +fi + +# Run before starting the locker +pre_lock() { + mpc pause + return +} + +# Run after the locker exits +post_lock() { + return +} + +############################################################################### + +pre_lock + +# We set a trap to kill the locker if we get killed, then start the locker and +# wait for it to exit. The waiting is not that straightforward when the locker +# forks, so we use this polling only if we have a sleep lock to deal with. +if [[ -e /dev/fd/${XSS_SLEEP_LOCK_FD:--1} ]]; then + kill_i3lock() { + pkill -xu $EUID "$@" i3lock + } + + trap kill_i3lock TERM INT + + # we have to make sure the locker does not inherit a copy of the lock fd + i3lock $i3lock_options {XSS_SLEEP_LOCK_FD}<&- + + # now close our fd (only remaining copy) to indicate we're ready to sleep + exec {XSS_SLEEP_LOCK_FD}<&- + + while kill_i3lock -0; do + sleep 0.5 + done +else + trap 'kill %%' TERM INT + i3lock -n $i3lock_options & + wait +fi + +post_lock diff --git a/archive/bin/i3-startup-once b/archive/bin/i3-startup-once new file mode 100755 index 00000000..ce0a3075 --- /dev/null +++ b/archive/bin/i3-startup-once @@ -0,0 +1,34 @@ +#!/bin/sh + +# idea is that on physical hardware running X we use the XFCE desktop session +# from the display manager, and then rely on ~/.config/autostart to start +# things up. then when running a graphical session in a virtual machine, say, +# we use the i3 desktop session from the display manager, and that stuff (most +# of which only makes sense on real hardware) doesn't get started up + +# so, ~/.dmrc shouldn't be checked into dotfiles repo -- use configuration +# management to set the default session in lightdm.conf + +# this script remains for fixups when i3 launches; ideally it will eventually +# not be needed + +. $HOME/.shenv + +# ---- xrandr on specific hosts + +# this relies on having set the video device to 'virtio' in virt-manager +if [ "$(hostname -f)" = "develacc.melete.silentflame.com" ]; then + xrandr --output Virtual-1 --mode 1600x900 +fi + +# ---- input methods + +if ! in-develacc; then + # work around Debian bug #812826 + pkill -u $USER ibus-daemon + IBUS_ENABLE_SYNC_MODE=0 ibus-daemon --xim --daemonize +fi + +# ---- Emacs daemon + +update-emacs-daemon-environment diff --git a/archive/bin/i3-startup-xtrlock b/archive/bin/i3-startup-xtrlock new file mode 100755 index 00000000..2bf6daff --- /dev/null +++ b/archive/bin/i3-startup-xtrlock @@ -0,0 +1,21 @@ +#!/bin/sh + +. $HOME/.shenv + +# screen locking setup + +# kill any other lockers that might have snuck in +pkill -u $USER light-locker +pkill -u $USER xscreensaver +pkill -u $USER xautolock +pkill -u $USER xss-lock + +# turn over lid switch handling to logind, if needed +if which xfconf-query >/dev/null; then + xfconf-query -c xfce4-power-manager -n \ + -p /xfce4-power-manager/logind-handle-lid-switch \ + -t bool -s true +fi + +xss-lock --transfer-sleep-lock \ + -- i3-startup-xtrlock-inner-lock & diff --git a/archive/bin/i3-startup-xtrlock-inner-lock b/archive/bin/i3-startup-xtrlock-inner-lock new file mode 100755 index 00000000..3721d4c0 --- /dev/null +++ b/archive/bin/i3-startup-xtrlock-inner-lock @@ -0,0 +1,59 @@ +#!/bin/bash + +# Based on /usr/share/doc/xss-lock/transfer-sleep-lock-i3lock.sh on +# Debian stretch +# +# xss-lock should be invoked like this: +# +# % xss-lock --transfer-sleep-lock -- i3-startup-xtrlock-inner-lock + +# ensure we can easily see the blue padlock +# commented out because if the active window is virt-viewer, and mouse +# is hovering over "Leave fullscreen", this will cause virt-viewer to +# grab the mouse before xtrlock can lock the screen +# xmouse-away-from-edge + +xtrlock_args="" +if [ -e "$HOME/local/xtrlock-please-blank" ]; then + xtrlock_args="-b" + rm ~/local/xtrlock-please-blank +fi + +# If unclutter is unclutter-xfixes, we want to kill it and restart +# later so that it doesn't hide xtrlock's cursor. Note that classic +# unclutter won't hide xtrlock's cursor. Rather than checking which +# unclutter we have, though, just kill it +pkill -xu $EUID unclutter ||: + +# We set a trap to kill the locker if we get killed, then start the locker and +# wait for it to exit. The waiting is not that straightforward when the locker +# forks, so we use this polling only if we have a sleep lock to deal with. +if [[ -e /dev/fd/${XSS_SLEEP_LOCK_FD:--1} ]]; then + # pre-sleep commands + # kill caffeination because it tends to be ineffective after + # system has come back from suspend + xset +dpms + pkill -u $USER i3-nagbar + + kill_xtrlock() { + pkill -xu $EUID "$@" xtrlock + } + + trap kill_xtrlock TERM INT + + # we have to make sure the locker does not inherit a copy of the lock fd + xtrlock $xtrlock_args -f {XSS_SLEEP_LOCK_FD}<&- + + # now close our fd (only remaining copy) to indicate we're ready to sleep + exec {XSS_SLEEP_LOCK_FD}<&- + + while kill_xtrlock -0; do + sleep 0.5 + done +else + trap 'kill %%' TERM INT + xtrlock $xtrlock_args & + wait +fi + +unclutter -idle 5 -root -noevents & diff --git a/archive/bin/xflock4 b/archive/bin/xflock4 new file mode 100755 index 00000000..9bfad4c5 --- /dev/null +++ b/archive/bin/xflock4 @@ -0,0 +1,5 @@ +#!/bin/sh + +# override /usr/bin/xflock4 to use i3lock via xss-lock + +loginctl lock-session diff --git a/archive/bin/xmouse-away-from-edge b/archive/bin/xmouse-away-from-edge new file mode 100755 index 00000000..8ddf8aaa --- /dev/null +++ b/archive/bin/xmouse-away-from-edge @@ -0,0 +1,43 @@ +#!/usr/bin/perl + +# Copyright (C) 2019 Sean Whitton +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or (at +# your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +use 5.028; +use strict; +use warnings; + +our $tolerance = 50; +our $jitter = 50; + +my $xdpyinfo = `xdpyinfo`; +$xdpyinfo =~ /dimensions: ([0-9]+)x([0-9]+)/; +my ($width, $height) = ($1, $2); +my $getmouselocation = `xdotool getmouselocation`; +$getmouselocation =~ /x:([0-9]+) y:([0-9]+)/; +my ($x, $y) = ($1, $2); + +if ($width - $x > 0 && $width - $x < $tolerance) { + move(-$jitter, 0); +} elsif ($x < $tolerance) { + move($jitter, 0); +} +if ($height - $y > 0 && $height - $y < $tolerance) { + move(0, -$jitter); +} elsif ($y < $tolerance) { + move(0, $jitter); +} + +sub move { system "xdotool mousemove_relative --sync -- $_[0] $_[1]" } |