Romanian PC Forum Sabitech Media - web design, gazduire web, promovare, seo, logo design si branding


Go Back   Romanian PC Forum > Software > Unix - Linux - BSD

Unix - Linux - BSD Coltul fanilor... distributii, configurari, sfaturi si probleme, tutoriale, etc.


Reply
 
Thread Tools
Old 03.04.2017, 20:03   #1
AnbuBlack
*nix enthusiast
 
AnbuBlack's Avatar
 
Join Date: 20.04.2011
Location: 127.0.0.1
Posts: 3,981
Thanks: 4,677
Thanked 6,292 Times in 3,015 Posts
Default Script baterie perl - i3blocks

Scriptul trebuie să afișeze statusul bateriei, face acest lucru cu brio, ce nu face: nu afișează icoană atunci când laptopul este pe AC (power), fără a încărca baterie (un fel de status unknow).

Battery (perl)

Code:
#!/usr/bin/perl
#
# Copyright 2014 Pierre Mavro <deimos@deimos.fr>
# Copyright 2014 Vivien Didelot <vivien@didelot.org>
#
# Licensed under the terms of the GNU GPL v3, or any later version.
#
# This script is meant to use with i3blocks. It parses the output of the "acpi"
# command (often provided by a package of the same name) to read the status of
# the battery, and eventually its remaining time (to full charge or discharge).
#
# The color will gradually change for a percentage below 85%, and the urgency
# (exit code 33) is set if there is less that 5% remaining.

use strict;
use warnings;
use utf8;

my $acpi;
my $status;
my $percent;
my $ac_adapt;
my $full_text;
my $short_text;
my $bat_number = $ENV{BLOCK_INSTANCE} || 0;

# print utf-8 chars directly and redirect stderr to stdout
binmode STDOUT, ':encoding(UTF-8)';
*STDERR = *STDOUT;

# read the first line of the "acpi" command output
open (ACPI, "acpi -b | grep 'Battery $bat_number' |") or die;
$acpi = <ACPI>;
close(ACPI);

# fail on unexpected output
if ($acpi !~ /: (\w+), (\d+)%/) {
    die "$acpi\n";
}

$status = $1;
$percent = $2;
$full_text = "$percent%";

if ($status eq 'Discharging') {
    if ($percent < 10) {
                $full_text .= '  ';
        } elsif ($percent < 25) {
                $full_text .= '  ';
        } elsif ($percent < 50) {
                $full_text .= '  ';
        } elsif ($percent < 75) {
                $full_text .= '  ';
        } elsif ($percent < 100) {
                $full_text .= '  ';
        } elsif ($status eq 'Charging') {
                $full_text .= "⚡ $percent% Chr";
        } elsif ($status eq 'Unknown') {
            open (AC_ADAPTER, "acpi -a |") or die;
                 $ac_adapt = <AC_ADAPTER>;
            close(AC_ADAPTER);

    if ($ac_adapt =~ /: ([\w-]+)/) {
         $ac_adapt = $1;

             if ($ac_adapt eq 'on-line') {
                     $full_text .= '  ';
             } elsif ($ac_adapt eq 'off-line') {
                     $full_text .= ' ';
             }
        }
    }
}

$short_text = $full_text;

if ($acpi =~ /, (\d+:\d+):\d+/) {
    $full_text .= " ($1)";
}

# print text
print "$full_text\n";
print "$short_text\n";

# consider color and urgent flag only on discharge
if ($status eq 'Discharging') {

    if ($percent < 20) {
        print "#FF0000\n";
    } elsif ($percent < 40) {
        print "#FFAE00\n";
    } elsif ($percent < 60) {
        print "#FFF600\n";
    } elsif ($percent < 85) {
        print "#A8FF00\n";
    }
if ($status eq 'Charging') {
        if ($percent > 20) {
                print "#cce0ff\n";
        } elsif ($percent > 40) {
                print "#80b3ff\n";
        } elsif ($percent > 60) {
                print "#1a75ff\n";
        } elsif ($percent > 85) {
                print "#003d99\n";
        }
}    

    if ($percent < 5) {
        exit(33);
    }

}


exit(0);
Scriptul îl folosesc în i3blocks ca modul pentru baterie. Am făcut un script în bash dar nu este atât de fancy că cel în perl și afișajul este unul static.

---------- Post added at 19:57 ---------- Previous post was at 19:30 ----------

i3blocks.config

Code:
command=/usr/lib/i3blocks/$BLOCK_NAME
separator_block_width=12


[disk-root]
label=:
command=/usr/lib/i3blocks/disk /
interval=30
color=#cce6ff

#[ssid]
#label=
#command=echo "$(iw dev wlo1 link | grep SSID | cut -d " " -f 2-)"
#color=#d33682
#interval=5

#[wireless]
#instance=wlo1
#command=/usr/lib/i3blocks/iface
#color=#00FF00
#interval=10

#[strength]
#command=echo "$(iw dev wlo1 link | grep signal | cut -d " " -f 2-)"
#interval=10
#color=#cb4b16

[temp0]
label=
command=echo `sensors | grep 'Core' | cut -c16-23 | head -n1}`
interval=1
color=#99ccff

[temp1]
label=
command=echo `sensors | grep 'Core' | cut -c16-23 | head -n2`
interval=1
color=#99ccff

[battery]
command=~/.config/i3/battery
color=#66b3ff
interval=10

#[key_layout]
#label=
#command=~/.config/i3/blocks/keymap
#interval=10

[volume]
label=
command=~/.config/i3/blocks/volume
interval=1
signal=1
color=#1ac6ff

[load]
label= 
command=~/.config/i3/blocks/load
interval=1
color=#00ace6

[time]
label=
command=date '+%H:%M:%S  %d:%m:%Y'
interval=1
color=#0086b3

[packages]
label=
command=pacaur -Qu | wc -l
interval=200
color=#ff9900
Am încercat să am cât mai puține dependințe (bash/perl,etc) ca să nu se rupă la update.

---------- Post added at 20:03 ---------- Previous post was at 19:57 ----------

Module pentru i3blocks (scrise în bash):

keymap

Code:
#!/usr/bin/env bash

setxkbmap -query | awk '
    BEGIN{layout="";variant=""}
    /^layout/{layout=$2}
    /^variant/{variant=" ("$2")"}
    END{printf("%s%s",layout,variant)}'
load

Code:
#!/bin/bash

INSTANCE="${BLOCK_INSTANCE:-1}"

URGENT_VALUE=90

LOAD=$(cat /proc/loadavg | awk -F ' ' '{print $'"${INSTANCE}"'}')
if [[ "${LOAD}" != "" ]]; then
  LOAD_PERC=$(echo "scale=0; ${LOAD} * 100" | bc -l)
  LOAD_PERC=${LOAD_PERC%.*}

  echo "${LOAD}"
  echo "${LOAD}"
  echo ""

  if [[ "${LOAD_PERC}" -ge "${URGENT_VALUE}" ]]; then
    exit 33
  fi
fi
volume

Code:
#!/bin/bash

# Left click
if [[ "${BLOCK_BUTTON}" -eq 1 ]]; then
  amixer -q sset Master 5%+
# Middle click
elif [[ "${BLOCK_BUTTON}" -eq 2 ]]; then
  amixer -q sset Master toggle
# Right click
elif [[ "${BLOCK_BUTTON}" -eq 3 ]]; then
  amixer -q sset Master 5%-
fi

statusLine=$(amixer get Master | tail -n 1)
status=$(echo "${statusLine}" | grep -wo "on")
volume=$(echo "${statusLine}" | awk -F ' ' '{print $5}' | tr -d '[]%')

if [[ "${status}" == "on" ]]; then
  echo " ${volume}%"
  echo " ${volume}%"
  echo ""
else
  echo " ${mute}"
  echo " ${mute}"
  echo ""
fi
Battery (bash)

Code:
#!/bin/bash

BATTERY=0
BATTERY_INFO=$(acpi -b | grep "Battery ${BATTERY}")
BATTERY_STATE=$(echo "${BATTERY_INFO}" | grep -wo "Full\|Charging\|Discharging")
BATTERY_POWER=$(echo "${BATTERY_INFO}" | grep -o '[0-9]\+%' | tr -d '%')

URGENT_VALUE=10

if [[ "${BATTERY_STATE}" = "Charging" ]]; then
  echo " ${BATTERY_POWER}%"
  echo " ${BATTERY_POWER}%"
  echo ""

elif [[ "${BATTERY_STATE}" = "Discharging" ]]; then
  echo " ${BATTERY_POWER}%"
  echo " ${BATTERY_POWER}%"
  echo ""
else
  echo " ${BATTERY_POWER}%"
  echo " ${BATTERY_POWER}%"
  echo ""
fi
__________________
Doar Universul şi prostia umană sunt infinite, însă nu sunt sigur de primul. - Albert Einstein


_________________
Manuale:
_FreeBSD: FreeBSD Handbook | The Complete FreeBSD | Unix Toolbox | FAQ
_Arch GNU/Linux : ArchWiki

Last edited by AnbuBlack; 03.04.2017 at 22:23.
AnbuBlack is online now   Reply With Quote
The Following 2 Users Say Thank You to AnbuBlack For This Useful Post:
bogdan (27.04.2017), XVanish (03.04.2017)
Old 03.04.2017, 21:53   #2
XVanish
RPC Administrator
 
XVanish's Avatar
 
Join Date: 03.06.2008
Location: Baia Mare
Age: 37
Posts: 5,964
Thanks: 3,655
Thanked 3,372 Times in 1,984 Posts
Send a message via Yahoo to XVanish Send a message via Skype™ to XVanish
Default Re: Script baterie perl - i3blocks

Uite despre ce povesteam in chat:

Asta e din ~/.config/i3/config
Code:
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
bar {
        status_command i3status
    status_command i3blocks -c ~/.config/i3/i3blocks.conf
}
i3blocks.conf Battery:
Code:
# Battery indicator
#
# The battery instance defaults to 0.
[battery]
label=BAT
#label=⚡
#instance=1
command=/usr/lib/i3blocks/battery
color=#66b3ff
interval=10
Am pus manual command si calea noului battery de la i3blocks si tot nu apare nimic... Si aici e /usr/lib/i3blocks/battery - cel original cu care vine i3blocks si pe care am vrut sa testez icoana si bateria si toate cele:

Code:
#!/usr/bin/perl
#
# Copyright 2014 Pierre Mavro <deimos@deimos.fr>
# Copyright 2014 Vivien Didelot <vivien@didelot.org>
#
# Licensed under the terms of the GNU GPL v3, or any later version.
#
# This script is meant to use with i3blocks. It parses the output of the "acpi"
# command (often provided by a package of the same name) to read the status of
# the battery, and eventually its remaining time (to full charge or discharge).
#
# The color will gradually change for a percentage below 85%, and the urgency
# (exit code 33) is set if there is less that 5% remaining.

use strict;
use warnings;
use utf8;

my $acpi;
my $status;
my $percent;
my $full_text;
my $short_text;
my $bat_number = $ENV{BLOCK_INSTANCE} || 0;

# read the first line of the "acpi" command output
open (ACPI, "acpi -b | grep 'Battery $bat_number' |") or die;
$acpi = <ACPI>;
close(ACPI);

# fail on unexpected output
if ($acpi !~ /: (\w+), (\d+)%/) {
    die "$acpi\n";
}

$status = $1;
$percent = $2;
$full_text = "$percent%";

if ($status eq 'Discharging') {
    $full_text .= ' DIS';
} elsif ($status eq 'Charging') {
    $full_text .= ' CHR';
}

$short_text = $full_text;

if ($acpi =~ /(\d\d:\d\d):/) {
    $full_text .= " ($1)";
}

# print text
print "$full_text\n";
print "$short_text\n";

# consider color and urgent flag only on discharge
if ($status eq 'Discharging') {

    if ($percent < 20) {
        print "#FF0000\n";
    } elsif ($percent < 40) {
        print "#FFAE00\n";
    } elsif ($percent < 60) {
        print "#FFF600\n";
    } elsif ($percent < 85) {
        print "#A8FF00\n";
    }

    if ($percent < 5) {
        exit(33);
    }
}

exit(0);


---------- Post added at 22:13 ---------- Previous post was at 22:12 ----------

Cred ca asta e problema:

Code:
[root@6700K i3blocks]# acpi
No support for device type: power_supply


---------- Post added at 22:53 ---------- Previous post was at 22:13 ----------

Ai incercat sa scoti conditia de Chargin afara, sa vezi daca separat merge? Asa ceva:

Code:
#!/usr/bin/perl
#
# Copyright 2014 Pierre Mavro <deimos@deimos.fr>
# Copyright 2014 Vivien Didelot <vivien@didelot.org>
#
# Licensed under the terms of the GNU GPL v3, or any later version.
#
# This script is meant to use with i3blocks. It parses the output of the "acpi"
# command (often provided by a package of the same name) to read the status of
# the battery, and eventually its remaining time (to full charge or discharge).
#
# The color will gradually change for a percentage below 85%, and the urgency
# (exit code 33) is set if there is less that 5% remaining.

use strict;
use warnings;
use utf8;

my $acpi;
my $status;
my $percent;
my $ac_adapt;
my $full_text;
my $short_text;
my $bat_number = $ENV{BLOCK_INSTANCE} || 0;

# print utf-8 chars directly and redirect stderr to stdout
binmode STDOUT, ':encoding(UTF-8)';
*STDERR = *STDOUT;

# read the first line of the "acpi" command output
open (ACPI, "acpi -b | grep 'Battery $bat_number' |") or die;
$acpi = <ACPI>;
close(ACPI);

# fail on unexpected output
if ($acpi !~ /: (\w+), (\d+)%/) {
    die "$acpi\n";
}

$status = $1;
$percent = $2;
$full_text = "$percent%";

if ($status eq 'Discharging') {
    if ($percent < 10) {
                $full_text .= '  ';
        } elsif ($percent < 25) {
                $full_text .= '  ';
        } elsif ($percent < 50) {
                $full_text .= '  ';
        } elsif ($percent < 75) {
                $full_text .= '  ';
        } elsif ($percent < 100) {
                $full_text .= '  ';
        } elsif ($status eq 'Unknown') {
            open (AC_ADAPTER, "acpi -a |") or die;
                 $ac_adapt = <AC_ADAPTER>;
            close(AC_ADAPTER);

    if ($ac_adapt =~ /: ([\w-]+)/) {
         $ac_adapt = $1;

             if ($ac_adapt eq 'on-line') {
                     $full_text .= '  ';
             } elsif ($ac_adapt eq 'off-line') {
                     $full_text .= ' ';
             }
        }
    }
}

# if charging
if ($status eq 'Charging') {
     $full_text .= "⚡ $percent% Chr";
}

$short_text = $full_text;

if ($acpi =~ /, (\d+:\d+):\d+/) {
    $full_text .= " ($1)";
}

# print text
print "$full_text\n";
print "$short_text\n";

# consider color and urgent flag only on discharge
if ($status eq 'Discharging') {

    if ($percent < 20) {
        print "#FF0000\n";
    } elsif ($percent < 40) {
        print "#FFAE00\n";
    } elsif ($percent < 60) {
        print "#FFF600\n";
    } elsif ($percent < 85) {
        print "#A8FF00\n";
    }
if ($status eq 'Charging') {
        if ($percent > 20) {
                print "#cce0ff\n";
        } elsif ($percent > 40) {
                print "#80b3ff\n";
        } elsif ($percent > 60) {
                print "#1a75ff\n";
        } elsif ($percent > 85) {
                print "#003d99\n";
        }
}    

    if ($percent < 5) {
        exit(33);
    }

}


exit(0);
Macar vezi daca merge separat, si daca apare icoana aia care e diferita de celelalte.
__________________
Internetul e distractie, nu pierde controlul!


Foloseste Google si YouTube inainte de a pune intrebari stupide!
XVanish is online now   Reply With Quote
The Following User Says Thank You to XVanish For This Useful Post:
Alin99 (05.04.2017)
Old 04.04.2017, 16:11   #3
AnbuBlack
*nix enthusiast
 
AnbuBlack's Avatar
 
Join Date: 20.04.2011
Location: 127.0.0.1
Posts: 3,981
Thanks: 4,677
Thanked 6,292 Times in 3,015 Posts
Default Re: Script baterie perl - i3blocks

Într-un final am script funcțional pentru baterie. Nu este cel scris în Perl, ci unul în bash luat de pe net pe care l-am modificat ca să corespundă cerințelor mele. Rezultatul arată în felul următor:

00unk.png 01unk.png 02ch.png

03ch.png04ch.png05ch.png

06ch.png07ch.png08ch.png

08ch.png09ch.png10ch.png

11ch.png12ch.png13ch.png

14ch.png15ch.png

Scriptul afișează doar icoana bateriei, dar cu un simplu click pe ea afișează detalii despre starea bateriei (charge/discharge/unknown/procent).

Script baterie:
Code:
#!/usr/bin/env bash
#  batterybar; displays battery percentage as a bar on i3blocks
#  
#  Copyright 2015 Keftaa <adnan.37h@gmail.com>
#  
#  This program 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.
#  
#  



output=$(acpi battery)
percentage=$(echo "$output" | grep -o -m1 '[0-9]\{1,3\}%' | tr -d '%')
status=$(echo "$output" | egrep -o -m1 'Discharging|Charging|AC|Full|Unknown')
remaining=$( echo "$output" | egrep -o -m1 '[0-9][0-9]:[0-9][0-9]')
[[ -n $remaining ]] && remaining_formatted=" ($remaining)"
squares="■"


#There are 8 colors that reflect the current battery percentage when 
#discharging and charging
dis_colors=("#FF0027" "#FF3B05" "#FFB923" "#FFD000" "#E4FF00" "#ADFF00" "#6DFF00" "#13e600") 
charging_color=("#ac00e6" "#9900ff" "#3333ff" "#66a3ff" "#33ccff" "#33ccff" "#80ffff" "#99ccff")
full_color="#66b3ff"
ac_color="#7575a3"
unknown_color="#666699"


while getopts 1:2:3:4:5:6:7:8:9:10:11:12:13:14:15:16:f:a:h opt; do
    case "$opt" in
        1) dis_colors[0]="$OPTARG";;
        2) dis_colors[1]="$OPTARG";;
        3) dis_colors[2]="$OPTARG";;
        4) dis_colors[3]="$OPTARG";;
        5) dis_colors[4]="$OPTARG";;
        6) dis_colors[5]="$OPTARG";;
        7) dis_colors[6]="$OPTARG";;
        8) dis_colors[7]="$OPTARG";;
        9) charging_color[0]="$OPTARG";;
       10) charging_color[1]="$OPTARG";;
       11) charging_color[2]="$OPTARG";;
       12) charging_color[3]="$OPTARG";;
       13) charging_color[4]="$OPTARG";;
       14) charging_color[5]="$OPTARG";;
       15) charging_color[6]="$OPTARG";;
       16) charging_color[7]="$OPTARG";;
        f) full_color="$OPTARG";;
        a) ac_color="$OPTARG";;
        h) printf "Usage: batterybar [OPTION] color
        When discharging, there are 8 [1-8] levels colors.
        You can specify custom colors, for example:
        
        batterybar -1 red -2 \"#F6F6F6\" -8 green
        
        You can also specify the colors for the charging, AC and
        charged states:
        
        batterybar -c green -f white -a \"#EEEEEE\"\n";
        exit 0;
    esac
done



if (( percentage > 0 && percentage < 20  )); then
    squares=""
elif (( percentage >= 20 && percentage < 40 )); then
    squares=""
elif (( percentage >= 40 && percentage < 60 )); then
    squares=""
elif (( percentage >= 60 && percentage < 80 )); then
    squares=""
elif (( percentage >=80 )); then
    squares=""
fi

if [[ "$status" = "Unknown" ]]; then
    squares="<sup>?</sup>$squares"
fi

case "$status" in
"Charging")
      if (( percentage >= 0 && percentage < 10 )); then
        color="${charging_color[0]}"
    elif (( percentage >= 10 && percentage < 20 )); then
        color="${charging_color[1]}"
    elif (( percentage >= 20 && percentage < 30 )); then
        color="${dcharging_color[2]}"
    elif (( percentage >= 30 && percentage < 40 )); then
        color="${charging_color[3]}"
    elif (( percentage >= 40 && percentage < 60 )); then
        color="${charging_color[4]}"
    elif (( percentage >= 60 && percentage < 70 )); then
        color="${charging_color[5]}"
    elif (( percentage >= 70 && percentage < 80 )); then
        color="${charging_color[6]}"
    elif (( percentage >= 80 )); then
        color="${charging_color[7]}"
    fi
;;
"Full")
    color="$full_color"
;;
"AC")
    color="$ac_color"
;;
"Discharging"|"Unknown")
    if (( percentage >= 0 && percentage < 10 )); then
        color="${dis_colors[0]}"
    elif (( percentage >= 10 && percentage < 20 )); then
        color="${dis_colors[1]}"
    elif (( percentage >= 20 && percentage < 30 )); then
        color="${dis_colors[2]}"
    elif (( percentage >= 30 && percentage < 40 )); then
        color="${dis_colors[3]}"
    elif (( percentage >= 40 && percentage < 60 )); then
        color="${dis_colors[4]}"
    elif (( percentage >= 60 && percentage < 70 )); then
        color="${dis_colors[5]}"
    elif (( percentage >= 70 && percentage < 80 )); then
        color="${dis_colors[6]}"
    elif (( percentage >= 80 )); then
        color="${dis_colors[7]}"
    fi
;;
esac

if [[ "$BLOCK_BUTTON" -eq 1 ]]; then 
    echo "$status <span foreground=\"$color\">$percentage%$remaining_formatted</span>"
fi
echo "<span foreground=\"$color\">$squares</span>"
__________________
Doar Universul şi prostia umană sunt infinite, însă nu sunt sigur de primul. - Albert Einstein


_________________
Manuale:
_FreeBSD: FreeBSD Handbook | The Complete FreeBSD | Unix Toolbox | FAQ
_Arch GNU/Linux : ArchWiki

Last edited by AnbuBlack; 04.04.2017 at 16:14.
AnbuBlack is online now   Reply With Quote
The Following 2 Users Say Thank You to AnbuBlack For This Useful Post:
Alin99 (05.04.2017), XVanish (04.04.2017)
Old 04.04.2017, 18:07   #4
XVanish
RPC Administrator
 
XVanish's Avatar
 
Join Date: 03.06.2008
Location: Baia Mare
Age: 37
Posts: 5,964
Thanks: 3,655
Thanked 3,372 Times in 1,984 Posts
Send a message via Yahoo to XVanish Send a message via Skype™ to XVanish
Default Re: Script baterie perl - i3blocks

Deci tot nu i-ai dat de cap la scriptul perl... asta e. Arata bine, cam multe culori diferite pentru gustul meu dar tie trebuie sa iti placa. Cu scriptul asta isi face refresh automat la intervalele setate sau nu? Stiu ca asta era una dintre problemele initiale pe care le-ai intampinat.
__________________
Internetul e distractie, nu pierde controlul!


Foloseste Google si YouTube inainte de a pune intrebari stupide!
XVanish is online now   Reply With Quote
Old 04.04.2017, 18:50   #5
AnbuBlack
*nix enthusiast
 
AnbuBlack's Avatar
 
Join Date: 20.04.2011
Location: 127.0.0.1
Posts: 3,981
Thanks: 4,677
Thanked 6,292 Times in 3,015 Posts
Default Re: Script baterie perl - i3blocks

Quote:
Originally Posted by XVanish View Post
Deci tot nu i-ai dat de cap la scriptul perl... asta e. Arata bine, cam multe culori diferite pentru gustul meu dar tie trebuie sa iti placa. Cu scriptul asta isi face refresh automat la intervalele setate sau nu? Stiu ca asta era una dintre problemele initiale pe care le-ai intampinat.
Nu mi se par deloc multe culori pentru că fiecare reprezită un prag de încărcare (0-20, 20-40,etc); refreshul este în timp real.
__________________
Doar Universul şi prostia umană sunt infinite, însă nu sunt sigur de primul. - Albert Einstein


_________________
Manuale:
_FreeBSD: FreeBSD Handbook | The Complete FreeBSD | Unix Toolbox | FAQ
_Arch GNU/Linux : ArchWiki
AnbuBlack is online now   Reply With Quote
The Following 2 Users Say Thank You to AnbuBlack For This Useful Post:
Alin99 (05.04.2017), XVanish (04.04.2017)
Old 04.04.2017, 19:00   #6
XVanish
RPC Administrator
 
XVanish's Avatar
 
Join Date: 03.06.2008
Location: Baia Mare
Age: 37
Posts: 5,964
Thanks: 3,655
Thanked 3,372 Times in 1,984 Posts
Send a message via Yahoo to XVanish Send a message via Skype™ to XVanish
Default Re: Script baterie perl - i3blocks

Asta e important, sa fie in timp real. Eu personal prefer aceeasi culoare la icoane, ca doar oricum ai icoane diferite pentru nivelul de incarcare a bateriei, goala, o linie, doua linii etc... deci se vede oricum cat e de incarcata.

Cum am zis, tie sa iti placa, nu noua.
__________________
Internetul e distractie, nu pierde controlul!


Foloseste Google si YouTube inainte de a pune intrebari stupide!
XVanish is online now   Reply With Quote
The Following 2 Users Say Thank You to XVanish For This Useful Post:
Alin99 (05.04.2017), AnbuBlack (04.04.2017)
Old 06.04.2017, 18:58   #7
AnbuBlack
*nix enthusiast
 
AnbuBlack's Avatar
 
Join Date: 20.04.2011
Location: 127.0.0.1
Posts: 3,981
Thanks: 4,677
Thanked 6,292 Times in 3,015 Posts
Default Re: Script baterie perl - i3blocks

Forma finală (cred ):

i3blocks:
- afișaj player (audacious)
_ funcții controlate din mouse:
i) click stg. (previous song)
ii) click dr. (next song)
iii) midle button (play/pause song)

001.png 002.png

- afișaj player consolă (moc)
_ funcții controlate din mouse:
i) click stg. (previous song)
ii) click dr. (next song)
iii) midle button (play/pause song)

003.png 004.png

- afișaj temperatură (momentan static, încă nu am apucat să îi implementez mai multe funcții;

- afisăj baterie dinamic diferite niveluri de încărcare (post 3)

Apropo de afișajul playerelor: când ai ieșit din ele acesta dispare din bară (); în scripturile pe care le-am găsit pe net afișajul rămânea în bată ca un cârnat inestetic și zicea că playerul X este offline (ceva de genul numai rețin exact).

Rezultatul:
005.jpg
__________________
Doar Universul şi prostia umană sunt infinite, însă nu sunt sigur de primul. - Albert Einstein


_________________
Manuale:
_FreeBSD: FreeBSD Handbook | The Complete FreeBSD | Unix Toolbox | FAQ
_Arch GNU/Linux : ArchWiki

Last edited by AnbuBlack; 06.04.2017 at 19:02.
AnbuBlack is online now   Reply With Quote
The Following User Says Thank You to AnbuBlack For This Useful Post:
bogdan (27.04.2017)
Old 06.04.2017, 19:12   #8
XVanish
RPC Administrator
 
XVanish's Avatar
 
Join Date: 03.06.2008
Location: Baia Mare
Age: 37
Posts: 5,964
Thanks: 3,655
Thanked 3,372 Times in 1,984 Posts
Send a message via Yahoo to XVanish Send a message via Skype™ to XVanish
Default Re: Script baterie perl - i3blocks

Super, arata bine! Vai... de as putea face copy/paste la tot ce tine de i3wm, conky, i3blocks si tot ce trebuie ar fi super... incepe sa ma enerveze faptul ca nu am nimic la indemana pe wm-ul asta chel si ma cam afecteaza la munca... nimic nu e cum mi-ar placea sa fie. Dar tot nu renunt! O sa vina si vremea cand voi avea timp de customizari, sper cat de curand!
__________________
Internetul e distractie, nu pierde controlul!


Foloseste Google si YouTube inainte de a pune intrebari stupide!
XVanish is online now   Reply With Quote
The Following User Says Thank You to XVanish For This Useful Post:
AnbuBlack (08.04.2017)
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problema functionare/baterie laptop Nosya Suport Tehnic 4 09.06.2014 18:17
Baterie Asus Costin Suport Tehnic 4 18.12.2013 21:42
Autonomie baterie Samsung Galaxy S2 XVanish GSM & Telecomunicatii 23 13.02.2013 00:35
[VAND] Baterie laptop winston90 Hardware 0 06.11.2012 17:08
STAIR - Baterie alimentata cu aer ! XVanish IT&C News 3 13.12.2010 15:10

 
Advertisement




camere foto digitale

aparate foto digitale


Partner Links
Sabitech Media - dezvoltare web, servicii media

RSP Forum - sateliti.info
Comunitate Satelitara






All times are GMT +2. The time now is 22:30.


Powered by vBulletin® - © Jelsoft Enterprises Ltd.
~ Copyright © 2007-2015 Romanian PC Forum ~
Toate drepturile rezervate

Romanian Sattelites Provider Wi-Fi Magazin