Browse Source

update

master
Daniel Napora 2 years ago
parent
commit
f2f401fde7
  1. 6
      mabox-en/Packages-Desktop
  2. 23
      mabox-en/desktop-overlay/etc/skel/.config/mabox/jgtype.csv
  3. 63
      mabox-en/desktop-overlay/etc/skel/bin/autosnap
  4. 95
      mabox-en/desktop-overlay/etc/skel/bin/jgtype
  5. 22
      mabox-en/desktop-overlay/etc/skel/bin/mabox-terminal
  6. 6
      mabox-pl/Packages-Desktop

6
mabox-en/Packages-Desktop

@ -132,6 +132,12 @@ dash
#micro-manjaro
terminus-font
vim
#---------=> Modern CLI tools
bat
fd
sd
exa
ripgrep
#---------=> GUI text editor
geany

23
mabox-en/desktop-overlay/etc/skel/.config/mabox/jgtype.csv

@ -0,0 +1,23 @@
^sep(<big><b>jgtype</b></big> - <i>type command helper</i>)
Updates,^checkout(updates)
Mirrors and keys,^checkout(mirrors)
^sep()
Configure,geany ~/.config/mabox/jgtype.csv
#TAGS
^tag(updates)
^sep(Pacman)
Update sudo pacman -Syu,jgtype "sudo pacman -Syu"
PKG DB refresh + update sudo pacman -Syyu,jgtype "sudo pacman -Syyu"
^sep(Yay)
Update yay,jgtype "yay"
PKG DB refresh + update yay -Syyu,jgtype "yay -Syyu"
^tag(mirrors)
^sep(Mirrors ranking)
Fasttrack sudo pacman-mirrors -f5,jgtype "sudo pacman-mirrors -f5"
GeoIP sudo pacman-mirrors -i --geoip, jgtype "sudo pacman-mirrors -i --geoip"
All sudo pacman-mirrors -i -c all,jgtype "sudo pacman-mirrors -i -c all"
Can't render this file because it contains an unexpected character in line 12 and column 33.

63
mabox-en/desktop-overlay/etc/skel/bin/autosnap

@ -0,0 +1,63 @@
#!/bin/bash
#===================================================================================
# AUTOSNAP
# FILE: autosnap
# USAGE: autosnap
# DESCRIPTION: Snap current windows according the mouse position
# REQUIREMENTS: xdotool, xrandr
# AUTHOR: Leonardo Marco
# VERSION: 1.0
# CREATED: 12.10.2017
# LAST-UPDATE: 12.10.2017
#===================================================================================
# Key combinations in openbox (same as configured in rc.xml)
topleft_key="super+KP_Home"
top_key="super+KP_Up"
topright_key="super+KP_Prior"
left_key="super+KP_Left"
center_key="super+KP_Begin"
right_key="super+KP_Right"
bottomleft_key="super+KP_End"
bottom_key="super+KP_Down"
bottomright_key="super+KP_Next"
# Format xrandr output
xrandr="$(xrandr | grep -w "connected" | grep -o "[0-9]\+x[0-9]\++[0-9]\++[0-9]\+" | tr "x+" " " | sort -nk 4)"
# Get num of monitors
num_screens=$(echo "$xrandr" | wc -l)
[ "$num_screens" -gt 2 ] && echo "Script cannot deal with more than 2 monitors" >&2 && exit 1
# Get screen resolution
screen_left=($(echo "$xrandr" | head -1))
[ "$num_screens" -gt 1 ] && screen_right=($(echo "$xrandr" | tail -1))
# Get current mouse position
out="$(xdotool getmouselocation)"
out=(${out//[^0-9 ]/})
current_x="${out[0]}"
current_y="${out[1]}"
# Calculate current monitor and relative position to this monitor
if [ "$num_screens" -gt 1 ] && [ "$current_x" -gt "${screen_right[2]}" ]; then
current_screen=(${screen_right[*]})
current_x=$(($current_x-${screen_right[2]}))
else
current_screen=(${screen_left[*]})
fi
# Check zone-position
if [ "$current_y" -lt "$((${current_screen[1]}*1/3))" ]; then # IN-TOP
var_key="top"
elif [ "$current_y" -gt "$((${current_screen[1]}*2/3))" ]; then # IN-BOTTOM
var_key="bottom"
fi
if [ "$current_x" -lt "$((${current_screen[0]}*1/3))" ]; then # IN-LEFT
var_key="${var_key}left"
elif [ "$current_x" -gt "$((${current_screen[0]}*2/3))" ]; then # IN-RIGHT
var_key="${var_key}right"
fi
[ ! "$var_key" ] && var_key="center"
var_key="${var_key}_key"
# Press openbox snap combination according position
xdotool key "${!var_key}"

95
mabox-en/desktop-overlay/etc/skel/bin/jgtype

@ -0,0 +1,95 @@
#!/bin/bash
if [ "$1" ]; then
case "$1" in
edit) edit;;
reset) reset;;
*) xdotool type --delay 0 "$1"
exit 1
;;
esac
fi
# IF exist ~/.config/mabox/jgtype.csv CSV="$HOME/.config/mabox/jgtype.csv
# ELSE CSV=/usr/share/mb-jgtools/jgtype.csv
. $HOME/.config/mabox/mabox.conf
jgmenu_theme=${jgmenu_theme:-obtheme}
jgmenu_use_icons=${jgmenu_use_icons:-true}
case $jgmenu_theme in
default)
export color_norm_fg="#FFFFFF "
;;
obtheme)
export color_title_fg="#FFFFFF "
ob_file=$HOME/.config/openbox/rc.xml
[[ -f $ob_file ]] && wm_theme=$(awk '/<theme>/ {while (getline n) {if (match(n, /<name>/)){l=n; exit}}} END {split(l, a, "[<>]"); print a[3]}' "$ob_file")
while read -r a b c
do
[[ -n "$a" && "$a" != [[:blank:]#]* ]] && export "$a$b$c"
done < $HOME/.config/mabox/jgobthemes/$wm_theme.colorrc
;;
*)
export color_norm_fg="#FFFFFF "
;;
esac
. $HOME/.config/mabox/jgmenusize.conf
config_file=$(mktemp)
menu_file=$(mktemp)
trap "rm -f ${config_file} ${menu_file}" EXIT
cat <<EOF >${config_file}
stay_alive = 0
menu_width = 340
#menu_height_min = 480
menu_padding_top = ${MENU_PADDING_TOP:-4}
menu_padding_right = ${MENU_PADDING_RIGHT:-4}
menu_padding_bottom = ${MENU_PADDING_BOTTOM:-4}
menu_padding_left = ${MENU_PADDING_LEFT:-4}
menu_radius = ${MENU_RADIUS:-0}
menu_halign = center
menu_valign = center
tabs = ${TABS:-80}
item_margin_y = 4
item_height = 24
item_padding_x = 10
item_radius = 0
item_border = 1
icon_size = 0
color_menu_bg = ${color_menu_bg:-#222222 80}
color_menu_border = ${color_menu_border:-#2f9b85 100}
color_norm_bg = ${color_norm_bg:-#000000 0}
color_norm_fg = ${color_norm_fg:-#CCCCCC 100}
color_sel_bg = ${color_sel_bg:-#169f6f 60}
color_sel_fg = ${color_sel_fg:-#f8f8f8 100}
color_sel_border = ${color_sel_border:-#504e65 100}
color_sep_fg = ${color_sep_fg:-#4D4D4D 100}
color_sep_bg = ${color_sep_bg:-#262626 100}
color_title_fg = ${color_title_fg:-#4D4D4D 100}
color_title_border = ${color_title_border:-#169f6f 100}
color_title_bg = ${color_title_bg:-#262626 100}
color_scroll_ind = ${COLOR_SCROLL_IND:-#504e65 100}
sep_markup = weight="bold" foreground="${color_title_fg% *}"
sep_height = ${sep_height:-5}
font = ${jgmenu_font:-Noto Sans Medium 9}
EOF
cat <<EOF >${menu_file}
. ~/.config/mabox/jgtype.csv
EOF
jgmenu --config-file=${config_file} --csv-file=${menu_file}

22
mabox-en/desktop-overlay/etc/skel/bin/mabox-terminal

@ -0,0 +1,22 @@
#!/bin/bash
# Author: Daniel Napora <napcok@gmail.com>
# "Show-Hide" terminal wrapper for terminator for use with keybind eg. super + enter.
# Depenging on actual state it start, show or hide terminal window.
ID=$(wmctrl -x -l | grep mabox-terminal | awk '{print $1}' | head -n 1)
if [ -z "${ID}" ]; then
TOP=$(wmctrl -d|grep "*"|awk '{print $8}'|cut -d',' -f2)
LEFT=$[$(wmctrl -d|grep "*"|awk '{print $4}'|cut -d'x' -f1)/8]
HEIGHT=$[$(wmctrl -d|grep "*"|awk '{print $4}'|cut -d'x' -f2)/2]
WIDTH=$[${LEFT}*6]
terminator -T mabox-terminal -b --geometry "${WIDTH}x${HEIGHT}+${LEFT}+${TOP}"
else
ID_DEC=$((${ID}))
ACTIVE_WIN_DEC=$(xdotool getactivewindow)
if [ "${ACTIVE_WIN_DEC}" == "${ID_DEC}" ]; then
xdotool windowminimize ${ID_DEC}
else
xdotool windowactivate ${ID_DEC}
fi
fi

6
mabox-pl/Packages-Desktop

@ -132,6 +132,12 @@ dash
#micro-manjaro
terminus-font
vim
#---------=> Modern CLI tools
bat
fd
sd
exa
ripgrep
#---------=> GUI text editor
geany

Loading…
Cancel
Save