Xfce is a lightweight desktop environment for operating systems of the Unix variety. This small project extends its basic functionality.
Installation involves copying the scripts into a suitable location.
[user@computer:~]$ sudo cp -i xfce4-* /usr/local/bin
The shell scripts can be edited, should such a thing be necessary.
There are several shell scripts, each of which has a single responsibility.
When invoked without arguments, they print a usage summary and terminate.
Otherwise they send the appropriate messages to Xfce.
They are intended to be used with shortcut keys, so
they use zenity
(a graphical dialog) for communicating with the user, but
fall back to echo
(command line messages) if it's not available.
They might also have other dependencies.
The script xfce4-focus
focuses task list windows based on their indices.
It requires xfce4-panel
with at least one task list that
uses window title ordering.
It also depends on xfconf-query
, wmctrl
and xprop
.
Assume there are four windows open in the currently active workspace. It's easy to bring the second window on the task bar to the top
[user@computer:~]$ xfce4-focus 2
or stack all of the windows, putting the first one on the top.
[user@computer:~]$ xfce4-focus 3 2 4 1
The script xfce4-move
moves the currently active window to
a precise position on the screen.
The position can be specified by
using a combination of center
, up
, down
, left
and right
.
It depends on xwininfo
xprop
and wmctrl
.
Centering a window
[user@computer:~]$ xfce4-move center
or moving it to the bottom right corner of the screen is trivial
[user@computer:~]$ xfce4-move down right
and works even if there's a task bar or another panel in the way.
Shortcut keys can be set in the Keyboard menu or by
editing ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml
.
The following configuration allows using the Super key with a number to focus a window.
<?xml version="1.0" encoding="UTF-8"?>
<channel name="xfce4-keyboard-shortcuts" version="1.0">
<property name="commands" type="empty">
<property name="default" type="empty">
<property name="<Super>1" type="string" value="xfce4-focus 1" />
<property name="<Super>2" type="string" value="xfce4-focus 2" />
<property name="<Super>3" type="string" value="xfce4-focus 3" />
<property name="<Super>4" type="string" value="xfce4-focus 4" />
<property name="<Super>5" type="string" value="xfce4-focus 5" />
<property name="<Super>6" type="string" value="xfce4-focus 6" />
<property name="<Super>7" type="string" value="xfce4-focus 7" />
<property name="<Super>8" type="string" value="xfce4-focus 8" />
<property name="<Super>9" type="string" value="xfce4-focus 9" />
</property>
</property>
</channel>
The following configuration allows using the Super key with a letter, arranged in a matrix, to move a window.
<?xml version="1.0" encoding="UTF-8"?>
<channel name="xfce4-keyboard-shortcuts" version="1.0">
<property name="commands" type="empty">
<property name="default" type="empty">
<property name="<Super>q" type="string" value="xfce4-move up left />
<property name="<Super>w" type="string" value="xfce4-move center up />
<property name="<Super>e" type="string" value="xfce4-move up right />
<property name="<Super>a" type="string" value="xfce4-move center left />
<property name="<Super>s" type="string" value="xfce4-move center />
<property name="<Super>d" type="string" value="xfce4-move center right />
<property name="<Super>z" type="string" value="xfce4-move down left />
<property name="<Super>x" type="string" value="xfce4-move center down />
<property name="<Super>c" type="string" value="xfce4-move down right />
</property>
</property>
</channel>
This project is in usable condition, but may develop further over time.
Contributions are welcome.