Mise à jour de quelques fichiers de config
This commit is contained in:
parent
b6ca59c7d1
commit
61f21a2e6e
30 changed files with 2649 additions and 43 deletions
302
.config/dunst/dunstrc
Normal file
302
.config/dunst/dunstrc
Normal file
|
@ -0,0 +1,302 @@
|
||||||
|
[global]
|
||||||
|
font = Fira Sans
|
||||||
|
|
||||||
|
# Allow a small subset of html markup:
|
||||||
|
# <b>bold</b>
|
||||||
|
# <i>italic</i>
|
||||||
|
# <s>strikethrough</s>
|
||||||
|
# <u>underline</u>
|
||||||
|
#
|
||||||
|
# For a complete reference see
|
||||||
|
# <http://developer.gnome.org/pango/stable/PangoMarkupFormat.html>.
|
||||||
|
# If markup is not allowed, those tags will be stripped out of the
|
||||||
|
# message.
|
||||||
|
allow_markup = yes
|
||||||
|
|
||||||
|
# The format of the message. Possible variables are:
|
||||||
|
# %a appname
|
||||||
|
# %s summary
|
||||||
|
# %b body
|
||||||
|
# %i iconname (including its path)
|
||||||
|
# %I iconname (without its path)
|
||||||
|
# %p progress value if set ([ 0%] to [100%]) or nothing
|
||||||
|
# Markup is allowed
|
||||||
|
format = "%s %p\n%b"
|
||||||
|
|
||||||
|
# Sort messages by urgency.
|
||||||
|
sort = yes
|
||||||
|
|
||||||
|
# Show how many messages are currently hidden (because of geometry).
|
||||||
|
indicate_hidden = yes
|
||||||
|
|
||||||
|
# Alignment of message text.
|
||||||
|
# Possible values are "left", "center" and "right".
|
||||||
|
alignment = left
|
||||||
|
|
||||||
|
# The frequency with wich text that is longer than the notification
|
||||||
|
# window allows bounces back and forth.
|
||||||
|
# This option conflicts with "word_wrap".
|
||||||
|
# Set to 0 to disable.
|
||||||
|
bounce_freq = 10
|
||||||
|
|
||||||
|
|
||||||
|
# Show age of message if message is older than show_age_threshold
|
||||||
|
# seconds.
|
||||||
|
# Set to -1 to disable.
|
||||||
|
show_age_threshold = 60
|
||||||
|
|
||||||
|
# Split notifications into multiple lines if they don't fit into
|
||||||
|
# geometry.
|
||||||
|
word_wrap = yes
|
||||||
|
|
||||||
|
# Ignore newlines '\n' in notifications.
|
||||||
|
ignore_newline = no
|
||||||
|
|
||||||
|
|
||||||
|
# The geometry of the window:
|
||||||
|
# [{width}]x{height}[+/-{x}+/-{y}]
|
||||||
|
# The geometry of the message window.
|
||||||
|
# The height is measured in number of notifications everything else
|
||||||
|
# in pixels. If the width is omitted but the height is given
|
||||||
|
# ("-geometry x2"), the message window expands over the whole screen
|
||||||
|
# (dmenu-like). If width is 0, the window expands to the longest
|
||||||
|
# message displayed. A positive x is measured from the left, a
|
||||||
|
# negative from the right side of the screen. Y is measured from
|
||||||
|
# the top and down respectevly.
|
||||||
|
# The width can be negative. In this case the actual width is the
|
||||||
|
# screen width minus the width defined in within the geometry option.
|
||||||
|
geometry = "500x5-25+25"
|
||||||
|
|
||||||
|
# Shrink window if it's smaller than the width. Will be ignored if
|
||||||
|
# width is 0.
|
||||||
|
shrink = yes
|
||||||
|
|
||||||
|
# The transparency of the window. Range: [0; 100].
|
||||||
|
# This option will only work if a compositing windowmanager is
|
||||||
|
# present (e.g. xcompmgr, compiz, etc.).
|
||||||
|
transparency = 15
|
||||||
|
|
||||||
|
# Don't remove messages, if the user is idle (no mouse or keyboard input)
|
||||||
|
# for longer than idle_threshold seconds.
|
||||||
|
# Set to 0 to disable.
|
||||||
|
# default 120
|
||||||
|
idle_threshold = 120
|
||||||
|
|
||||||
|
# Which monitor should the notifications be displayed on.
|
||||||
|
monitor = 0
|
||||||
|
|
||||||
|
# Display notification on focused monitor. Possible modes are:
|
||||||
|
# mouse: follow mouse pointer
|
||||||
|
# keyboard: follow window with keyboard focus
|
||||||
|
# none: don't follow anything
|
||||||
|
#
|
||||||
|
# "keyboard" needs a windowmanager that exports the
|
||||||
|
# _NET_ACTIVE_WINDOW property.
|
||||||
|
# This should be the case for almost all modern windowmanagers.
|
||||||
|
#
|
||||||
|
# If this option is set to mouse or keyboard, the monitor option
|
||||||
|
# will be ignored.
|
||||||
|
follow = keyboard
|
||||||
|
|
||||||
|
# Should a notification popped up from history be sticky or timeout
|
||||||
|
# as if it would normally do.
|
||||||
|
sticky_history = yes
|
||||||
|
|
||||||
|
# Maximum amount of notifications kept in history
|
||||||
|
history_length = 20
|
||||||
|
|
||||||
|
# Display indicators for URLs (U) and actions (A).
|
||||||
|
show_indicators = yes
|
||||||
|
|
||||||
|
# The height of a single line. If the height is smaller than the
|
||||||
|
# font height, it will get raised to the font height.
|
||||||
|
# This adds empty space above and under the text.
|
||||||
|
line_height = 0
|
||||||
|
|
||||||
|
# Draw a line of "separator_height" pixel height between two
|
||||||
|
# notifications.
|
||||||
|
# Set to 0 to disable.
|
||||||
|
separator_height = 1
|
||||||
|
|
||||||
|
# Padding between text and separator.
|
||||||
|
# padding = 8
|
||||||
|
padding = 8
|
||||||
|
|
||||||
|
# Horizontal padding.
|
||||||
|
horizontal_padding = 10
|
||||||
|
|
||||||
|
# Define a color for the separator.
|
||||||
|
# possible values are:
|
||||||
|
# * auto: dunst tries to find a color fitting to the background;
|
||||||
|
# * foreground: use the same color as the foreground;
|
||||||
|
# * frame: use the same color as the frame;
|
||||||
|
# * anything else will be interpreted as a X color.
|
||||||
|
separator_color = #515151
|
||||||
|
|
||||||
|
# Print a notification on startup.
|
||||||
|
# This is mainly for error detection, since dbus (re-)starts dunst
|
||||||
|
# automatically after a crash.
|
||||||
|
startup_notification = false
|
||||||
|
|
||||||
|
# dmenu path.
|
||||||
|
dmenu = /usr/bin/dmenu -p dunst:
|
||||||
|
|
||||||
|
# Browser for opening urls in context menu.
|
||||||
|
browser = firefox
|
||||||
|
|
||||||
|
# Align icons left/right/off
|
||||||
|
icon_position = left
|
||||||
|
|
||||||
|
# Paths to default icons.
|
||||||
|
icon_folders = /usr/share/icons/Vertex-Icons/status/16/:/usr/share/icons/Vertex-Icons/devices/16/:/usr/share/icons/Vertex-Icons/apps/16/
|
||||||
|
# icon_folders = /usr/share/icons/Adwaita/16x16/status/:/usr/share/icons/Adwaita/16x16/devices/:/usr/share/icons/Adwaita/16x16/apps/
|
||||||
|
# icon_folders = /usr/share/icons/breeze-dark/status/16/:/usr/share/icons/breeze-dark/devices/16/:/usr/share/icons/breeze-dark/apps/16/
|
||||||
|
|
||||||
|
[frame]
|
||||||
|
width = 1
|
||||||
|
color = "#6699cc"
|
||||||
|
|
||||||
|
[shortcuts]
|
||||||
|
|
||||||
|
# Shortcuts are specified as [modifier+][modifier+]...key
|
||||||
|
# Available modifiers are "ctrl", "mod1" (the alt-key), "mod2",
|
||||||
|
# "mod3" and "mod4" (windows-key).
|
||||||
|
# Xev might be helpful to find names for keys.
|
||||||
|
|
||||||
|
# Close notification.
|
||||||
|
close = mod1+space
|
||||||
|
|
||||||
|
# Close all notifications.
|
||||||
|
# close_all = ctrl+shift+space
|
||||||
|
close_all = ctrl+mod1+space
|
||||||
|
|
||||||
|
# Redisplay last message(s).
|
||||||
|
# On the US keyboard layout "grave" is normally above TAB and left
|
||||||
|
# of "1".
|
||||||
|
history = ctrl+mod4+h
|
||||||
|
|
||||||
|
# Context menu.
|
||||||
|
context = ctrl+mod1+c
|
||||||
|
|
||||||
|
[urgency_low]
|
||||||
|
# IMPORTANT: colors have to be defined in quotation marks.
|
||||||
|
# Otherwise the "#" and following would be interpreted as a comment.
|
||||||
|
background = "#393939"
|
||||||
|
foreground = "#a09f93"
|
||||||
|
timeout = 10
|
||||||
|
|
||||||
|
[urgency_normal]
|
||||||
|
background = "#2d2d2d"
|
||||||
|
foreground = "#d3d0c8"
|
||||||
|
timeout = 10
|
||||||
|
|
||||||
|
[urgency_critical]
|
||||||
|
background = "#2d2d2d"
|
||||||
|
foreground = "#f2777a"
|
||||||
|
timeout = 0
|
||||||
|
|
||||||
|
|
||||||
|
# Every section that isn't one of the above is interpreted as a rules to
|
||||||
|
# override settings for certain messages.
|
||||||
|
# Messages can be matched by "appname", "summary", "body", "icon", "category",
|
||||||
|
# "msg_urgency" and you can override the "timeout", "urgency", "foreground",
|
||||||
|
# "background", "new_icon" and "format".
|
||||||
|
# Shell-like globbing will get expanded.
|
||||||
|
#
|
||||||
|
# SCRIPTING
|
||||||
|
# You can specify a script that gets run when the rule matches by
|
||||||
|
# setting the "script" option.
|
||||||
|
# The script will be called as follows:
|
||||||
|
# script appname summary body icon urgency
|
||||||
|
# where urgency can be "LOW", "NORMAL" or "CRITICAL".
|
||||||
|
#
|
||||||
|
# NOTE: if you don't want a notification to be displayed, set the format
|
||||||
|
# to "".
|
||||||
|
# NOTE: It might be helpful to run dunst -print in a terminal in order
|
||||||
|
# to find fitting options for rules.
|
||||||
|
|
||||||
|
#[espeak]
|
||||||
|
# summary = "*"
|
||||||
|
# script = dunst_espeak.sh
|
||||||
|
|
||||||
|
#[script-test]
|
||||||
|
# summary = "*script*"
|
||||||
|
# script = dunst_test.sh
|
||||||
|
|
||||||
|
#[ignore]
|
||||||
|
# # This notification will not be displayed
|
||||||
|
# summary = "foobar"
|
||||||
|
# format = ""
|
||||||
|
|
||||||
|
#[signed_on]
|
||||||
|
# appname = Pidgin
|
||||||
|
# summary = "*signed on*"
|
||||||
|
# urgency = low
|
||||||
|
#
|
||||||
|
#[signed_off]
|
||||||
|
# appname = Pidgin
|
||||||
|
# summary = *signed off*
|
||||||
|
# urgency = low
|
||||||
|
#
|
||||||
|
#[says]
|
||||||
|
# appname = Pidgin
|
||||||
|
# summary = *says*
|
||||||
|
# urgency = critical
|
||||||
|
#
|
||||||
|
#[twitter]
|
||||||
|
# appname = Pidgin
|
||||||
|
# summary = *twitter.com*
|
||||||
|
# urgency = normal
|
||||||
|
#
|
||||||
|
#[Claws Mail]
|
||||||
|
# appname = claws-mail
|
||||||
|
# category = email.arrived
|
||||||
|
# urgency = normal
|
||||||
|
# background = "#2F899E"
|
||||||
|
# foreground = "#FFA247"
|
||||||
|
#
|
||||||
|
#[mute.sh]
|
||||||
|
# appname = mute
|
||||||
|
# category = mute.sound
|
||||||
|
# script = mute.sh
|
||||||
|
#
|
||||||
|
#[JDownloader]
|
||||||
|
# appname = JDownloader
|
||||||
|
# category = JD
|
||||||
|
# background = "#FFA247"
|
||||||
|
# foreground = "#FFFFFF"
|
||||||
|
#
|
||||||
|
#[newsbeuter]
|
||||||
|
# summary = *article*
|
||||||
|
# background = "#98AA21"
|
||||||
|
# foreground = "#FFFFFF"
|
||||||
|
#
|
||||||
|
#[irc]
|
||||||
|
# appname = weechat
|
||||||
|
# timeout = 0
|
||||||
|
# background = "#0033bb"
|
||||||
|
# foreground = "#dddddd"
|
||||||
|
#
|
||||||
|
#[weechat hl]
|
||||||
|
# appname = weechat
|
||||||
|
# category = weechat.HL
|
||||||
|
# background = "#FF5C47"
|
||||||
|
# foreground = "#FFFFFF"
|
||||||
|
#
|
||||||
|
#[weechat pn]
|
||||||
|
# appname = weechat
|
||||||
|
# category = weechat.PM
|
||||||
|
# background = "#D53B84"
|
||||||
|
# foreground = "#FFFFFF"
|
||||||
|
#
|
||||||
|
#[CMUS]
|
||||||
|
# appname = CMUS
|
||||||
|
# category = cmus
|
||||||
|
# background = "#6C4AB7"
|
||||||
|
# foreground = "#FFE756"
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# background = "#30AB70"
|
||||||
|
# foreground = "#F67245"
|
||||||
|
#
|
||||||
|
# vim: ft=cfg
|
25
.i3/config
25
.i3/config
|
@ -53,7 +53,8 @@ bindsym $mod+n border normal 1
|
||||||
|
|
||||||
# Font for window titles. Will also be used by the bar unless a different font
|
# Font for window titles. Will also be used by the bar unless a different font
|
||||||
# is used in the bar {} block below.
|
# is used in the bar {} block below.
|
||||||
font xft:xos4 Terminus,xft:TerminessTTF Nerd Font
|
font -xos4-terminus-medium-r-normal--14-140-72-72-c-80-iso10646-1
|
||||||
|
# font xft:Cantarell
|
||||||
|
|
||||||
# Use Mouse+$mod to drag floating windows
|
# Use Mouse+$mod to drag floating windows
|
||||||
floating_modifier $mod
|
floating_modifier $mod
|
||||||
|
@ -61,18 +62,20 @@ floating_modifier $mod
|
||||||
# start a terminal
|
# start a terminal
|
||||||
bindsym $mod+Return exec terminal -e fish
|
bindsym $mod+Return exec terminal -e fish
|
||||||
bindsym $mod+Ctrl+Return exec terminal
|
bindsym $mod+Ctrl+Return exec terminal
|
||||||
|
bindsym $mod+Shift+Return exec terminal -fn -xos4-terminus-medium-r-normal--32-320-72-72-c-160-iso10646-1 -e fish
|
||||||
|
|
||||||
# kill focused window
|
# kill focused window
|
||||||
bindsym $mod+Shift+q kill
|
bindsym $mod+Shift+q kill
|
||||||
|
|
||||||
# start program launcher
|
# start program launcher
|
||||||
bindsym $mod+d exec --no-startup-id dmenu_recent -f -nb '#2d2d2d' -nf '#747369' -sb '#6699cc' -sf '#2d2d2d' -p 'execute' -fn 'xos4 Terminus'
|
# bindsym $mod+d exec --no-startup-id dmenu_recent -f -nb '#2d2d2d' -nf '#747369' -sb '#6699cc' -sf '#2d2d2d' -p 'execute' -fn 'xos4 Terminus'
|
||||||
|
bindsym $mod+d exec --no-startup-id dmenu_recent -f -fn 'Fira Mono'
|
||||||
|
|
||||||
# launch desktop menu
|
# launch desktop menu
|
||||||
bindsym $mod+z exec --no-startup-id i3-dmenu-desktop --dmenu='dmenu -f -i -fn "xos4 Terminus" -nb "#2d2d2d" -nf "#747369" -sb "#6699cc" -sf "#2d2d2d"'
|
bindsym $mod+z exec --no-startup-id i3-dmenu-desktop --dmenu='dmenu -f -p "Launch:" -i -fn "Fira Mono" -nb "#2d2d2d" -nf "#747369" -sb "#6699cc" -sf "#2d2d2d"'
|
||||||
|
|
||||||
# launch without history
|
# launch without history
|
||||||
bindsym $mod+Ctrl+d exec --no-startup-id dmenu_run -f -nb '#2d2d2d' -nf '#747369' -sb '#6699cc' -sf '#2d2d2d' -p 'execute' -fn 'xos4 Terminus'
|
bindsym $mod+Ctrl+d exec --no-startup-id dmenu_run -f -p "Execute:" -nb '#2d2d2d' -nf '#747369' -sb '#6699cc' -sf '#2d2d2d' -fn 'Fira Mono'
|
||||||
|
|
||||||
# HUD
|
# HUD
|
||||||
# exec ~/.i3/i3-appmenu-service.py
|
# exec ~/.i3/i3-appmenu-service.py
|
||||||
|
@ -107,8 +110,8 @@ bindsym --release Num_Lock exec --no-startup-id pkill -SIGRTMIN+12 i3blocks
|
||||||
|
|
||||||
# Start Applications
|
# Start Applications
|
||||||
bindsym $mod+Ctrl+b exec i3-sensible-terminal +sb -e 'bmenu'
|
bindsym $mod+Ctrl+b exec i3-sensible-terminal +sb -e 'bmenu'
|
||||||
bindsym $mod+F2 exec firefox-nightly
|
bindsym $mod+F2 exec $BROWSER
|
||||||
bindsym $mod+Shift+F2 exec firefox-nightly --private-window
|
bindsym $mod+Shift+F2 exec $BROWSER --private-window
|
||||||
bindsym $mod+Ctrl+F2 exec surf "https://www.qwant.com?l=fr&h=1&hc=2&a=1&s=1&b=0&i=1&r=FR&sr=fr"
|
bindsym $mod+Ctrl+F2 exec surf "https://www.qwant.com?l=fr&h=1&hc=2&a=1&s=1&b=0&i=1&r=FR&sr=fr"
|
||||||
bindsym $mod+Ctrl+F3 exec pcmanfm
|
bindsym $mod+Ctrl+F3 exec pcmanfm
|
||||||
bindsym $mod+F3 exec i3-sensible-terminal +sb -e ranger
|
bindsym $mod+F3 exec i3-sensible-terminal +sb -e ranger
|
||||||
|
@ -277,6 +280,7 @@ for_window [class="(?i)variety"] floating enable
|
||||||
for_window [class="Yad"] floating enable
|
for_window [class="Yad"] floating enable
|
||||||
# for_window [class="Firefox"] border pixel 1
|
# for_window [class="Firefox"] border pixel 1
|
||||||
for_window [title="(?i)pinentry"] floating enable
|
for_window [title="(?i)pinentry"] floating enable
|
||||||
|
for_window [title="(?i)Minecraft"] border none
|
||||||
# switch to workspace with urgent window automatically
|
# switch to workspace with urgent window automatically
|
||||||
for_window [urgent=latest] focus
|
for_window [urgent=latest] focus
|
||||||
|
|
||||||
|
@ -350,7 +354,7 @@ exec ring.cx -r
|
||||||
exec --no-startup-id sleep 10 && i3-msg '[class="Gnome-ring"] move scratchpad'
|
exec --no-startup-id sleep 10 && i3-msg '[class="Gnome-ring"] move scratchpad'
|
||||||
#exec zeal
|
#exec zeal
|
||||||
#exec --no-startup-id qbittorrent
|
#exec --no-startup-id qbittorrent
|
||||||
exec --no-startup-id sleep 2 && urxvtc +sb -e newsbeuter
|
exec --no-startup-id sleep 2 && urxvtc +sb -e newsboat
|
||||||
exec --no-startup-id sleep 5 && i3-msg '[class="URxvt"] move scratchpad'
|
exec --no-startup-id sleep 5 && i3-msg '[class="URxvt"] move scratchpad'
|
||||||
#exec --no-startup-id variety
|
#exec --no-startup-id variety
|
||||||
#exec --no-startup-id while true; do feh --bg-center $HOME/Images/wallpapers/396396-blackangel.jpg; sleep 5m; feh --bg-max $HOME/Images/wallpapers/other-clock-tower-time-brick-gears-steampunk-high-quality-picture.jpg; sleep 5m; done
|
#exec --no-startup-id while true; do feh --bg-center $HOME/Images/wallpapers/396396-blackangel.jpg; sleep 5m; feh --bg-max $HOME/Images/wallpapers/other-clock-tower-time-brick-gears-steampunk-high-quality-picture.jpg; sleep 5m; done
|
||||||
|
@ -359,10 +363,11 @@ exec --no-startup-id redshift-gtk
|
||||||
#exec --no-startup-id ${HOME}/.screenlayout/home.sh
|
#exec --no-startup-id ${HOME}/.screenlayout/home.sh
|
||||||
#exec --no-startup-id sleep 5 && mocp -S
|
#exec --no-startup-id sleep 5 && mocp -S
|
||||||
#exec --no-startup-id mpv ~/Vidéos/wallpapers/pirate_flag.mp4 --wid 0 --loop-file -quiet
|
#exec --no-startup-id mpv ~/Vidéos/wallpapers/pirate_flag.mp4 --wid 0 --loop-file -quiet
|
||||||
exec --no-startup-id setxkbmap fr oss
|
#exec --no-startup-id setxkbmap fr oss
|
||||||
exec --no-startup-id btpd --bw-out 40 --max-peers 50
|
exec --no-startup-id btpd --bw-out 40 --max-peers 50
|
||||||
exec --no-startup-id nm-applet
|
exec --no-startup-id nm-applet
|
||||||
exec --no-startup-id grive-indicator
|
exec --no-startup-id sudo droidmote 2302 1234
|
||||||
|
exec --no-startup-id gdfs $HOME/.google_drive $HOME/Google_Drive/
|
||||||
|
|
||||||
# Start i3bar to display a workspace bar (plus the system information i3status if available)
|
# Start i3bar to display a workspace bar (plus the system information i3status if available)
|
||||||
bar {
|
bar {
|
||||||
|
@ -376,7 +381,7 @@ bar {
|
||||||
|
|
||||||
bindsym button4 nop
|
bindsym button4 nop
|
||||||
bindsym button5 nop
|
bindsym button5 nop
|
||||||
font xft:xos4 Terminus
|
# font -xos4-terminus-medium-r-normal--14-140-72-72-c-80-iso10646-1
|
||||||
strip_workspace_numbers yes
|
strip_workspace_numbers yes
|
||||||
|
|
||||||
colors {
|
colors {
|
||||||
|
|
421
.i3/config-bepo
Normal file
421
.i3/config-bepo
Normal file
|
@ -0,0 +1,421 @@
|
||||||
|
# i3 config file (v4)
|
||||||
|
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
|
||||||
|
|
||||||
|
# Set mod key (Mod1=<Alt>, Mod4=<Super>)
|
||||||
|
set $mod Mod4
|
||||||
|
|
||||||
|
# set default desktop layout (default is tiling)
|
||||||
|
# workspace_layout tabbed <stacking|tabbed>
|
||||||
|
|
||||||
|
# Configure border style <normal|1pixel|pixel xx|none|pixel>
|
||||||
|
new_window normal
|
||||||
|
new_float normal
|
||||||
|
|
||||||
|
# Hide borders
|
||||||
|
hide_edge_borders none
|
||||||
|
|
||||||
|
# change borders
|
||||||
|
bindsym $mod+u border none
|
||||||
|
bindsym $mod+y border pixel 2
|
||||||
|
bindsym $mod+n border normal
|
||||||
|
|
||||||
|
# Font for window titles. Will also be used by the bar unless a different font
|
||||||
|
# is used in the bar {} block below.
|
||||||
|
# font xft:Fira Sans 10
|
||||||
|
font 8x13
|
||||||
|
# font "-misc-fixed-medium-r-normal--13-120-75-75-c-80-iso10646-1"
|
||||||
|
|
||||||
|
# Use Mouse+$mod to drag floating windows
|
||||||
|
floating_modifier $mod
|
||||||
|
|
||||||
|
# start a terminal
|
||||||
|
bindsym $mod+Return exec i3-sensible-terminal
|
||||||
|
|
||||||
|
# kill focused window
|
||||||
|
bindsym $mod+Shift+q kill
|
||||||
|
|
||||||
|
# start program launcher
|
||||||
|
bindsym $mod+d exec --no-startup-id dmenu_run
|
||||||
|
|
||||||
|
# launch desktop menu
|
||||||
|
bindsym $mod+z exec --no-startup-id i3-dmenu-desktop
|
||||||
|
|
||||||
|
################################################################################################
|
||||||
|
## sound-section - DO NOT EDIT if you wish to automatically upgrade Alsa -> Pulseaudio later! ##
|
||||||
|
################################################################################################
|
||||||
|
|
||||||
|
#exec --no-startup-id volumeicon
|
||||||
|
#bindsym $mod+Ctrl+m exec terminal -e 'alsamixer'
|
||||||
|
exec --no-startup-id pulseaudio
|
||||||
|
#exec --no-startup-id pa-applet
|
||||||
|
bindsym $mod+Ctrl+m exec pavucontrol
|
||||||
|
|
||||||
|
################################################################################################
|
||||||
|
|
||||||
|
# Screen brightness controls
|
||||||
|
bindsym XF86MonBrightnessUp exec "xbacklight -inc 10"
|
||||||
|
bindsym XF86MonBrightnessDown exec "xbacklight -dec 10"
|
||||||
|
|
||||||
|
# Volume controls
|
||||||
|
bindsym XF86AudioRaiseVolume exec BLOCK_BUTTON=4 ${HOME}/.i3blocks/volume && pkill -RTMIN+10 i3blocks
|
||||||
|
bindsym XF86AudioLowerVolume exec BLOCK_BUTTON=5 ${HOME}/.i3blocks/volume && pkill -RTMIN+10 i3blocks
|
||||||
|
bindsym XF86AudioMute exec BLOCK_BUTTON=2 ${HOME}/.i3blocks/volume && pkill -RTMIN+10 i3blocks
|
||||||
|
bindsym XF86AudioMicMute exec BLOCK_BUTTON=2 BLOCK_INSTANCE=Capture ${HOME}/.i3blocks/volume && pkill -RTMIN+10 i3blocks
|
||||||
|
|
||||||
|
# LEDs controls
|
||||||
|
bindsym --release Caps_Lock exec pkill -SIGRTMIN+11 i3blocks
|
||||||
|
bindsym --release Num_Lock exec pkill -SIGRTMIN+12 i3blocks
|
||||||
|
|
||||||
|
# Start Applications
|
||||||
|
bindsym $mod+Ctrl+b exec i3-sensible-terminal +sb -e 'bmenu'
|
||||||
|
bindsym $mod+F2 exec firefox
|
||||||
|
bindsym $mod+Ctrl+F3 exec pcmanfm
|
||||||
|
bindsym $mod+F3 exec i3-sensible-terminal +sb -e ranger
|
||||||
|
bindsym $mod+Shift+F3 exec gksu pcmanfm
|
||||||
|
bindsym $mod+F5 exec i3-sensible-terminal +sb -e 'mocp'
|
||||||
|
bindsym $mod+t exec --no-startup-id pkill compton
|
||||||
|
bindsym $mod+Ctrl+t exec --no-startup-id compton -b
|
||||||
|
bindsym $mod+Shift+d --release exec "killall dunst; exec notify-send 'restart dunst'"
|
||||||
|
bindsym Print exec --no-startup-id i3-scrot
|
||||||
|
bindsym $mod+Print --release exec --no-startup-id i3-scrot -w
|
||||||
|
bindsym $mod+Shift+Print --release exec --no-startup-id i3-scrot -s
|
||||||
|
#bindsym $mod+Shift+h exec xdg-open /usr/share/doc/manjaro/i3_help.pdf
|
||||||
|
bindsym $mod+Ctrl+x --release exec --no-startup-id xkill
|
||||||
|
bindsym XF86MyComputer exec ${HOME}/Softs/keyboard_toggle
|
||||||
|
|
||||||
|
set $mode_ide (a)tom (e)clipse (t)exmaker
|
||||||
|
mode "$mode_ide" {
|
||||||
|
bindsym a exec atom; mode default
|
||||||
|
bindsym e exec eclipse; mode default
|
||||||
|
bindsym t exec texmaker; mode default
|
||||||
|
|
||||||
|
bindsym Return mode default
|
||||||
|
bindsym Escape mode default
|
||||||
|
}
|
||||||
|
bindsym $mod+F1 mode $mode_ide
|
||||||
|
|
||||||
|
# focus_follows_mouse no
|
||||||
|
|
||||||
|
# change focus
|
||||||
|
bindsym $mod+j focus left
|
||||||
|
bindsym $mod+k focus down
|
||||||
|
bindsym $mod+l focus up
|
||||||
|
bindsym $mod+odiaeresis focus right
|
||||||
|
|
||||||
|
# alternatively, you can use the cursor keys:
|
||||||
|
bindsym $mod+Left focus left
|
||||||
|
bindsym $mod+Down focus down
|
||||||
|
bindsym $mod+Up focus up
|
||||||
|
bindsym $mod+Right focus right
|
||||||
|
|
||||||
|
# move focused window
|
||||||
|
bindsym $mod+Shift+j move left
|
||||||
|
bindsym $mod+Shift+k move down
|
||||||
|
bindsym $mod+Shift+l move up
|
||||||
|
bindsym $mod+Shift+odiaeresis move right
|
||||||
|
|
||||||
|
# alternatively, you can use the cursor keys:
|
||||||
|
bindsym $mod+Shift+Left move left
|
||||||
|
bindsym $mod+Shift+Down move down
|
||||||
|
bindsym $mod+Shift+Up move up
|
||||||
|
bindsym $mod+Shift+Right move right
|
||||||
|
|
||||||
|
# workspace back and forth (with/without active container)
|
||||||
|
workspace_auto_back_and_forth yes
|
||||||
|
bindsym $mod+b workspace back_and_forth
|
||||||
|
bindsym $mod+Shift+b move container to workspace back_and_forth; workspace back_and_forth
|
||||||
|
|
||||||
|
# split orientation
|
||||||
|
bindsym $mod+h split h
|
||||||
|
bindsym $mod+v split v
|
||||||
|
bindsym $mod+q split toggle
|
||||||
|
|
||||||
|
# toggle fullscreen mode for the focused container
|
||||||
|
bindsym $mod+f fullscreen toggle
|
||||||
|
|
||||||
|
# change container layout (stacked, tabbed, toggle split)
|
||||||
|
bindsym $mod+s layout stacking
|
||||||
|
bindsym $mod+w layout tabbed
|
||||||
|
bindsym $mod+e layout toggle split
|
||||||
|
|
||||||
|
# toggle tiling / floating
|
||||||
|
bindsym $mod+Shift+space floating toggle
|
||||||
|
|
||||||
|
# change focus between tiling / floating windows
|
||||||
|
bindsym $mod+space focus mode_toggle
|
||||||
|
|
||||||
|
# toggle sticky
|
||||||
|
bindsym $mod+Shift+s sticky toggle
|
||||||
|
|
||||||
|
# focus the parent container
|
||||||
|
bindsym $mod+a focus parent
|
||||||
|
|
||||||
|
# move the currently focused window to the scratchpad
|
||||||
|
bindsym $mod+Shift+twosuperior move scratchpad
|
||||||
|
|
||||||
|
# Show the next scratchpad window or hide the focused scratchpad window.
|
||||||
|
# If there are multiple scratchpad windows, this command cycles through them.
|
||||||
|
bindsym $mod+twosuperior scratchpad show
|
||||||
|
|
||||||
|
#navigate workspaces next / previous
|
||||||
|
bindsym $mod+Ctrl+Right workspace next
|
||||||
|
bindsym $mod+Ctrl+Left workspace prev
|
||||||
|
|
||||||
|
# Workspace names
|
||||||
|
# to display names or symbols instead of plain workspace numbers you can use
|
||||||
|
# something like: set $ws1 1:mail
|
||||||
|
# set $ws2 2:
|
||||||
|
set $ws1 1
|
||||||
|
set $ws2 2
|
||||||
|
set $ws3 3
|
||||||
|
set $ws4 4
|
||||||
|
set $ws5 5
|
||||||
|
set $ws6 6
|
||||||
|
set $ws7 7
|
||||||
|
set $ws8 8
|
||||||
|
|
||||||
|
# switch to workspace
|
||||||
|
bindsym $mod+1 workspace $ws1
|
||||||
|
bindsym $mod+2 workspace $ws2
|
||||||
|
bindsym $mod+3 workspace $ws3
|
||||||
|
bindsym $mod+4 workspace $ws4
|
||||||
|
bindsym $mod+5 workspace $ws5
|
||||||
|
bindsym $mod+6 workspace $ws6
|
||||||
|
bindsym $mod+7 workspace $ws7
|
||||||
|
bindsym $mod+8 workspace $ws8
|
||||||
|
|
||||||
|
# Move focused container to workspace
|
||||||
|
bindsym $mod+Ctrl+1 move container to workspace $ws1
|
||||||
|
bindsym $mod+Ctrl+2 move container to workspace $ws2
|
||||||
|
bindsym $mod+Ctrl+3 move container to workspace $ws3
|
||||||
|
bindsym $mod+Ctrl+4 move container to workspace $ws4
|
||||||
|
bindsym $mod+Ctrl+5 move container to workspace $ws5
|
||||||
|
bindsym $mod+Ctrl+6 move container to workspace $ws6
|
||||||
|
bindsym $mod+Ctrl+7 move container to workspace $ws7
|
||||||
|
bindsym $mod+Ctrl+8 move container to workspace $ws8
|
||||||
|
|
||||||
|
# Move to workspace with focused container
|
||||||
|
bindsym $mod+Shift+1 move container to workspace $ws1; workspace $ws1
|
||||||
|
bindsym $mod+Shift+2 move container to workspace $ws2; workspace $ws2
|
||||||
|
bindsym $mod+Shift+3 move container to workspace $ws3; workspace $ws3
|
||||||
|
bindsym $mod+Shift+4 move container to workspace $ws4; workspace $ws4
|
||||||
|
bindsym $mod+Shift+5 move container to workspace $ws5; workspace $ws5
|
||||||
|
bindsym $mod+Shift+6 move container to workspace $ws6; workspace $ws6
|
||||||
|
bindsym $mod+Shift+7 move container to workspace $ws7; workspace $ws7
|
||||||
|
bindsym $mod+Shift+8 move container to workspace $ws8; workspace $ws8
|
||||||
|
|
||||||
|
# Open applications on specific workspaces
|
||||||
|
# assign [class="Thunderbird"] $ws1
|
||||||
|
# assign [class="Firefox"] $ws3
|
||||||
|
#assign [class="(?i)Claws-mail"] $ws4
|
||||||
|
# assign [class="Skype"] $ws5
|
||||||
|
|
||||||
|
# Open specific applications in floating mode
|
||||||
|
#for_window [title="alsamixer"] floating enable border pixel 1
|
||||||
|
#for_window [class="Calamares"] floating enable border normal
|
||||||
|
#for_window [class="Clipgrab"] floating enable
|
||||||
|
for_window [title="File Transfer*"] floating enable
|
||||||
|
for_window [class="Galculator"] floating enable border pixel 1
|
||||||
|
#for_window [class="GParted"] floating enable border normal
|
||||||
|
#for_window [title="i3_help"] floating enable sticky enable border normal
|
||||||
|
for_window [class="Lightdm-gtk-greeter-settings"] floating enable
|
||||||
|
for_window [class="Lxappearance"] floating enable sticky enable border normal
|
||||||
|
for_window [class="Manjaro Settings Manager"] floating enable border normal
|
||||||
|
for_window [class="Manjaro Welcome"] floating enable
|
||||||
|
for_window [title="MuseScore: Play Panel"] floating enable
|
||||||
|
for_window [class="Nitrogen"] floating enable sticky enable border normal
|
||||||
|
for_window [class="Oblogout"] fullscreen enable
|
||||||
|
#for_window [class="octopi"] floating enable
|
||||||
|
#for_window [class="Pamac-manager"] floating enable
|
||||||
|
for_window [class="Pavucontrol"] floating enable
|
||||||
|
for_window [class="qt5ct"] floating enable sticky enable border normal
|
||||||
|
for_window [class="Qtconfig-qt4"] floating enable sticky enable border normal
|
||||||
|
for_window [class="Simple-scan"] floating enable border normal
|
||||||
|
for_window [class="(?i)System-config-printer.py"] floating enable border normal
|
||||||
|
for_window [class="Skype"] floating enable border normal
|
||||||
|
for_window [class="Thus"] floating enable border normal
|
||||||
|
for_window [class="Timeset-gui"] floating enable border normal
|
||||||
|
#for_window [class="(?i)virtualbox"] floating enable border normal
|
||||||
|
for_window [class="Xfburn"] floating enable
|
||||||
|
for_window [class="(?i)variety"] floating enable
|
||||||
|
|
||||||
|
# switch to workspace with urgent window automatically
|
||||||
|
for_window [urgent=latest] focus
|
||||||
|
|
||||||
|
# reload the configuration file
|
||||||
|
bindsym $mod+Shift+c reload
|
||||||
|
|
||||||
|
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
|
||||||
|
bindsym $mod+Shift+r restart
|
||||||
|
|
||||||
|
# exit i3 (logs you out of your X session)
|
||||||
|
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'"
|
||||||
|
|
||||||
|
# Set shut down, restart and locking features
|
||||||
|
bindsym $mod+0 mode "$mode_system"
|
||||||
|
set $mode_system (l)ock, (e)xit, switch_(u)ser, (s)uspend, (h)ibernate, (r)eboot, (S)hutdown
|
||||||
|
mode "$mode_system" {
|
||||||
|
bindsym l exec --no-startup-id xscreensaver-command -lock, mode "default"
|
||||||
|
bindsym s exec --no-startup-id xscreensaver-command -lock && sleep 3 && systemctl suspend, mode "default"
|
||||||
|
bindsym u exec --no-startup-id i3exit switch_user, mode "default"
|
||||||
|
bindsym e exec --no-startup-id i3exit logout, mode "default"
|
||||||
|
bindsym h exec --no-startup-id xscreensaver-command -lock && sleep 3 && systemctl hibernate, mode "default"
|
||||||
|
bindsym r exec --no-startup-id systemctl reboot, mode "default"
|
||||||
|
bindsym Shift+s exec --no-startup-id systemctl poweroff, mode "default"
|
||||||
|
|
||||||
|
# exit system mode: "Enter" or "Escape"
|
||||||
|
bindsym Return mode "default"
|
||||||
|
bindsym Escape mode "default"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Resize window (you can also use the mouse for that)
|
||||||
|
bindsym $mod+r mode "resize"
|
||||||
|
mode "resize" {
|
||||||
|
# These bindings trigger as soon as you enter the resize mode
|
||||||
|
# Pressing left will shrink the window’s width.
|
||||||
|
# Pressing right will grow the window’s width.
|
||||||
|
# Pressing up will shrink the window’s height.
|
||||||
|
# Pressing down will grow the window’s height.
|
||||||
|
bindsym j resize shrink width 5 px or 5 ppt
|
||||||
|
bindsym k resize grow height 5 px or 5 ppt
|
||||||
|
bindsym l resize shrink height 5 px or 5 ppt
|
||||||
|
bindsym m resize grow width 5 px or 5 ppt
|
||||||
|
|
||||||
|
# same bindings, but for the arrow keys
|
||||||
|
bindsym Left resize shrink width 5 px or 5 ppt
|
||||||
|
bindsym Down resize grow height 5 px or 5 ppt
|
||||||
|
bindsym Up resize shrink height 5 px or 5 ppt
|
||||||
|
bindsym Right resize grow width 5 px or 5 ppt
|
||||||
|
|
||||||
|
# exit resize mode: Enter or Escape
|
||||||
|
bindsym Return mode "default"
|
||||||
|
bindsym Escape mode "default"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Lock screen
|
||||||
|
bindsym $mod+9 exec --no-startup-id xscreensaver-command -lock
|
||||||
|
|
||||||
|
# Autostart applications
|
||||||
|
## adjustment of i3bar battery reading (only run at the very first login):
|
||||||
|
#exec --no-startup-id /usr/bin/adjust_i3statusconf
|
||||||
|
exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
|
||||||
|
exec --no-startup-id compton -b
|
||||||
|
exec --no-startup-id nm-applet
|
||||||
|
#exec --no-startup-id xfce4-power-manager
|
||||||
|
exec --no-startup-id clipit
|
||||||
|
# exec --no-startup-id blueman
|
||||||
|
# exec_always --no-startup-id sbxkb
|
||||||
|
exec --no-startup-id conky
|
||||||
|
# exec --no-startup-id start_conky_green
|
||||||
|
exec --no-startup-id xscreensaver -no-splash
|
||||||
|
exec_always --no-startup-id setcursor
|
||||||
|
#exec --no-startup-id blueman-applet
|
||||||
|
exec claws-mail
|
||||||
|
exec ring.cx -r
|
||||||
|
#exec zeal
|
||||||
|
exec --no-startup-id terminal +sb -e $HOME/Softs/rtorrent
|
||||||
|
exec --no-startup-id terminal +sb -e newsbeuter
|
||||||
|
exec --no-startup-id sleep 3 && i3-msg '[class="(?i)urxvt"] move scratchpad'
|
||||||
|
exec --no-startup-id variety
|
||||||
|
exec --no-startup-id xinput --disable "AlpsPS/2 ALPS DualPoint TouchPad"
|
||||||
|
exec --no-startup-id redshift-gtk
|
||||||
|
exec --no-startup-id ${HOME}/.screenlayout/home.sh
|
||||||
|
exec --no-startup-id syncthing-gtk
|
||||||
|
|
||||||
|
# Start i3bar to display a workspace bar (plus the system information i3status if available)
|
||||||
|
bar {
|
||||||
|
position top
|
||||||
|
status_command i3blocks
|
||||||
|
|
||||||
|
## please set your primary output first. Example: 'xrandr --output eDP1 --primary'
|
||||||
|
tray_output primary
|
||||||
|
tray_output eDP1
|
||||||
|
# output eDP1
|
||||||
|
|
||||||
|
bindsym button4 nop
|
||||||
|
bindsym button5 nop
|
||||||
|
#font xft:Fira Mono,FontAwesome 10
|
||||||
|
strip_workspace_numbers yes
|
||||||
|
|
||||||
|
# colors {
|
||||||
|
# # background $transparent
|
||||||
|
# background #2B2C2B
|
||||||
|
# statusline #F9FAF9
|
||||||
|
# separator #454947
|
||||||
|
#
|
||||||
|
# # border backgr. text
|
||||||
|
# focused_workspace #F9FAF9 #16A085 #2B2C2B
|
||||||
|
# active_workspace #595B5B #353836 #FDF6E3
|
||||||
|
# inactive_workspace #595B5B #353836 #EEE8D5
|
||||||
|
# urgent_workspace #16A085 #FDF6E3 #E5201D
|
||||||
|
# }
|
||||||
|
}
|
||||||
|
|
||||||
|
# hide/unhide i3status bar
|
||||||
|
bindsym $mod+m bar mode toggle
|
||||||
|
|
||||||
|
# Theme colors
|
||||||
|
# class border backgr. text indic. child_border
|
||||||
|
# client.focused #808280 #808280 #80FFF9 #FDF6E3
|
||||||
|
# client.focused_inactive #434745 #434745 #16A085 #454948
|
||||||
|
# client.unfocused #434745 #434745 #16A085 #454948
|
||||||
|
# client.urgent #CB4B16 #FDF6E3 #16A085 #268BD2
|
||||||
|
# client.placeholder #000000 #0c0c0c #ffffff #000000 #0c0c0c
|
||||||
|
# client.background #2B2C2B
|
||||||
|
|
||||||
|
#############################
|
||||||
|
### settings for i3-gaps: ###
|
||||||
|
#############################
|
||||||
|
|
||||||
|
# # Set inner/outer gaps
|
||||||
|
# gaps inner 10
|
||||||
|
# gaps outer -4
|
||||||
|
#
|
||||||
|
# # Additionally, you can issue commands with the following syntax. This is useful to bind keys to changing the gap size.
|
||||||
|
# # gaps inner|outer current|all set|plus|minus <px>
|
||||||
|
# # gaps inner all set 10
|
||||||
|
# # gaps outer all plus 5
|
||||||
|
#
|
||||||
|
# # Smart gaps (gaps used if only more than one container on the workspace)
|
||||||
|
# smart_gaps on
|
||||||
|
#
|
||||||
|
# # Smart borders (draw borders around container only if it is not the only container on this workspace)
|
||||||
|
# # on|no_gaps (on=always activate and no_gaps=only activate if the gap size to the edge of the screen is 0)
|
||||||
|
# #smart_borders on
|
||||||
|
#
|
||||||
|
# # Press $mod+Shift+g to enter the gap mode. Choose o or i for modifying outer/inner gaps. Press one of + / - (in-/decrement for current workspace) or 0 (remove gaps for current workspace). If you also press Shift with these keys, the change will be global for all workspaces.
|
||||||
|
# set $mode_gaps Gaps: (o) outer, (i) inner
|
||||||
|
# set $mode_gaps_outer Outer Gaps: +|-|0 (local), Shift + +|-|0 (global)
|
||||||
|
# set $mode_gaps_inner Inner Gaps: +|-|0 (local), Shift + +|-|0 (global)
|
||||||
|
# bindsym $mod+Shift+g mode "$mode_gaps"
|
||||||
|
#
|
||||||
|
# mode "$mode_gaps" {
|
||||||
|
# bindsym o mode "$mode_gaps_outer"
|
||||||
|
# bindsym i mode "$mode_gaps_inner"
|
||||||
|
# bindsym Return mode "default"
|
||||||
|
# bindsym Escape mode "default"
|
||||||
|
# }
|
||||||
|
# mode "$mode_gaps_inner" {
|
||||||
|
# bindsym plus gaps inner current plus 5
|
||||||
|
# bindsym minus gaps inner current minus 5
|
||||||
|
# bindsym 0 gaps inner current set 0
|
||||||
|
#
|
||||||
|
# bindsym Shift+plus gaps inner all plus 5
|
||||||
|
# bindsym Shift+minus gaps inner all minus 5
|
||||||
|
# bindsym Shift+0 gaps inner all set 0
|
||||||
|
#
|
||||||
|
# bindsym Return mode "default"
|
||||||
|
# bindsym Escape mode "default"
|
||||||
|
# }
|
||||||
|
# mode "$mode_gaps_outer" {
|
||||||
|
# bindsym plus gaps outer current plus 5
|
||||||
|
# bindsym minus gaps outer current minus 5
|
||||||
|
# bindsym 0 gaps outer current set 0
|
||||||
|
#
|
||||||
|
# bindsym Shift+plus gaps outer all plus 5
|
||||||
|
# bindsym Shift+minus gaps outer all minus 5
|
||||||
|
# bindsym Shift+0 gaps outer all set 0
|
||||||
|
#
|
||||||
|
# bindsym Return mode "default"
|
||||||
|
# bindsym Escape mode "default"
|
||||||
|
# }
|
398
.i3/config.base
Normal file
398
.i3/config.base
Normal file
|
@ -0,0 +1,398 @@
|
||||||
|
## i3 config file (v4)
|
||||||
|
## Please see http://i3wm.org/docs/userguide.html for a complete reference!
|
||||||
|
#
|
||||||
|
### Base16 Eighties
|
||||||
|
## Author: Chris Kempson (http://chriskempson.com)
|
||||||
|
##
|
||||||
|
## You can use these variables anywhere in the i3 configuration file.
|
||||||
|
#
|
||||||
|
#set $base00 #2d2d2d
|
||||||
|
#set $base01 #393939
|
||||||
|
#set $base02 #515151
|
||||||
|
#set $base03 #747369
|
||||||
|
#set $base04 #a09f93
|
||||||
|
#set $base05 #d3d0c8
|
||||||
|
#set $base06 #e8e6df
|
||||||
|
#set $base07 #f2f0ec
|
||||||
|
#set $base08 #f2777a
|
||||||
|
#set $base09 #f99157
|
||||||
|
#set $base0A #ffcc66
|
||||||
|
#set $base0B #99cc99
|
||||||
|
#set $base0C #66cccc
|
||||||
|
#set $base0D #6699cc
|
||||||
|
#set $base0E #cc99cc
|
||||||
|
#set $base0F #d27b53
|
||||||
|
#
|
||||||
|
## Basic color configuration using the Base16 variables for windows and borders.
|
||||||
|
## Property Name Border BG Text Indicator Child Border
|
||||||
|
#client.focused $base05 $base0D $base00 $base05 $base0D
|
||||||
|
#client.focused_inactive $base01 $base01 $base05 $base03 $base01
|
||||||
|
#client.unfocused $base01 $base00 $base05 $base01 $base01
|
||||||
|
#client.urgent $base08 $base08 $base00 $base08 $base08
|
||||||
|
#client.placeholder $base00 $base00 $base05 $base00 $base00
|
||||||
|
#client.background $base07
|
||||||
|
|
||||||
|
# $i3-theme-window
|
||||||
|
|
||||||
|
# Set mod key (Mod1=<Alt>, Mod4=<Super>)
|
||||||
|
set $mod Mod4
|
||||||
|
exec --no-startup-id urxvtd
|
||||||
|
|
||||||
|
# set default desktop layout (default is tiling)
|
||||||
|
# workspace_layout tabbed <stacking|tabbed>
|
||||||
|
|
||||||
|
# Configure border style <normal|1pixel|pixel xx|none|pixel>
|
||||||
|
new_window normal
|
||||||
|
new_float normal
|
||||||
|
|
||||||
|
# Hide borders
|
||||||
|
hide_edge_borders none
|
||||||
|
|
||||||
|
# change borders
|
||||||
|
bindsym $mod+u border none
|
||||||
|
bindsym $mod+y border pixel 2
|
||||||
|
bindsym $mod+n border normal 2
|
||||||
|
|
||||||
|
# Font for window titles. Will also be used by the bar unless a different font
|
||||||
|
# is used in the bar {} block below.
|
||||||
|
font xft:xos4 Terminus
|
||||||
|
|
||||||
|
# Use Mouse+$mod to drag floating windows
|
||||||
|
floating_modifier $mod
|
||||||
|
|
||||||
|
# start a terminal
|
||||||
|
bindsym $mod+Return exec terminal -e fish
|
||||||
|
bindsym $mod+Ctrl+Return exec terminal
|
||||||
|
|
||||||
|
# kill focused window
|
||||||
|
bindsym $mod+Shift+q kill
|
||||||
|
|
||||||
|
# start program launcher
|
||||||
|
bindsym $mod+d exec --no-startup-id dmenu_recent -nb '#2d2d2d' -nf '#747369' -sb '#6699cc' -sf '#2d2d2d' -p 'execute' -fn 'xos4 Terminus'
|
||||||
|
|
||||||
|
# launch desktop menu
|
||||||
|
bindsym $mod+z exec --no-startup-id i3-dmenu-desktop --dmenu='dmenu -i -fn "xos4 Terminus" -nb "#2d2d2d" -nf "#747369" -sb "#6699cc" -sf "#2d2d2d"'
|
||||||
|
|
||||||
|
# launch without history
|
||||||
|
bindsym $mod+Ctrl+d exec --no-startup-id dmenu_run -nb '#2d2d2d' -nf '#747369' -sb '#6699cc' -sf '#2d2d2d' -p 'execute' -fn 'xos4 Terminus'
|
||||||
|
|
||||||
|
# HUD
|
||||||
|
# exec ~/.i3/i3-appmenu-service.py
|
||||||
|
# bindsym $mod+x exec ~/.i3/i3-hud-menu.py
|
||||||
|
# bindsym $mod+x exec --no-startup-id qmenu_hud
|
||||||
|
|
||||||
|
################################################################################################
|
||||||
|
## sound-section - DO NOT EDIT if you wish to automatically upgrade Alsa -> Pulseaudio later! ##
|
||||||
|
################################################################################################
|
||||||
|
|
||||||
|
#exec --no-startup-id volumeicon
|
||||||
|
#bindsym $mod+Ctrl+m exec terminal -e 'alsamixer'
|
||||||
|
exec --no-startup-id pulseaudio
|
||||||
|
#exec --no-startup-id pa-applet
|
||||||
|
bindsym $mod+Ctrl+m exec pavucontrol
|
||||||
|
|
||||||
|
################################################################################################
|
||||||
|
|
||||||
|
# Screen brightness controls
|
||||||
|
bindsym XF86MonBrightnessUp exec --no-startup-id echo $((( $(cat /sys/class/backlight/intel_backlight/actual_brightness) + 10 ))) > /sys/class/backlight/intel_backlight/brightness || echo 937 > /sys/class/backlight/intel_backlight/brightness
|
||||||
|
bindsym XF86MonBrightnessDown exec --no-startup-id echo $((( $(cat /sys/class/backlight/intel_backlight/actual_brightness) - 10 ))) > /sys/class/backlight/intel_backlight/brightness || echo 0 > /sys/class/backlight/intel_backlight/brightness
|
||||||
|
|
||||||
|
# Volume controls
|
||||||
|
bindsym XF86AudioRaiseVolume exec --no-startup-id BLOCK_BUTTON=4 ${HOME}/.i3blocks/volume && pkill -RTMIN+10 i3blocks
|
||||||
|
bindsym XF86AudioLowerVolume exec --no-startup-id BLOCK_BUTTON=5 ${HOME}/.i3blocks/volume && pkill -RTMIN+10 i3blocks
|
||||||
|
bindsym XF86AudioMute exec --no-startup-id BLOCK_BUTTON=2 ${HOME}/.i3blocks/volume && pkill -RTMIN+10 i3blocks
|
||||||
|
bindsym XF86AudioMicMute exec --no-startup-id BLOCK_BUTTON=2 BLOCK_INSTANCE=Capture ${HOME}/.i3blocks/volume && pkill -RTMIN+10 i3blocks
|
||||||
|
|
||||||
|
# LEDs controls
|
||||||
|
bindsym --release Caps_Lock exec --no-startup-id pkill -SIGRTMIN+11 i3blocks
|
||||||
|
bindsym --release Num_Lock exec --no-startup-id pkill -SIGRTMIN+12 i3blocks
|
||||||
|
|
||||||
|
# Start Applications
|
||||||
|
bindsym $mod+Ctrl+b exec i3-sensible-terminal +sb -e 'bmenu'
|
||||||
|
bindsym $mod+Ctrl+F2 exec firefox
|
||||||
|
bindsym $mod+Shift+F2 exec firefox --private-window
|
||||||
|
bindsym $mod+F2 exec surf "https://www.qwant.com?l=fr&h=1&hc=2&a=1&s=1&b=0&i=1&r=FR&sr=fr"
|
||||||
|
bindsym $mod+Ctrl+F3 exec pcmanfm
|
||||||
|
bindsym $mod+F3 exec i3-sensible-terminal +sb -e ranger
|
||||||
|
bindsym $mod+F4 exec i3-sensible-terminal +sb -e bashmount
|
||||||
|
bindsym $mod+Shift+F3 exec gksu pcmanfm
|
||||||
|
bindsym $mod+F5 exec i3-sensible-terminal +sb -e 'mocp'
|
||||||
|
#bindsym $mod+t exec --no-startup-id pkill compton
|
||||||
|
#bindsym $mod+Ctrl+t exec --no-startup-id compton -b
|
||||||
|
bindsym $mod+Shift+d --release exec "killall dunst; exec notify-send 'restart dunst'"
|
||||||
|
bindsym Print exec --no-startup-id i3-scrot
|
||||||
|
bindsym $mod+Print --release exec --no-startup-id i3-scrot -w
|
||||||
|
bindsym $mod+Shift+Print --release exec --no-startup-id i3-scrot -s
|
||||||
|
#bindsym $mod+Shift+h exec xdg-open /usr/share/doc/manjaro/i3_help.pdf
|
||||||
|
bindsym $mod+Ctrl+x --release exec --no-startup-id xkill
|
||||||
|
bindsym XF86MyComputer exec ${HOME}/bin/keyboard_toggle
|
||||||
|
|
||||||
|
set $mode_ide (a)tom (t)exmaker
|
||||||
|
mode "$mode_ide" {
|
||||||
|
bindsym a exec atom; mode default
|
||||||
|
bindsym t exec texmaker; mode default
|
||||||
|
|
||||||
|
bindsym Return mode default
|
||||||
|
bindsym Escape mode default
|
||||||
|
}
|
||||||
|
bindsym $mod+F1 mode $mode_ide
|
||||||
|
|
||||||
|
# focus_follows_mouse no
|
||||||
|
|
||||||
|
# change focus
|
||||||
|
bindsym $mod+j focus left
|
||||||
|
bindsym $mod+k focus down
|
||||||
|
bindsym $mod+l focus up
|
||||||
|
bindsym $mod+m focus right
|
||||||
|
|
||||||
|
# alternatively, you can use the cursor keys:
|
||||||
|
bindsym $mod+Left focus left
|
||||||
|
bindsym $mod+Down focus down
|
||||||
|
bindsym $mod+Up focus up
|
||||||
|
bindsym $mod+Right focus right
|
||||||
|
|
||||||
|
# move focused window
|
||||||
|
bindsym $mod+Shift+j move left
|
||||||
|
bindsym $mod+Shift+k move down
|
||||||
|
bindsym $mod+Shift+l move up
|
||||||
|
bindsym $mod+Shift+m move right
|
||||||
|
|
||||||
|
# alternatively, you can use the cursor keys:
|
||||||
|
bindsym $mod+Shift+Left move left
|
||||||
|
bindsym $mod+Shift+Down move down
|
||||||
|
bindsym $mod+Shift+Up move up
|
||||||
|
bindsym $mod+Shift+Right move right
|
||||||
|
|
||||||
|
# workspace back and forth (with/without active container)
|
||||||
|
workspace_auto_back_and_forth yes
|
||||||
|
bindsym $mod+b workspace back_and_forth
|
||||||
|
bindsym $mod+Shift+b move container to workspace back_and_forth; workspace back_and_forth
|
||||||
|
|
||||||
|
# split orientation
|
||||||
|
bindsym $mod+h split h
|
||||||
|
bindsym $mod+v split v
|
||||||
|
bindsym $mod+q split toggle
|
||||||
|
|
||||||
|
# toggle fullscreen mode for the focused container
|
||||||
|
bindsym $mod+f fullscreen toggle
|
||||||
|
|
||||||
|
# change container layout (stacked, tabbed, toggle split)
|
||||||
|
bindsym $mod+s layout stacking
|
||||||
|
bindsym $mod+w layout tabbed
|
||||||
|
bindsym $mod+e layout toggle split
|
||||||
|
|
||||||
|
# toggle tiling / floating
|
||||||
|
bindsym $mod+Shift+space floating toggle
|
||||||
|
|
||||||
|
# change focus between tiling / floating windows
|
||||||
|
bindsym $mod+space focus mode_toggle
|
||||||
|
|
||||||
|
# toggle sticky
|
||||||
|
bindsym $mod+Shift+s sticky toggle
|
||||||
|
|
||||||
|
# focus the parent container
|
||||||
|
bindsym $mod+a focus parent
|
||||||
|
|
||||||
|
# move the currently focused window to the scratchpad
|
||||||
|
bindsym $mod+Shift+twosuperior move scratchpad
|
||||||
|
|
||||||
|
# Show the next scratchpad window or hide the focused scratchpad window.
|
||||||
|
# If there are multiple scratchpad windows, this command cycles through them.
|
||||||
|
bindsym $mod+twosuperior scratchpad show
|
||||||
|
|
||||||
|
#navigate workspaces next / previous
|
||||||
|
bindsym $mod+Ctrl+Right workspace next
|
||||||
|
bindsym $mod+Ctrl+Left workspace prev
|
||||||
|
|
||||||
|
# Workspace names
|
||||||
|
# to display names or symbols instead of plain workspace numbers you can use
|
||||||
|
# something like: set $ws1 1:mail
|
||||||
|
# set $ws2 2:
|
||||||
|
set $ws1 1
|
||||||
|
set $ws2 2
|
||||||
|
set $ws3 3
|
||||||
|
set $ws4 4
|
||||||
|
set $ws5 5
|
||||||
|
set $ws6 6
|
||||||
|
set $ws7 7
|
||||||
|
set $ws8 8
|
||||||
|
|
||||||
|
# switch to workspace
|
||||||
|
bindsym $mod+1 workspace $ws1
|
||||||
|
bindsym $mod+2 workspace $ws2
|
||||||
|
bindsym $mod+3 workspace $ws3
|
||||||
|
bindsym $mod+4 workspace $ws4
|
||||||
|
bindsym $mod+5 workspace $ws5
|
||||||
|
bindsym $mod+6 workspace $ws6
|
||||||
|
bindsym $mod+7 workspace $ws7
|
||||||
|
bindsym $mod+8 workspace $ws8
|
||||||
|
|
||||||
|
# Move focused container to workspace
|
||||||
|
bindsym $mod+Ctrl+1 move container to workspace $ws1
|
||||||
|
bindsym $mod+Ctrl+2 move container to workspace $ws2
|
||||||
|
bindsym $mod+Ctrl+3 move container to workspace $ws3
|
||||||
|
bindsym $mod+Ctrl+4 move container to workspace $ws4
|
||||||
|
bindsym $mod+Ctrl+5 move container to workspace $ws5
|
||||||
|
bindsym $mod+Ctrl+6 move container to workspace $ws6
|
||||||
|
bindsym $mod+Ctrl+7 move container to workspace $ws7
|
||||||
|
bindsym $mod+Ctrl+8 move container to workspace $ws8
|
||||||
|
|
||||||
|
# Move to workspace with focused container
|
||||||
|
bindsym $mod+Shift+1 move container to workspace $ws1; workspace $ws1
|
||||||
|
bindsym $mod+Shift+2 move container to workspace $ws2; workspace $ws2
|
||||||
|
bindsym $mod+Shift+3 move container to workspace $ws3; workspace $ws3
|
||||||
|
bindsym $mod+Shift+4 move container to workspace $ws4; workspace $ws4
|
||||||
|
bindsym $mod+Shift+5 move container to workspace $ws5; workspace $ws5
|
||||||
|
bindsym $mod+Shift+6 move container to workspace $ws6; workspace $ws6
|
||||||
|
bindsym $mod+Shift+7 move container to workspace $ws7; workspace $ws7
|
||||||
|
bindsym $mod+Shift+8 move container to workspace $ws8; workspace $ws8
|
||||||
|
|
||||||
|
# Open applications on specific workspaces
|
||||||
|
#assign [class="Claws-mail"] $ws5
|
||||||
|
#assign [class="Surf"] $ws2
|
||||||
|
#assign [class="Vlc"] $ws3
|
||||||
|
#assign [class="Atom"] $ws4
|
||||||
|
|
||||||
|
# Open specific applications in floating mode
|
||||||
|
#for_window [title="alsamixer"] floating enable border pixel 1
|
||||||
|
#for_window [class="Calamares"] floating enable border normal
|
||||||
|
#for_window [class="Clipgrab"] floating enable
|
||||||
|
for_window [title="File Transfer*"] floating enable
|
||||||
|
for_window [class="Galculator"] floating enable border pixel 1
|
||||||
|
#for_window [class="GParted"] floating enable border normal
|
||||||
|
#for_window [title="i3_help"] floating enable sticky enable border normal
|
||||||
|
#for_window [class="octopi"] floating enable
|
||||||
|
#for_window [class="Pamac-manager"] floating enable
|
||||||
|
for_window [class="Pavucontrol"] floating enable
|
||||||
|
for_window [class="qt5ct"] floating enable sticky enable border normal
|
||||||
|
for_window [class="Qtconfig-qt4"] floating enable sticky enable border normal
|
||||||
|
for_window [class="Simple-scan"] floating enable border normal
|
||||||
|
for_window [class="(?i)System-config-printer.py"] floating enable border normal
|
||||||
|
for_window [class="Skype"] floating enable border normal
|
||||||
|
for_window [class="Thus"] floating enable border normal
|
||||||
|
for_window [class="Timeset-gui"] floating enable border normal
|
||||||
|
#for_window [class="(?i)virtualbox"] floating enable border normal
|
||||||
|
for_window [class="Xfburn"] floating enable
|
||||||
|
for_window [class="(?i)variety"] floating enable
|
||||||
|
for_window [class="Yad"] floating enable
|
||||||
|
|
||||||
|
# switch to workspace with urgent window automatically
|
||||||
|
for_window [urgent=latest] focus
|
||||||
|
|
||||||
|
# reload the configuration file
|
||||||
|
bindsym $mod+Shift+c reload
|
||||||
|
|
||||||
|
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
|
||||||
|
bindsym $mod+Shift+r restart
|
||||||
|
|
||||||
|
# exit i3 (logs you out of your X session)
|
||||||
|
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'"
|
||||||
|
|
||||||
|
# Set shut down, restart and locking features
|
||||||
|
bindsym $mod+0 mode "$mode_system"
|
||||||
|
set $mode_system (l)ock, (e)xit, (s)uspend, (h)ibernate, (r)eboot, (S)hutdown
|
||||||
|
mode "$mode_system" {
|
||||||
|
#bindsym l exec --no-startup-id xscreensaver-command -lock, mode "default"
|
||||||
|
bindsym l exec --no-startup-id i3lock-wrapper -e, mode "default"
|
||||||
|
bindsym s exec --no-startup-id i3lock-wrapper -e && systemctl suspend, mode "default"
|
||||||
|
bindsym e exec --no-startup-id i3-msg exit, mode "default"
|
||||||
|
bindsym h exec --no-startup-id i3lock-wrapper -e && systemctl hibernate, mode "default"
|
||||||
|
bindsym r exec --no-startup-id systemctl reboot, mode "default"
|
||||||
|
bindsym Shift+s exec --no-startup-id systemctl poweroff, mode "default"
|
||||||
|
|
||||||
|
# exit system mode: "Enter" or "Escape"
|
||||||
|
bindsym Return mode "default"
|
||||||
|
bindsym Escape mode "default"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Resize window (you can also use the mouse for that)
|
||||||
|
bindsym $mod+r mode "resize"
|
||||||
|
mode "resize" {
|
||||||
|
# These bindings trigger as soon as you enter the resize mode
|
||||||
|
# Pressing left will shrink the window’s width.
|
||||||
|
# Pressing right will grow the window’s width.
|
||||||
|
# Pressing up will shrink the window’s height.
|
||||||
|
# Pressing down will grow the window’s height.
|
||||||
|
bindsym j resize shrink width 5 px or 5 ppt
|
||||||
|
bindsym k resize grow height 5 px or 5 ppt
|
||||||
|
bindsym l resize shrink height 5 px or 5 ppt
|
||||||
|
bindsym m resize grow width 5 px or 5 ppt
|
||||||
|
|
||||||
|
# same bindings, but for the arrow keys
|
||||||
|
bindsym Left resize shrink width 5 px or 5 ppt
|
||||||
|
bindsym Down resize grow height 5 px or 5 ppt
|
||||||
|
bindsym Up resize shrink height 5 px or 5 ppt
|
||||||
|
bindsym Right resize grow width 5 px or 5 ppt
|
||||||
|
|
||||||
|
# exit resize mode: Enter or Escape
|
||||||
|
bindsym Return mode "default"
|
||||||
|
bindsym Escape mode "default"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Lock screen
|
||||||
|
bindsym $mod+9 exec --no-startup-id i3lock-wrapper -e
|
||||||
|
|
||||||
|
# Autostart applications
|
||||||
|
## adjustment of i3bar battery reading (only run at the very first login):
|
||||||
|
#exec --no-startup-id /usr/bin/adjust_i3statusconf
|
||||||
|
exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
|
||||||
|
#exec --no-startup-id compton -b
|
||||||
|
exec --no-startup-id nm-applet
|
||||||
|
#exec --no-startup-id xfce4-power-manager
|
||||||
|
exec --no-startup-id clipit
|
||||||
|
# exec --no-startup-id blueman
|
||||||
|
# exec_always --no-startup-id sbxkb
|
||||||
|
exec --no-startup-id conky
|
||||||
|
# exec --no-startup-id start_conky_green
|
||||||
|
# exec --no-startup-id xscreensaver -no-splash
|
||||||
|
exec_always --no-startup-id setcursor
|
||||||
|
#exec --no-startup-id blueman-applet
|
||||||
|
exec claws-mail
|
||||||
|
exec ring.cx -r
|
||||||
|
exec --no-startup-id sleep 10 && i3-msg '[class="Gnome-ring"] move scratchpad'
|
||||||
|
#exec zeal
|
||||||
|
exec --no-startup-id transmission-gtk -m
|
||||||
|
exec --no-startup-id sleep 2 && urxvtc +sb -e newsbeuter
|
||||||
|
exec --no-startup-id sleep 5 && i3-msg '[class="URxvt"] move scratchpad'
|
||||||
|
exec --no-startup-id variety
|
||||||
|
#exec --no-startup-id while true; do feh --bg-center $HOME/Images/wallpapers/396396-blackangel.jpg; sleep 5m; feh --bg-max $HOME/Images/wallpapers/other-clock-tower-time-brick-gears-steampunk-high-quality-picture.jpg; sleep 5m; done
|
||||||
|
exec --no-startup-id xinput --disable "AlpsPS/2 ALPS DualPoint TouchPad"
|
||||||
|
exec --no-startup-id redshift-gtk
|
||||||
|
#exec --no-startup-id ${HOME}/.screenlayout/home.sh
|
||||||
|
#exec --no-startup-id sleep 5 && mocp -S
|
||||||
|
#exec --no-startup-id mpv ~/Vidéos/wallpapers/pirate_flag.mp4 --wid 0 --loop-file -quiet
|
||||||
|
|
||||||
|
# Start i3bar to display a workspace bar (plus the system information i3status if available)
|
||||||
|
bar {
|
||||||
|
# position top
|
||||||
|
status_command i3blocks
|
||||||
|
|
||||||
|
## please set your primary output first. Example: 'xrandr --output eDP1 --primary'
|
||||||
|
tray_output primary
|
||||||
|
tray_output eDP1
|
||||||
|
# output eDP1
|
||||||
|
|
||||||
|
bindsym button4 nop
|
||||||
|
bindsym button5 nop
|
||||||
|
# font xft:ProFont 11
|
||||||
|
strip_workspace_numbers yes
|
||||||
|
|
||||||
|
# colors {
|
||||||
|
# background $base00
|
||||||
|
# separator $base01
|
||||||
|
# statusline $base04
|
||||||
|
#
|
||||||
|
# # State Border BG Text
|
||||||
|
# focused_workspace $base05 $base0D $base00
|
||||||
|
# active_workspace $base05 $base03 $base00
|
||||||
|
# inactive_workspace $base03 $base01 $base05
|
||||||
|
# urgent_workspace $base08 $base08 $base00
|
||||||
|
# binding_mode $base00 $base0A $base00
|
||||||
|
# }
|
||||||
|
|
||||||
|
# $i3-theme-bar
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
# hide/unhide i3status bar
|
||||||
|
bindsym $mod+semicolon bar mode toggle
|
36
.i3/i3-appmenu-service.py
Executable file
36
.i3/i3-appmenu-service.py
Executable file
|
@ -0,0 +1,36 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
from gi.repository import Gtk
|
||||||
|
import dbus
|
||||||
|
import dbus.service
|
||||||
|
from dbus.mainloop.glib import DBusGMainLoop
|
||||||
|
|
||||||
|
class i3AppmenuService(dbus.service.Object):
|
||||||
|
def __init__(self):
|
||||||
|
bus_name = dbus.service.BusName('com.canonical.AppMenu.Registrar', bus = dbus.SessionBus())
|
||||||
|
dbus.service.Object.__init__(self, bus_name, '/com/canonical/AppMenu/Registrar')
|
||||||
|
self.window_dict = dict()
|
||||||
|
|
||||||
|
@dbus.service.method('com.canonical.AppMenu.Registrar',
|
||||||
|
in_signature='uo',
|
||||||
|
sender_keyword='sender')
|
||||||
|
def RegisterWindow(self, windowId, menuObjectPath, sender):
|
||||||
|
self.window_dict[windowId] = (sender, menuObjectPath)
|
||||||
|
|
||||||
|
@dbus.service.method('com.canonical.AppMenu.Registrar',
|
||||||
|
in_signature='u',
|
||||||
|
out_signature='so')
|
||||||
|
def GetMenuForWindow(self, windowId):
|
||||||
|
if windowId in self.window_dict:
|
||||||
|
sender, menuObjectPath = self.window_dict[windowId]
|
||||||
|
return [dbus.String(sender), dbus.ObjectPath(menuObjectPath)]
|
||||||
|
|
||||||
|
@dbus.service.method('com.canonical.AppMenu.Registrar')
|
||||||
|
def Q(self):
|
||||||
|
Gtk.main_quit()
|
||||||
|
|
||||||
|
DBusGMainLoop(set_as_default=True)
|
||||||
|
myservice = i3AppmenuService()
|
||||||
|
Gtk.main()
|
||||||
|
|
||||||
|
# GTK apps : get dbus service (xprop)
|
168
.i3/i3-hud-menu.py
Executable file
168
.i3/i3-hud-menu.py
Executable file
|
@ -0,0 +1,168 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
import dbus
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
"""
|
||||||
|
format_label_list
|
||||||
|
"""
|
||||||
|
def format_label_list(label_list):
|
||||||
|
head, *tail = label_list
|
||||||
|
result = head
|
||||||
|
for label in tail:
|
||||||
|
result = result + " > " + label
|
||||||
|
return result
|
||||||
|
|
||||||
|
"""
|
||||||
|
try_appmenu_interface
|
||||||
|
"""
|
||||||
|
def try_appmenu_interface(window_id):
|
||||||
|
# --- Get Appmenu Registrar DBus interface
|
||||||
|
session_bus = dbus.SessionBus()
|
||||||
|
appmenu_registrar_object = session_bus.get_object('com.canonical.AppMenu.Registrar', '/com/canonical/AppMenu/Registrar')
|
||||||
|
appmenu_registrar_object_iface = dbus.Interface(appmenu_registrar_object, 'com.canonical.AppMenu.Registrar')
|
||||||
|
|
||||||
|
# --- Get dbusmenu object path
|
||||||
|
try:
|
||||||
|
dbusmenu_bus, dbusmenu_object_path = appmenu_registrar_object_iface.GetMenuForWindow(window_id)
|
||||||
|
except dbus.exceptions.DBusException:
|
||||||
|
return
|
||||||
|
|
||||||
|
# --- Access dbusmenu items
|
||||||
|
dbusmenu_object = session_bus.get_object(dbusmenu_bus, dbusmenu_object_path)
|
||||||
|
dbusmenu_object_iface = dbus.Interface(dbusmenu_object, 'com.canonical.dbusmenu')
|
||||||
|
dbusmenu_items = dbusmenu_object_iface.GetLayout(0, -1, ["label"])
|
||||||
|
|
||||||
|
dbusmenu_item_dict = dict()
|
||||||
|
|
||||||
|
""" explore_dbusmenu_item """
|
||||||
|
def explore_dbusmenu_item(item, label_list):
|
||||||
|
item_id = item[0]
|
||||||
|
item_props = item[1]
|
||||||
|
item_children = item[2]
|
||||||
|
|
||||||
|
if 'label' in item_props:
|
||||||
|
new_label_list = label_list + [item_props['label']]
|
||||||
|
else:
|
||||||
|
new_label_list = label_list
|
||||||
|
|
||||||
|
# FIXME: This is not excluding all unactivable menuitems.
|
||||||
|
if len(item_children) == 0:
|
||||||
|
dbusmenu_item_dict[format_label_list(new_label_list)] = item_id
|
||||||
|
else:
|
||||||
|
for child in item_children:
|
||||||
|
explore_dbusmenu_item(child, new_label_list)
|
||||||
|
|
||||||
|
explore_dbusmenu_item(dbusmenu_items[1], [])
|
||||||
|
|
||||||
|
# --- Run dmenu
|
||||||
|
dmenu_string = ''
|
||||||
|
head, *tail = dbusmenu_item_dict.keys()
|
||||||
|
dmenu_string = head
|
||||||
|
for m in tail:
|
||||||
|
dmenu_string += '\n'
|
||||||
|
dmenu_string += m
|
||||||
|
|
||||||
|
dmenu_cmd = subprocess.Popen(['dmenu', '-i', '-l', '10', '-fn', 'xos4 Terminus'], stdout=subprocess.PIPE, stdin=subprocess.PIPE)
|
||||||
|
dmenu_cmd.stdin.write(dmenu_string.encode('utf-8'))
|
||||||
|
dmenu_result = dmenu_cmd.communicate()[0].decode('utf8')
|
||||||
|
dmenu_cmd.stdin.close()
|
||||||
|
|
||||||
|
# --- Use dmenu result
|
||||||
|
if dmenu_result in dbusmenu_item_dict:
|
||||||
|
action = dbusmenu_item_dict[dmenu_result]
|
||||||
|
print(dbusmenu_object_iface.Event(action, 'clicked', 0, 0))
|
||||||
|
|
||||||
|
|
||||||
|
"""
|
||||||
|
try_gtk_interface
|
||||||
|
"""
|
||||||
|
def try_gtk_interface(gtk_bus_name_cmd, gtk_object_path_cmd):
|
||||||
|
gtk_bus_name = gtk_bus_name_cmd.split(' ')[2].split('\n')[0].split('"')[1]
|
||||||
|
print(gtk_object_path_cmd)
|
||||||
|
gtk_object_path = gtk_object_path_cmd.split(' ')[2].split('\n')[0].split('"')[1]
|
||||||
|
print("GTK MenuModel Bus name and object path: ", gtk_bus_name, gtk_object_path)
|
||||||
|
|
||||||
|
# --- Ask for menus over DBus ---
|
||||||
|
session_bus = dbus.SessionBus()
|
||||||
|
gtk_menubar_object = session_bus.get_object(gtk_bus_name, gtk_object_path)
|
||||||
|
gtk_menubar_object_iface = dbus.Interface(gtk_menubar_object, dbus_interface='org.gtk.Menus')
|
||||||
|
gtk_action_object_actions_iface = dbus.Interface(gtk_menubar_object, dbus_interface='org.gtk.Actions')
|
||||||
|
gtk_menubar_results = gtk_menubar_object_iface.Start([x for x in range(1024)])
|
||||||
|
|
||||||
|
# --- Construct menu list ---
|
||||||
|
gtk_menubar_menus = dict()
|
||||||
|
for gtk_menubar_result in gtk_menubar_results:
|
||||||
|
gtk_menubar_menus[(gtk_menubar_result[0], gtk_menubar_result[1])] = gtk_menubar_result[2]
|
||||||
|
|
||||||
|
gtk_menubar_action_dict = dict()
|
||||||
|
gtk_menubar_target_dict = dict()
|
||||||
|
|
||||||
|
""" explore_menu """
|
||||||
|
def explore_menu(menu_id, label_list):
|
||||||
|
for menu in gtk_menubar_menus[menu_id]:
|
||||||
|
if 'label' in menu:
|
||||||
|
menu_label = menu['label'].replace('_', '')
|
||||||
|
else:
|
||||||
|
menu_label = '?'
|
||||||
|
|
||||||
|
new_label_list = label_list + [menu_label]
|
||||||
|
formatted_label = format_label_list(new_label_list)
|
||||||
|
|
||||||
|
if 'action' in menu:
|
||||||
|
menu_action = menu['action']
|
||||||
|
gtk_menubar_action_dict[formatted_label] = menu_action
|
||||||
|
if 'target' in menu:
|
||||||
|
menu_target = menu['target']
|
||||||
|
gtk_menubar_target_dict[formatted_label] = menu_target
|
||||||
|
|
||||||
|
if ':section' in menu:
|
||||||
|
menu_section = menu[':section']
|
||||||
|
section_menu_id = (menu_section[0], menu_section[1])
|
||||||
|
explore_menu(section_menu_id, label_list)
|
||||||
|
|
||||||
|
if ':submenu' in menu:
|
||||||
|
menu_submenu = menu[':submenu']
|
||||||
|
submenu_menu_id = (menu_submenu[0], menu_submenu[1])
|
||||||
|
explore_menu(submenu_menu_id, new_label_list)
|
||||||
|
|
||||||
|
explore_menu((0,0), [])
|
||||||
|
|
||||||
|
# --- Run dmenu
|
||||||
|
dmenu_string = ''
|
||||||
|
head, *tail = gtk_menubar_action_dict.keys()
|
||||||
|
dmenu_string = head
|
||||||
|
for m in tail:
|
||||||
|
dmenu_string += '\n'
|
||||||
|
dmenu_string += m
|
||||||
|
|
||||||
|
dmenu_cmd = subprocess.Popen(['dmenu', '-i', '-l', '10', '-fn', 'xos4 Terminus'], stdout=subprocess.PIPE, stdin=subprocess.PIPE)
|
||||||
|
dmenu_cmd.stdin.write(dmenu_string.encode('utf-8'))
|
||||||
|
dmenu_result = dmenu_cmd.communicate()[0].decode('utf8')
|
||||||
|
dmenu_cmd.stdin.close()
|
||||||
|
|
||||||
|
# --- Use dmenu result
|
||||||
|
if dmenu_result in gtk_menubar_action_dict:
|
||||||
|
action = gtk_menubar_action_dict[dmenu_result]
|
||||||
|
print('GTK Action :', action)
|
||||||
|
gtk_action_object_actions_iface.Activate(action.replace('unity.', ''), [], dict())
|
||||||
|
|
||||||
|
"""
|
||||||
|
main
|
||||||
|
"""
|
||||||
|
|
||||||
|
# --- Get X Window ID ---
|
||||||
|
window_id_cmd = subprocess.check_output(['xprop', '-root', '-notype', '_NET_ACTIVE_WINDOW']).decode('utf-8')
|
||||||
|
window_id = window_id_cmd.split(' ')[4].split('\n')[0]
|
||||||
|
|
||||||
|
print('Window id is :', window_id)
|
||||||
|
|
||||||
|
# --- Get GTK MenuModel Bus name ---
|
||||||
|
|
||||||
|
gtk_bus_name_cmd = subprocess.check_output(['xprop', '-id', window_id, '-notype', '_GTK_UNIQUE_BUS_NAME']).decode('utf-8')
|
||||||
|
gtk_object_path_cmd = subprocess.check_output(['xprop', '-id', window_id, '-notype', '_GTK_MENUBAR_OBJECT_PATH']).decode('utf-8')
|
||||||
|
|
||||||
|
if gtk_bus_name_cmd == '_GTK_UNIQUE_BUS_NAME: not found.\n' or gtk_object_path_cmd == '_GTK_MENUBAR_OBJECT_PATH: not found.\n':
|
||||||
|
try_appmenu_interface(int(window_id, 16))
|
||||||
|
else:
|
||||||
|
try_gtk_interface(gtk_bus_name_cmd, gtk_object_path_cmd)
|
204
.i3blocks.conf
Normal file
204
.i3blocks.conf
Normal file
|
@ -0,0 +1,204 @@
|
||||||
|
# i3blocks config file
|
||||||
|
#
|
||||||
|
# Please see man i3blocks for a complete reference!
|
||||||
|
# The man page is also hosted at http://vivien.github.io/i3blocks
|
||||||
|
#
|
||||||
|
# List of valid properties:
|
||||||
|
#
|
||||||
|
# align
|
||||||
|
# color
|
||||||
|
# command
|
||||||
|
# full_text
|
||||||
|
# instance
|
||||||
|
# interval
|
||||||
|
# label
|
||||||
|
# min_width
|
||||||
|
# name
|
||||||
|
# separator
|
||||||
|
# separator_block_width
|
||||||
|
# short_text
|
||||||
|
# signal
|
||||||
|
# urgent
|
||||||
|
|
||||||
|
# Global properties
|
||||||
|
#
|
||||||
|
# The top properties below are applied to every block, but can be overridden.
|
||||||
|
# Each block command defaults to the script name to avoid boilerplate.
|
||||||
|
command=${HOME}/.i3blocks/$BLOCK_NAME
|
||||||
|
separator_block_width=15
|
||||||
|
markup=none
|
||||||
|
|
||||||
|
#[window_title]
|
||||||
|
#command=echo $(xdotool getactivewindow getwindowname)
|
||||||
|
#interval=1
|
||||||
|
|
||||||
|
# CPU usage
|
||||||
|
#
|
||||||
|
# The script may be called with -w and -c switches to specify thresholds,
|
||||||
|
# see the script for details.
|
||||||
|
[cpu_usage]
|
||||||
|
#label=
|
||||||
|
label=cpu
|
||||||
|
interval=1
|
||||||
|
#min_width= 99.99%
|
||||||
|
#separator=false
|
||||||
|
|
||||||
|
[load_average]
|
||||||
|
#label=
|
||||||
|
label=load
|
||||||
|
interval=1
|
||||||
|
|
||||||
|
# Temperature
|
||||||
|
#
|
||||||
|
# Support multiple chips, though lm-sensors.
|
||||||
|
# The script may be called with -w and -c switches to specify thresholds,
|
||||||
|
# see the script for details.
|
||||||
|
[temperature]
|
||||||
|
#label=
|
||||||
|
label=cpu
|
||||||
|
instance=coretemp-isa-0000
|
||||||
|
interval=3
|
||||||
|
separator=false
|
||||||
|
|
||||||
|
[temperature]
|
||||||
|
label=gpu
|
||||||
|
instance=radeon-pci-0300
|
||||||
|
interval=3
|
||||||
|
# Memory usage
|
||||||
|
#
|
||||||
|
# The type defaults to "mem" if the instance is not specified.
|
||||||
|
[memory]
|
||||||
|
label=ram
|
||||||
|
separator=false
|
||||||
|
interval=1
|
||||||
|
#min_width=RAM 99.99%
|
||||||
|
|
||||||
|
[memory]
|
||||||
|
label=swap
|
||||||
|
instance=swap
|
||||||
|
#separator=false
|
||||||
|
interval=1
|
||||||
|
#min_width=SWAP 99.99%
|
||||||
|
|
||||||
|
# Disk usage
|
||||||
|
#
|
||||||
|
# The directory defaults to $HOME if the instance is not specified.
|
||||||
|
# The script may be called with a optional argument to set the alert
|
||||||
|
# (defaults to 10 for 10%).
|
||||||
|
#[disk]
|
||||||
|
#label=
|
||||||
|
#instance=/
|
||||||
|
#interval=30
|
||||||
|
#separator=false
|
||||||
|
|
||||||
|
#[disk]
|
||||||
|
#label=
|
||||||
|
#instance=/mnt/data
|
||||||
|
#interval=30
|
||||||
|
|
||||||
|
# Packages to update
|
||||||
|
[updates]
|
||||||
|
#label=
|
||||||
|
interval=300
|
||||||
|
|
||||||
|
# Network interface monitoring
|
||||||
|
#
|
||||||
|
# If the instance is not specified, use the interface used for default route.
|
||||||
|
# The address can be forced to IPv4 or IPv6 with -4 or -6 switches.
|
||||||
|
#[iface]
|
||||||
|
#label=wlan
|
||||||
|
#instance=wlp1s0
|
||||||
|
#interval=10
|
||||||
|
#separator=false
|
||||||
|
|
||||||
|
#[public_ip]
|
||||||
|
#label=
|
||||||
|
#interval=60
|
||||||
|
#separator=false
|
||||||
|
|
||||||
|
#[vpn]
|
||||||
|
#interval=30
|
||||||
|
|
||||||
|
#[wifi]
|
||||||
|
##label=
|
||||||
|
##label=wlan
|
||||||
|
#instance=wlp1s0
|
||||||
|
#interval=3
|
||||||
|
#separator=false
|
||||||
|
|
||||||
|
#[bandwidth]
|
||||||
|
#instance=wlp1s0
|
||||||
|
#interval=1
|
||||||
|
#min_width=d 999K u 999K
|
||||||
|
|
||||||
|
#[bandwidth]
|
||||||
|
#instance=enp0s31f6
|
||||||
|
#interval=1
|
||||||
|
#min_width=IN 999K OUT 999K
|
||||||
|
|
||||||
|
|
||||||
|
# Battery indicator
|
||||||
|
#
|
||||||
|
# The battery instance defaults to 0.
|
||||||
|
[battery]
|
||||||
|
#label=BAT
|
||||||
|
#label=⚡
|
||||||
|
instance=0
|
||||||
|
interval=5
|
||||||
|
|
||||||
|
# Generic media player support
|
||||||
|
#
|
||||||
|
# This displays "ARTIST - SONG" if a music is playing.
|
||||||
|
# Supported players are: spotify, vlc, audacious, xmms2, mplayer, and others.
|
||||||
|
[mocp]
|
||||||
|
#instance=spotify
|
||||||
|
interval=20
|
||||||
|
signal=13
|
||||||
|
|
||||||
|
# OpenVPN support
|
||||||
|
#
|
||||||
|
# Support multiple VPN, with colors.
|
||||||
|
#[openvpn]
|
||||||
|
#interval=20
|
||||||
|
|
||||||
|
|
||||||
|
# Volume indicator
|
||||||
|
#
|
||||||
|
# The first parameter sets the step (and units to display)
|
||||||
|
# The second parameter overrides the mixer selection
|
||||||
|
# See the script for details.
|
||||||
|
[volume]
|
||||||
|
instance=Master
|
||||||
|
#instance=PCM
|
||||||
|
interval=once
|
||||||
|
signal=10
|
||||||
|
separator=false
|
||||||
|
|
||||||
|
[volume]
|
||||||
|
instance=Capture
|
||||||
|
#instance=PCM
|
||||||
|
interval=once
|
||||||
|
signal=10
|
||||||
|
|
||||||
|
|
||||||
|
# Key indicators
|
||||||
|
#
|
||||||
|
# Add the following bindings to i3 config file:
|
||||||
|
#
|
||||||
|
# bindsym --release Caps_Lock exec pkill -SIGRTMIN+11 i3blocks
|
||||||
|
# bindsym --release Num_Lock exec pkill -SIGRTMIN+12 i3blocks
|
||||||
|
[keyindicator]
|
||||||
|
instance=CAPS
|
||||||
|
interval=once
|
||||||
|
signal=11
|
||||||
|
separator=false
|
||||||
|
|
||||||
|
[keyindicator]
|
||||||
|
instance=NUM
|
||||||
|
interval=once
|
||||||
|
signal=12
|
||||||
|
|
||||||
|
# Date Time
|
||||||
|
#
|
||||||
|
[time]
|
||||||
|
interval=1
|
90
.i3blocks/bandwidth
Executable file
90
.i3blocks/bandwidth
Executable file
|
@ -0,0 +1,90 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# Copyright (C) 2012 Stefan Breunig <stefan+measure-net-speed@mathphys.fsk.uni-heidelberg.de>
|
||||||
|
# Copyright (C) 2014 kaueraal
|
||||||
|
# Copyright (C) 2015 Thiago Perrotta <perrotta dot thiago at poli dot ufrj dot br>
|
||||||
|
|
||||||
|
# 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/>.
|
||||||
|
|
||||||
|
# Use the provided interface, otherwise the device used for the default route.
|
||||||
|
if [[ -n $BLOCK_INSTANCE ]]; then
|
||||||
|
INTERFACE=$BLOCK_INSTANCE
|
||||||
|
else
|
||||||
|
INTERFACE=$(ip route | awk '/^default/ { print $5 ; exit }')
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Issue #36 compliant.
|
||||||
|
if ! [ -e "/sys/class/net/${INTERFACE}/operstate" ] || ! [ "`cat /sys/class/net/${INTERFACE}/operstate`" = "up" ]
|
||||||
|
then
|
||||||
|
#echo "$INTERFACE down"
|
||||||
|
#echo "$INTERFACE down"
|
||||||
|
#echo "#FF0000"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# path to store the old results in
|
||||||
|
path="/dev/shm/$(basename $0)-${INTERFACE}"
|
||||||
|
|
||||||
|
# grabbing data for each adapter.
|
||||||
|
read rx < "/sys/class/net/${INTERFACE}/statistics/rx_bytes"
|
||||||
|
read tx < "/sys/class/net/${INTERFACE}/statistics/tx_bytes"
|
||||||
|
|
||||||
|
# get time
|
||||||
|
time=$(date +%s)
|
||||||
|
|
||||||
|
# write current data if file does not exist. Do not exit, this will cause
|
||||||
|
# problems if this file is sourced instead of executed as another process.
|
||||||
|
if ! [[ -f "${path}" ]]; then
|
||||||
|
echo "${time} ${rx} ${tx}" > "${path}"
|
||||||
|
chmod 0666 "${path}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# read previous state and update data storage
|
||||||
|
read old < "${path}"
|
||||||
|
echo "${time} ${rx} ${tx}" > "${path}"
|
||||||
|
|
||||||
|
# parse old data and calc time passed
|
||||||
|
old=(${old//;/ })
|
||||||
|
time_diff=$(( $time - ${old[0]} ))
|
||||||
|
|
||||||
|
# sanity check: has a positive amount of time passed
|
||||||
|
[[ "${time_diff}" -gt 0 ]] || exit
|
||||||
|
|
||||||
|
# calc bytes transferred, and their rate in byte/s
|
||||||
|
rx_diff=$(( $rx - ${old[1]} ))
|
||||||
|
tx_diff=$(( $tx - ${old[2]} ))
|
||||||
|
rx_rate=$(( $rx_diff / $time_diff ))
|
||||||
|
tx_rate=$(( $tx_diff / $time_diff ))
|
||||||
|
|
||||||
|
# shift by 10 bytes to get KiB/s. If the value is larger than
|
||||||
|
# 1024^2 = 1048576, then display MiB/s instead
|
||||||
|
|
||||||
|
# incoming
|
||||||
|
echo -n " "
|
||||||
|
rx_kib=$(( $rx_rate >> 10 ))
|
||||||
|
if [[ "$rx_rate" -gt 1048576 ]]; then
|
||||||
|
printf '%sM' "`echo "scale=1; $rx_kib / 1024" | bc`"
|
||||||
|
else
|
||||||
|
echo -n "${rx_kib}K"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -n " "
|
||||||
|
|
||||||
|
# outgoing
|
||||||
|
echo -n " "
|
||||||
|
tx_kib=$(( $tx_rate >> 10 ))
|
||||||
|
if [[ "$tx_rate" -gt 1048576 ]]; then
|
||||||
|
printf '%sM' "`echo "scale=1; $tx_kib / 1024" | bc`"
|
||||||
|
else
|
||||||
|
echo -n "${tx_kib}K"
|
||||||
|
fi
|
151
.i3blocks/battery
Executable file
151
.i3blocks/battery
Executable file
|
@ -0,0 +1,151 @@
|
||||||
|
#!/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)"
|
||||||
|
icon=""
|
||||||
|
|
||||||
|
|
||||||
|
#There are 8 colors that reflect the current battery percentage when
|
||||||
|
#discharging
|
||||||
|
dis_colors=("#f2777a" "#f99157" "#f99157" "#ffcc66" "#ffcc66" "#99cc99"
|
||||||
|
"#99cc99" "#66cccc")
|
||||||
|
|
||||||
|
charging_color="#6699cc"
|
||||||
|
full_color="#6699cc"
|
||||||
|
ac_color="#6699cc"
|
||||||
|
|
||||||
|
while getopts 1:2:3:4:5:6:7:8:c: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";;
|
||||||
|
c) charging_color="$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
|
||||||
|
# #icon=""
|
||||||
|
# icon="----"
|
||||||
|
#elif (( percentage >= 20 && percentage < 40 )); then
|
||||||
|
# #icon=""
|
||||||
|
# icon="#---"
|
||||||
|
#elif (( percentage >= 40 && percentage < 60 )); then
|
||||||
|
# #icon=""
|
||||||
|
# icon="##--"
|
||||||
|
#elif (( percentage >= 60 && percentage < 80 )); then
|
||||||
|
# #icon=""
|
||||||
|
# icon="###-"
|
||||||
|
#elif (( percentage >=80 )); then
|
||||||
|
# #icon=""
|
||||||
|
# icon="####"
|
||||||
|
#fi
|
||||||
|
#
|
||||||
|
#if [[ "$status" = "Unknown" ]]; then
|
||||||
|
# icon=""
|
||||||
|
#fi
|
||||||
|
|
||||||
|
icon="bat "
|
||||||
|
|
||||||
|
case "$status" in
|
||||||
|
"Charging")
|
||||||
|
color="$charging_color"
|
||||||
|
icon="$icon↑"
|
||||||
|
if (( percentage >= 0 && percentage <= 10 )); then
|
||||||
|
color="${dis_colors[0]}"
|
||||||
|
echo 0 on > /proc/acpi/ibm/led
|
||||||
|
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
|
||||||
|
;;
|
||||||
|
"Full")
|
||||||
|
color="$full_color"
|
||||||
|
icon="=$icon"
|
||||||
|
;;
|
||||||
|
"AC")
|
||||||
|
color="$ac_color"
|
||||||
|
icon="$icon↑"
|
||||||
|
echo 0 on > /proc/acpi/ibm/led
|
||||||
|
;;
|
||||||
|
"Discharging"|"Unknown")
|
||||||
|
icon="$icon↓"
|
||||||
|
if (( percentage >= 0 && percentage <= 10 )); then
|
||||||
|
color="${dis_colors[0]}"
|
||||||
|
echo 0 blink > /proc/acpi/ibm/led
|
||||||
|
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
|
||||||
|
|
||||||
|
echo "$icon $percentage% $remaining_formatted"
|
||||||
|
echo "$percentage%"
|
||||||
|
echo "$color"
|
61
.i3blocks/cpu_usage
Executable file
61
.i3blocks/cpu_usage
Executable file
|
@ -0,0 +1,61 @@
|
||||||
|
#!/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 = 70;
|
||||||
|
my $t_crit = 90;
|
||||||
|
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;
|
||||||
|
while (<MPSTAT>) {
|
||||||
|
if (/^.*\s+(\d+\.\d+)\s+$/) {
|
||||||
|
$cpu_usage = 100 - $1; # 100% - %idle
|
||||||
|
last;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
close(MPSTAT);
|
||||||
|
|
||||||
|
|
||||||
|
$cpu_usage eq -1 and die 'Can\'t find CPU information';
|
||||||
|
# Print short_text, full_text
|
||||||
|
printf "%5.2f%%\n", $cpu_usage;
|
||||||
|
printf "%2d%%\n", $cpu_usage;
|
||||||
|
|
||||||
|
# Print color, if needed
|
||||||
|
if ($cpu_usage >= $t_crit) {
|
||||||
|
print "#f2777a\n";
|
||||||
|
#exit 33;
|
||||||
|
} elsif ($cpu_usage >= $t_warn) {
|
||||||
|
print "#f99157\n";
|
||||||
|
} elsif ($cpu_usage >= 40) {
|
||||||
|
print "#ffcc66\n";
|
||||||
|
} elsif ($cpu_usage >= 10) {
|
||||||
|
print "#99cc99\n";
|
||||||
|
} else {
|
||||||
|
print "#66cccc\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
exit 0;
|
46
.i3blocks/disk
Executable file
46
.i3blocks/disk
Executable file
|
@ -0,0 +1,46 @@
|
||||||
|
#!/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="${BLOCK_INSTANCE:-$HOME}"
|
||||||
|
ALERT_LOW="${1:-10}" # color will turn red under this value (default: 10%)
|
||||||
|
|
||||||
|
# df -h -P -l "$DIR" | awk -v alert_low=$ALERT_LOW '
|
||||||
|
df -h -P -l "$DIR" | awk '
|
||||||
|
/\/.*/ {
|
||||||
|
# full text
|
||||||
|
print $4
|
||||||
|
|
||||||
|
# short text
|
||||||
|
print $4
|
||||||
|
|
||||||
|
use=$5
|
||||||
|
|
||||||
|
# no need to continue parsing
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
END {
|
||||||
|
gsub(/%$/,"",use)
|
||||||
|
if (100 - use < 10) {
|
||||||
|
# color
|
||||||
|
print "#0000FF"
|
||||||
|
} else if (100 - use < 20) {
|
||||||
|
print "#2E9DF2"
|
||||||
|
} else {
|
||||||
|
print "#00FFFF"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'
|
61
.i3blocks/iface
Executable file
61
.i3blocks/iface
Executable file
|
@ -0,0 +1,61 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# Copyright (C) 2014 Julien Bonjean <julien@bonjean.info>
|
||||||
|
# Copyright (C) 2014 Alexander Keller <github@nycroth.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 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/>.
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Use the provided interface, otherwise the device used for the default route.
|
||||||
|
if [[ -n $BLOCK_INSTANCE ]]; then
|
||||||
|
IF=$BLOCK_INSTANCE
|
||||||
|
else
|
||||||
|
IF=$(ip route | awk '/^default/ { print $5 ; exit }')
|
||||||
|
fi
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# As per #36 -- It is transparent: e.g. if the machine has no battery or wireless
|
||||||
|
# connection (think desktop), the corresponding block should not be displayed.
|
||||||
|
[[ ! -d /sys/class/net/${IF} ]] && exit
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------
|
||||||
|
|
||||||
|
if [[ "$(cat /sys/class/net/$IF/operstate)" = 'down' ]]; then
|
||||||
|
echo down # full text
|
||||||
|
echo down # short text
|
||||||
|
echo \#F2777A # color
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
case $1 in
|
||||||
|
-4)
|
||||||
|
AF=inet ;;
|
||||||
|
-6)
|
||||||
|
AF=inet6 ;;
|
||||||
|
*)
|
||||||
|
AF=inet6? ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# if no interface is found, use the first device with a global scope
|
||||||
|
IPADDR=$(ip addr show $IF | perl -n -e "/$AF ([^\/]+).* scope global/ && print \$1 and exit")
|
||||||
|
|
||||||
|
case $BLOCK_BUTTON in
|
||||||
|
3) echo -n "$IPADDR" | xclip -q -se c ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------
|
||||||
|
|
||||||
|
echo "$IPADDR" # full text
|
||||||
|
echo "$IPADDR" # short text
|
73
.i3blocks/keyindicator
Executable file
73
.i3blocks/keyindicator
Executable file
|
@ -0,0 +1,73 @@
|
||||||
|
#!/usr/bin/perl
|
||||||
|
#
|
||||||
|
# Copyright 2014 Marcelo Cerri <mhcerri at gmail dot 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 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/>.
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
use utf8;
|
||||||
|
use Getopt::Long;
|
||||||
|
use File::Basename;
|
||||||
|
|
||||||
|
# Default values
|
||||||
|
my $indicator = $ENV{BLOCK_INSTANCE} || "CAPS";
|
||||||
|
my $color_on = "#99cc99";
|
||||||
|
my $color_off = "#515151";
|
||||||
|
|
||||||
|
sub help {
|
||||||
|
my $program = basename($0);
|
||||||
|
printf "Usage: %s [-c <color on>] [-C <color off>]\n", $program;
|
||||||
|
printf " -c <color on>: hex color to use when indicator is on\n";
|
||||||
|
printf " -C <color off>: hex color to use when indicator is off\n";
|
||||||
|
printf "\n";
|
||||||
|
printf "Note: environment variable \$BLOCK_INSTANCE should be one of:\n";
|
||||||
|
printf " CAPS, NUM (default is CAPS).\n";
|
||||||
|
exit 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
Getopt::Long::config qw(no_ignore_case);
|
||||||
|
GetOptions("help|h" => \&help,
|
||||||
|
"c=s" => \$color_on,
|
||||||
|
"C=s" => \$color_off) or exit 1;
|
||||||
|
|
||||||
|
# Key mapping
|
||||||
|
my %indicators = (
|
||||||
|
CAPS => 0x00000001,
|
||||||
|
NUM => 0x00000002,
|
||||||
|
);
|
||||||
|
|
||||||
|
# Retrieve key flags
|
||||||
|
my $mask = 0;
|
||||||
|
open(XSET, "xset -q |") or die;
|
||||||
|
while (<XSET>) {
|
||||||
|
if (/LED mask:\s*([0-9]+)/) {
|
||||||
|
$mask = $1;
|
||||||
|
last;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
close(XSET);
|
||||||
|
|
||||||
|
my $indi = "N";
|
||||||
|
|
||||||
|
# Output
|
||||||
|
printf "%s\n", $indicator;
|
||||||
|
if ($indicator eq "CAPS") {$indi = "C";}
|
||||||
|
printf "%s\n", $indi;
|
||||||
|
if (($indicators{$indicator} || 0) & $mask) {
|
||||||
|
printf "%s\n", $color_on;
|
||||||
|
} else {
|
||||||
|
printf "%s\n", $color_off;
|
||||||
|
}
|
||||||
|
exit 0
|
37
.i3blocks/load_average
Executable file
37
.i3blocks/load_average
Executable file
|
@ -0,0 +1,37 @@
|
||||||
|
#!/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)"
|
||||||
|
all="$(cut -d ' ' -f1-3 /proc/loadavg)"
|
||||||
|
cpus="$(nproc)"
|
||||||
|
|
||||||
|
# full text
|
||||||
|
echo "$all"
|
||||||
|
|
||||||
|
# short text
|
||||||
|
echo "$load"
|
||||||
|
|
||||||
|
# color if load is too high
|
||||||
|
awk -v cpus=$cpus -v cpuload=$load '
|
||||||
|
BEGIN {
|
||||||
|
if (cpus <= cpuload) {
|
||||||
|
print "#f2777a";
|
||||||
|
#exit 33;
|
||||||
|
} else {
|
||||||
|
print "#99cc99";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'
|
76
.i3blocks/mediaplayer
Executable file
76
.i3blocks/mediaplayer
Executable file
|
@ -0,0 +1,76 @@
|
||||||
|
#!/usr/bin/perl
|
||||||
|
# Copyright (C) 2014 Tony Crisci <tony@dubstepdish.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 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/>.
|
||||||
|
|
||||||
|
# Requires playerctl binary to be in your path (except cmus)
|
||||||
|
# See: https://github.com/acrisci/playerctl
|
||||||
|
|
||||||
|
# Set instance=NAME in the i3blocks configuration to specify a music player
|
||||||
|
# (playerctl will attempt to connect to org.mpris.MediaPlayer2.[NAME] on your
|
||||||
|
# DBus session).
|
||||||
|
|
||||||
|
use Env qw(BLOCK_INSTANCE);
|
||||||
|
|
||||||
|
my @metadata = ();
|
||||||
|
my $player_arg = "";
|
||||||
|
|
||||||
|
if ($BLOCK_INSTANCE) {
|
||||||
|
$player_arg = "--player='$BLOCK_INSTANCE'";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($ENV{'BLOCK_BUTTON'} == 1) {
|
||||||
|
system("playerctl $player_arg previous");
|
||||||
|
} elsif ($ENV{'BLOCK_BUTTON'} == 2) {
|
||||||
|
system("playerctl $player_arg play-pause");
|
||||||
|
} elsif ($ENV{'BLOCK_BUTTON'} == 3) {
|
||||||
|
system("playerctl $player_arg next");
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($player_arg eq '' or $player_arg =~ /cmus$/) {
|
||||||
|
# try cmus first
|
||||||
|
my @cmus = split /^/, qx(cmus-remote -Q);
|
||||||
|
if ($? == 0) {
|
||||||
|
foreach my $line (@cmus) {
|
||||||
|
my @data = split /\s/, $line;
|
||||||
|
if (shift @data eq 'tag') {
|
||||||
|
my $key = shift @data;
|
||||||
|
my $value = join ' ', @data;
|
||||||
|
|
||||||
|
@metadata[0] = $value if $key eq 'artist';
|
||||||
|
@metadata[1] = $value if $key eq 'title';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (@metadata) {
|
||||||
|
# metadata found so we are done
|
||||||
|
print(join ' - ', @metadata);
|
||||||
|
exit 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# if cmus was given, we are done
|
||||||
|
exit 0 unless $player_arg eq '';
|
||||||
|
}
|
||||||
|
|
||||||
|
my $artist = qx(playerctl $player_arg metadata artist);
|
||||||
|
# exit status will be nonzero when playerctl cannot find your player
|
||||||
|
exit(0) if $?;
|
||||||
|
push(@metadata, $artist) if $artist;
|
||||||
|
|
||||||
|
my $title = qx(playerctl $player_arg metadata title);
|
||||||
|
exit(0) if $?;
|
||||||
|
push(@metadata, $title) if $title;
|
||||||
|
|
||||||
|
print(join(" - ", @metadata)) if @metadata;
|
79
.i3blocks/memory
Executable file
79
.i3blocks/memory
Executable file
|
@ -0,0 +1,79 @@
|
||||||
|
#!/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="${BLOCK_INSTANCE:-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_free/1024/1024)
|
||||||
|
printf("%5.2f%\n", (swap_total-swap_free)*100/swap_total)
|
||||||
|
else
|
||||||
|
#printf("%.1f%\n", mem_free/1024/1024)
|
||||||
|
printf("%5.2f%\n", (mem_total-mem_free)*100/mem_total)
|
||||||
|
|
||||||
|
# TODO: short text
|
||||||
|
if (type == "swap")
|
||||||
|
#printf("%.1fG\n", swap_free/1024/1024)
|
||||||
|
printf("%2.0f%\n", (swap_total-swap_free)*100/swap_total)
|
||||||
|
else
|
||||||
|
#printf("%.1f%\n", mem_free/1024/1024)
|
||||||
|
printf("%2.0f%\n", (mem_total-mem_free)*100/mem_total)
|
||||||
|
|
||||||
|
# TODO: color (if less than X%)
|
||||||
|
if (type == "swap")
|
||||||
|
if ((swap_total-swap_free)*100/swap_total > 90)
|
||||||
|
printf("#f2777a")
|
||||||
|
else if ((swap_total-swap_free)*100/swap_total > 70)
|
||||||
|
printf("#f99157")
|
||||||
|
else if ((swap_total-swap_free)*100/swap_total > 40)
|
||||||
|
printf("#ffcc66")
|
||||||
|
else if ((swap_total-swap_free)*100/swap_total > 10)
|
||||||
|
printf("#99cc99")
|
||||||
|
else
|
||||||
|
printf("#66cccc")
|
||||||
|
else
|
||||||
|
if ((mem_total-mem_free)*100/mem_total > 90)
|
||||||
|
printf("#f2777a")
|
||||||
|
else if ((mem_total-mem_free)*100/mem_total > 70)
|
||||||
|
printf("#f99157")
|
||||||
|
else if ((mem_total-mem_free)*100/mem_total > 40)
|
||||||
|
printf("#ffcc66")
|
||||||
|
else if ((mem_total-mem_free)*100/mem_total > 10)
|
||||||
|
printf("#99cc99")
|
||||||
|
else
|
||||||
|
printf("#66cccc")
|
||||||
|
}
|
||||||
|
' /proc/meminfo
|
18
.i3blocks/mocp
Executable file
18
.i3blocks/mocp
Executable file
|
@ -0,0 +1,18 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
case $BLOCK_BUTTON in
|
||||||
|
1) mocp -r ;;
|
||||||
|
2) mocp -G ;;
|
||||||
|
3) mocp -f ;;
|
||||||
|
4) mocp -j $(($(mocp -Q "%cs") - 5))s ;;
|
||||||
|
5) mocp -j $(($(mocp -Q "%cs") + 5))s ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
status=$(mocp -Q "%state")
|
||||||
|
case $status in
|
||||||
|
STOP ) status="[]" ;;
|
||||||
|
PAUSE ) status="||" ;;
|
||||||
|
PLAY ) status=" >" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
echo $status $(mocp -Q "%song")
|
149
.i3blocks/openvpn
Executable file
149
.i3blocks/openvpn
Executable file
|
@ -0,0 +1,149 @@
|
||||||
|
#!/usr/bin/perl
|
||||||
|
# Made by Pierre Mavro/Deimosfr <deimos@deimos.fr>
|
||||||
|
# Licensed under the terms of the GNU GPL v3, or any later version.
|
||||||
|
# Version: 0.2
|
||||||
|
|
||||||
|
# Usage:
|
||||||
|
# 1. The configuration name of OpenVPN should be familiar for you (home,work...)
|
||||||
|
# 2. The device name in your configuration file should be fully named (tun0,tap1...not only tun or tap)
|
||||||
|
# 3. When you launch one or multiple OpenVPN connexion, be sure the PID file is written in the correct folder (ex: --writepid /run/openvpn/home.pid)
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
use utf8;
|
||||||
|
use Getopt::Long;
|
||||||
|
|
||||||
|
my $openvpn_enabled='/dev/shm/openvpn_i3blocks_enabled';
|
||||||
|
my $openvpn_disabled='/dev/shm/openvpn_i3blocks_disabled';
|
||||||
|
|
||||||
|
# Print output
|
||||||
|
sub print_output {
|
||||||
|
my $ref_pid_files = shift;
|
||||||
|
my @pid_files = @$ref_pid_files;
|
||||||
|
my $change=0;
|
||||||
|
|
||||||
|
# Total pid files
|
||||||
|
my $total_pid = @pid_files;
|
||||||
|
if ($total_pid == 0) {
|
||||||
|
print "VPN: down\n"x2;
|
||||||
|
# Delete OpenVPN i3blocks temp files
|
||||||
|
if (-f $openvpn_enabled) {
|
||||||
|
unlink $openvpn_enabled or die "Can't delete $openvpn_enabled\n";
|
||||||
|
# Colorize if VPN has just went down
|
||||||
|
print '#FF0000\n';
|
||||||
|
}
|
||||||
|
unless (-f $openvpn_disabled) {
|
||||||
|
open(my $shm, '>', $openvpn_disabled) or die "Can't write $openvpn_disabled\n";
|
||||||
|
}
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
# Check if interface device is present
|
||||||
|
my $vpn_found=0;
|
||||||
|
my $pid;
|
||||||
|
my $cmd_line;
|
||||||
|
my @config_name;
|
||||||
|
my @config_path;
|
||||||
|
my $interface;
|
||||||
|
my $current_config_path;
|
||||||
|
my $current_config_name;
|
||||||
|
foreach (@pid_files) {
|
||||||
|
# Get current PID
|
||||||
|
$pid=0;
|
||||||
|
open(PID, '<', $_);
|
||||||
|
while(<PID>) {
|
||||||
|
chomp $_;
|
||||||
|
$pid = $_;
|
||||||
|
}
|
||||||
|
close(PID);
|
||||||
|
# Check if PID has been found
|
||||||
|
if ($pid ==0) {
|
||||||
|
print "Can't get PID $_: $!\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
# Check if PID is still alive
|
||||||
|
$cmd_line='/proc/'.$pid.'/cmdline';
|
||||||
|
if (-f $cmd_line) {
|
||||||
|
# Get config name
|
||||||
|
open(CMD_LINE, '<', $cmd_line);
|
||||||
|
while(<CMD_LINE>) {
|
||||||
|
chomp $_;
|
||||||
|
if ($_ =~ /--config\s*(.*\.conf)/) {
|
||||||
|
# Get interface from config file
|
||||||
|
$current_config_path = $1;
|
||||||
|
# Remove unwanted escape chars
|
||||||
|
$current_config_path =~ s/\x{00}//g;
|
||||||
|
$interface = 'null';
|
||||||
|
# Get configuration name
|
||||||
|
if ($current_config_path =~ /(\w+).conf/) {
|
||||||
|
$current_config_name=$1;
|
||||||
|
} else {
|
||||||
|
$current_config_name='unknow';
|
||||||
|
}
|
||||||
|
# Get OpenVPN interface device name
|
||||||
|
open(CONFIG, '<', $current_config_path) or die "Can't read config file '$current_config_path': $!\n";
|
||||||
|
while(<CONFIG>) {
|
||||||
|
chomp $_;
|
||||||
|
if ($_ =~ /dev\s+(\w+)/) {
|
||||||
|
$interface=$1;
|
||||||
|
last;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
close(CONFIG);
|
||||||
|
# check if interface exist
|
||||||
|
unless ($interface eq 'null') {
|
||||||
|
if (-d "/sys/class/net/$interface") {
|
||||||
|
push @config_name, $current_config_name;
|
||||||
|
$vpn_found=1;
|
||||||
|
# Write enabled file
|
||||||
|
unless (-f $openvpn_enabled) {
|
||||||
|
open(my $shm, '>', $openvpn_enabled) or die "Can't write $openvpn_enabled\n";
|
||||||
|
$change=1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
close(CMD_LINE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Check if PID found
|
||||||
|
my $names;
|
||||||
|
my $short_status;
|
||||||
|
if ($vpn_found == 1) {
|
||||||
|
$names = join('/', @config_name);
|
||||||
|
$short_status='up';
|
||||||
|
} else {
|
||||||
|
$short_status='down';
|
||||||
|
$names = $short_status;
|
||||||
|
}
|
||||||
|
|
||||||
|
print "VPN: $names\n";
|
||||||
|
print "VPN: $short_status\n";
|
||||||
|
|
||||||
|
# Print color if there were changes
|
||||||
|
print "#00FF00\n" if ($change == 1);
|
||||||
|
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
sub check_opts {
|
||||||
|
# Vars
|
||||||
|
my @pid_file=glob '/run/openvpn/*.pid';
|
||||||
|
|
||||||
|
# Set options
|
||||||
|
GetOptions( "help|h" => \&help,
|
||||||
|
"p=s" => \@pid_file);
|
||||||
|
|
||||||
|
print_output(\@pid_file);
|
||||||
|
}
|
||||||
|
|
||||||
|
sub help {
|
||||||
|
print "Usage: openvpn [-d pid folder files]\n";
|
||||||
|
print "-d : pid folder files (default /run/openvpn/*.pid)\n";
|
||||||
|
print "Note: devices in configuration file should be named with their number (ex: tun0, tap1)\n";
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
&check_opts;
|
6
.i3blocks/public_ip
Executable file
6
.i3blocks/public_ip
Executable file
|
@ -0,0 +1,6 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
curl ip.yunohost.org
|
||||||
|
echo
|
||||||
|
curl ip.yunohost.org
|
||||||
|
echo
|
82
.i3blocks/temperature
Executable file
82
.i3blocks/temperature
Executable file
|
@ -0,0 +1,82 @@
|
||||||
|
#!/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>
|
||||||
|
# Copyright 2014 Benjamin Chretien <chretien at lirmm dot fr>
|
||||||
|
|
||||||
|
# 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/>.
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
use utf8;
|
||||||
|
use Getopt::Long;
|
||||||
|
|
||||||
|
binmode(STDOUT, ":utf8");
|
||||||
|
|
||||||
|
# default values
|
||||||
|
my $t_warn = 60;
|
||||||
|
my $t_crit = 70;
|
||||||
|
my $chip = "$ENV{BLOCK_INSTANCE}";
|
||||||
|
my $temperature = -9999;
|
||||||
|
my $color = "#d3d0c8";
|
||||||
|
#my $status = "";
|
||||||
|
|
||||||
|
sub help {
|
||||||
|
print "Usage: temperature [-w <warning>] [-c <critical>] [--chip <chip>]\n";
|
||||||
|
print "-w <percent>: warning threshold to become yellow\n";
|
||||||
|
print "-c <percent>: critical threshold to become red\n";
|
||||||
|
print "--chip <chip>: sensor chip\n";
|
||||||
|
exit 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
GetOptions("help|h" => \&help,
|
||||||
|
"w=i" => \$t_warn,
|
||||||
|
"c=i" => \$t_crit,
|
||||||
|
"chip=s" => \$chip);
|
||||||
|
|
||||||
|
# Get chip temperature
|
||||||
|
open (SENSORS, "sensors -u $chip |") or die;
|
||||||
|
while (<SENSORS>) {
|
||||||
|
if (/^\s+temp1_input:\s+[\+]*([\-]*\d+\.\d)/) {
|
||||||
|
$temperature = $1;
|
||||||
|
last;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
close(SENSORS);
|
||||||
|
|
||||||
|
$temperature eq -9999 and die 'Cannot find temperature';
|
||||||
|
|
||||||
|
# Print color, if needed
|
||||||
|
if ($temperature >= $t_crit) {
|
||||||
|
$color = "#f2777a";
|
||||||
|
# $status = "";
|
||||||
|
#exit 33;
|
||||||
|
} elsif ($temperature >= $t_warn) {
|
||||||
|
$color = "#f99157";
|
||||||
|
# $status = "";
|
||||||
|
} elsif ($temperature >= 50) {
|
||||||
|
$color = "#ffcc66";
|
||||||
|
# $status = "";
|
||||||
|
} elsif ($temperature >=40) {
|
||||||
|
$color = "#99cc99";
|
||||||
|
# $status = "";
|
||||||
|
} else {
|
||||||
|
$color = "#66cccc";
|
||||||
|
# $status = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
#printf "$status %d°C\n%d°C\n$color\n", $temperature, $temperature;
|
||||||
|
printf "%d°C\n%d°C\n$color\n", $temperature, $temperature;
|
||||||
|
|
||||||
|
exit 0;
|
4
.i3blocks/time
Executable file
4
.i3blocks/time
Executable file
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
date '+%x (%V) %X'
|
||||||
|
date '+%d/%m %R'
|
15
.i3blocks/updates
Executable file
15
.i3blocks/updates
Executable file
|
@ -0,0 +1,15 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
avail=$(checkupdates | wc -l )
|
||||||
|
aur=$(yaourt -Qua | grep 'aur/' | wc -l)
|
||||||
|
|
||||||
|
if [[ $(($aur+$avail)) -eq 0 ]]
|
||||||
|
then
|
||||||
|
echo "0 màj"
|
||||||
|
echo ok
|
||||||
|
echo "#99cc99"
|
||||||
|
else
|
||||||
|
echo "$avail màj"
|
||||||
|
echo "$avail"
|
||||||
|
echo "#f99157"
|
||||||
|
fi
|
91
.i3blocks/volume
Executable file
91
.i3blocks/volume
Executable file
|
@ -0,0 +1,91 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# Copyright (C) 2014 Julien Bonjean <julien@bonjean.info>
|
||||||
|
# Copyright (C) 2014 Alexander Keller <github@nycroth.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 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/>.
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# The second parameter overrides the mixer selection
|
||||||
|
# For PulseAudio users, use "pulse"
|
||||||
|
# For Jack/Jack2 users, use "jackplug"
|
||||||
|
# For ALSA users, you may use "default" for your primary card
|
||||||
|
# or you may use hw:# where # is the number of the card desired
|
||||||
|
MIXER="default"
|
||||||
|
[ -n "$(lsmod | grep pulse)" ] && MIXER="pulse"
|
||||||
|
[ -n "$(lsmod | grep jack)" ] && MIXER="jackplug"
|
||||||
|
MIXER="${2:-$MIXER}"
|
||||||
|
|
||||||
|
# The instance option sets the control to report and configure
|
||||||
|
# This defaults to the first control of your selected mixer
|
||||||
|
# For a list of the available, use `amixer -D $Your_Mixer scontrols`
|
||||||
|
SCONTROL="${BLOCK_INSTANCE:-$(amixer -D $MIXER scontrols |
|
||||||
|
sed -n "s/Simple mixer control '\([A-Za-z ]*\)',0/\1/p" |
|
||||||
|
head -n1
|
||||||
|
)}"
|
||||||
|
|
||||||
|
# The first parameter sets the step to change the volume by (and units to display)
|
||||||
|
# This may be in in % or dB (eg. 5% or 3dB)
|
||||||
|
STEP="${1:-5%}"
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------
|
||||||
|
|
||||||
|
capability() { # Return "Capture" if the device is a capture device
|
||||||
|
amixer -D $MIXER get $SCONTROL |
|
||||||
|
sed -n "s/ Capabilities:.*cvolume.*/Capture/p"
|
||||||
|
}
|
||||||
|
|
||||||
|
volume() {
|
||||||
|
amixer -D $MIXER get $SCONTROL $(capability)
|
||||||
|
}
|
||||||
|
|
||||||
|
format() {
|
||||||
|
TYPE=""
|
||||||
|
TYPE_MUTE=""
|
||||||
|
if [[ $SCONTROL = "Master" ]]
|
||||||
|
then
|
||||||
|
# TYPE_MUTE=" "
|
||||||
|
# TYPE=" "
|
||||||
|
TYPE="vol "
|
||||||
|
TYPE_MUTE="vol "
|
||||||
|
elif [[ $SCONTROL = "Capture" ]]
|
||||||
|
then
|
||||||
|
# TYPE_MUTE=" "
|
||||||
|
# TYPE=" "
|
||||||
|
TYPE="mic "
|
||||||
|
TYPE_MUTE="mic "
|
||||||
|
fi
|
||||||
|
perl_filter='if (/.*\[(\d+%)\] (\[(-?\d+.\d+dB)\] )?\[(on|off)\]/)'
|
||||||
|
perl_filter+='{CORE::say $4 eq "off" ? "'
|
||||||
|
perl_filter+=$TYPE_MUTE
|
||||||
|
perl_filter+=$([[ $STEP = *dB ]] && echo '$3' || echo '$1')
|
||||||
|
perl_filter+='\n\n#f2777a" : "'
|
||||||
|
perl_filter+=$TYPE
|
||||||
|
# If dB was selected, print that instead
|
||||||
|
perl_filter+=$([[ $STEP = *dB ]] && echo '$3' || echo '$1')
|
||||||
|
perl_filter+='\n\n#99cc99"; exit}'
|
||||||
|
perl -ne "$perl_filter"
|
||||||
|
}
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------
|
||||||
|
|
||||||
|
case $BLOCK_BUTTON in
|
||||||
|
3) amixer -q -D $MIXER sset $SCONTROL $(capability) 1%+ ;;
|
||||||
|
1) amixer -q -D $MIXER sset $SCONTROL $(capability) 1%- ;;
|
||||||
|
2) amixer -q -D $MIXER sset $SCONTROL $(capability) toggle ;; # right click, mute/unmute
|
||||||
|
4) amixer -q -D $MIXER sset $SCONTROL $(capability) ${STEP}+ ;; # scroll up, increase
|
||||||
|
5) amixer -q -D $MIXER sset $SCONTROL $(capability) ${STEP}- ;; # scroll down, decrease
|
||||||
|
esac
|
||||||
|
|
||||||
|
volume | format
|
11
.i3blocks/vpn
Executable file
11
.i3blocks/vpn
Executable file
|
@ -0,0 +1,11 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
echo VPN
|
||||||
|
echo VPN
|
||||||
|
|
||||||
|
if [ -e "/var/run/vpnc/defaultroute" ]
|
||||||
|
then
|
||||||
|
echo "#00FFFF"
|
||||||
|
else
|
||||||
|
echo "#386587"
|
||||||
|
fi
|
46
.i3blocks/wifi
Executable file
46
.i3blocks/wifi
Executable file
|
@ -0,0 +1,46 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# Copyright (C) 2014 Alexander Keller <github@nycroth.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 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:-wlan0}"
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# As per #36 -- It is transparent: e.g. if the machine has no battery or wireless
|
||||||
|
# connection (think desktop), the corresponding block should not be displayed.
|
||||||
|
[[ ! -d /sys/class/net/${INTERFACE}/wireless ]] ||
|
||||||
|
[[ "$(cat /sys/class/net/$INTERFACE/operstate)" = 'down' ]] && exit
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------
|
||||||
|
|
||||||
|
QUALITY=$(grep $INTERFACE /proc/net/wireless | awk '{ print int($3 * 100 / 70) }')
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------
|
||||||
|
|
||||||
|
echo $QUALITY% # full text
|
||||||
|
echo $QUALITY% # short text
|
||||||
|
|
||||||
|
# color
|
||||||
|
if [[ $QUALITY -ge 80 ]]; then
|
||||||
|
echo "#00FF00"
|
||||||
|
elif [[ $QUALITY -lt 80 ]]; then
|
||||||
|
echo "#FFF600"
|
||||||
|
elif [[ $QUALITY -lt 60 ]]; then
|
||||||
|
echo "#FFAE00"
|
||||||
|
elif [[ $QUALITY -lt 40 ]]; then
|
||||||
|
echo "#FF0000"
|
||||||
|
fi
|
|
@ -1,3 +1,8 @@
|
||||||
let g:netrw_dirhistmax =10
|
let g:netrw_dirhistmax =10
|
||||||
let g:netrw_dirhist_cnt =1
|
let g:netrw_dirhist_cnt =6
|
||||||
let g:netrw_dirhist_1='/boot/grub/themes/Archlinux'
|
let g:netrw_dirhist_1='/boot/grub/themes/Archlinux'
|
||||||
|
let g:netrw_dirhist_2='/home/breizh/.config/i3'
|
||||||
|
let g:netrw_dirhist_3='/home/breizh/projects'
|
||||||
|
let g:netrw_dirhist_4='/home/breizh/.config/fisherman/transfer'
|
||||||
|
let g:netrw_dirhist_5='/home/breizh/Documents/IUT/Licence/Admin_Réseaux'
|
||||||
|
let g:netrw_dirhist_6='/home/breizh/Documents/IUT/Licence/Admin_Réseaux/TP4'
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 2d991f14f688a38b7b2bcd397bad5efadd0f80a9
|
Subproject commit ee13503508ee52c62b16a79ada86779e0cb46886
|
|
@ -1,30 +0,0 @@
|
||||||
#!/usr/bin/fish
|
|
||||||
|
|
||||||
for folder in *
|
|
||||||
echo -n "[ ] Mise à jour de $folder"
|
|
||||||
if test -d $folder
|
|
||||||
cd $folder
|
|
||||||
git pull >/dev/null ^/dev/null
|
|
||||||
and begin
|
|
||||||
echo -en "\r[ "
|
|
||||||
set_color green
|
|
||||||
echo -n OK
|
|
||||||
set_color normal
|
|
||||||
echo " ]"
|
|
||||||
end
|
|
||||||
or begin
|
|
||||||
echo -en "\r["
|
|
||||||
set_color red
|
|
||||||
echo FAIL
|
|
||||||
set_color normal
|
|
||||||
echo -n "]"
|
|
||||||
end
|
|
||||||
cd -
|
|
||||||
else
|
|
||||||
echo -ne "\r["
|
|
||||||
set_color yellow
|
|
||||||
echo -n SKIP
|
|
||||||
set_color normal
|
|
||||||
echo "]"
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 9f383b92beb73b75f8920d9cdebe11cc42c90d93
|
Subproject commit 40fe641708c58476c3a1b9aeafb68dd888d4920b
|
|
@ -16,3 +16,4 @@ if filereadable(expand("~/.vimrc_background"))
|
||||||
endif
|
endif
|
||||||
source ~/.vimrc_background
|
source ~/.vimrc_background
|
||||||
endif
|
endif
|
||||||
|
cmap w!! w !sudo tee > /dev/null %
|
||||||
|
|
Loading…
Reference in a new issue