Slackware This Forum is for the discussion of Slackware Linux.
Notices
Welcome to
LinuxQuestions.org , a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free.
Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please
contact us . If you need to reset your password,
click here .
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a
virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month.
Click here for more info.
03-06-2021, 05:50 AM
#691
Member
Registered: Jun 2003
Distribution: Slackware-Current and Salix 14.2
Posts: 274
Rep:
(I dug up this tiling script from my backup. I think got it from the arch forums)
Nice tiling script. Perhaps useful for those who like tiling in xfce. The most important functionality is the "tile all visible windows on screen", which is not in XFCE (unless I missed it).
anyway binding "tiling_toolg.sh tile" to Mod4-t, is a really handy functionality. Though, it requires xdotool and wmcrtl, which are on slackbuilds.org.
The command "tiling_toolg.sh tile" will give for example the result as can be seen in the pic (in this case with 4 visible windows).
The script:
Code:
#!/bin/bash
# tiling script for xfce or openbox etc.
# name: tiling_toolg.sh
# requires : xwininfo xdotool wmcrtl
# xwininfo is already installed in slackware
# xdotool and wmctrl can be get from slackbuilds.org
#
# usage:
# best to use shortkeys for the commands
# for example Mod4-t for "tiling_toolg.sh tile" , Mod-d for "tiling_toolg.sh showdesktop"
# Mod4-c for "tiling_toolg.sh cascade , Mod4-s for "tiling_toolg.sh tiletwo"
#
# tiling_toolg.sh tile // tile all visible windows on screen
# tiling_toolg.sh tiletwo // select 2 windows and tile side-by-side
# tiling_toolg.sh cascade // to cascade windows
# tiling_toolg.sh showdesktop // show the desktop -not needed anymore
# and others:
# tiling_toolg select
# tiling_toolg tile
# tiling_toolg tiletwol
# tiling_toolg tiletwor
# tiling_toolg tilethree
# tiling_toolg tilethreev
# tiling_toolg stacktwo
# set gaps (0 removes gaps)
outer_gaps=1
inner_gaps=3
# set gaps for 'select' mode
expose_gaps=20
# set desktop dimensions
display_width=$(xdotool getdisplaygeometry | cut -d" " -f1)
display_height=$(xdotool getdisplaygeometry | cut -d" " -f2)
# desktop height without panel(s)
desktop_height=$(xprop -root _NET_WORKAREA | awk '{ print $6 }' | cut -d"," -f1)
# window decorations
window_id=$(xdotool getactivewindow)
titlebar_offset=$(xwininfo -id "$window_id" | awk '/Relative upper-left Y:/ { print $4 }')
# top panel
top_bar=$(xprop -root _NET_WORKAREA | awk '{ print $4 }' | cut -d"," -f1)
# bottom panel (not needed)
bottom_bar=`expr $display_height - $desktop_height - $top_bar`
function get_desktop_dim {
if (( ${#DIM[@]} == 0 )) ; then
DIM=(`expr $display_width - $outer_gaps \* 2` `expr $desktop_height - $outer_gaps \* 2`)
fi
}
# which workspace we're on
function get_workspace {
if [[ "$DTOP" == "" ]] ; then
DTOP=`xdotool get_desktop`
fi
}
function is_desktop {
xwininfo -id "$*" | grep '"Desktop"'
return "$?"
}
function get_visible_window_ids {
if (( ${#WDOWS[@]} == 0 )) ; then
WDOWS=(`xdotool search --desktop $DTOP --onlyvisible "" 2>/dev/null`)
fi
}
function win_showdesktop {
get_workspace
get_visible_window_ids
command="search --desktop $DTOP \"\""
if (( ${#WDOWS[@]} > 0 )) ; then
command="$command windowminimize %@"
else
command="$command windowraise %@"
fi
echo "$command" | xdotool -
}
function win_tile_two {
get_desktop_dim
wid1=`xdotool selectwindow 2>/dev/null`
is_desktop "$wid1" && return
wid2=`xdotool selectwindow 2>/dev/null`
is_desktop "$wid2" && return
half_w=`expr ${DIM[0]} / 2`
win_h=${DIM[1]}
commands="windowsize $wid1 `expr $half_w - $inner_gaps` `expr $win_h - $titlebar_offset`"
commands="$commands windowsize $wid2 `expr $half_w - $inner_gaps` `expr $win_h - $titlebar_offset`"
commands="$commands windowmove $wid1 $outer_gaps `expr $top_bar + $outer_gaps`"
commands="$commands windowmove $wid2 `expr $half_w + $outer_gaps + $inner_gaps` `expr $top_bar + $outer_gaps`"
commands="$commands windowraise $wid1"
commands="$commands windowraise $wid2"
wmctrl -i -r $wid1 -b remove,maximized_vert,maximized_horz
wmctrl -i -r $wid2 -b remove,maximized_vert,maximized_horz
echo "$commands" | xdotool -
}
function win_tile_two_left {
get_desktop_dim
wid1=`xdotool selectwindow 2>/dev/null`
is_desktop "$wid1" && return
wid2=`xdotool selectwindow 2>/dev/null`
is_desktop "$wid2" && return
half_w=`expr ${DIM[0]} / 3`
win_h=${DIM[1]}
commands="windowsize $wid1 `expr $half_w \* 2 - $inner_gaps` `expr $win_h - $titlebar_offset`"
commands="$commands windowsize $wid2 `expr $half_w - $inner_gaps` `expr $win_h - $titlebar_offset`"
commands="$commands windowmove $wid1 $outer_gaps `expr $top_bar + $outer_gaps`"
commands="$commands windowmove $wid2 `expr $half_w \* 2 + $outer_gaps + $inner_gaps` `expr $top_bar + $outer_gaps`"
commands="$commands windowraise $wid1"
commands="$commands windowraise $wid2"
wmctrl -i -r $wid1 -b remove,maximized_vert,maximized_horz
wmctrl -i -r $wid2 -b remove,maximized_vert,maximized_horz
echo "$commands" | xdotool -
}
function win_tile_two_right {
get_desktop_dim
wid1=`xdotool selectwindow 2>/dev/null`
is_desktop "$wid1" && return
wid2=`xdotool selectwindow 2>/dev/null`
is_desktop "$wid2" && return
half_w=`expr ${DIM[0]} / 3`
win_h=${DIM[1]}
commands="windowsize $wid1 `expr $half_w - $inner_gaps` `expr $win_h - $titlebar_offset`"
commands="$commands windowsize $wid2 `expr $half_w \* 2 - $inner_gaps` `expr $win_h - $titlebar_offset`"
commands="$commands windowmove $wid1 $outer_gaps `expr $top_bar + $outer_gaps`"
commands="$commands windowmove $wid2 `expr $half_w + $outer_gaps + $inner_gaps` `expr $top_bar + $outer_gaps`"
commands="$commands windowraise $wid1"
commands="$commands windowraise $wid2"
wmctrl -i -r $wid1 -b remove,maximized_vert,maximized_horz
wmctrl -i -r $wid2 -b remove,maximized_vert,maximized_horz
echo "$commands" | xdotool -
}
function win_stack_two {
get_desktop_dim
wid1=`xdotool selectwindow 2>/dev/null`
is_desktop "$wid1" && return
wid2=`xdotool selectwindow 2>/dev/null`
is_desktop "$wid2" && return
win_w=${DIM[0]}
half_h=`expr ${DIM[1]} / 2`
commands="windowsize $wid1 `expr $win_w` `expr $half_h - $titlebar_offset - $inner_gaps`"
commands="$commands windowsize $wid2 `expr $win_w` `expr $half_h - $titlebar_offset - $inner_gaps`"
commands="$commands windowmove $wid1 $outer_gaps `expr $top_bar + $outer_gaps`"
commands="$commands windowmove $wid2 $outer_gaps `expr $half_h + $top_bar + $outer_gaps + $inner_gaps`"
commands="$commands windowraise $wid1"
commands="$commands windowraise $wid2"
wmctrl -i -r $wid1 -b remove,maximized_vert,maximized_horz
wmctrl -i -r $wid2 -b remove,maximized_vert,maximized_horz
echo "$commands" | xdotool -
}
function win_tile_three {
get_desktop_dim
wid1=`xdotool selectwindow 2>/dev/null`
is_desktop "$wid1" && return
wid2=`xdotool selectwindow 2>/dev/null`
is_desktop "$wid2" && return
wid3=`xdotool selectwindow 2>/dev/null`
is_desktop "$wid3" && return
win_h=${DIM[1]}
half_w=`expr ${DIM[0]} / 2`
half_h=`expr ${win_h} / 2`
commands="windowsize $wid1 `expr $half_w - $inner_gaps` `expr $win_h - $titlebar_offset`"
commands="$commands windowsize $wid2 `expr $half_w - $inner_gaps` `expr $half_h - $titlebar_offset - $inner_gaps`"
commands="$commands windowsize $wid3 `expr $half_w - $inner_gaps` `expr $half_h - $titlebar_offset - $inner_gaps`"
commands="$commands windowmove $wid1 $outer_gaps `expr $top_bar + $outer_gaps`"
commands="$commands windowmove $wid2 `expr $half_w + $outer_gaps + $inner_gaps` `expr $top_bar + $outer_gaps`"
commands="$commands windowmove $wid3 `expr $half_w + $outer_gaps + $inner_gaps` `expr $half_h + $top_bar + $outer_gaps + $inner_gaps`"
commands="$commands windowraise $wid1"
commands="$commands windowraise $wid2"
commands="$commands windowraise $wid3"
wmctrl -i -r $wid1 -b remove,maximized_vert,maximized_horz
wmctrl -i -r $wid2 -b remove,maximized_vert,maximized_horz
wmctrl -i -r $wid3 -b remove,maximized_vert,maximized_horz
echo "$commands" | xdotool -
}
function win_tile_three_v {
get_desktop_dim
wid1=`xdotool selectwindow 2>/dev/null`
is_desktop "$wid1" && return
wid2=`xdotool selectwindow 2>/dev/null`
is_desktop "$wid2" && return
wid3=`xdotool selectwindow 2>/dev/null`
is_desktop "$wid3" && return
win_h=${DIM[1]}
half_w=`expr ${DIM[0]} / 3`
commands="windowsize $wid1 `expr $half_w - $inner_gaps` `expr $win_h - $titlebar_offset`"
commands="$commands windowsize $wid2 `expr $half_w - $inner_gaps` `expr $win_h - $titlebar_offset`"
commands="$commands windowsize $wid3 `expr $half_w - $inner_gaps` `expr $win_h - $titlebar_offset`"
commands="$commands windowmove $wid1 $outer_gaps `expr $top_bar + $outer_gaps`"
commands="$commands windowmove $wid2 `expr $half_w + $outer_gaps + $inner_gaps / 2` `expr $top_bar + $outer_gaps`"
commands="$commands windowmove $wid3 `expr $half_w \* 2 + $outer_gaps + $inner_gaps` `expr $top_bar + $outer_gaps`"
commands="$commands windowraise $wid1"
commands="$commands windowraise $wid2"
commands="$commands windowraise $wid3"
wmctrl -i -r $wid1 -b remove,maximized_vert,maximized_horz
wmctrl -i -r $wid2 -b remove,maximized_vert,maximized_horz
wmctrl -i -r $wid3 -b remove,maximized_vert,maximized_horz
echo "$commands" | xdotool -
}
function win_tile {
get_workspace
get_visible_window_ids
(( ${#WDOWS[@]} < 1 )) && return;
get_desktop_dim
# determine how many rows and columns we need
cols=`echo "scale=0 ; sqrt(${#WDOWS[@]})" | bc`
rows=$cols
wins=`expr $rows \* $cols`
if (( "$wins" < "${#WDOWS[@]}" )) ; then
cols=`expr $cols + 1`
wins=`expr $rows \* $cols`
if (( "$wins" < "${#WDOWS[@]}" )) ; then
rows=`expr $rows + 1`
wins=`expr $rows \* $cols`
fi
fi
(( $cols < 1 )) && cols=1;
(( $rows < 1 )) && rows=1;
win_w=`expr ${DIM[0]} / $cols`
win_h=`expr ${DIM[1]} / $rows`
# do tiling
x=0; y=0; commands=""
for window in ${WDOWS[@]} ; do
wmctrl -i -r $window -b remove,maximized_vert,maximized_horz
commands="$commands windowsize $window `expr $win_w - $inner_gaps \* 2` `expr $win_h - $titlebar_offset - $inner_gaps \* 2`"
commands="$commands windowmove $window `expr $x \* $win_w + $outer_gaps` `expr $y \* $win_h + $top_bar + $outer_gaps`"
x=`expr $x + 1`
if (( $x > `expr $cols - 1` )) ; then
x=0
y=`expr $y + 1`
fi
done
echo "$commands" | xdotool -
}
function expose {
get_workspace
get_visible_window_ids
(( ${#WDOWS[@]} < 1 )) && return;
get_desktop_dim
# determine how many rows and columns we need
cols=`echo "sqrt(${#WDOWS[@]})" | bc`
rows=$cols
wins=`expr $rows \* $cols`
if (( "$wins" < "${#WDOWS[@]}" )) ; then
cols=`expr $cols + 1`
wins=`expr $rows \* $cols`
if (( "$wins" < "${#WDOWS[@]}" )) ; then
rows=`expr $rows + 1`
wins=`expr $rows \* $cols`
fi
fi
(( $cols < 1 )) && cols=1;
(( $rows < 1 )) && rows=1;
win_w=`expr ${DIM[0]} / $cols`
win_h=`expr ${DIM[1]} / $rows`
# do tiling
x=0; y=0; commands=""
for window in ${WDOWS[@]} ; do
wmctrl -i -r $window -b remove,maximized_vert,maximized_horz
commands="$commands windowsize $window `expr $win_w - $expose_gaps \* 2` `expr $win_h - $titlebar_offset - $expose_gaps \* 2`"
commands="$commands windowmove $window `expr $x \* $win_w + $expose_gaps` `expr $y \* $win_h + $top_bar + $expose_gaps`"
x=`expr $x + 1`
if (( $x > `expr $cols - 1` )) ; then
x=0
y=`expr $y + 1`
fi
done
echo "$commands" | xdotool -
}
function win_cascade {
get_workspace
get_visible_window_ids
(( ${#WDOWS[@]} < 1 )) && return;
x=0; y=0; commands=""
for window in ${WDOWS[@]} ; do
wmctrl -i -r $window -b remove,maximized_vert,maximized_horz
commands="$commands windowsize $window 1024 640"
commands="$commands windowmove $window `expr $x + $outer_gaps` `expr $y + $top_bar + $outer_gaps`"
x=`expr $x + 100`
y=`expr $y + 80`
done
echo "$commands" | xdotool -
}
function win_select {
get_workspace
get_visible_window_ids
(( ${#WDOWS[@]} < 1 )) && return;
# store window positions and widths
i=0
for window in ${WDOWS[@]} ; do
GEO=`xdotool getwindowgeometry $window | grep Geometry | sed 's/.* \([0-9].*\)/\1/g'`;
height[$i]=`echo $GEO | sed 's/\(.*\)x.*/\1/g'`
width[$i]=`echo $GEO | sed 's/.*x\(.*\)/\1/g'`
# ( xwininfo gives position not ignoring titlebars and borders, unlike xdotool )
POS=(`xwininfo -stats -id $window | grep 'geometry ' | sed 's/.*[-+]\([0-9]*[-+][0-9*]\)/\1/g' | sed 's/[+-]/ /g'`)
posx[$i]=${POS[0]}
posy[$i]=${POS[1]}
i=`expr $i + 1`
done
# tile windows
expose
# select a window
wid=`xdotool selectwindow 2>/dev/null`
is_desktop "$wid" && return
# restore window positions and widths
i=0; commands=""
for (( i=0; $i<${#WDOWS[@]}; i++ )) ; do
commands="$commands windowsize ${WDOWS[i]} ${height[$i]} ${width[$i]}"
commands="$commands windowmove ${WDOWS[i]} ${posx[$i]} ${posy[$i]}"
done
commands="$commands windowraise $wid"
echo "$commands" | xdotool -
}
for command in ${@} ; do
if [[ "$command" == "tile" ]] ; then
win_tile
elif [[ "$command" == "select" ]] ; then
win_select
elif [[ "$command" == "tiletwo" ]] ; then
win_tile_two
elif [[ "$command" == "tiletwol" ]] ; then
win_tile_two_left
elif [[ "$command" == "tiletwor" ]] ; then
win_tile_two_right
elif [[ "$command" == "stacktwo" ]] ; then
win_stack_two
elif [[ "$command" == "tilethree" ]] ; then
win_tile_three
elif [[ "$command" == "tilethreev" ]] ; then
win_tile_three_v
elif [[ "$command" == "cascade" ]] ; then
win_cascade
elif [[ "$command" == "showdesktop" ]] ; then
win_showdesktop
fi
done
edit: screenshot with gaps
Last edited by deNiro; 03-06-2021 at 07:38 AM .
5 members found this post helpful.
03-06-2021, 12:42 PM
#692
Senior Member
Registered: Oct 2006
Location: Cp6uja
Distribution: Slackware on x86 and arm
Posts: 2,471
Hey neNiro, this is a nice little tool!
And it works here (14.2) from the get-go (after
sboinstall the
two offending dependencies
)
03-06-2021, 01:12 PM
#693
Member
Registered: Jun 2003
Distribution: Slackware-Current and Salix 14.2
Posts: 274
Rep:
Quote:
Originally Posted by
SCerovec
Hey neNiro, this is a nice little tool!
And it works here (14.2) from the get-go (after
sboinstall the
two offending dependencies
)
you're welcome. I'm glad I found it back in my backup, since I missed these functions a lot after moving back from dwm to xfce since running current. And it works very well, even with a lot of windows.
03-07-2021, 04:04 AM
#694
LQ Newbie
Registered: Jun 2010
Distribution: Slackware 15
Posts: 11
Rep:
Hi, currently I am using Slackware current with XFCE 4.16
Couple of months ago I was successfully using xfce4-xkb-plugin version 0.7.1 (Taken from Slackbuilds)
in order to indicate the keyboard layout currently in use.
Right now, the switch of the layouts is working but on current version of XFCE, I am not able to add the layout indication to XFCE panel.
Is there any way to do it?
2 members found this post helpful.
03-31-2021, 11:41 AM
#695
LQ Veteran
Registered: Feb 2007
Distribution: Slackware64-current with "True Multilib" and KDE4Town.
Posts: 9,096
Original Poster
1 members found this post helpful.
04-15-2021, 05:39 PM
#697
Senior Member
Registered: Nov 2003
Distribution: Slackʍɐɹǝ
Posts: 1,486
Hey guys, I'm a recent switcher to xfce as I was looking for something with better performance for my Pi400.
I'm wondering, is there a way I can have nfs mounts appear on the desktop like how removable media does?
Thanks
1 members found this post helpful.
04-27-2021, 09:11 PM
#698
Senior Member
Registered: Sep 2006
Location: wroclaw, poland
Distribution: many, primary Slackware
Posts: 2,717
How to create custom menu for applications menu? Default shipped with Slackware contains all KDE apps - I will never use - and some other apps I will never use. So I need to trim down number of entries in menu. Xce is asking for custom menu file - what is it? How can I create one?
04-28-2021, 01:49 AM
#699
LQ Veteran
Registered: Feb 2007
Distribution: Slackware64-current with "True Multilib" and KDE4Town.
Posts: 9,096
Original Poster
After all these years I'm disappointed Xfce still doesn't have a GUI menu editor, but there are alternatives.
Have you search through this thread?
04-28-2021, 01:51 AM
#700
Senior Member
Registered: Sep 2014
Distribution: Slackware
Posts: 1,753
Rep:
Quote:
Originally Posted by
igadoter
Xce is asking for custom menu file - what is it? How can I create one?
Here, I'd just replace this XML:
Code:
/etc/xdg/menus/xfce-applications.menu
There's no other user here, and it's compiled xfce4-4.12, so the menu's never replaced.
Custom menu file is the same, XML file that you select in "Applications Menu" panel plugin settings.
1 members found this post helpful.
04-28-2021, 05:27 PM
#701
Senior Member
Registered: Sep 2006
Location: wroclaw, poland
Distribution: many, primary Slackware
Posts: 2,717
The file just contains menu layout - nothing more. Where menu entries come from?
04-28-2021, 05:56 PM
#702
LQ Veteran
Registered: Feb 2007
Distribution: Slackware64-current with "True Multilib" and KDE4Town.
Posts: 9,096
Original Poster
04-28-2021, 06:15 PM
#703
Senior Member
Registered: Sep 2006
Location: wroclaw, poland
Distribution: many, primary Slackware
Posts: 2,717
Thanks - I found this
https://launchpad.net/menulibre written in python - hope will work. Alternative is in java - but Slackware does not ship any java runtime - at least I didn't find one.
04-28-2021, 07:59 PM
#704
Senior Member
Registered: Oct 2003
Location: WA
Distribution: Slackware
Posts: 1,266
I'm hoping to revisit menulibre for SBo. When they refactored "just a bit" the dependencies got too much for 14.2. Sure, you can fiddle with the XML, but that is beyond tedious.
1 members found this post helpful.
All times are GMT -5. The time now is 06:36 PM .
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know .
Latest Threads
LQ News