Compare commits
15 Commits
v2.2
...
13ba2b6dee
Author | SHA1 | Date | |
---|---|---|---|
13ba2b6dee | |||
732c2b0240 | |||
0eb4e494ff | |||
ce22b8347c | |||
62c2c06904 | |||
12649c0f60 | |||
a63091b320 | |||
faf7ca45e0 | |||
|
3769428fdf | ||
|
f2ab61b389 | ||
|
8c29d40616 | ||
|
31c920de8a | ||
|
6cf1aac9de | ||
|
3f7f7d7b21 | ||
|
2c763ce6ea |
5
.dir-locals.el
Normal file
5
.dir-locals.el
Normal 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"))))
|
@@ -3,7 +3,7 @@
|
||||
Accessibility setup script for the i3 window manager.
|
||||
|
||||
## i38.sh
|
||||
Released under the terms of the GPL License Version 3: http://www.wtfpl.net
|
||||
Released under the terms of the GPL License Version 3: https://www.gnu.org/licenses/
|
||||
This is a Stormux project: https://stormux.org
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ An uppercase I looks like a 1, 3 from i3, and 8 because the song [We Are 138](ht
|
||||
- libcanberra: [optional]To play the desktop login sound.
|
||||
- libnotify: For sending notifications
|
||||
- notification-daemon: To handle notifications
|
||||
- xfce4-notifyd: For sending notifications Replaces notification-daemon requires Orca from git.
|
||||
- xfce4-notifyd: For sending notifications Replaces notification-daemon requires Orca from git (Sway user will need to install the customized variant at <https://github.com/icasdri/xfce4-notifyd-layer-shell>)
|
||||
- ocrdesktop: For getting contents of the current window with OCR.
|
||||
- pamixer: for the mute-unmute script
|
||||
- playerctl: music controls
|
||||
@@ -32,6 +32,7 @@ An uppercase I looks like a 1, 3 from i3, and 8 because the song [We Are 138](ht
|
||||
- sox: for sounds.
|
||||
- transfersh: [optional] for file sharing GUI
|
||||
- udiskie: [optional] for automatically mounting removable storage
|
||||
- x11bell: [optional] Bell support if you do not have a PC speaker. Available from https://github.com/jovanlanik/x11bell
|
||||
- xclip: Clipboard support
|
||||
- xbacklight: [optional] for screen brightness adjustment
|
||||
- xorg-setxkbmap: [optional] for multiple keyboard layouts
|
||||
|
56
i38.sh
56
i38.sh
@@ -11,10 +11,11 @@
|
||||
# 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/>.
|
||||
|
||||
# Flag for sway configurations
|
||||
usingSway=1 # Not by default.
|
||||
i3Path="${XDG_CONFIG_HOME:-$HOME/.config}/i3"
|
||||
i3msg="i3-msg"
|
||||
sensibleTerminal="i3-sensible-terminal"
|
||||
|
||||
# Dialog accessibility
|
||||
export DIALOGOPTS='--no-lines --visit-items'
|
||||
|
||||
@@ -174,7 +175,7 @@ yesno() {
|
||||
|
||||
help() {
|
||||
echo "${0##*/}"
|
||||
echo "Released under the terms of the WTFPL License: http://www.wtfpl.net"
|
||||
echo "Released under the terms of the GPL V3 License: https://www.gnu.org/licenses/"
|
||||
echo -e "This is a Stormux project: https://stormux.org\n"
|
||||
echo -e "Usage:\n"
|
||||
echo "With no arguments, create the i3 configuration."
|
||||
@@ -258,9 +259,10 @@ while getopts "${args}" i ; do
|
||||
case "$i" in
|
||||
h) help;;
|
||||
s)
|
||||
swaySystemIncludesPath="/etc/sway/config.d"
|
||||
usingSway=0
|
||||
i3msg="swaymsg"
|
||||
i3Path="${XDG_CONFIG_HOME:-$HOME/.config}/sway"
|
||||
sensibleTerminal="sway --sensible-terminal"
|
||||
;;
|
||||
u) update_scripts;;
|
||||
x) write_xinitrc ;&
|
||||
@@ -402,8 +404,18 @@ cp -rv scripts/ "${i3Path}/" | dialog --backtitle "I38" --progressbox "Moving sc
|
||||
cat << EOF > ${i3Path}/config
|
||||
# Generated by I38 (${0##*/}) https://git.stormux.org/storm/I38
|
||||
# $(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)
|
||||
#
|
||||
# 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.
|
||||
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+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
|
||||
# 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
|
||||
|
||||
# start a terminal
|
||||
bindsym \$mod+Return exec $sensibleTerminal
|
||||
bindsym \$mod+Return exec ${i3Path}/scripts/i3-sensible-terminal.sh
|
||||
|
||||
# kill focused window
|
||||
bindsym \$mod+F4 kill
|
||||
@@ -533,6 +545,13 @@ bindsym $mod+Shift+BackSpace mode "default"
|
||||
|
||||
EOF
|
||||
|
||||
# ocrdesktop through speech-dispatcher
|
||||
if command -v ocrdesktop &> /dev/null ; then
|
||||
echo "bindsym ${mod}+F5 exec bash -c 'spd-say \"performing O C R\" && ocrdesktop -cno | spd-say -e --'" >> ${i3Path}/config
|
||||
fi
|
||||
# Interrupt speech-dispatcher output
|
||||
echo "bindsym ${mod}+Shift+F5 exec spd-say -C" >> ${i3Path}/config
|
||||
|
||||
# Multiple keyboard layouts if requested.
|
||||
if [[ ${#kbd[@]} -gt 1 ]]; then
|
||||
echo "bindsym Mod4+space exec ${i3Path}/scripts/keyboard.sh cycle ${kbd[@]}" >> ${i3Path}/config
|
||||
@@ -606,10 +625,16 @@ bindsym g exec ${i3Path}/scripts/game_controler.sh -s, mode "default"
|
||||
bindsym apostrophe exec --no-startup-id ${i3Path}/scripts/window_list.sh, mode "default"
|
||||
# Restart orca
|
||||
bindsym Shift+o exec $(command -v orca) --replace, mode "default"
|
||||
# reload the configuration file
|
||||
bindsym Control+semicolon exec bash -c '$i3msg -t run_command reload && spd-say -P important -Cw "I38 Configuration reloaded."', mode "default"
|
||||
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
|
||||
bindsym Control+Shift+semicolon exec $i3msg -t run_command restart && spd-say -P important -Cw "I3 restarted.", mode "default"
|
||||
$(if [[ $usingSway -eq 0 ]]; then
|
||||
echo "# reload the configuration file"
|
||||
echo "bindsym Control+semicolon exec bash -c '$i3msg -t command reload && spd-say -P important -Cw "I38 Configuration reloaded."', mode "default""
|
||||
|
||||
else
|
||||
echo "# reload the configuration file"
|
||||
echo "bindsym Control+semicolon exec bash -c '$i3msg -t run_command reload && spd-say -P important -Cw "I38 Configuration reloaded."', mode "default""
|
||||
echo "# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)"
|
||||
echo "bindsym Control+Shift+semicolon exec $i3msg -t run_command restart && spd-say -P important -Cw "I3 restarted.", mode "default""
|
||||
fi)
|
||||
# Run dialog with exclamation
|
||||
bindsym Shift+exclam exec ${i3Path}/scripts/run_dialog.sh, mode "default"
|
||||
# exit i3 (logs you out of your X session)
|
||||
@@ -626,8 +651,12 @@ fi
|
||||
|
||||
cat << EOF >> ${i3Path}/config
|
||||
# Auto start section
|
||||
$(if [[ $sounds -eq 0 ]]; then
|
||||
echo "exec_always --no-startup-id ${i3Path}/scripts/sound.py"
|
||||
$(if [[ $sounzzds -eq 0 ]]; then
|
||||
if [[ $usingSway -eq 0 ]]; then
|
||||
echo "exec --no-startup-id ${i3Path}/scripts/sound.py"
|
||||
else
|
||||
echo "exec_always --no-startup-id ${i3Path}/scripts/sound.py"
|
||||
fi
|
||||
fi
|
||||
if [[ $loginSound -eq 0 ]]; then
|
||||
echo 'exec --no-startup-id canberra-gtk-play -i desktop-login'
|
||||
@@ -660,6 +689,9 @@ if [[ $dex -eq 0 ]]; then
|
||||
echo 'exec --no-startup-id dex --autostart --environment i3'
|
||||
else
|
||||
echo '# Startup applications'
|
||||
if command -v x11bell &> /dev/null ; then
|
||||
echo 'exec --no-startup-id x11bell play -nqV0 synth .1 sq norm -12'
|
||||
fi
|
||||
echo 'exec --no-startup-id clipster -d'
|
||||
echo 'exec orca'
|
||||
echo "exec_always --no-startup-id ${i3Path}/scripts/desktop.sh"
|
||||
|
@@ -19,7 +19,7 @@
|
||||
batteryName=""
|
||||
|
||||
if [[ "$batteryName" == "" ]]; then
|
||||
batteryName="$(find /sys/class/power_supply -name 'sony_controller_battery_*' | cut -d/ -f5)"
|
||||
batteryName="$(find /sys/class/power_supply -name 'sony_controller_battery_*' -or -name 'ps-controller-battery-*' | cut -d/ -f5)"
|
||||
fi
|
||||
|
||||
# If there's no file, we don't check it.
|
||||
|
23
scripts/i3-sensible-terminal.sh
Executable file
23
scripts/i3-sensible-terminal.sh
Executable 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.'
|
@@ -29,8 +29,9 @@ def read_desktop_files(paths):
|
||||
|
||||
userApplicationsPath = Path.home() / '.local/share/applications'
|
||||
systemApplicationsPath = Path('/usr/share/applications')
|
||||
|
||||
desktopEntries = read_desktop_files([userApplicationsPath, systemApplicationsPath])
|
||||
userFlatpakApplicationsPath = Path.home() / '.local/share/flatpak/exports/share/applications'
|
||||
systemFlatpakApplicationsPath = Path('/var/lib/flatpak/exports/share/applications')
|
||||
desktopEntries = read_desktop_files([userApplicationsPath, systemApplicationsPath, userFlatpakApplicationsPath, systemFlatpakApplicationsPath])
|
||||
|
||||
# Combine some of the categories
|
||||
categoryMap = {
|
||||
|
@@ -16,6 +16,6 @@ if [ $(pamixer --get-mute) = false ]; then
|
||||
pamixer -t
|
||||
else
|
||||
pamixer -t
|
||||
play -qnG synth 0.05 sin 440
|
||||
play -qnGV0 synth 0.05 sin 440
|
||||
spd-say -P important -Cw 'Unmuted!'
|
||||
fi
|
||||
|
@@ -20,13 +20,13 @@ i3 = i3ipc.Connection()
|
||||
|
||||
def on_new_window(self,i3):
|
||||
if i3.container.name == 'xfce4-notifyd':
|
||||
system('play -n synth .05 sq 1800 tri 2400 delay 0 .03 remix - repeat 2 echo .55 0.7 20 1 norm -12 &')
|
||||
system('play -nqV0 synth .05 sq 1800 tri 2400 delay 0 .03 remix - repeat 2 echo .55 0.7 20 1 norm -12 &')
|
||||
else:
|
||||
system('play -n synth .25 sin 440:880 sin 480:920 remix - norm -3 pitch -500 &')
|
||||
system('play -nqV0 synth .25 sin 440:880 sin 480:920 remix - norm -3 pitch -500 &')
|
||||
|
||||
def on_close_window(self,i3):
|
||||
if i3.container.name != 'xfce4-notifyd':
|
||||
system('play -n synth .25 sin 880:440 sin 920:480 remix - norm -3 pitch -500 &')
|
||||
system('play -nqV0 synth .25 sin 880:440 sin 920:480 remix - norm -3 pitch -500 &')
|
||||
|
||||
def on_mode(self,event):
|
||||
mode= event.change
|
||||
@@ -37,7 +37,7 @@ def on_mode(self,event):
|
||||
elif mode == 'default':
|
||||
system('play -qV0 "|sox -np synth .07 sq 400" "|sox -np synth .5 sq 800" fade h 0 .5 .5 norm -20 reverse &')
|
||||
else:
|
||||
system('play -n synth 0.05 pluck F3 norm -8 : synth 0.05 pluck C4 norm -8 : synth 0.05 pluck F4 norm -8 : synth 0.05 pluck C5 norm -8')
|
||||
system('play -nqV0 synth 0.05 pluck F3 norm -8 : synth 0.05 pluck C4 norm -8 : synth 0.05 pluck F4 norm -8 : synth 0.05 pluck C5 norm -8')
|
||||
|
||||
def on_workspace_focus(self,i3):
|
||||
#system('play -qnV0 synth pi fade 0 .25 .15 pad 0 1 reverb overdrive riaa norm -8 speed 1 &')
|
||||
@@ -47,13 +47,13 @@ def on_workspace_move(self,i3):
|
||||
system('play -qnV0 synth pi fade 0 .25 .15 pad 0 1 reverb overdrive riaa norm -8 speed 1 reverse &')
|
||||
|
||||
def on_restart(self,i3):
|
||||
system('play -qn synth .25 saw 500:1200 fade .1 .25 .1 norm -8 &')
|
||||
system('play -qnV0 synth .25 saw 500:1200 fade .1 .25 .1 norm -8 &')
|
||||
|
||||
def on_exit(self,i3):
|
||||
system('play -qn synth .3 sin 700:200 fade 0 .3 0 &')
|
||||
system('play -qnV0 synth .3 sin 700:200 fade 0 .3 0 &')
|
||||
|
||||
def on_fullscreen(self,i3):
|
||||
system('play -qn synth br flanger fade h .3 .3 0 &')
|
||||
system('play -qnV0 synth br flanger fade h .3 .3 0 &')
|
||||
|
||||
i3 = i3ipc.Connection()
|
||||
|
||||
|
Reference in New Issue
Block a user