Skip to content
Snippets Groups Projects
Select Git revision
  • b1aaed556ac26af62982d1f5fea49aa02554e33c
  • devel default
  • altamiro74
  • daniel66
  • bruna16
  • walmes10
  • alcides51
  • jhenifer61
  • bruna17
  • alessandra36
  • gabriel55
  • bruno41
  • angela25
  • angela26
  • bruno40
  • walmes9
  • eduardo28
  • jhenifer39
  • alessandra35
  • bruna15
  • bruna14
21 results

MingotiTb6.1.R

Blame
  • Forked from pet-estatistica / labestData
    Source project has a limited visibility.
    le-edubar-fixed-position.sh 2.05 KiB
    #!/bin/bash
    
    # Copyright (C) 2004-2010 Centro de Computacao Cientifica e Software Livre
    # Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
    #
    # This file is part of le-edubar-fixed-position
    #
    # le-edubar-fixed-position is free software; you can redistribute it and/or
    # modify it under the terms of the GNU General Public License
    # as published by the Free Software Foundation; either version 2
    # of the License, or (at your option) any later version.
    #
    # This program is distributed in the hope that it will be useful,
    # but WITHOUT ANY WARRANTY; without even the implied warranty of
    # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    # GNU General Public License for more details.
    #
    # You should have received a copy of the GNU General Public License
    # along with this program; if not, write to the Free Software
    # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
    # USA.
    
    SCREEN_WIDTH=$(xrandr | grep '*' | awk '{print $1}' | cut -d"x" -f1)
    
    if (( SCREEN_WIDTH < 1024 )); then
        ICON_SIZE=96
    else
        ICON_SIZE=128
    fi
    
    EDUBAR_WIDTH=$((ICON_SIZE * 5 + 10));
    
    EDUBAR_HEIGHT=$ICON_SIZE;
    
    CONFIG="$HOME/.kde/share/config/plasma-desktop-appletsrc"
    
    POS_X=$((SCREEN_WIDTH/4))
    POS_Y=0;
    
    PLUGIN=$(grep "^plugin=edubar$" $CONFIG)
    
    if [ -z "$PLUGIN" ]; then
    
        ID=$(egrep "^\[Containments\]\[[0-9]*\]\[Applets\]\[[0-9]*\]$" $CONFIG | \
        cut -d "[" -f5 | sed 's/\]//g' | sort -g | tail -n1)
    
        ID=$((ID+1))
    
        kwriteconfig --file $CONFIG --group Containments --group 1 --group Applets \
                     --group $ID \
                     --key geometry "$POS_X,$POS_Y,$EDUBAR_WIDTH,$EDUBAR_HEIGHT"
        kwriteconfig --file $CONFIG --group Containments --group 1 --group Applets \
                     --group $ID --key immutability "1"
        kwriteconfig --file $CONFIG --group Containments --group 1 --group Applets \
                     --group $ID --key plugin "edubar"
        kwriteconfig --file $CONFIG --group Containments --group 1 --group Applets \
                     --group $ID --key zvalue "0"
    fi
    
    chown -R --reference="$HOME" "$HOME/.kde"