Compare commits

..

4 Commits

Author SHA1 Message Date
62c2c06904 Rename script. 2024-09-20 14:00:27 -04:00
12649c0f60 Directory local variables for Emacs contributors.
Sets some handy things for sending patches, might be useful for other contributors.
2024-09-20 14:00:27 -04:00
a63091b320 Put the sensible-terminal script into i38 itself.
There is no such --sensible-terminal flag to Sway, and given it's just
a script we may as well put it in our codebase instead.
2024-09-20 14:00:27 -04:00
faf7ca45e0 When using Sway, include the default distribution files for configuration.
Useful for things such as importing the proper dBus environment.
2024-09-20 14:00:27 -04:00
3 changed files with 45 additions and 5 deletions

5
.dir-locals.el Normal file
View File

@ -0,0 +1,5 @@
;;; Directory Local Variables -*- no-byte-compile: t -*-
;;; For more information see (info "(emacs) Directory Variables")
((nil . ((vc-prepare-patches-separately . nil)
(vc-default-patch-addressee . "billy@wolfe.casa"))))

22
i38.sh
View File

@ -11,10 +11,11 @@
# PARTICULAR PURPOSE. See the GNU General Public License for more details. # 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 <https://www.gnu.org/licenses/>. # You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
# Flag for sway configurations
usingSway=1 # Not by default.
i3Path="${XDG_CONFIG_HOME:-$HOME/.config}/i3" i3Path="${XDG_CONFIG_HOME:-$HOME/.config}/i3"
i3msg="i3-msg" i3msg="i3-msg"
sensibleTerminal="i3-sensible-terminal"
# Dialog accessibility # Dialog accessibility
export DIALOGOPTS='--no-lines --visit-items' export DIALOGOPTS='--no-lines --visit-items'
@ -258,9 +259,10 @@ while getopts "${args}" i ; do
case "$i" in case "$i" in
h) help;; h) help;;
s) s)
swaySystemIncludesPath="/etc/sway/config.d"
usingSway=0
i3msg="swaymsg" i3msg="swaymsg"
i3Path="${XDG_CONFIG_HOME:-$HOME/.config}/sway" i3Path="${XDG_CONFIG_HOME:-$HOME/.config}/sway"
sensibleTerminal="sway --sensible-terminal"
;; ;;
u) update_scripts;; u) update_scripts;;
x) write_xinitrc ;& x) write_xinitrc ;&
@ -402,8 +404,18 @@ cp -rv scripts/ "${i3Path}/" | dialog --backtitle "I38" --progressbox "Moving sc
cat << EOF > ${i3Path}/config cat << EOF > ${i3Path}/config
# Generated by I38 (${0##*/}) https://git.stormux.org/storm/I38 # Generated by I38 (${0##*/}) https://git.stormux.org/storm/I38
# $(date '+%A, %B %d, %Y at %I:%M%p') # $(date '+%A, %B %d, %Y at %I:%M%p')
EOF
# If we are using Sway, we need to load in the system configuration
# Usually, this is for system specific dBus things that the distro knows how to manage; we should trust their judgment with that
if [[ $usingSway ]] && [[ -d "${swaySystemIncludesPath}" ]]; then
cat << EOF >> ${i3Path}/config
# Include your distribution Sway configuration files.
include ${swaySystemIncludesPath}/*
EOF
fi
cat << EOF >> ${i3Path}/config
# i3 config file (v4) # i3 config file (v4)
# #
# Please see https://i3wm.org/docs/userguide.html for a complete reference! # Please see https://i3wm.org/docs/userguide.html for a complete reference!
@ -443,7 +455,7 @@ bindsym \$mod+Control+Delete exec --no-startup-id sgtk-bar
# Use pactl to adjust volume in PulseAudio. # Use pactl to adjust volume in PulseAudio.
bindsym \$mod+XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +${volumeJump}% & play -qnG synth 0.03 sin 440 bindsym \$mod+XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +${volumeJump}% & play -qnG synth 0.03 sin 440
bindsym \$mod+XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -${volumeJump}% & play -qnG synth 0.03 sin 440 bindsym \$mod+XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -${volumeJump}% & play -qnG synth 0.03 sin 440
bindsym \$mod+XF86AudioMute exec --no-startup-id ${i3Path}/scripts/mute-unmute.sh bindsym \$mod+XF86AudioMute exec --no-startup-id ${i3Path}/scrip/ts/mute-unmute.sh
# Music player controls # Music player controls
# Requires playerctl. # Requires playerctl.
@ -457,7 +469,7 @@ bindsym XF86AudioStop exec --no-startup-id play -qV0 "| sox -np synth 0.03 sin 2
bindsym XF86AudioNext exec --no-startup-id play -qV0 "| sox -np synth 0.03 sin 2000 pad 0 .02" "| sox -np synth 0.03 sin 2000" norm 1.0 vol 0.4 & ${i3Path}/scripts/music_controler.sh next bindsym XF86AudioNext exec --no-startup-id play -qV0 "| sox -np synth 0.03 sin 2000 pad 0 .02" "| sox -np synth 0.03 sin 2000" norm 1.0 vol 0.4 & ${i3Path}/scripts/music_controler.sh next
# start a terminal # start a terminal
bindsym \$mod+Return exec $sensibleTerminal bindsym \$mod+Return exec ${i3Path}/scripts/i3-sensible-terminal.sh
# kill focused window # kill focused window
bindsym \$mod+F4 kill bindsym \$mod+F4 kill

23
scripts/i3-sensible-terminal.sh Executable file
View File

@ -0,0 +1,23 @@
#!/bin/sh
#
# This code is released in public domain by Han Boetes <han@mijncomputer.nl>
#
# This script tries to exec a terminal emulator by trying some known terminal
# emulators.
#
# We welcome patches that add distribution-specific mechanisms to find the
# preferred terminal emulator. On Debian, there is the x-terminal-emulator
# symlink for example.
#
# Invariants:
# 1. $TERMINAL must come first
# 2. Distribution-specific mechanisms come next, e.g. x-terminal-emulator
# 3. The terminal emulator with best accessibility comes first.
# 4. No order is guaranteed/desired for the remaining terminal emulators.
for terminal in "$TERMINAL" x-terminal-emulator mate-terminal gnome-terminal terminator xfce4-terminal urxvt rxvt termit Eterm aterm uxterm xterm roxterm termite lxterminal terminology st qterminal lilyterm tilix terminix konsole kitty guake tilda alacritty hyper wezterm; do
if command -v "$terminal" > /dev/null 2>&1; then
exec "$terminal" "$@"
fi
done
i3-nagbar -m 'i3-sensible-terminal could not find a terminal emulator. Please install one.'