Skip to content
Snippets Groups Projects
Select Git revision
  • f7bb2786dc235fbbfead0e8241f47d4d0ea70d84
  • devel default protected
  • eduardo217
  • jhenifer207
  • jhenifer128
  • jhenifer126
  • jhenifer125
  • guilherme190
  • lineu180
  • lineu181
  • bruna141
  • bruna216
  • altamiro187
  • maria134
  • maria133
  • maria132
  • vinicius177
  • vinicius176
  • vinicius173
  • vinicius210
  • ludmila155
21 results

ManlyTb1.4.Rd

Blame
  • 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"