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 /bin | |
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 'bin')
-rwxr-xr-x | bin/i3-quit | 9 | ||||
-rwxr-xr-x | bin/i3-rotate-wallpaper | 69 | ||||
-rwxr-xr-x | bin/i3-startup-i3lock | 12 | ||||
-rwxr-xr-x | bin/i3-startup-i3lock-inner | 59 | ||||
-rwxr-xr-x | bin/i3-startup-once | 34 | ||||
-rwxr-xr-x | bin/i3-startup-xtrlock | 21 | ||||
-rwxr-xr-x | bin/i3-startup-xtrlock-inner-lock | 59 | ||||
-rwxr-xr-x | bin/xflock4 | 5 | ||||
-rwxr-xr-x | bin/xmouse-away-from-edge | 43 |
9 files changed, 0 insertions, 311 deletions
diff --git a/bin/i3-quit b/bin/i3-quit deleted file mode 100755 index b9bd09f9..00000000 --- a/bin/i3-quit +++ /dev/null @@ -1,9 +0,0 @@ -#!/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/bin/i3-rotate-wallpaper b/bin/i3-rotate-wallpaper deleted file mode 100755 index b31bf91f..00000000 --- a/bin/i3-rotate-wallpaper +++ /dev/null @@ -1,69 +0,0 @@ -#!/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/bin/i3-startup-i3lock b/bin/i3-startup-i3lock deleted file mode 100755 index 000861ea..00000000 --- a/bin/i3-startup-i3lock +++ /dev/null @@ -1,12 +0,0 @@ -#!/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/bin/i3-startup-i3lock-inner b/bin/i3-startup-i3lock-inner deleted file mode 100755 index 02c59c90..00000000 --- a/bin/i3-startup-i3lock-inner +++ /dev/null @@ -1,59 +0,0 @@ -#!/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/bin/i3-startup-once b/bin/i3-startup-once deleted file mode 100755 index ce0a3075..00000000 --- a/bin/i3-startup-once +++ /dev/null @@ -1,34 +0,0 @@ -#!/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/bin/i3-startup-xtrlock b/bin/i3-startup-xtrlock deleted file mode 100755 index 2bf6daff..00000000 --- a/bin/i3-startup-xtrlock +++ /dev/null @@ -1,21 +0,0 @@ -#!/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/bin/i3-startup-xtrlock-inner-lock b/bin/i3-startup-xtrlock-inner-lock deleted file mode 100755 index 3721d4c0..00000000 --- a/bin/i3-startup-xtrlock-inner-lock +++ /dev/null @@ -1,59 +0,0 @@ -#!/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/bin/xflock4 b/bin/xflock4 deleted file mode 100755 index 9bfad4c5..00000000 --- a/bin/xflock4 +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# override /usr/bin/xflock4 to use i3lock via xss-lock - -loginctl lock-session diff --git a/bin/xmouse-away-from-edge b/bin/xmouse-away-from-edge deleted file mode 100755 index 8ddf8aaa..00000000 --- a/bin/xmouse-away-from-edge +++ /dev/null @@ -1,43 +0,0 @@ -#!/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]" } |