mirror of
https://github.com/rbreaves/kinto.git
synced 2025-07-31 16:26:39 +02:00
- Relocated files and updated paths
This commit is contained in:
182
linux/system-config/dename.sh
Normal file
182
linux/system-config/dename.sh
Normal file
@@ -0,0 +1,182 @@
|
||||
#!/bin/bash
|
||||
|
||||
function detect_budgie()
|
||||
{
|
||||
ps -e | grep -E '^.* budgie-wm' > /dev/null
|
||||
if [ $? -ne 0 ];
|
||||
then
|
||||
return 0
|
||||
fi
|
||||
VERSION=`dpkg-query -l | grep budgie-core | awk '{print $3}'`
|
||||
DESKTOP="budgie"
|
||||
return 1
|
||||
}
|
||||
|
||||
function detect_gnome()
|
||||
{
|
||||
ps -e | grep -E '^.* gnome-session' > /dev/null
|
||||
if [ $? -ne 0 ];
|
||||
then
|
||||
return 0
|
||||
fi
|
||||
VERSION=`gnome-session --version | awk '{print $2}'`
|
||||
DESKTOP="gnome"
|
||||
return 1
|
||||
}
|
||||
|
||||
function detect_kde4()
|
||||
{
|
||||
ps -e | grep -E '^.* kded4$' > /dev/null
|
||||
if [ $? -ne 0 ];
|
||||
then
|
||||
return 0
|
||||
else
|
||||
VERSION=`kded4 --version | grep -m 1 'KDE' | awk -F ':' '{print $2}' | awk '{print $1}'`
|
||||
DESKTOP="KDE"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
function detect_kde()
|
||||
{
|
||||
ps -e | grep -E '^.* kded5$' > /dev/null
|
||||
if [ $? -ne 0 ];
|
||||
then
|
||||
return 0
|
||||
else
|
||||
VERSION=`kded5 --version | grep -m 1 'KDE' | awk -F ':' '{print $2}' | awk '{print $1}'`
|
||||
DESKTOP="KDE"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
function detect_unity()
|
||||
{
|
||||
ps -e | grep -E 'unity-panel' > /dev/null
|
||||
if [ $? -ne 0 ];
|
||||
then
|
||||
return 0
|
||||
fi
|
||||
VERSION=`unity --version | awk '{print $2}'`
|
||||
DESKTOP="unity"
|
||||
return 1
|
||||
}
|
||||
|
||||
function detect_xfce()
|
||||
{
|
||||
ps -e | grep -E '^.* xfce4-session$' > /dev/null
|
||||
if [ $? -ne 0 ];
|
||||
then
|
||||
return 0
|
||||
fi
|
||||
VERSION=`xfce4-session --version | grep xfce4-session | awk '{print $2}'`
|
||||
DESKTOP="xfce"
|
||||
return 1
|
||||
}
|
||||
|
||||
function detect_cinnamon()
|
||||
{
|
||||
ps -e | grep -E '^.* cinnamon$' > /dev/null
|
||||
if [ $? -ne 0 ];
|
||||
then
|
||||
return 0
|
||||
fi
|
||||
VERSION=`cinnamon --version | awk '{print $2}'`
|
||||
DESKTOP="cinnamon"
|
||||
return 1
|
||||
}
|
||||
|
||||
function detect_mate()
|
||||
{
|
||||
ps -e | grep -E '^.* mate-panel$' > /dev/null
|
||||
if [ $? -ne 0 ];
|
||||
then
|
||||
return 0
|
||||
fi
|
||||
VERSION=`mate-about --version | awk '{print $4}'`
|
||||
DESKTOP="mate"
|
||||
return 1
|
||||
}
|
||||
|
||||
function detect_lxde()
|
||||
{
|
||||
ps -e | grep -E '^.* lxsession$' > /dev/null
|
||||
if [ $? -ne 0 ];
|
||||
then
|
||||
return 0
|
||||
fi
|
||||
|
||||
# We can detect LXDE version only thru package manager
|
||||
which apt-cache > /dev/null 2> /dev/null
|
||||
if [ $? -ne 0 ];
|
||||
then
|
||||
which yum > /dev/null 2> /dev/null
|
||||
if [ $? -ne 0 ];
|
||||
then
|
||||
VERSION='unknown'
|
||||
else
|
||||
# For Fedora
|
||||
VERSION=`yum list lxde-common | grep lxde-common | awk '{print $2}' | awk -F '-' '{print $1}'`
|
||||
fi
|
||||
else
|
||||
# For Lubuntu and Knoppix
|
||||
VERSION=`apt-cache show lxde-common /| grep 'Version:' | awk '{print $2}' | awk -F '-' '{print $1}'`
|
||||
fi
|
||||
DESKTOP="lxde"
|
||||
return 1
|
||||
}
|
||||
|
||||
function detect_sugar()
|
||||
{
|
||||
if [ "$DESKTOP_SESSION" == "sugar" ];
|
||||
then
|
||||
VERSION=`python -c "from jarabe import config; print config.version"`
|
||||
DESKTOP="sugar"
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
DESKTOP="unknown"
|
||||
if detect_unity;
|
||||
then
|
||||
if detect_kde;
|
||||
then
|
||||
if detect_kde4;
|
||||
then
|
||||
if detect_budgie;
|
||||
then
|
||||
if detect_gnome;
|
||||
then
|
||||
if detect_xfce;
|
||||
then
|
||||
if detect_cinnamon;
|
||||
then
|
||||
if detect_mate;
|
||||
then
|
||||
if detect_lxde;
|
||||
then
|
||||
detect_sugar
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
if [ "$1" == '-v' ];
|
||||
then
|
||||
echo $VERSION
|
||||
else
|
||||
if [ "$1" == '-n' ];
|
||||
then
|
||||
echo $DESKTOP
|
||||
else
|
||||
echo $DESKTOP $VERSION
|
||||
fi
|
||||
fi
|
21
linux/system-config/unipkg.sh
Normal file
21
linux/system-config/unipkg.sh
Normal file
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
if pkgmgr="$( which apt-get )" 2> /dev/null; then
|
||||
echo "Debian"
|
||||
$pkgmgr update
|
||||
$pkgmgr --yes --force-yes install $1
|
||||
elif pkgmgr="$( which dnf )" 2> /dev/null; then
|
||||
echo "dnf"
|
||||
$pkgmgr check-update; $pkgmgr install -y $1
|
||||
elif pkgmgr="$( which pacman )" 2> /dev/null; then
|
||||
echo "Arch-based"
|
||||
$pkgmgr -Syy;yes | $pkgmgr -S $1
|
||||
else
|
||||
echo "Package manager not found, please install $1" >&2
|
||||
exit 1
|
||||
fi
|
||||
if [[ 1 -ne $# ]]; then
|
||||
echo "Syntax: $0 PACKAGE"
|
||||
exit 1
|
||||
fi
|
||||
exit $?
|
Reference in New Issue
Block a user