Issue with the Separate entry in Appearance>Wallpaper [Solved]
Re: Issue with the Separate entry in Appearance>Wallpaper
Ok, I'll wait. I have something else on that list to take care of
Production: MX-23 Xfce, AMD FX-4130 Quad-Core, GeForce GT 630/PCIe/SSE2, 16 GB, SSD 120 GB, Data 1TB
Personal: Lenovo X1 Carbon with MX-23 Fluxbox
Other: Raspberry Pi 5 with MX-23 Xfce Raspberry Pi Respin
Personal: Lenovo X1 Carbon with MX-23 Fluxbox
Other: Raspberry Pi 5 with MX-23 Xfce Raspberry Pi Respin
Re: Issue with the Separate entry in Appearance>Wallpaper
Translations for separate-backgrounds seem to be a bit all over the place.
In the languages I tried the first window shows
- German and Italian show no text at all
- Polish, French, Spanish, Greek & Dutch show a mix of translated and English strings.
The later may be due to incomplete translations, but something is wrong with the translation files for the former..
In the languages I tried the first window shows
- German and Italian show no text at all
- Polish, French, Spanish, Greek & Dutch show a mix of translated and English strings.
The later may be due to incomplete translations, but something is wrong with the translation files for the former..
Re: Issue with the Separate entry in Appearance>Wallpaper
@Jerry3904
Made a PR to MX-Linux/mxfb-accessories with the commenting fix and a nice surprise for those who wanted a preview in the file selection window...
Made a PR to MX-Linux/mxfb-accessories with the commenting fix and a nice surprise for those who wanted a preview in the file selection window...
Re: Issue with the Separate entry in Appearance>Wallpaper
I was just testing out this morning, scheduled for today!
Production: MX-23 Xfce, AMD FX-4130 Quad-Core, GeForce GT 630/PCIe/SSE2, 16 GB, SSD 120 GB, Data 1TB
Personal: Lenovo X1 Carbon with MX-23 Fluxbox
Other: Raspberry Pi 5 with MX-23 Xfce Raspberry Pi Respin
Personal: Lenovo X1 Carbon with MX-23 Fluxbox
Other: Raspberry Pi 5 with MX-23 Xfce Raspberry Pi Respin
Re: Issue with the Separate entry in Appearance>Wallpaper
@Jerry3904 The only minor issue is the left over comment in the keys file. When you enable separate desktop, this gets appended to the keys file at the bottom.
Code: Select all
#This executes fbsetbg every time workspace is changed to load <workspace number>.jpg from ~/.fluxbox/backgrounds/numbered/
ChangeWorkspace :Exec fbsetbg ~/.fluxbox/backgrounds/numbered/\$(xprop -root _NET_CURRENT_DESKTOP |awk '{print \$3+1}').jpg
When you disable separate background, the binding gets removed but the comment remains.
Code: Select all
#This executes fbsetbg every time workspace is changed to load <workspace number>.jpg from ~/.fluxbox/backgrounds/numbered/
Over time from enabling and disabling the separate background you end up with this at the bottom of the keys file.
Code: Select all
#This executes fbsetbg every time workspace is changed to load <workspace number>.jpg from ~/.fluxbox/backgrounds/numbered/
#This executes fbsetbg every time workspace is changed to load <workspace number>.jpg from ~/.fluxbox/backgrounds/numbered/
#This executes fbsetbg every time workspace is changed to load <workspace number>.jpg from ~/.fluxbox/backgrounds/numbered/
#This executes fbsetbg every time workspace is changed to load <workspace number>.jpg from ~/.fluxbox/backgrounds/numbered/
This is my Fluxbox . There are many others like it, but this one is mine. My Fluxbox is my best friend. It is my life.
I must master it as I must master my life. Without me, my Fluxbox is useless. Without my Fluxbox, I am useless.
I must master it as I must master my life. Without me, my Fluxbox is useless. Without my Fluxbox, I am useless.
Re: Issue with the Separate entry in Appearance>Wallpaper
Thanks.
Production: MX-23 Xfce, AMD FX-4130 Quad-Core, GeForce GT 630/PCIe/SSE2, 16 GB, SSD 120 GB, Data 1TB
Personal: Lenovo X1 Carbon with MX-23 Fluxbox
Other: Raspberry Pi 5 with MX-23 Xfce Raspberry Pi Respin
Personal: Lenovo X1 Carbon with MX-23 Fluxbox
Other: Raspberry Pi 5 with MX-23 Xfce Raspberry Pi Respin
Re: Issue with the Separate entry in Appearance>Wallpaper
@Melber @siamhie I added an if-clause at aroun line 100 to fix that: seems to work, please check.
Code: Select all
#Append the needed changes to the keys config file (the "\" is needed not to replace the variables:
keysstring="This executes fbsetbg every time workspace is changed to load <workspace number>.jpg from ~/.fluxbox/backgrounds/numbered/"
if grep -q $keysstring "$x"; then
echo "#This executes fbsetbg every time workspace is changed to load <workspace number>.jpg from ~/.fluxbox/backgrounds/numbered/
ChangeWorkspace :Exec fbsetbg ~/.fluxbox/backgrounds/numbered/"fi
echo "$(xprop -root _NET_CURRENT_DESKTOP |awk '{print \$3+1}').jpg" >> ~/.fluxbox/keys
Production: MX-23 Xfce, AMD FX-4130 Quad-Core, GeForce GT 630/PCIe/SSE2, 16 GB, SSD 120 GB, Data 1TB
Personal: Lenovo X1 Carbon with MX-23 Fluxbox
Other: Raspberry Pi 5 with MX-23 Xfce Raspberry Pi Respin
Personal: Lenovo X1 Carbon with MX-23 Fluxbox
Other: Raspberry Pi 5 with MX-23 Xfce Raspberry Pi Respin
Re: Issue with the Separate entry in Appearance>Wallpaper
Jerry3904 wrote: Wed Dec 06, 2023 1:23 pm @Melber @siamhie I added an if-clause at aroun line 100 to fix that:seems to work, please check.Code: Select all
#Append the needed changes to the keys config file (the "\" is needed not to replace the variables: keysstring="This executes fbsetbg every time workspace is changed to load <workspace number>.jpg from ~/.fluxbox/backgrounds/numbered/" if grep -q $keysstring "$x"; then echo "#This executes fbsetbg every time workspace is changed to load <workspace number>.jpg from ~/.fluxbox/backgrounds/numbered/ ChangeWorkspace :Exec fbsetbg ~/.fluxbox/backgrounds/numbered/"fi echo "$(xprop -root _NET_CURRENT_DESKTOP |awk '{print \$3+1}').jpg" >> ~/.fluxbox/keys
@Jerry3904 I don't want to bugger this up. Is this the section you are referring to?
Code: Select all
if [ -z "$x" ]
then
echo "\$x is empty- the keys file has not been edited, editing it to allow different wallpaper for each workspace"
#Backup the keys config file:
cp ~/.fluxbox/keys ~/.restore/fluxbox/keys_BAK
#Append the needed changes to the keys config file (the "\" is needed not to replace the variables:
echo "#This executes fbsetbg every time workspace is changed to load <workspace number>.jpg from ~/.fluxbox/backgrounds/numbered/
ChangeWorkspace :Exec fbsetbg ~/.fluxbox/backgrounds/numbered/\$(xprop -root _NET_CURRENT_DESKTOP |awk '{print \$3+1}').jpg" >> ~/.fluxbox/keys
else
echo "\$x is NOT empty- the keys file seems to already allow custom wallpapers for each workspace."
### echo Do you want to set up a single wallpaper for all Workspaces?
## If no, edit the keys file, removing the line that sets the ChangeWorkspace...
fi
This is my Fluxbox . There are many others like it, but this one is mine. My Fluxbox is my best friend. It is my life.
I must master it as I must master my life. Without me, my Fluxbox is useless. Without my Fluxbox, I am useless.
I must master it as I must master my life. Without me, my Fluxbox is useless. Without my Fluxbox, I am useless.
Re: Issue with the Separate entry in Appearance>Wallpaper
No, sorry, not working for me.
Here's my edited version of the script
- keys file stuff working
- rm error fixed
- yad window definitions rejigged
- formatting to make code a bit more readable
Code: Select all
#!/bin/bash
# Script to configure separate backgrounds for each Fluxbox Workspace
# Written by user PPC and modified by MX Devs
# Released under GPLv3
TEXTDOMAINDIR=/usr/share/locale
export TEXTDOMAIN="mxfb-accessories"
#Confirmation Window
NOTIFICATION=$" Rotate Backgrounds has been disabled to avoid conflict."
MESSAGE1=$" This app allows you to configure separate backgrounds for each Workspace </b>"
HINT1=$" Selection windows will pop up each Workspace."
HINT2=$" Type \"mxfb\" to jump to the MXFB backgrounds."
HINT3=$" Select the background you want and click OK."
NOTE1=$" NOTE 1: Background changes using the menu won't be permanent."
NOTE2=$" NOTE 2: Re-run this script when you add new workspaces!"
TITLE=$"MXFB -- separate workspace wallpapers"
TITLE2=$"Wallpaper selector"
TITLE3=$"Warning"
BUTTON1=$"Cancel"
BUTTON2=$"Disable separate backgrounds"
BUTTON3=$"Setup separate backgrounds"
MESSAGE2=$"Separate backgrounds have been disabled."
WARNING=$"There is no wallpaper image selected for Workspace $n... Will substitute 'mx_blue.jpg' to avoid any errors."
ICON=/usr/share/icons/mxflux.png
yad --title=$"$TITLE" --window-icon=$ICON --class= mxfb-sbg --text-align=center \
--width=500 --height=300 --center \
--text="
<b>$MESSAGE1\n
<b>--$HINT1
--$HINT2
-- $HINT3 \n
$NOTE1
$NOTE2</b>
" \
--button="<b>$BUTTON1</b>":1 \
--button="<b>$BUTTON2</b>":2 \
--button="<b>$BUTTON3</b>":3 \
foo=$?
[[ $foo -eq 1 ]] && exit 0
#####
#DISABLE SEPARATE BACKGROUNDS
#####
if [[ $foo -eq 2 ]]; then
awk '!/ChangeWorkspace/' ~/.fluxbox/keys > temp && mv temp ~/.fluxbox/keys
awk '!/#This executes fbsetbg/' ~/.fluxbox/keys > temp && mv temp ~/.fluxbox/keys
# block feh and enable nitrogen
HASHCHECK_NITROGEN=$(grep '#nitrogen' $HOME/.fluxbox/startup)
if [ ! -z "$HASHCHECK_NITROGEN" ]; then
sed -i 's/#nitrogen/nitrogen/' $HOME/.fluxbox/startup
fi
HASHCHECK_FEH=$(grep '#~/.fehbg' $HOME/.fluxbox/startup)
if [ -z "$HASHCHECK_FEH" ]; then
sed -i 's/~\/.fehbg/#~\/.fehbg/' $HOME/.fluxbox/startup
fi
nitrogen --restore
sed -i '/$full/d' $HOME/.fluxbox/lastwallpaper
yad --title=$"$TITLE" --class= mxfb-sbg --window-icon=$ICON \
--width=500 --height=300 --center --text-align=center \
--text="\n\n<b>$MESSAGE2</b>" --fixed --no-buttons --timeout=3
fluxbox-remote restart
exit 0
fi
#####
#SET UP SEPARATE BACKGROUNDS
#####
# block nitrogen and enable fehbg
HASHCHECK_NITROGEN=$(grep '#nitrogen' $HOME/.fluxbox/startup)
if [ -z "$HASHCHECK_NITROGEN" ]; then
sed -i 's/nitrogen/#nitrogen/' $HOME/.fluxbox/startup
fi
HASHCHECK_FEH=$(grep '#~/.fehbg' $HOME/.fluxbox/startup)
if [ ! -z "$HASHCHECK_FEH" ]; then
sed -i 's/#~\/.fehbg/~\/.fehbg/' $HOME/.fluxbox/startup
fi
#Check if the keys file has already been edited to allow costume wallpapers for each workspace:
##check if the keys file has a ChangeWorkspace entry
expression_to_find="ChangeWorkspace"
x=$(grep $expression_to_find ~/.fluxbox/keys)
if [ -z "$x" ]
then
echo "\$x is empty- the keys file has not been edited, editing it to allow different wallpaper for each workspace"
#Backup the keys config file:
cp ~/.fluxbox/keys ~/.restore/fluxbox/keys_BAK
#Append the needed changes to the keys config file (the "\" is needed not to replace the variables:
CHECK_KEYS=$(grep 'ChangeWorkspace :Exec' $HOME/.fluxbox/keys)
if [ -z "$CHECK_KEYS" ]; then
echo "#This executes fbsetbg every time workspace is changed to load <workspace number>.jpg from ~/.fluxbox/backgrounds/numbered/
ChangeWorkspace :Exec fbsetbg ~/.fluxbox/backgrounds/numbered/\$(xprop -root _NET_CURRENT_DESKTOP |awk '{print \$3+1}').jpg" >> ~/.fluxbox/keys
fi
else
echo "\$x is NOT empty- the keys file seems to already allow custom wallpapers for each workspace."
fi
#Create the needed folder
mkdir -p ~/.fluxbox/backgrounds/numbered/
#Check how many Workspaces Fluxbox currently has:
number_of_workspaces=$(xdotool get_num_desktops)
#Remove existing numbered wallpapers to avoid failure when wallpaper is symlinked to /usr/share/backgrounds
if [ -f "$HOME/.fluxbox/backgrounds/numbered/*.jpg" ]; then
rm -r $HOME/.fluxbox/backgrounds/numbered/*.jpg
fi
#Disable Rotate backgrounds if running
STRING="Background.Delay: 0"
if ! grep -q "$STRING" $HOME/.ideskrc;
then
sed -i 's/^\([[:blank:]]*Background\.Delay:\).*/\1 0/' "$HOME/.ideskrc"
yad --title=$"$TITLE" --class= mxfb-sbg \
--timeout=3 --no-buttons --geometry 500x100 --text-align=center \
--text="\n<b>$NOTIFICATION</b>"
fi
#Loop for as many workspaces as there are, selecting one wallpaper for each workspace
for ((n=1;n<=$number_of_workspaces;n++))
do
cd /usr/share/backgrounds/
# select wallpaper:
wallpaper=$(yad --title="$TITLE2" --window-icon=$ICON --class= mxfb-sbg \
--width=800 --height=400 --center --text-align=center \
--file-selection --add-preview --large-preview \
--text="\nWORKSPACE $n\n" )
# copy and rename wallpaper to match the current Workspace number:
cp $wallpaper ~/.fluxbox/backgrounds/numbered/$n.jpg
if [ ! "$?" = "0" ]; then
echo User canceled the script
exit 0
fi
#Check if wallpaper for current Workspace exists, if not, use a default one (mx_blue.jpg), to avoid errors. NOTE: if the users does not select any wallpaper at this time but a wallpaper for that workspace already existed, that previous selection will be maintained
FILE=$n.jpg
cd ~/.fluxbox/backgrounds/numbered/
if [ ! -f "$FILE" ]
then
echo "File $FILE does not exist, using a default one- mx_blue.jpg"
yad --center --window-icon=$ICON--title="$TITLE3" --text="$WARNING"
cp /usr/share/backgrounds/mx_blue.jpg ~/.fluxbox/backgrounds/numbered/$n.jpg
fi
done
echo Finished setting up workspace wallpapers, restarting fluxbox
#Implement the changes:
fluxbox-remote restart
pgrep -u $(id -u) -x idesk >/dev/null && idesktoggle idesk refresh
killall -SIGUSR1 conky 2>/dev/null
echo fluxbox restarted, script finished
Re: Issue with the Separate entry in Appearance>Wallpaper
OK, thanks for the repair!
Production: MX-23 Xfce, AMD FX-4130 Quad-Core, GeForce GT 630/PCIe/SSE2, 16 GB, SSD 120 GB, Data 1TB
Personal: Lenovo X1 Carbon with MX-23 Fluxbox
Other: Raspberry Pi 5 with MX-23 Xfce Raspberry Pi Respin
Personal: Lenovo X1 Carbon with MX-23 Fluxbox
Other: Raspberry Pi 5 with MX-23 Xfce Raspberry Pi Respin