More Gentoo-friendliness

This commit is contained in:
speediegq 2022-10-09 15:11:42 +02:00
parent 3086171d8f
commit edb73ef90b
2 changed files with 1 additions and 26 deletions

View file

@ -2,35 +2,13 @@
# speedwm-dm
# Create a .desktop file for people who use display managers.
# Delete the topbar file
rm -f /usr/share/speedwm/topbar
# Delete the padding file
rm -f /usr/share/speedwm/nopadding
# Make the directory for the .desktop file if it does not exist
mkdir -p /usr/share/xsessions
# Write the .desktop entry
printf "[Desktop Entry]\nEncoding=UTF-8\nName=speedwm\nComment=speedwm: speedie's window manager\nExec=/usr/bin/speedwm_run\nIcon=speedwm\nType=XSession" > /usr/share/xsessions/speedwm.desktop
# If the bar is on the top, touch /usr/share/speedwm/topbar
TOPBAR=$(grep "barposition" options.h | grep "1" | awk '{ print $5 }')
# If we have no padding, touch /usr/share/speedwm/nopadding
PADDING=$(grep "barpaddingv" options.h | grep "0" | awk '{ print $5 }')
# Write the compositor to /usr/share/speedwm/compositor
COMPOSITOR=$(grep "define COMPOSITOR " actions.h | awk '{ print $3 }' | sed 's/"//g')
# Status
STATUS=$(grep "char status" options.h | awk '{ print $5 }' | sed 's/"//g; s/;//g')
# Print all of it
echo $TOPBAR | grep -q "1" && touch /usr/share/speedwm/topbar
echo $PADDING | grep -q "0" && touch /usr/share/speedwm/nopadding
echo $COMPOSITOR > /usr/share/speedwm/compositor
echo $STATUS > /usr/share/speedwm/statusbar
echo $(pwd) > /usr/share/speedwm/sourcedir
sed "s/#define //g" toggle.h | grep LAYOUT | sed "s|/[*]|#|g; s|[*]/||g; s/ //g; s/1/=1/g; s/0/=0/g; s/#/ # /g" > /usr/share/speedwm/layouts

View file

@ -2,11 +2,8 @@
# speedwm_status
# status bar manager
STATUSBAR=$(cat /usr/share/speedwm/statusbar)
STATUSBAR2=$(grep speedwm.status: $HOME/.config/speedwm-de/speedwmrc | awk '{ print $2 }')
STATUSBAR="status"
IN_ARGS="$@"
BUTTON="$BUTTON"
echo $BUTTON > /tmp/button
# check if the two values are the same, if not then we use the rc config
if [ "$STATUSBAR" != "$STATUSBAR2" ]; then