From 932248dbab3bc2951be7cb7c25bb6d4d20964e24 Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Tue, 21 Mar 2023 13:19:47 +0800 Subject: Improve openbox --- X11/openbox/rc.xml | 36 +++++++++++++++++++++--------------- bin/desktop/takeshot | 3 ++- 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/X11/openbox/rc.xml b/X11/openbox/rc.xml index d7c0345..7c08d18 100644 --- a/X11/openbox/rc.xml +++ b/X11/openbox/rc.xml @@ -105,10 +105,14 @@ - alacritty --title OPENBOX-CONFIG - -o "window.dimensions.lines=32" - -o "window.dimensions.columns=90" - -e vim ~/.config/openbox/rc.xml + + sh -c ' + xdotool search --name @OPENBOX_CONFIG windowactivate || \ + alacritty --title @OPENBOX_CONFIG \ + -o "window.dimensions.lines=32" \ + -o "window.dimensions.columns=90" \ + -e vim ~/.config/openbox/rc.xml \ + ' @@ -485,7 +489,7 @@ - takeshot --area + ~/bin/takeshot --area @@ -557,15 +561,13 @@ - - alacritty --title MPD -e ncmpcpp - - - - alacritty --title YOO --class "CONFIRM_BEFORE_CLOSE" - + sh -c ' + xdotool search --name MPD windowactivate || \ + alacritty --title MPD -e ncmpcpp + ' + @@ -605,9 +607,13 @@ - alacritty - -o "window.dimensions.lines=30" - -e nmtui + sh -c ' + xdotool search --name "Network Manager" windowactivate || \ + alacritty \ + --title "Network Manager" \ + -o "window.dimensions.lines=30" \ + -e nmtui + ' diff --git a/bin/desktop/takeshot b/bin/desktop/takeshot index 09252f3..9f34f26 100755 --- a/bin/desktop/takeshot +++ b/bin/desktop/takeshot @@ -53,7 +53,8 @@ shotwin () { } shotarea () { - cd ${dir} && maim -u -f png -s -b 2 -c 0.35,0.55,0.855 | tee "$file" | xclip -selection clipboard -t image/png + set -o pipefail + cd ${dir} && maim -u -f png -s -b 2 -c 0.35,0.55,0.855 | tee "$file" | xclip -selection clipboard -t image/png && \ notify_view } -- cgit v1.2.3-70-g09d2