diff --git a/bin/mb-brightness b/bin/mb-brightness new file mode 100755 index 0000000..94b99ee --- /dev/null +++ b/bin/mb-brightness @@ -0,0 +1,17 @@ +#!/bin/bash +## mb-brightness - control brightness on Mabox + +CARD=$(ls /sys/class/backlight | head -n 1) + +inc() { +[[ "$CARD" == *"intel_"* ]] && xbacklight -inc 10 || light -A 5 +} + +dec() { +[[ "$CARD" == *"intel_"* ]] && xbacklight -dec 10 || light -U 5 +} + +case "$1" in + inc)inc;; + dec)dec;; +esac diff --git a/bin/obxml b/bin/obxml new file mode 100755 index 0000000..5e869c3 --- /dev/null +++ b/bin/obxml @@ -0,0 +1,63 @@ +#!/bin/bash +# helper script for editing Openbox rc.xml config file + +nspace="http://openbox.org/3.4/rc" +rcxml="$HOME/.config/openbox/rc.xml" +reconf=0 + +sel(){ +xml sel -N a="$nspace" -t -v ${1} "$rcxml" +} + +set(){ +xml ed -L -N a="$nspace" -u ${1} -v ${2} "$rcxml" +reconf=1 +} + +switch_desk(){ +case "$1" in + on) + set '/a:openbox_config/a:mouse/a:context[@name="Root"]/a:mousebind[@action="Click"][@button="Up"]/a:action/a:to' previous + set '/a:openbox_config/a:mouse/a:context[@name="Root"]/a:mousebind[@action="Click"][@button="Down"]/a:action/a:to' next + ;; + off) + set '/a:openbox_config/a:mouse/a:context[@name="Root"]/a:mousebind[@action="Click"][@button="Up"]/a:action/a:to' none + set '/a:openbox_config/a:mouse/a:context[@name="Root"]/a:mousebind[@action="Click"][@button="Down"]/a:action/a:to' none + ;; +esac + +} + +show_desk(){ +case "$1" in + on) + set '/a:openbox_config/a:mouse/a:context[@name="Root"]/a:mousebind[@action="Press"][@button="Left"]/a:action/@name' ToggleShowDesktop + ;; + off) + set '/a:openbox_config/a:mouse/a:context[@name="Root"]/a:mousebind[@action="Press"][@button="Left"]/a:action/@name' none + ;; +esac +} +focus_follow_mouse(){ +case "$1" in + on) + set '/a:openbox_config/a:focus/a:followMouse' yes + set '/a:openbox_config/a:focus/a:raiseOnFocus' yes + ;; + off) + set '/a:openbox_config/a:focus/a:followMouse' no + set '/a:openbox_config/a:focus/a:raiseOnFocus' no + ;; +esac +} + +case "$1" in +sel)sel "$2";; +set)set "$2" "$3";; +switch_desk)switch_desk "$2";; +show_desk)show_desk "$2";; +focus_follow_mouse)focus_follow_mouse "$2";; + +esac + +[[ "$reconf" = "1" ]] && openbox --reconfigure diff --git a/bin/wpg-mabox b/bin/wpg-mabox deleted file mode 100755 index e7387fb..0000000 --- a/bin/wpg-mabox +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash -reload-gtk - -killall conky - -sleep 1 -wallp="$(< "${HOME}/.cache/wal/wal")" -cp "$HOME/.config/wpg/samples/${wallp##*/}_wal_sample.png" "$HOME/.config/conky/images/colors-colorize.png" -nitrogen --set-scaled ${wallp} --save - -mb-conky-session --autostart -#echo ${wallp##*/} -