2020-09-11 15:05:15 +00:00
|
|
|
# Simple Scripts
|
2020-11-23 09:35:26 +00:00
|
|
|
|
2020-09-11 15:05:15 +00:00
|
|
|
## Audio
|
|
|
|
|
2021-07-27 05:43:45 +00:00
|
|
|
[**audio/mute.sh**](https://git.john.me.tz/jpm/scripts/src/branch/master/audio/mute.sh)
|
2020-11-16 07:40:33 +00:00
|
|
|
|
|
|
|
Just a simple script to toggle Alsa mute.
|
2020-09-11 15:05:15 +00:00
|
|
|
|
2021-07-27 05:43:45 +00:00
|
|
|
[**audio/noise-cancel.sh**](https://git.john.me.tz/jpm/scripts/src/branch/master/audio/noise-cancel.sh)
|
2020-09-11 15:05:15 +00:00
|
|
|
|
|
|
|
Add a noise-cancelled version of existing interfaces to Pulseaudio.
|
|
|
|
|
2021-07-27 05:43:45 +00:00
|
|
|
[**audio/stream-podcasts.pl**](https://git.john.me.tz/jpm/scripts/src/branch/master/audio/stream-podcasts.pl)
|
2020-12-01 10:13:20 +00:00
|
|
|
|
|
|
|
Commandline podcast streamer. Fetchs the feed for desired podcasts, find items
|
|
|
|
published today, then plays them in order. Given arguments, it will use those
|
|
|
|
as feeds, otherwise it will use the hash listed in the script.
|
|
|
|
|
2020-09-11 15:05:15 +00:00
|
|
|
## i3
|
|
|
|
|
2020-11-23 09:35:26 +00:00
|
|
|
I haven't used i3 in earnest for quite some time since moving to Sway, so it is
|
|
|
|
very likely that some of these scripts are broken based on other config changes.
|
2020-09-11 15:05:15 +00:00
|
|
|
|
2021-07-27 05:43:45 +00:00
|
|
|
[**i3/i3move.sh**](https://git.john.me.tz/jpm/scripts/src/branch/master/i3/i3move.sh)
|
2020-09-11 15:05:15 +00:00
|
|
|
|
2020-11-23 09:35:26 +00:00
|
|
|
When any of the Xrandr scripts below is run, it will print it's name to a config
|
|
|
|
file. This script will read that config file and then knows how the outputs are
|
|
|
|
arranged. Once this is known, it allows hotkeys to know which output to move a
|
|
|
|
workspace to.
|
2020-09-11 15:05:15 +00:00
|
|
|
|
2021-07-27 05:43:45 +00:00
|
|
|
[**i3/detached.sh**](https://git.john.me.tz/jpm/scripts/src/branch/master/i3/detached.sh)
|
2020-09-11 15:05:15 +00:00
|
|
|
|
|
|
|
Xrandr config. Just the laptop display.
|
|
|
|
|
2021-07-27 05:43:45 +00:00
|
|
|
[**i3/home.sh**](https://git.john.me.tz/jpm/scripts/src/branch/master/i3/home.sh)
|
2020-09-11 15:05:15 +00:00
|
|
|
|
2020-11-23 09:35:26 +00:00
|
|
|
Xrandr config. Not a layout I currently use. Home is now the "stacked" view from
|
|
|
|
sway/displays.
|
|
|
|
|
2021-07-27 05:43:45 +00:00
|
|
|
[**i3/work.sh**](https://git.john.me.tz/jpm/scripts/src/branch/master/i3/work.sh)
|
2020-11-23 09:35:26 +00:00
|
|
|
|
|
|
|
Xrandr config. Vertical on the left, horizontal aligned to top of the vertical,
|
|
|
|
and laptop directly below that. Left-to-right order is
|
|
|
|
Vertical-Horizontal-Laptop.
|
2020-09-11 15:05:15 +00:00
|
|
|
|
|
|
|
## Rofi
|
|
|
|
|
2020-11-23 09:35:26 +00:00
|
|
|
[Rofi](https://github.com/davatorium/rofi) is a neat graphical launcher and menu
|
|
|
|
system. I use it for a bunch of stuff to supplement i3 and Sway to fill out same
|
|
|
|
desktop niceties. See configs in 'dotfiles' repository.
|
2020-09-11 15:05:15 +00:00
|
|
|
|
2021-07-27 05:43:45 +00:00
|
|
|
[**rofi/drun.sh**](https://git.john.me.tz/jpm/scripts/src/branch/master/rofi/drun.sh)
|
2020-09-11 15:05:15 +00:00
|
|
|
|
|
|
|
Simple launcher.
|
|
|
|
|
2021-07-27 05:43:45 +00:00
|
|
|
[**rofi/rofi-openvpn.sh**](https://git.john.me.tz/jpm/scripts/src/branch/master/rofi/rofi-openvpn.sh)
|
2020-09-11 15:05:15 +00:00
|
|
|
|
|
|
|
Quick VPN switcher.
|
|
|
|
|
2021-07-27 05:43:45 +00:00
|
|
|
[**rofi/rofi-power-menu.sh**](https://git.john.me.tz/jpm/scripts/src/branch/master/rofi/rofi-power-menu.sh)
|
2020-09-11 15:05:15 +00:00
|
|
|
|
2021-08-11 22:36:36 +00:00
|
|
|
Lock, toggle displays, reload yubico authenticator, log out, restart Sway/i3,
|
|
|
|
reload waybar, hibernate, reboot, shutdown.
|
2020-09-11 15:05:15 +00:00
|
|
|
|
2021-07-27 05:43:45 +00:00
|
|
|
[**rofi/rofi-send-to-kodi.sh**](https://git.john.me.tz/jpm/scripts/src/branch/master/rofi/rofi-send-to-kodi.sh)
|
2020-09-11 15:05:15 +00:00
|
|
|
|
|
|
|
Forward pasted link to ./send-to-kodi.sh.
|
|
|
|
|
2021-07-27 05:43:45 +00:00
|
|
|
[**rofi/rofi-ssh-menu.sh**](https://git.john.me.tz/jpm/scripts/src/branch/master/rofi/rofi-ssh-menu.sh)
|
2020-09-11 15:05:15 +00:00
|
|
|
|
2020-11-23 09:35:26 +00:00
|
|
|
Open a terminal to any SSH shortcut machine. (TODO: Integrate with 'sshs' to get
|
|
|
|
machine list from there instead of a static list).
|
2020-09-11 15:05:15 +00:00
|
|
|
|
2021-07-27 05:43:45 +00:00
|
|
|
[**rofi/sway-alt-tab.sh**](https://git.john.me.tz/jpm/scripts/src/branch/master/sway/sway-alt-tab.sh)
|
2020-09-11 15:05:15 +00:00
|
|
|
|
|
|
|
Show all currently running applications in Sway to locate window.
|
|
|
|
|
|
|
|
## Sway
|
|
|
|
|
2020-11-23 09:35:26 +00:00
|
|
|
[Sway](https://github.com/swaywm/sway) is an i3-compatible Wayland compositor
|
|
|
|
and tiling window manager. See configs in 'dotfiles' repository. Here are some
|
|
|
|
scripts exclusively for automating or enhancing Sway.
|
2020-09-11 15:05:15 +00:00
|
|
|
|
2021-07-27 05:43:45 +00:00
|
|
|
[**sway/displays.pl**](https://git.john.me.tz/jpm/scripts/src/branch/master/sway/displays.pl)
|
2020-09-11 15:05:15 +00:00
|
|
|
|
2020-11-23 09:35:26 +00:00
|
|
|
Script to automatically configure wayland outputs using swaymsg. Also forks
|
|
|
|
waybars for each display. Allows custom configurations. No argument will run the
|
|
|
|
last used configuration (~/config/last_display). '-w' will run only waybar
|
|
|
|
without changing displays.
|
2020-09-11 15:05:15 +00:00
|
|
|
|
2021-07-27 05:43:45 +00:00
|
|
|
[**sway/gammastep.pl**](https://git.john.me.tz/jpm/scripts/src/branch/master/sway/gammastep.pl)
|
2020-09-11 15:05:15 +00:00
|
|
|
|
2020-11-23 09:35:26 +00:00
|
|
|
Setup Gammastep based on current location. I don't have geolocation in my
|
|
|
|
laptop, so this requires a URL that returns JSON, including a "lat" and "lon".
|
|
|
|
My URL (restricted to my IPs) returns these as recorded by PhoneTrack on my
|
|
|
|
phone similar to:
|
2020-09-11 15:05:15 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
{"lat":"180.12345678","lon":"-180.12345678","timestamp":"1599831660"}
|
|
|
|
```
|
|
|
|
|
2020-11-23 09:35:26 +00:00
|
|
|
It forks to keep running if terminal is killed. If location fails to be fetched
|
|
|
|
it will try again every 5 seconds.
|
2020-09-11 15:05:15 +00:00
|
|
|
|
2021-07-27 05:43:45 +00:00
|
|
|
[**sway/popup-term.pl**](https://git.john.me.tz/jpm/scripts/src/branch/master/sway/popup-term.pl)
|
2020-09-11 15:05:15 +00:00
|
|
|
|
2020-11-23 09:35:26 +00:00
|
|
|
A DIY version of the Tilde terminal. If terminal is not running, it opens on the
|
|
|
|
current display. If it is running but not on current dislpay, it moves to
|
|
|
|
current display. If it is already on current display, it is moved to a hidden
|
|
|
|
display ('grave').
|
2020-09-11 15:05:15 +00:00
|
|
|
|
2020-11-23 09:35:26 +00:00
|
|
|
Note the relevant settings in dotfiles repository (sway/config) related to the
|
|
|
|
'grave' workspace, as well as UXTerm.
|
2020-09-11 15:05:15 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
for_window [class="UXTerm"] floating enable, resize set height 600px, resize set width 800px, move position 1120px 460px
|
|
|
|
# Grave '`' key, DIY version of Tilde pop-up terminal
|
|
|
|
bindsym $mod+Grave exec /home/jpm/scripts/sway/popup-term.pl
|
|
|
|
# Visit the hidden grave workspace
|
|
|
|
bindsym $mod+Shift+Grave workspace grave
|
|
|
|
```
|
|
|
|
|
2020-11-23 09:35:26 +00:00
|
|
|
Also note that 'grave' has no label in waybar (waybar/config.template) to allow
|
|
|
|
it to be *hidden*.
|
2020-09-11 15:05:15 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
"sway/workspaces": {
|
2023-01-07 13:16:47 +00:00
|
|
|
"format": "{icon}",
|
|
|
|
"format-icons": {
|
|
|
|
"0": "0 \uf073", // Example of workspace with a label
|
|
|
|
"grave": "",
|
|
|
|
...
|
2020-09-11 15:05:15 +00:00
|
|
|
```
|
|
|
|
|
2021-07-27 05:43:45 +00:00
|
|
|
[**sway/swayidle.sh**](https://git.john.me.tz/jpm/scripts/src/branch/master/sway/swayidle.sh)
|
2020-09-11 15:05:15 +00:00
|
|
|
|
2020-11-16 07:40:33 +00:00
|
|
|
Work in progress. These scripts don't currently work the way I like.
|
2020-09-11 15:05:15 +00:00
|
|
|
|
2020-11-23 09:35:26 +00:00
|
|
|
Sway has an Idle detection daemon that can flexibly take different actions after
|
|
|
|
certain periods of inactivity as well as prior to sleep and after wake.
|
2020-09-11 15:05:15 +00:00
|
|
|
|
2020-11-23 09:35:26 +00:00
|
|
|
This script is meant to unify all of the actions into one script by accepting an
|
|
|
|
option.
|
2020-09-11 15:05:15 +00:00
|
|
|
|
2021-07-27 05:43:45 +00:00
|
|
|
[**sway/swayidlecountdown.sh**](https://git.john.me.tz/jpm/scripts/src/branch/master/sway/swayidlecountdown.sh)
|
2020-11-16 07:40:33 +00:00
|
|
|
|
2020-11-23 09:35:26 +00:00
|
|
|
Prior to locking a countdown should be provided. Currently testing how to manage
|
|
|
|
a countdown with Dunst, which doesn't actually support dynamic notifications.
|
2020-11-16 07:40:33 +00:00
|
|
|
|
|
|
|
## Thinkpad
|
|
|
|
|
2021-07-27 05:43:45 +00:00
|
|
|
[**thinkpad/blc.pl**](https://git.john.me.tz/jpm/scripts/src/branch/master/thinkpad/blc.pl)
|
2020-11-23 09:35:26 +00:00
|
|
|
|
|
|
|
Overly complicated backlight brightness control script. Provides flexible
|
|
|
|
control of backlight so that changes can be easily scripted or called from
|
|
|
|
keyboard shortcuts. --help provides some usage docs.
|
2020-11-16 07:40:33 +00:00
|
|
|
|
2021-07-27 05:43:45 +00:00
|
|
|
[**thinkpad/kbd_backlight.pl**](https://git.john.me.tz/jpm/scripts/src/branch/master/thinkpad/kbd_backlight.pl)
|
2020-11-23 09:35:26 +00:00
|
|
|
|
|
|
|
Simple script to cycle keyboard backlight. Gets max brightness, current
|
|
|
|
brightness and then changes then increments the current brightness. Uses mod of
|
|
|
|
max+1 so that it will cycle back around to 0 (disabled) if it is already at max.
|
2020-11-16 07:40:33 +00:00
|
|
|
|
2021-07-27 05:43:45 +00:00
|
|
|
[**thinkpad/pow.pl**](https://git.john.me.tz/jpm/scripts/src/branch/master/thinkpad/pow.pl)
|
2021-07-27 05:17:23 +00:00
|
|
|
|
|
|
|
Overly complicated battery and power status fetcher script. Can output stats as
|
|
|
|
JSON, Waybar-friendly percentage and icon, or a pretty table suitable for use with
|
|
|
|
plain-text notifications via notify-send or similar.
|
|
|
|
|
2021-07-27 05:43:45 +00:00
|
|
|
[**thinkpad/user-thinkpad-controls@.service**](https://git.john.me.tz/jpm/scripts/src/branch/master/thinkpad/user-thinkpad-controls@.service)
|
2020-11-23 09:35:26 +00:00
|
|
|
|
|
|
|
SystemD unit file used to give ownership of necessary sys files to whichever
|
|
|
|
user it is enabled for `systemctl enable user-thinkpad-control@jpm`. Without
|
|
|
|
this, the user won't be able to write these files and thus cannot set brightness
|
|
|
|
values.
|
2020-11-16 07:40:33 +00:00
|
|
|
|
|
|
|
## Waybar
|
|
|
|
|
2020-11-23 09:35:26 +00:00
|
|
|
[Waybar](https://github.com/Alexays/Waybar) is a very flexible and customizable
|
|
|
|
taskbar for Sway (and other Wlroots-based wayland compositors). Waybar applets
|
|
|
|
have hover and click functionality and have several scripts related to those.
|
|
|
|
See the .config repository for the actual Waybar and Sway configs.
|
2020-11-16 07:40:33 +00:00
|
|
|
|
2021-07-27 05:43:45 +00:00
|
|
|
[**waybar/waybar-cpu.sh**](https://git.john.me.tz/jpm/scripts/src/branch/master/waybar/waybar-cpu.sh)
|
2020-11-16 07:40:33 +00:00
|
|
|
|
|
|
|
Launch htop in floating window (bottom-right). If already running, kill it.
|
|
|
|
|
2021-07-27 05:43:45 +00:00
|
|
|
[**waybar/waybar-disk.sh**](https://git.john.me.tz/jpm/scripts/src/branch/master/waybar/waybar-disk.sh)
|
2020-11-16 07:40:33 +00:00
|
|
|
|
2020-11-23 09:35:26 +00:00
|
|
|
Notification with disk usage summaries. Renders properly with Dunst, but not
|
|
|
|
Mako.
|
2020-11-16 07:40:33 +00:00
|
|
|
|
2021-07-27 05:43:45 +00:00
|
|
|
[**waybar/waybar-mem.sh**](https://git.john.me.tz/jpm/scripts/src/branch/master/waybar/waybar-mem.sh)
|
2020-11-16 07:40:33 +00:00
|
|
|
|
|
|
|
Notification with memory usage summaries.
|
|
|
|
|
2021-07-27 05:43:45 +00:00
|
|
|
[**waybar/waybar-nm.sh**](https://git.john.me.tz/jpm/scripts/src/branch/master/waybar/waybar-nm.sh)
|
2020-11-16 07:40:33 +00:00
|
|
|
|
|
|
|
Launch nmtui in floating window (bottom-right). If already running, kill it.
|
2020-09-11 15:05:15 +00:00
|
|
|
|
|
|
|
## Miscellaneous
|
|
|
|
|
2021-07-27 05:43:45 +00:00
|
|
|
[**apply-gruvbox.sh**](https://git.john.me.tz/jpm/scripts/src/branch/master/apply-gruvbox.sh)
|
2020-12-01 10:13:20 +00:00
|
|
|
|
|
|
|
A single theme version of the one provided
|
|
|
|
[here](https://raw.githubusercontent.com/Mayccoll/Gogh). Applies the theme to a
|
|
|
|
variety of terminals. Not really necessary after cloning the 'dotfiles'
|
|
|
|
repository.
|
|
|
|
|
2021-07-27 05:43:45 +00:00
|
|
|
[**send-to-kodi.sh**](https://git.john.me.tz/jpm/scripts/src/branch/master/send-to-kodi.sh)
|
2020-09-11 15:05:15 +00:00
|
|
|
|
2020-11-23 09:35:26 +00:00
|
|
|
[This script](https://github.com/allejok96/send-to-kodi) sends a URL or local
|
|
|
|
file to a [Kodi](https://github.com/xbmc) media player. Only modified to have my
|
|
|
|
local media server IP.
|
2020-09-11 15:05:15 +00:00
|
|
|
|
2021-07-27 05:43:45 +00:00
|
|
|
[**setup_wireguard.sh**](https://git.john.me.tz/jpm/scripts/src/branch/master/setup_wireguard.sh)
|
2020-09-11 15:05:15 +00:00
|
|
|
|
2020-12-01 10:13:20 +00:00
|
|
|
Script to install WireGuard and generate a config file. Requires modification
|
|
|
|
with the server public IP, server public key, and change to first 3 octets if
|
|
|
|
necessary. Will attempt to resolve dependencies and has a special case for
|
|
|
|
Raspberry Pi (detected with `uname -m` as 'arm'.
|