Commit 3edff1e8 authored by HS-157's avatar HS-157
Browse files

Rajout

parent 711be36c
# dot-files
dot-files / Fichiers de configuration
Xcursor.theme: Vanilla-DMZ
! ===============================================
! URXVT
! ===============================================
! URxvt*termName: string
URxvt*geometry: 240x84
! URxvt*chdir: string
! URxvt*reverseVideo: boolean
URxvt*loginShell: false
! URxvt*jumpScroll: boolean
! URxvt*skipScroll: boolean
! URxvt*pastableTabs: boolean
! URxvt*scrollstyle: mode
URxvt*scrollBar: false
! URxvt*scrollBar_right: boolean
! URxvt*scrollBar_floating: boolean
! URxvt*scrollBar_align: mode
! URxvt*thickness: number
! URxvt*scrollTtyOutput: boolean
! URxvt*scrollTtyKeypress: boolean
! URxvt*scrollWithBuffer: boolean
! URxvt*inheritPixmap: boolean
! URxvt*transparent: boolean
! URxvt*tintColor: color
! URxvt*shading: number
! URxvt*blurRadius: HxV
URxvt*fading: 40
URxvt*fadeColor: black
! URxvt*utmpInhibit: boolean
! URxvt*urgentOnBell: boolean
! URxvt*visualBell: boolean
! URxvt*mapAlert: boolean
! URxvt*meta8: boolean
! URxvt*mouseWheelScrollPage: boolean
! URxvt*tripleclickwords: boolean
! URxvt*insecure: boolean
! URxvt*cursorUnderline: boolean
! URxvt*cursorBlink: boolean
! URxvt*pointerBlank: boolean
URxvt*background: #161616
URxvt*foreground: #839496
!URxvt*color0: #000000
!URxvt*color1: #F35555
!URxvt*color2: #70CC78
!URxvt*color3: #F39166
!!URxvt*color4: #0000CC
!URxvt*color4: #6EADEF
!URxvt*color5: #B77BB7
!URxvt*color6: #54ABA7
!URxvt*color7: #909090
!URxvt*color8: #202020
!URxvt*color9: #F35555
!URxvt*color10: #70CC78
!URxvt*color11: #D2D265
!!URxvt*color12: #0033CC
!URxvt*color12: #75A8F0
!URxvt*color13: #BC71BC
!URxvt*color14: #72B5BE
!URxvt*color15: #FFFFFF
! URxvt*colorBD: color
! URxvt*colorIT: color
URxvt*colorUL: #75A8F0
! URxvt*colorRV: color
! URxvt*underlineColor: color
! URxvt*scrollColor: color
! URxvt*troughColor: color
! URxvt*highlightColor: color
! URxvt*highlightTextColor: color
URxvt*cursorColor: #626262
URxvt*cursorColor2: #FFFFFF
! URxvt*pointerColor: color
! URxvt*pointerColor2: color
! URxvt*borderColor: color
! URxvt*iconFile: file
URxvt.font: xft:DejaVu Sans Mono:size=10
URxvt.boldFont: xft:DejaVu Sans Mono:bold:size=10
! URxvt*italicFont: fontname
! URxvt*boldItalicFont: fontname
! URxvt*intensityStyles: boolean
! URxvt*inputMethod: name
! URxvt*preeditType: style
! URxvt*imLocale: string
! URxvt*imFont: fontname
! URxvt*title: string
! URxvt*iconName: string
URxvt*saveLines: 100000
! URxvt*buffered: boolean
! URxvt*depth: number
! URxvt*visual: number
! URxvt*transient-for: windowid
! URxvt*override-redirect: boolean
! URxvt*hold: boolean
! URxvt*externalBorder: number
! URxvt*internalBorder: number
! URxvt*borderLess: boolean
! URxvt*lineSpace: number
URxvt*letterSpace: -1
! URxvt*skipBuiltinGlyphs: boolean
! URxvt*pointerBlankDelay: number
! URxvt*backspacekey: string
! URxvt*deletekey: string
! URxvt*print-pipe: string
! URxvt*modifier: modifier
! URxvt*cutchars: string
! URxvt*answerbackString: string
! URxvt*secondaryScreen: boolean
! URxvt*secondaryScroll: boolean
! URxvt*perl-lib: string
! URxvt*perl-eval: perl-eval
URxvt*perl-ext-common: default,matcher
! URxvt*perl-ext: string
! URxvt*iso14755: boolean
! URxvt*iso14755_52: boolean
! URxvt*xrm: string
! URxvt*keysym.sym: keysym
! URxvt*background.border: boolean
! URxvt*background.expr: string
! URxvt*background.interval: seconds
! URxvt*bell-command: string
URxvt*matcher.button: 1
! URxvt*matcher.launcher: string
! URxvt*matcher.launcher.*: string
! URxvt*matcher.pattern.*: string
! URxvt*matcher.rend.*: string
! URxvt*remote-clipboard.fetch: string
! URxvt*remote-clipboard.store: string
! URxvt*searchable-scrollback: string
! URxvt*selection-autotransform.*: string
! URxvt*selection-pastebin.cmd: string
! URxvt*selection-pastebin.url: string
! URxvt*selection.pattern-0: string
! URxvt*tab-bg: colour
! URxvt*tab-fg: colour
! URxvt*tabbar-bg: colour
! URxvt*tabbar-fg: colour
URxvt*url-launcher: /usr/bin/xdg-open
! blue
*color4: #2049ff
! bright_blue
*color12: #5c7aff
#!/usr/bin/python3
import sys
import time
import shutil
columns = shutil.get_terminal_size()[0]
numberOfLineToShow = 0
if len(sys.argv) > 1:
try:
numberOfLineToShow = int(sys.argv[1])
except:
print("L'argument passé doit être un entier ")
exit(1)
k = 0
lines = ""
# Read from pipe
while True:
line = sys.stdin.readline()
if not line:
break
lines += line
fname = "/tmp/logo"
num_chars = dict()
maxChar = 0
num_lines = 0
for line in lines.split('\n'):
num_chars[num_lines] = len(line)
num_lines += 1
maxChar = max(maxChar,len(line))
with open(fname, 'w') as f:
num_lines = 0
maxChar = maxChar+5
if maxChar*2 < columns: # par sur le fait qu'alsi a une sortie équivalente a celle de cowsay
for line in lines.split('\n'):
line += " "*(maxChar - num_chars[num_lines])
f.write(line + "\n")
num_lines += 1
elif maxChar > columns:
exit(1)
else:
maxChar = 1
while num_lines < numberOfLineToShow:
line = " " * (maxChar) + "\n"
f.write(line)
num_lines += 1
pcm.!default {
type hw
card 1
}
ctl.!default {
type hw
card 0
}
#!/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;
# read the first line of the "acpi" command output
open (ACPI, 'acpi -b |') or die "Can't exec acpi: $!\n";
$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 .= '';
} 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);
}
}
else {
print "#00FF00"
}
exit(0);
#!/usr/bin/perl
#
# Copyright 2014 Pierre Mavro <deimos@deimos.fr>
# Copyright 2014 Vivien Didelot <vivien@didelot.org>
# Copyright 2014 Andreas Guldstrand <andreas.guldstrand@gmail.com>
#
# Licensed under the terms of the GNU GPL v3, or any later version.
use strict;
use warnings;
use utf8;
use Getopt::Long;
# default values
my $t_warn = 50;
my $t_crit = 80;
my $cpu_usage = -1;
sub help {
print "Usage: cpu_usage [-w <warning>] [-c <critical>]\n";
print "-w <percent>: warning threshold to become yellow\n";
print "-c <percent>: critical threshold to become red\n";
exit 0;
}
GetOptions("help|h" => \&help,
"w=i" => \$t_warn,
"c=i" => \$t_crit);
# Get CPU usage
$ENV{LC_ALL}="en_US"; # if mpstat is not run under en_US locale, things may break, so make sure it is
open (MPSTAT, 'mpstat 1 1 |') or die "Can't exec mpstat: $!";
while (<MPSTAT>) {
if (/^Average:\s+all\s+(\d+\.\d+)\s+\d+\.\d+\s+(\d+\.\d+)/) {
$cpu_usage = $1 + $2; # %usr + %sys
last;
}
}
close(MPSTAT);
$cpu_usage eq -1 and die 'Can\'t find CPU information';
# Print short_text, full_text
printf "%.2f%%\n", $cpu_usage;
printf "%.2f%%\n", $cpu_usage;
# Print color, if needed
if ($cpu_usage >= $t_crit) {
print "#FF0000\n";
exit 33;
} elsif ($cpu_usage >= $t_warn) {
print "#FFFC00\n";
}
exit 0;
#!/bin/sh
# Copyright (C) 2014 Julien Bonjean <julien@bonjean.info>
# 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 3 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, see <http://www.gnu.org/licenses/>.
DIR="${1:-$HOME}"
ALERT_LOW="${2:-10}" # color will turn red under this value (default: 10%)
df -h -P -l "$DIR" 2>/dev/null |
awk -v alert_low=$ALERT_LOW '
/\/.*/ {
# full text
print $4
# short text
print $4
use=$5
# no need to continue parsing
exit 0
}
END {
gsub(/%$/,"",use)
if (100 - use < alert_low) {
# color
print "#FF0000"
}
}
'
#!/bin/sh
# Copyright (C) 2014 Julien Bonjean <julien@bonjean.info>
# 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 3 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, see <http://www.gnu.org/licenses/>.
load="$(cut -d ' ' -f1 /proc/loadavg)"
cpus="$(nproc)"
# full text
echo "$load"
# short text
echo "$load"
# color if load is too high
if [ $(awk 'BEGIN{ print "'$cpus'"<="'$load'" }') -eq 1 ]; then
echo "#FF0000"
fi
#!/bin/sh
# Copyright (C) 2014 Julien Bonjean <julien@bonjean.info>
# 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 3 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, see <http://www.gnu.org/licenses/>.
TYPE="${1:-mem}"
awk -v type=$TYPE '
/^MemTotal:/ {
mem_total=$2
}
/^MemFree:/ {
mem_free=$2
}
/^Buffers:/ {
mem_free+=$2
}
/^Cached:/ {
mem_free+=$2
}
/^SwapTotal:/ {
swap_total=$2
}
/^SwapFree:/ {
swap_free=$2
}
END {
# full text
if (type == "swap")
printf("%.1fG\n", (swap_total-swap_free)/1024/1024)
else
printf("%.1fG\n", mem_free/1024/1024)
# TODO: short text
# TODO: color (if less than X%)
}
' /proc/meminfo
#!/bin/sh
# Copyright (C) 2014 Julien Bonjean <julien@bonjean.info>
# 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 3 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, see <http://www.gnu.org/licenses/>.
INTERFACE="${BLOCK_INSTANCE:-eth0}"
state="$(cat /sys/class/net/$INTERFACE/operstate)"
if [ "$state" != "up" ]; then
# uncomment those lines if you want to see down interfaces
# echo "down"
# echo "down"
# echo "#FF0000"
exit 0
fi
speed="$(cat /sys/class/net/$INTERFACE/speed 2> /dev/null)"
ipaddr="$(ip addr show $INTERFACE | perl -n -e'/inet (.+)\// && print $1')"
ipaddr="${ipaddr:-0.0.0.0}"
# short text
echo "$ipaddr"
#!/bin/sh
# Copyright (C) 2014 Julien Bonjean <julien@bonjean.info>
# 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 3 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, see <http://www.gnu.org/licenses/>.
CARD="${1:-0}"
MIXER="${2:-default}" # use pulse for pulseaudio, default is alsa
amixer -c $CARD -M -D $MIXER get Master |
sed -n 's/^[^:]*: Playback [0-9]* \[\([0-9]*%\)\] .*/\1/p' |
head -n1
#!/bin/sh
# Copyright (C) 2014 Julien Bonjean <julien@bonjean.info>
# 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 3 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, see <http://www.gnu.org/licenses/>.
CARD="${1:-0}"
MIXER="${2:-default}" # use pulse for pulseaudio, default is alsa
amixer -c $CARD -M -D $MIXER get IEC958 |
sed -n 's/^[^:]*: Playback [0-9]* \[\([0-9]*%\)\] .*/\1/p' |
head -n1
[Filechooser Settings]
LocationMode=filename-entry
ShowHidden=false
ShowSizeColumn=true
GeometryX=534
GeometryY=223
GeometryWidth=852
GeometryHeight=630
SortColumn=name
SortOrder=ascending
StartupMode=recent
[Settings]
gtk-application-prefer-dark-theme = true
gtk-theme-name = Adwaita
gtk-icon-theme-name = Adwaita
gtk-font-name = Sans 8
[Settings]
gtk-application-prefer-dark-theme = true
gtk-theme-name = Adwaita
gtk-icon-theme-name = Adwaita
gtk-font-name = Sans 8
# This is a sample commands.py. You can add your own commands here.
#
# Please refer to commands_full.py for all the default commands and a complete
# documentation. Do NOT add them all here, or you may end up with defunct
# commands when upgrading ranger.
# You always need to import ranger.api.commands here to get the Command class:
from ranger.api.commands import *
# A simple command for demonstration purposes follows.
#------------------------------------------------------------------------------
# You can import any python module as needed.
import os
# Any class that is a subclass of "Command" will be integrated into ranger as a
# command. Try typing ":my_edit<ENTER>" in ranger!
class my_edit(Command):
# The so-called doc-string of the class will be visible in the built-in
# help that is accessible by typing "?c" inside ranger.
""":my_edit <filename>
A sample command for demonstration purposes that opens a file in an editor.
"""
# The execute method is called when you run this command in ranger.
def execute(self):
# self.arg(1) is the first (space-separated) argument to the function.
# This way you can write ":my_edit somefilename<ENTER>".
if self.arg(1):
# self.rest(1) contains self.arg(1) and everything that follows
target_filename = self.rest(1)
else:
# self.fm is a ranger.core.filemanager.FileManager object and gives
# you access to internals of ranger.
# self.fm.thisfile is a ranger.container.file.File object and is a
# reference to the currently selected file.
target_filename = self.fm.thisfile.path
# This is a generic function to print text in ranger.
self.fm.notify("Let's edit the file " + target_filename + "!")
# Using bad=True in fm.notify allows you to print error messages:
if not os.path.exists(target_filename):