From edb73ef90bce5f95a4c6ebf4fda995d74c333ad3 Mon Sep 17 00:00:00 2001 From: speediegq Date: Sun, 9 Oct 2022 15:11:42 +0200 Subject: [PATCH] More Gentoo-friendliness --- scripts/speedwm-dm | 22 ---------------------- scripts/speedwm_status | 5 +---- 2 files changed, 1 insertion(+), 26 deletions(-) diff --git a/scripts/speedwm-dm b/scripts/speedwm-dm index 2bfaf0e..7bc59d2 100755 --- a/scripts/speedwm-dm +++ b/scripts/speedwm-dm @@ -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 diff --git a/scripts/speedwm_status b/scripts/speedwm_status index 72d8898..4b5a43a 100755 --- a/scripts/speedwm_status +++ b/scripts/speedwm_status @@ -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