mv wrappers to /usr/local/bin
This commit is contained in:
parent
533defce44
commit
470b32f22d
@ -91,6 +91,11 @@ checkautostart
|
||||
[ ! -f "$HOME/.config/mabox/.mwelcome" ] && mwelcome &
|
||||
# [ -f "$HOME/.config/wpg/.mabox-init" ] && wpg-mabox-init &
|
||||
|
||||
# rename old wrappers, they now in /usr/local/bin
|
||||
wrappers=(nitrogen i3lock xrandr lxappearance skippy-xd-fix)
|
||||
for wrapper in "${wrappers[@]}"
|
||||
[[ -f "$HOME/.local/bin/${wr}" ]] && mv "$HOME/.local/bin/${wr}" "$HOME/.local/bin/${wr}.old"
|
||||
do
|
||||
|
||||
. $HOME/.config/mabox/mabox.conf
|
||||
#Set config variables if not set or empty; ":" means do nothing
|
||||
|
38
local/bin/lxappearance
Executable file
38
local/bin/lxappearance
Executable file
@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
GTK2_RC="$HOME/.gtkrc-2.0"
|
||||
GTK3_RC="$HOME/.config/gtk-3.0/settings.ini"
|
||||
ICON_DEF="$HOME/.icons/default/index.theme"
|
||||
XRES="$HOME/.Xresources"
|
||||
|
||||
/usr/bin/lxappearance
|
||||
|
||||
sleep .5
|
||||
#READ Cursor theme name from GTK2_RC
|
||||
read CURTHEME <<< "$(grep gtk-cursor-theme-name ${GTK2_RC} | cut -d'"' -f2)"
|
||||
# WRITE to GTK3
|
||||
if grep "^gtk-cursor-theme-name=${CURTHEME}" ${GTK3_RC};then
|
||||
#found nic nie robimy
|
||||
:
|
||||
else
|
||||
sd "^gtk-cursor-theme-name.*$" "gtk-cursor-theme-name=${CURTHEME}" ${GTK3_RC}
|
||||
fi
|
||||
|
||||
# WRITE to ICON_DEF
|
||||
if grep "^Inherits=${CURTHEME}" ${ICON_DEF};then
|
||||
:
|
||||
else
|
||||
sd "^Inherits=.*$" "Inherits=${CURTHEME}" ${ICON_DEF}
|
||||
fi
|
||||
# WRITE to .Xresources
|
||||
if grep "^Xcursor.theme: ${CURTHEME}" ${XRES};then
|
||||
:
|
||||
else
|
||||
if grep Xcursor.theme ${XRES};then
|
||||
sd "^Xcursor.theme:.*$" "Xcursor.theme: ${CURTHEME}" ${XRES}
|
||||
else
|
||||
echo "Xcursor.theme: ${CURTHEME}" >> ${XRES}
|
||||
fi
|
||||
xrdb "$HOME/.Xresources"
|
||||
fi
|
||||
|
||||
|
52
local/bin/nitrogen
Executable file
52
local/bin/nitrogen
Executable file
@ -0,0 +1,52 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Wrapper for nitrogen, so LightDM wallpaper is synced.
|
||||
#
|
||||
# Copyright (C) 2021 Rafael Cavalcanti - rafaelc.org
|
||||
# Licensed under GPLv3
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
/usr/bin/nitrogen "$@"
|
||||
if [[ "${1:-}" == "--restore" ]]; then
|
||||
exit $?
|
||||
fi
|
||||
|
||||
readonly bg_path="$(awk -F '=' '/file/{print $2}' "$HOME/.config/nitrogen/bg-saved.cfg")"
|
||||
|
||||
dbus-send \
|
||||
--print-reply \
|
||||
--system \
|
||||
--dest=org.freedesktop.Accounts \
|
||||
/org/freedesktop/Accounts/User$(id -u) \
|
||||
org.freedesktop.DBus.Properties.Set \
|
||||
string:org.freedesktop.DisplayManager.AccountsService \
|
||||
string:BackgroundFile \
|
||||
variant:string:"$bg_path"
|
||||
|
||||
# Mabox Colorizer
|
||||
# Generate wallpaper color palette
|
||||
WALLPALDIR="$HOME/.config/colormenu/palettes/wallp"
|
||||
mkdir -p "$WALLPALDIR"
|
||||
read WALLPATH<<< $(grep file "$HOME/.config/nitrogen/bg-saved.cfg" | cut -d'=' -f2)
|
||||
WALLPAPER=${WALLPATH##*/}
|
||||
if [ ! -f "$WALLPALDIR/$WALLPAPER.clr" ]; then
|
||||
convert ${WALLPATH} -resize 25% -colors 16 -unique-colors txt:- |grep -v '^#'| awk '{print substr($3,1,7)}' |pastel sort-by brightness |pastel format hex > "$WALLPALDIR/$WALLPAPER.clr"
|
||||
fi
|
||||
|
||||
# GENERATE THUMBNAIL
|
||||
THUMBDIR="$HOME/.config/mabox/wallthumbs"
|
||||
mkdir -p ${THUMBDIR}
|
||||
THUMB="${THUMBDIR}/${WALLPAPER}.png"
|
||||
if [[ ! -f "$THUMB" ]]; then
|
||||
convert ${WALLPATH} -resize 270x150^ -gravity center -extent 270x150 ${THUMB}
|
||||
fi
|
||||
|
||||
# auto generate themes
|
||||
if command -v w2theme &> /dev/null
|
||||
then
|
||||
source ~/.config/colorizer/colorizer.conf
|
||||
if [[ "$wall2themes" == "yes" ]];then
|
||||
w2theme colorize
|
||||
fi
|
||||
fi
|
16
local/bin/xrandr
Executable file
16
local/bin/xrandr
Executable file
@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Wrapper for xrandr, so wallpaper and Conky are reloaded on resolution change.
|
||||
#
|
||||
# Copyright (C) 2022 Daniel Napora - maboxlinux.org
|
||||
# Licensed under GPLv3
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
/usr/bin/xrandr "$@"
|
||||
if [[ "$@" == *"--output"* ]];then
|
||||
nitrogen --restore
|
||||
if pgrep conky;then
|
||||
killall -SIGUSR1 conky 2> /dev/null
|
||||
fi
|
||||
fi
|
Loading…
Reference in New Issue
Block a user