From 9547c6cbbf6be3f3e11569cb339614a7a1a4c028 Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Wed, 10 Jul 2024 15:28:45 -0400 Subject: [PATCH] push scripts into /usr/local/bin that were possibly holding /a mountpoint open --- brc2 | 16 ++++++++++++++-- i3-abrowser | 2 +- i3-konsole | 2 +- i3-pull | 40 ---------------------------------------- i3-sway/common.conf | 8 ++++---- prof-notify | 2 +- script-files | 9 ++++++++- 7 files changed, 29 insertions(+), 50 deletions(-) delete mode 100755 i3-pull diff --git a/brc2 b/brc2 index 6b41bc1..c4dfdea 100644 --- a/brc2 +++ b/brc2 @@ -5040,9 +5040,21 @@ localai() { schroot -c bookworm } +spdfx() { + local spd_file + spdx -f ~/.spd/spd/spd_data_financial.gpg "$@" +} + spdx() { - local out i input pw - out=$(gpg -q -d ~/.spd/spd/spd_data.gpg 2>/dev/null | gr "$@") + local out i input pw file + if [[ $1 == -f ]]; then + file="$2" + shift 2 + else + file=~/.spd/spd/spd_data.gpg + fi + + out=$(gpg -q -d "$file" 2>/dev/null | gr "$@") if [[ $out == *$'\n'* ]]; then i=0 while read -r line; do diff --git a/i3-abrowser b/i3-abrowser index 101468a..fdd9e27 100755 --- a/i3-abrowser +++ b/i3-abrowser @@ -42,7 +42,7 @@ else fi # spawn and mark if we dont have a mark already -if ! /a/c/i3-focus-maybe abrowser; then +if ! i3-focus-maybe abrowser; then i3-msg "workspace 2" i3-split-maybe diff --git a/i3-konsole b/i3-konsole index c18e588..6140247 100755 --- a/i3-konsole +++ b/i3-konsole @@ -26,7 +26,7 @@ set -eE -o pipefail trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" exit status: $?, PIPESTATUS: ${PIPESTATUS[*]}" >&2' ERR -if ! /a/c/i3-focus-maybe term; then +if ! i3-focus-maybe term; then i3-msg "workspace 2" i3-split-maybe konsole & diff --git a/i3-pull b/i3-pull deleted file mode 100755 index 5ed9181..0000000 --- a/i3-pull +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash -# I, Ian Kelling, follow the GNU license recommendations at -# https://www.gnu.org/licenses/license-recommendations.en.html. They -# recommend that small programs, < 300 lines, be licensed under the -# Apache License 2.0. This file contains or is part of one or more small -# programs. If a small program grows beyond 300 lines, I plan to switch -# its license to GPL. - -# Copyright 2024 Ian Kelling - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -# pull in the $1 marked window to the current workspace, unless the current workspace is #1, then swap it with the current window - -set -e; . /usr/local/lib/bash-bear; set +e - -mark=$1 -# height of currently focused window -h=$(i3-msg -t get_tree | jq -r ".. | select(.focused? == true) | .rect.height") - -cur_workspace=$(i3-msg -t get_workspaces | jq -r '.[] | select(.focused? == true) | .name') - -# 1080 = half the 4k height -#if [[ $cur_workspace == 1 && $h ]] && (( h <= 1080 )); then -if [[ $cur_workspace == 1 && $h ]]; then - i3-msg "swap container with mark $mark; [con_mark=\"$mark\"] focus" -else - i3-msg '[con_mark="'$mark'"] move workspace current' -fi diff --git a/i3-sway/common.conf b/i3-sway/common.conf index dbc5931..16922ea 100644 --- a/i3-sway/common.conf +++ b/i3-sway/common.conf @@ -55,10 +55,10 @@ bindsym $mod+equal $ex "i3-set-layout splith" # get class with xprop, example output # WM_CLASS(STRING) = "irssi", "URxvt" # xprop |& grep WM_CLASS -bindsym $mod+w $ex "/a/exe/i3-abrowser" +bindsym $mod+w $ex "i3-abrowser" bindsym $mod+shift+w fullscreen toggle -bindsym $mod+e $ex "/a/exe/i3-emacs" +bindsym $mod+e $ex "i3-emacs" # unused #bindsym $mod+shift+e bindsym $mod+r $ex "/a/bin/ds/xl" @@ -127,7 +127,7 @@ bindcode 171 $ex "toggle-mute unmute" #bindsym $mod+shift+5 $ex "/a/a.sh" -bindsym $mod+b $ex "/a/exe/i3-konsole" +bindsym $mod+b $ex "i3-konsole" bindsym $mod+shift+b unmark term; mark term @@ -188,7 +188,7 @@ for_window [class="copyq" instance="copyq" window_type="normal"] floating enable # eh, dont really like web page titles + a long browser name string. for_window [class="firefox" instance="Navigator" window_role="browser"] title_format "b" bindsym $mod+y $ex copyq-restart -bindsym $mod+shift+y $ex "/a/exe/i3-chat" +bindsym $mod+shift+y $ex "i3-chat" # Font for window titles. Will also be used by the bar unless a different font # is used in the bar {} block below. diff --git a/prof-notify b/prof-notify index 3315241..a748328 100644 --- a/prof-notify +++ b/prof-notify @@ -24,7 +24,7 @@ set -e; . /usr/local/lib/bash-bear; set +e while read -r line; do # check that the profanity window is not focused - if ! /a/c/i3-check-profanity &>/dev/null; then + if ! i3-check-profanity &>/dev/null; then # the profanity tag makes it so new notification replaces old. dunstify -h string:x-dunst-stack-tag:profanity $line fi diff --git a/script-files b/script-files index 1cbb6aa..4e8c413 100644 --- a/script-files +++ b/script-files @@ -46,13 +46,20 @@ my_bin_files=( prof-notify /a/bin/newns/newns /a/bin/fai/fai/config/distro-install-common/ethusb-static + + i3-abrowser i3-auto-layout-toggle + i3-chat + i3-check-profanity + i3-emacs i3-event-hook + i3-focus-maybe + i3-konsole i3-mouse-warp - i3-pull i3-set-layout i3-split-maybe i3-split-push + copyq-restart toggle-mute ) -- 2.30.2