Skip to content

Commit

Permalink
refactored
Browse files Browse the repository at this point in the history
  • Loading branch information
ailtonbsj committed Dec 19, 2019
1 parent 101ff00 commit 31090c1
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

This is a taskbar of lubuntu with windows theme.

You can reset the taskbar using the keys `[Super] + [Alt] + R`.

The taskbar is available with two monitor too.

## lxhotkey commands

```bash
Expand Down
1 change: 1 addition & 0 deletions deb_package/DEBIAN/control
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Maintainer: ailtonbsj <[email protected]>
Section: utils
Architecture: all
Priority: optional
Depends: lubuntu-win10-theme
Homepage: https://ailtonbsj.github.io
Description: A taskbar with style of windows ten.
This is a taskbar with theme of win10 and function to
Expand Down
30 changes: 30 additions & 0 deletions deb_package/DEBIAN/postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

# Get Names of users
cat /etc/passwd | grep '/home/' | \
grep -v 'cups\|syslog' | cut -d ':' -f 1 > /tmp/homes.list

function runByUsers {
# $1 is default folder of user
# $2 is name of user
cd $1
panels="$1/.config/lxpanel/Lubuntu/panels/"
runuser -l $2 -c "mkdir -p $panels"
runuser -l $2 -c "cp -rf /tmp/lubuntu-w10-taskbar/left $panels"
runuser -l $2 -c "cp -rf /tmp/lubuntu-w10-taskbar/panel $panels"

lxsession="$1/.config/lxsession/Lubuntu/"
runuser -l $2 -c "mkdir -p $lxsession"
runuser -l $2 -c "touch $lxsession/autostart"
runuser -l $2 -c "sed -i \"s/taskbar-hotkey-enable//g\" $lxsession/autostart"
runuser -l $2 -c "echo \"taskbar-hotkey-enable\" >> $lxsession/autostart"
}

while read USUARIO; do
runByUsers "/home/$USUARIO" "$USUARIO"
runuser -l $USUARIO -c "rm -rf /home/$USUARIO/.cache/"
if [ -f /usr/bin/lxpanelctl ]; then
su - $USUARIO -c "lxpanelctl restart"
fi
done < /tmp/homes.list
runByUsers "/etc/skel" "root"
21 changes: 21 additions & 0 deletions deb_package/DEBIAN/prerm
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

# Get Names of users
cat /etc/passwd | grep '/home/' | \
grep -v 'cups\|syslog' | cut -d ':' -f 1 > /tmp/homes.list

function runByUsers {
# $1 is default folder of user
# $2 is name of user
lxsession="$1/.config/lxsession/Lubuntu/"
runuser -l $2 -c "sed -i \"s/taskbar-hotkey-enable//g\" $lxsession/autostart"
}

while read USUARIO; do
runByUsers "/home/$USUARIO" "$USUARIO"
runuser -l $USUARIO -c "rm -rf /home/$USUARIO/.cache/"
if [ -f /usr/bin/lxpanelctl ]; then
su - $USUARIO -c "lxpanelctl restart"
fi
done < /tmp/homes.list
runByUsers "/etc/skel" "root"
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions deb_package/usr/bin/taskbar-hotkey-enable
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

lxhotkey app "taskbar-reset" --
lxhotkey app "taskbar-reset" "<Super><Alt>R"
sed -i "s/taskbar-hotkey-enable//g" ~/.config/lxsession/Lubuntu/autostart
5 changes: 5 additions & 0 deletions deb_package/usr/bin/taskbar-reset
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

cp -rf /etc/skel/.config/lxpanel/Lubuntu/panels/panel ~/.config/lxpanel/Lubuntu/panels/
cp -rf /etc/skel/.config/lxpanel/Lubuntu/panels/left ~/.config/lxpanel/Lubuntu/panels/
lxpanelctl restart

0 comments on commit 31090c1

Please sign in to comment.