[+] First Commit

This commit is contained in:
Simon Rieger 2023-01-30 14:28:59 +01:00
commit 479cba9eac
1137 changed files with 120430 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 MiB

45
dot_bash_profile Normal file
View file

@ -0,0 +1,45 @@
if [ -z $DISPLAY ] && [ "$(tty)" = "/dev/tty1" ]; then
# First make sure dbus is started
if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then
export DBUS_SESSION_BUS_ADDRESS="$(dbus-daemon --session --fork --print-address)"
fi
echo "D-Bus per-session daemon address is: $DBUS_SESSION_BUS_ADDRESS"
# Set XDG_RUNTIME_DIR
# Paragraph modified from https://wiki.gentoo.org/wiki/Sway
if [ -z "${XDG_RUNTIME_DIR}" ]; then
export XDG_RUNTIME_DIR="/tmp/${UID}-runtime-dir"
if ! [ -d "${XDG_RUNTIME_DIR}" ]; then
mkdir "${XDG_RUNTIME_DIR}"
chmod 0700 "${XDG_RUNTIME_DIR}"
fi
fi
# Enable SSH agent
eval $(keychain --noask --eval --quiet)
# Various exports
#export SHELL="$(command -v zsh)"
export QT_QPA_PLATFORMTHEME=qt5ct
export QT_QPA_PLATFORM=wayland
export GDK_BACKEND=wayland
export XDG_SESSION_TYPE=wayland
export XDG_CURRENT_DESKTOP=sway
export WLR_NO_HARDWARE_CURSORS=1
export _JAVA_AWT_WM_NONREPARENTING=1 #Make java programs work somewhat
export PAN_MESA_DEBUG=gl3 #Fix alacritty not starting
export MOZ_ENABLE_WAYLAND=1 # Fix firefox not starting
export PATH="$PATH:~/.local/bin/"
export PATH="$PATH:~/go/bin/"
export PATH="$PATH:~/.local/share/flatpak/exports/bin/"
#export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:~/.local/lib/
exec sway
fi

View file

@ -0,0 +1,895 @@
# Configuration for Alacritty, the GPU enhanced terminal emulator.
# Import additional configuration files
#
# Imports are loaded in order, skipping all missing files, with the importing
# file being loaded last. If a field is already present in a previous import, it
# will be replaced.
#
# All imports must either be absolute paths starting with `/`, or paths relative
# to the user's home directory starting with `~/`.
#import:
# - /path/to/alacritty.yml
# Any items in the `env` entry below will be added as
# environment variables. Some entries may override variables
# set by alacritty itself.
#env:
# TERM variable
#
# This value is used to set the `$TERM` environment variable for
# each instance of Alacritty. If it is not present, alacritty will
# check the local terminfo database and use `alacritty` if it is
# available, otherwise `xterm-256color` is used.
#TERM: alacritty
#window:
# Window dimensions (changes require restart)
#
# Number of lines/columns (not pixels) in the terminal. Both lines and columns
# must be non-zero for this to take effect. The number of columns must be at
# least `2`, while using a value of `0` for columns and lines will fall back
# to the window manager's recommended size
#dimensions:
# columns: 0
# lines: 0
# Window position (changes require restart)
#
# Specified in number of pixels.
# If the position is not set, the window manager will handle the placement.
#position:
# x: 0
# y: 0
# Window padding (changes require restart)
#
# Blank space added around the window in pixels. This padding is scaled
# by DPI and the specified value is always added at both opposing sides.
#padding:
# x: 0
# y: 0
# Spread additional padding evenly around the terminal content.
#dynamic_padding: false
# Window decorations
#
# Values for `decorations`:
# - full: Borders and title bar
# - none: Neither borders nor title bar
#
# Values for `decorations` (macOS only):
# - transparent: Title bar, transparent background and title bar buttons
# - buttonless: Title bar, transparent background and no title bar buttons
#decorations: full
# Background opacity
#
# Window opacity as a floating point number from `0.0` to `1.0`.
# The value `0.0` is completely transparent and `1.0` is opaque.
#opacity: 1.0
# Startup Mode (changes require restart)
#
# Values for `startup_mode`:
# - Windowed
# - Maximized
# - Fullscreen
#
# Values for `startup_mode` (macOS only):
# - SimpleFullscreen
#startup_mode: Windowed
# Window title
#title: Alacritty
# Allow terminal applications to change Alacritty's window title.
#dynamic_title: true
# Window class (Linux/BSD only):
#class:
# Application instance name
#instance: Alacritty
# General application class
#general: Alacritty
# Decorations theme variant (Linux/BSD only)
#
# Override the variant of the GTK theme/Wayland client side decorations.
# Commonly supported values are `dark` and `light`. Set this to `None` to use
# the default theme variant.
#decorations_theme_variant: None
#scrolling:
# Maximum number of lines in the scrollback buffer.
# Specifying '0' will disable scrolling.
#history: 10000
# Scrolling distance multiplier.
#multiplier: 3
# Font configuration
#font:
# Normal (roman) font face
#normal:
# Font family
#
# Default:
# - (macOS) Menlo
# - (Linux/BSD) monospace
# - (Windows) Consolas
#family: monospace
# The `style` can be specified to pick a specific face.
#style: Regular
# Bold font face
#bold:
# Font family
#
# If the bold family is not specified, it will fall back to the
# value specified for the normal font.
#family: monospace
# The `style` can be specified to pick a specific face.
#style: Bold
# Italic font face
#italic:
# Font family
#
# If the italic family is not specified, it will fall back to the
# value specified for the normal font.
#family: monospace
# The `style` can be specified to pick a specific face.
#style: Italic
# Bold italic font face
#bold_italic:
# Font family
#
# If the bold italic family is not specified, it will fall back to the
# value specified for the normal font.
#family: monospace
# The `style` can be specified to pick a specific face.
#style: Bold Italic
# Point size
#size: 11.0
# Offset is the extra space around each character. `offset.y` can be thought
# of as modifying the line spacing, and `offset.x` as modifying the letter
# spacing.
#offset:
# x: 0
# y: 0
# Glyph offset determines the locations of the glyphs within their cells with
# the default being at the bottom. Increasing `x` moves the glyph to the
# right, increasing `y` moves the glyph upward.
#glyph_offset:
# x: 0
# y: 0
# Use built-in font for box drawing characters.
#
# If `true`, Alacritty will use a custom built-in font for box drawing
# characters (Unicode points 2500 - 259f).
#
#builtin_box_drawing: true
# If `true`, bold text is drawn using the bright color variants.
#draw_bold_text_with_bright_colors: false
# Colors (Tomorrow Night)
#colors:
# Default colors
#primary:
# background: '#1d1f21'
# foreground: '#c5c8c6'
# Bright and dim foreground colors
#
# The dimmed foreground color is calculated automatically if it is not
# present. If the bright foreground color is not set, or
# `draw_bold_text_with_bright_colors` is `false`, the normal foreground
# color will be used.
#dim_foreground: '#828482'
#bright_foreground: '#eaeaea'
# Cursor colors
#
# Colors which should be used to draw the terminal cursor.
#
# Allowed values are CellForeground/CellBackground, which reference the
# affected cell, or hexadecimal colors like #ff00ff.
#cursor:
# text: CellBackground
# cursor: CellForeground
# Vi mode cursor colors
#
# Colors for the cursor when the vi mode is active.
#
# Allowed values are CellForeground/CellBackground, which reference the
# affected cell, or hexadecimal colors like #ff00ff.
#vi_mode_cursor:
# text: CellBackground
# cursor: CellForeground
# Search colors
#
# Colors used for the search bar and match highlighting.
#search:
# Allowed values are CellForeground/CellBackground, which reference the
# affected cell, or hexadecimal colors like #ff00ff.
#matches:
# foreground: '#000000'
# background: '#ffffff'
#focused_match:
# foreground: '#ffffff'
# background: '#000000'
# Keyboard hints
#hints:
# First character in the hint label
#
# Allowed values are CellForeground/CellBackground, which reference the
# affected cell, or hexadecimal colors like #ff00ff.
#start:
# foreground: '#1d1f21'
# background: '#e9ff5e'
# All characters after the first one in the hint label
#
# Allowed values are CellForeground/CellBackground, which reference the
# affected cell, or hexadecimal colors like #ff00ff.
#end:
# foreground: '#e9ff5e'
# background: '#1d1f21'
# Line indicator
#
# Color used for the indicator displaying the position in history during
# search and vi mode.
#
# By default, these will use the opposing primary color.
#line_indicator:
# foreground: None
# background: None
# Footer bar
#
# Color used for the footer bar on the bottom, used by search regex input,
# hyperlink URI preview, etc.
#
#footer_bar:
# background: '#c5c8c6'
# foreground: '#1d1f21'
# Selection colors
#
# Colors which should be used to draw the selection area.
#
# Allowed values are CellForeground/CellBackground, which reference the
# affected cell, or hexadecimal colors like #ff00ff.
#selection:
# text: CellBackground
# background: CellForeground
# Normal colors
#normal:
# black: '#1d1f21'
# red: '#cc6666'
# green: '#b5bd68'
# yellow: '#f0c674'
# blue: '#81a2be'
# magenta: '#b294bb'
# cyan: '#8abeb7'
# white: '#c5c8c6'
# Bright colors
#bright:
# black: '#666666'
# red: '#d54e53'
# green: '#b9ca4a'
# yellow: '#e7c547'
# blue: '#7aa6da'
# magenta: '#c397d8'
# cyan: '#70c0b1'
# white: '#eaeaea'
# Dim colors
#
# If the dim colors are not set, they will be calculated automatically based
# on the `normal` colors.
#dim:
# black: '#131415'
# red: '#864343'
# green: '#777c44'
# yellow: '#9e824c'
# blue: '#556a7d'
# magenta: '#75617b'
# cyan: '#5b7d78'
# white: '#828482'
# Indexed Colors
#
# The indexed colors include all colors from 16 to 256.
# When these are not set, they're filled with sensible defaults.
#
# Example:
# `- { index: 16, color: '#ff00ff' }`
#
#indexed_colors: []
# Transparent cell backgrounds
#
# Whether or not `window.opacity` applies to all cell backgrounds or only to
# the default background. When set to `true` all cells will be transparent
# regardless of their background color.
#transparent_background_colors: false
# Bell
#
# The bell is rung every time the BEL control character is received.
#bell:
# Visual Bell Animation
#
# Animation effect for flashing the screen when the visual bell is rung.
#
# Values for `animation`:
# - Ease
# - EaseOut
# - EaseOutSine
# - EaseOutQuad
# - EaseOutCubic
# - EaseOutQuart
# - EaseOutQuint
# - EaseOutExpo
# - EaseOutCirc
# - Linear
#animation: EaseOutExpo
# Duration of the visual bell flash in milliseconds. A `duration` of `0` will
# disable the visual bell animation.
#duration: 0
# Visual bell animation color.
#color: '#ffffff'
# Bell Command
#
# This program is executed whenever the bell is rung.
#
# When set to `command: None`, no command will be executed.
#
# Example:
# command:
# program: notify-send
# args: ["Hello, World!"]
#
#command: None
#selection:
# This string contains all characters that are used as separators for
# "semantic words" in Alacritty.
#semantic_escape_chars: ",│`|:\"' ()[]{}<>\t"
# When set to `true`, selected text will be copied to the primary clipboard.
#save_to_clipboard: false
#cursor:
# Cursor style
#style:
# Cursor shape
#
# Values for `shape`:
# - ▇ Block
# - _ Underline
# - | Beam
#shape: Block
# Cursor blinking state
#
# Values for `blinking`:
# - Never: Prevent the cursor from ever blinking
# - Off: Disable blinking by default
# - On: Enable blinking by default
# - Always: Force the cursor to always blink
#blinking: Off
# Vi mode cursor style
#
# If the vi mode cursor style is `None` or not specified, it will fall back to
# the style of the active value of the normal cursor.
#
# See `cursor.style` for available options.
#vi_mode_style: None
# Cursor blinking interval in milliseconds.
#blink_interval: 750
# Time after which cursor stops blinking, in seconds.
#
# Specifying '0' will disable timeout for blinking.
#blink_timeout: 5
# If this is `true`, the cursor will be rendered as a hollow box when the
# window is not focused.
#unfocused_hollow: true
# Thickness of the cursor relative to the cell width as floating point number
# from `0.0` to `1.0`.
#thickness: 0.15
# Live config reload (changes require restart)
#live_config_reload: true
# Shell
#
# You can set `shell.program` to the path of your favorite shell, e.g.
# `/bin/fish`. Entries in `shell.args` are passed unmodified as arguments to the
# shell.
#
# Default:
# - (Linux/BSD/macOS) `$SHELL` or the user's login shell, if `$SHELL` is unset
# - (Windows) powershell
#shell:
# program: /bin/bash
# args:
# - --login
# Startup directory
#
# Directory the shell is started in. If this is unset, or `None`, the working
# directory of the parent process will be used.
#working_directory: None
# Send ESC (\x1b) before characters when alt is pressed.
#alt_send_esc: true
# Offer IPC using `alacritty msg` (unix only)
#ipc_socket: true
#mouse:
# Click settings
#
# The `double_click` and `triple_click` settings control the time
# alacritty should wait for accepting multiple clicks as one double
# or triple click.
#double_click: { threshold: 300 }
#triple_click: { threshold: 300 }
# If this is `true`, the cursor is temporarily hidden when typing.
#hide_when_typing: false
# Hints
#
# Terminal hints can be used to find text or hyperlink in the visible part of
# the terminal and pipe it to other applications.
#hints:
# Keys used for the hint labels.
#alphabet: "jfkdls;ahgurieowpq"
# List with all available hints
#
# Each hint must have any of `regex` or `hyperlinks` field and either an
# `action` or a `command` field. The fields `mouse`, `binding` and
# `post_processing` are optional.
#
# The `hyperlinks` option will cause OSC 8 escape sequence hyperlinks to be
# highlighted.
#
# The fields `command`, `binding.key`, `binding.mods`, `binding.mode` and
# `mouse.mods` accept the same values as they do in the `key_bindings` section.
#
# The `mouse.enabled` field controls if the hint should be underlined while
# the mouse with all `mouse.mods` keys held or the vi mode cursor is above it.
#
# If the `post_processing` field is set to `true`, heuristics will be used to
# shorten the match if there are characters likely not to be part of the hint
# (e.g. a trailing `.`). This is most useful for URIs and applies only to
# `regex` matches.
#
# Values for `action`:
# - Copy
# Copy the hint's text to the clipboard.
# - Paste
# Paste the hint's text to the terminal or search.
# - Select
# Select the hint's text.
# - MoveViModeCursor
# Move the vi mode cursor to the beginning of the hint.
#enabled:
# - regex: "(ipfs:|ipns:|magnet:|mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)\
# [^\u0000-\u001F\u007F-\u009F<>\"\\s{-}\\^⟨⟩`]+"
# hyperlinks: true
# command: xdg-open
# post_processing: true
# mouse:
# enabled: true
# mods: None
# binding:
# key: U
# mods: Control|Shift
# Mouse bindings
#
# Mouse bindings are specified as a list of objects, much like the key
# bindings further below.
#
# To trigger mouse bindings when an application running within Alacritty
# captures the mouse, the `Shift` modifier is automatically added as a
# requirement.
#
# Each mouse binding will specify a:
#
# - `mouse`:
#
# - Middle
# - Left
# - Right
# - Numeric identifier such as `5`
#
# - `action` (see key bindings for actions not exclusive to mouse mode)
#
# - Mouse exclusive actions:
#
# - ExpandSelection
# Expand the selection to the current mouse cursor location.
#
# And optionally:
#
# - `mods` (see key bindings)
#mouse_bindings:
# - { mouse: Right, action: ExpandSelection }
# - { mouse: Right, mods: Control, action: ExpandSelection }
# - { mouse: Middle, mode: ~Vi, action: PasteSelection }
# Key bindings
#
# Key bindings are specified as a list of objects. For example, this is the
# default paste binding:
#
# `- { key: V, mods: Control|Shift, action: Paste }`
#
# Each key binding will specify a:
#
# - `key`: Identifier of the key pressed
#
# - A-Z
# - F1-F24
# - Key0-Key9
#
# A full list with available key codes can be found here:
# https://docs.rs/glutin/*/glutin/event/enum.VirtualKeyCode.html#variants
#
# Instead of using the name of the keys, the `key` field also supports using
# the scancode of the desired key. Scancodes have to be specified as a
# decimal number. This command will allow you to display the hex scancodes
# for certain keys:
#
# `showkey --scancodes`.
#
# Then exactly one of:
#
# - `chars`: Send a byte sequence to the running application
#
# The `chars` field writes the specified string to the terminal. This makes
# it possible to pass escape sequences. To find escape codes for bindings
# like `PageUp` (`"\x1b[5~"`), you can run the command `showkey -a` outside
# of tmux. Note that applications use terminfo to map escape sequences back
# to keys. It is therefore required to update the terminfo when changing an
# escape sequence.
#
# - `action`: Execute a predefined action
#
# - ToggleViMode
# - SearchForward
# Start searching toward the right of the search origin.
# - SearchBackward
# Start searching toward the left of the search origin.
# - Copy
# - Paste
# - IncreaseFontSize
# - DecreaseFontSize
# - ResetFontSize
# - ScrollPageUp
# - ScrollPageDown
# - ScrollHalfPageUp
# - ScrollHalfPageDown
# - ScrollLineUp
# - ScrollLineDown
# - ScrollToTop
# - ScrollToBottom
# - ClearHistory
# Remove the terminal's scrollback history.
# - Hide
# Hide the Alacritty window.
# - Minimize
# Minimize the Alacritty window.
# - Quit
# Quit Alacritty.
# - ToggleFullscreen
# - SpawnNewInstance
# Spawn a new instance of Alacritty.
# - CreateNewWindow
# Create a new Alacritty window from the current process.
# - ClearLogNotice
# Clear Alacritty's UI warning and error notice.
# - ClearSelection
# Remove the active selection.
# - ReceiveChar
# - None
#
# - Vi mode exclusive actions:
#
# - Open
# Perform the action of the first matching hint under the vi mode cursor
# with `mouse.enabled` set to `true`.
# - ToggleNormalSelection
# - ToggleLineSelection
# - ToggleBlockSelection
# - ToggleSemanticSelection
# Toggle semantic selection based on `selection.semantic_escape_chars`.
# - CenterAroundViCursor
# Center view around vi mode cursor
#
# - Vi mode exclusive cursor motion actions:
#
# - Up
# One line up.
# - Down
# One line down.
# - Left
# One character left.
# - Right
# One character right.
# - First
# First column, or beginning of the line when already at the first column.
# - Last
# Last column, or beginning of the line when already at the last column.
# - FirstOccupied
# First non-empty cell in this terminal row, or first non-empty cell of
# the line when already at the first cell of the row.
# - High
# Top of the screen.
# - Middle
# Center of the screen.
# - Low
# Bottom of the screen.
# - SemanticLeft
# Start of the previous semantically separated word.
# - SemanticRight
# Start of the next semantically separated word.
# - SemanticLeftEnd
# End of the previous semantically separated word.
# - SemanticRightEnd
# End of the next semantically separated word.
# - WordLeft
# Start of the previous whitespace separated word.
# - WordRight
# Start of the next whitespace separated word.
# - WordLeftEnd
# End of the previous whitespace separated word.
# - WordRightEnd
# End of the next whitespace separated word.
# - Bracket
# Character matching the bracket at the cursor's location.
# - SearchNext
# Beginning of the next match.
# - SearchPrevious
# Beginning of the previous match.
# - SearchStart
# Start of the match to the left of the vi mode cursor.
# - SearchEnd
# End of the match to the right of the vi mode cursor.
#
# - Search mode exclusive actions:
# - SearchFocusNext
# Move the focus to the next search match.
# - SearchFocusPrevious
# Move the focus to the previous search match.
# - SearchConfirm
# - SearchCancel
# - SearchClear
# Reset the search regex.
# - SearchDeleteWord
# Delete the last word in the search regex.
# - SearchHistoryPrevious
# Go to the previous regex in the search history.
# - SearchHistoryNext
# Go to the next regex in the search history.
#
# - macOS exclusive actions:
# - ToggleSimpleFullscreen
# Enter fullscreen without occupying another space.
#
# - Linux/BSD exclusive actions:
#
# - CopySelection
# Copy from the selection buffer.
# - PasteSelection
# Paste from the selection buffer.
#
# - `command`: Fork and execute a specified command plus arguments
#
# The `command` field must be a map containing a `program` string and an
# `args` array of command line parameter strings. For example:
# `{ program: "alacritty", args: ["-e", "vttest"] }`
#
# And optionally:
#
# - `mods`: Key modifiers to filter binding actions
#
# - Command
# - Control
# - Option
# - Super
# - Shift
# - Alt
#
# Multiple `mods` can be combined using `|` like this:
# `mods: Control|Shift`.
# Whitespace and capitalization are relevant and must match the example.
#
# - `mode`: Indicate a binding for only specific terminal reported modes
#
# This is mainly used to send applications the correct escape sequences
# when in different modes.
#
# - AppCursor
# - AppKeypad
# - Search
# - Alt
# - Vi
#
# A `~` operator can be used before a mode to apply the binding whenever
# the mode is *not* active, e.g. `~Alt`.
#
# Bindings are always filled by default, but will be replaced when a new
# binding with the same triggers is defined. To unset a default binding, it can
# be mapped to the `ReceiveChar` action. Alternatively, you can use `None` for
# a no-op if you do not wish to receive input characters for that binding.
#
# If the same trigger is assigned to multiple actions, all of them are executed
# in the order they were defined in.
#key_bindings:
#- { key: Paste, action: Paste }
#- { key: Copy, action: Copy }
#- { key: L, mods: Control, action: ClearLogNotice }
#- { key: L, mods: Control, mode: ~Vi|~Search, chars: "\x0c" }
#- { key: PageUp, mods: Shift, mode: ~Alt, action: ScrollPageUp }
#- { key: PageDown, mods: Shift, mode: ~Alt, action: ScrollPageDown }
#- { key: Home, mods: Shift, mode: ~Alt, action: ScrollToTop }
#- { key: End, mods: Shift, mode: ~Alt, action: ScrollToBottom }
# Vi Mode
#- { key: Space, mods: Shift|Control, mode: ~Search, action: ToggleViMode }
#- { key: Space, mods: Shift|Control, mode: Vi|~Search, action: ScrollToBottom }
#- { key: Escape, mode: Vi|~Search, action: ClearSelection }
#- { key: I, mode: Vi|~Search, action: ToggleViMode }
#- { key: I, mode: Vi|~Search, action: ScrollToBottom }
#- { key: C, mods: Control, mode: Vi|~Search, action: ToggleViMode }
#- { key: Y, mods: Control, mode: Vi|~Search, action: ScrollLineUp }
#- { key: E, mods: Control, mode: Vi|~Search, action: ScrollLineDown }
#- { key: G, mode: Vi|~Search, action: ScrollToTop }
#- { key: G, mods: Shift, mode: Vi|~Search, action: ScrollToBottom }
#- { key: B, mods: Control, mode: Vi|~Search, action: ScrollPageUp }
#- { key: F, mods: Control, mode: Vi|~Search, action: ScrollPageDown }
#- { key: U, mods: Control, mode: Vi|~Search, action: ScrollHalfPageUp }
#- { key: D, mods: Control, mode: Vi|~Search, action: ScrollHalfPageDown }
#- { key: Y, mode: Vi|~Search, action: Copy }
#- { key: Y, mode: Vi|~Search, action: ClearSelection }
#- { key: Copy, mode: Vi|~Search, action: ClearSelection }
#- { key: V, mode: Vi|~Search, action: ToggleNormalSelection }
#- { key: V, mods: Shift, mode: Vi|~Search, action: ToggleLineSelection }
#- { key: V, mods: Control, mode: Vi|~Search, action: ToggleBlockSelection }
#- { key: V, mods: Alt, mode: Vi|~Search, action: ToggleSemanticSelection }
#- { key: Return, mode: Vi|~Search, action: Open }
#- { key: Z, mode: Vi|~Search, action: CenterAroundViCursor }
#- { key: K, mode: Vi|~Search, action: Up }
#- { key: J, mode: Vi|~Search, action: Down }
#- { key: H, mode: Vi|~Search, action: Left }
#- { key: L, mode: Vi|~Search, action: Right }
#- { key: Up, mode: Vi|~Search, action: Up }
#- { key: Down, mode: Vi|~Search, action: Down }
#- { key: Left, mode: Vi|~Search, action: Left }
#- { key: Right, mode: Vi|~Search, action: Right }
#- { key: Key0, mode: Vi|~Search, action: First }
#- { key: Key4, mods: Shift, mode: Vi|~Search, action: Last }
#- { key: Key6, mods: Shift, mode: Vi|~Search, action: FirstOccupied }
#- { key: H, mods: Shift, mode: Vi|~Search, action: High }
#- { key: M, mods: Shift, mode: Vi|~Search, action: Middle }
#- { key: L, mods: Shift, mode: Vi|~Search, action: Low }
#- { key: B, mode: Vi|~Search, action: SemanticLeft }
#- { key: W, mode: Vi|~Search, action: SemanticRight }
#- { key: E, mode: Vi|~Search, action: SemanticRightEnd }
#- { key: B, mods: Shift, mode: Vi|~Search, action: WordLeft }
#- { key: W, mods: Shift, mode: Vi|~Search, action: WordRight }
#- { key: E, mods: Shift, mode: Vi|~Search, action: WordRightEnd }
#- { key: Key5, mods: Shift, mode: Vi|~Search, action: Bracket }
#- { key: Slash, mode: Vi|~Search, action: SearchForward }
#- { key: Slash, mods: Shift, mode: Vi|~Search, action: SearchBackward }
#- { key: N, mode: Vi|~Search, action: SearchNext }
#- { key: N, mods: Shift, mode: Vi|~Search, action: SearchPrevious }
# Search Mode
#- { key: Return, mode: Search|Vi, action: SearchConfirm }
#- { key: Escape, mode: Search, action: SearchCancel }
#- { key: C, mods: Control, mode: Search, action: SearchCancel }
#- { key: U, mods: Control, mode: Search, action: SearchClear }
#- { key: W, mods: Control, mode: Search, action: SearchDeleteWord }
#- { key: P, mods: Control, mode: Search, action: SearchHistoryPrevious }
#- { key: N, mods: Control, mode: Search, action: SearchHistoryNext }
#- { key: Up, mode: Search, action: SearchHistoryPrevious }
#- { key: Down, mode: Search, action: SearchHistoryNext }
#- { key: Return, mode: Search|~Vi, action: SearchFocusNext }
#- { key: Return, mods: Shift, mode: Search|~Vi, action: SearchFocusPrevious }
# (Windows, Linux, and BSD only)
#- { key: V, mods: Control|Shift, mode: ~Vi, action: Paste }
#- { key: C, mods: Control|Shift, action: Copy }
#- { key: F, mods: Control|Shift, mode: ~Search, action: SearchForward }
#- { key: B, mods: Control|Shift, mode: ~Search, action: SearchBackward }
#- { key: C, mods: Control|Shift, mode: Vi|~Search, action: ClearSelection }
#- { key: Insert, mods: Shift, action: PasteSelection }
#- { key: Key0, mods: Control, action: ResetFontSize }
#- { key: Equals, mods: Control, action: IncreaseFontSize }
#- { key: Plus, mods: Control, action: IncreaseFontSize }
#- { key: NumpadAdd, mods: Control, action: IncreaseFontSize }
#- { key: Minus, mods: Control, action: DecreaseFontSize }
#- { key: NumpadSubtract, mods: Control, action: DecreaseFontSize }
# (Windows only)
#- { key: Return, mods: Alt, action: ToggleFullscreen }
# (macOS only)
#- { key: K, mods: Command, mode: ~Vi|~Search, chars: "\x0c" }
#- { key: K, mods: Command, mode: ~Vi|~Search, action: ClearHistory }
#- { key: Key0, mods: Command, action: ResetFontSize }
#- { key: Equals, mods: Command, action: IncreaseFontSize }
#- { key: Plus, mods: Command, action: IncreaseFontSize }
#- { key: NumpadAdd, mods: Command, action: IncreaseFontSize }
#- { key: Minus, mods: Command, action: DecreaseFontSize }
#- { key: NumpadSubtract, mods: Command, action: DecreaseFontSize }
#- { key: V, mods: Command, action: Paste }
#- { key: C, mods: Command, action: Copy }
#- { key: C, mods: Command, mode: Vi|~Search, action: ClearSelection }
#- { key: H, mods: Command, action: Hide }
#- { key: H, mods: Command|Alt, action: HideOtherApplications }
#- { key: M, mods: Command, action: Minimize }
#- { key: Q, mods: Command, action: Quit }
#- { key: W, mods: Command, action: Quit }
#- { key: N, mods: Command, action: SpawnNewInstance }
#- { key: F, mods: Command|Control, action: ToggleFullscreen }
#- { key: F, mods: Command, mode: ~Search, action: SearchForward }
#- { key: B, mods: Command, mode: ~Search, action: SearchBackward }
#debug:
# Display the time it takes to redraw each frame.
#render_timer: false
# Keep the log file after quitting Alacritty.
#persistent_logging: false
# Log level
#
# Values for `log_level`:
# - Off
# - Error
# - Warn
# - Info
# - Debug
# - Trace
#log_level: Warn
# Print all received window events.
#print_events: false
# Highlight window damage information.
#highlight_damage: false

View file

@ -0,0 +1,869 @@
# Configuration for Alacritty, the GPU enhanced terminal emulator.
# Any items in the `env` entry below will be added as
# environment variables. Some entries may override variables
# set by alacritty itself.
env:
# TERM variable
#
# This value is used to set the `$TERM` environment variable for
# each instance of Alacritty. If it is not present, alacritty will
# check the local terminfo database and use `alacritty` if it is
# available, otherwise `xterm-256color` is used.
TERM: xterm-256color
window:
# Window dimensions (changes require restart)
#
# Specified in number of columns/lines, not pixels.
# If both are `0`, this setting is ignored.
#dimensions:
# columns: 0
# lines: 0
# Window position (changes require restart)
#
# Specified in number of pixels.
# If the position is not set, the window manager will handle the placement.
#position:
# x: 0
# y: 0
# Window padding (changes require restart)
#
# Blank space added around the window in pixels. This padding is scaled
# by DPI and the specified value is always added at both opposing sides.
padding:
x: 6
y: 6
# Spread additional padding evenly around the terminal content.
dynamic_padding: false
# Background opacity
#
# Window opacity as a floating point number from `0.0` to `1.0`.
# The value `0.0` is completely transparent and `1.0` is opaque.
opacity: 1.0
# opacity: 0.80
# Window decorations
#
# Values for `decorations`:
# - full: Borders and title bar
# - none: Neither borders nor title bar
#
# Values for `decorations` (macOS only):
# - transparent: Title bar, transparent background and title bar buttons
# - buttonless: Title bar, transparent background, but no title bar buttons
#decorations: full
# Startup Mode (changes require restart)
#
# Values for `startup_mode`:
# - Windowed
# - Maximized
# - Fullscreen
#
# Values for `startup_mode` (macOS only):
# - SimpleFullscreen
#startup_mode: Windowed
# Window title
title: Alacritty
# Window class (Linux/BSD only):
class:
# Application instance name
instance: Alacritty
# General application class
general: Alacritty
# GTK theme variant (Linux/BSD only)
#
# Override the variant of the GTK theme. Commonly supported values are `dark` and `light`.
# Set this to `None` to use the default theme variant.
#gtk_theme_variant: None
scrolling:
# Maximum number of lines in the scrollback buffer.
# Specifying '0' will disable scrolling.
history: 5000
# Number of lines the viewport will move for every line scrolled when
# scrollback is enabled (history > 0).
#multiplier: 3
# Scroll to the bottom when new text is written to the terminal.
#auto_scroll: false
# Spaces per Tab (changes require restart)
#
# This setting defines the width of a tab in cells.
#
# Some applications, like Emacs, rely on knowing about the width of a tab.
# To prevent unexpected behavior in these applications, it's also required to
# change the `it` value in terminfo when altering this setting.
#tabspaces: 8
# Font configuration
font:
# Normal (roman) font face
normal:
# Font family
#
# Default:
# - (macOS) Menlo
# - (Linux/BSD) monospace
# - (Windows) Consolas
family: Source Code Pro
# family: CodeNewRoman Nerd Font
# family: RobotoMono Nerd Font
# family: Hack
# family: JetBrains Mono
# family: UbuntuMono Nerd Font
# family: Monofur Nerd Font
# family: TerminessTTF Nerd Font
# family: Mononoki Nerd Font
# The `style` can be specified to pick a specific face.
style: Regular
# Bold font face
bold:
# Font family
#
# If the bold family is not specified, it will fall back to the
# value specified for the normal font.
family: Source Code Pro
# family: CodeNewRoman Nerd Font
# family: RobotoMono Nerd Font
# family: Hack
# family: JetBrains Mono
# family: UbuntuMono Nerd Font
# family: Monofur Nerd Font
# family: TerminessTTF Nerd Font
# family: Mononoki Nerd Font
# The `style` can be specified to pick a specific face.
style: Bold
# Italic font face
italic:
# Font family
#
# If the italic family is not specified, it will fall back to the
# value specified for the normal font.
family: Source Code Pro
# family: CodeNewRoman Nerd Font
# family: RobotoMono Nerd Font
# family: Hack
# family: JetBrains Mono
# family: UbuntuMono Nerd Font
# family: Monofuritalic Nerd Font Mono
# family: TerminessTTF Nerd Font
# family: Mononoki Nerd Font
# The `style` can be specified to pick a specific face.
style: Italic
# Bold italic font face
bold_italic:
# Font family
#
# If the bold italic family is not specified, it will fall back to the
# value specified for the normal font.
family: Source Code Pro
# family: CodeNewRoman Nerd Font
# family: RobotoMono Nerd Font
# family: Hack
# family: JetBrains Mono
# family: UbuntuMono Nerd Font
# family: Monofuritalic Nerd Font Mono
# family: TerminessTTF Nerd Font
# family: Mononoki Nerd Font
# The `style` can be specified to pick a specific face.
style: Bold Italic
# Point size
size: 12.0
# Offset is the extra space around each character. `offset.y` can be thought of
# as modifying the line spacing, and `offset.x` as modifying the letter spacing.
offset:
x: 0
y: 1
# Glyph offset determines the locations of the glyphs within their cells with
# the default being at the bottom. Increasing `x` moves the glyph to the right,
# increasing `y` moves the glyph upwards.
#glyph_offset:
# x: 0
# y: 0
# Thin stroke font rendering (macOS only)
#
# Thin strokes are suitable for retina displays, but for non-retina screens
# it is recommended to set `use_thin_strokes` to `false`
#
# macOS >= 10.14.x:
#
# If the font quality on non-retina display looks bad then set
# `use_thin_strokes` to `true` and enable font smoothing by running the
# following command:
# `defaults write -g CGFontRenderingFontSmoothingDisabled -bool NO`
#
# This is a global setting and will require a log out or restart to take
# effect.
#use_thin_strokes: true
# If `true`, bold text is drawn using the bright color variants.
draw_bold_text_with_bright_colors: true
#######################################
## START OF COLOR SCHEMES ##
#######################################
schemes:
### Doom One ###
DoomOne: &DoomOne
primary:
background: '#282c34'
foreground: '#bbc2cf'
cursor:
text: CellBackground
cursor: '#528bff'
selection:
text: CellForeground
background: '#3e4451'
normal:
black: '#1c1f24'
red: '#ff6c6b'
green: '#98be65'
yellow: '#da8548'
blue: '#51afef'
magenta: '#c678dd'
cyan: '#5699af'
white: '#202328'
bright:
black: '#5b6268'
red: '#da8548'
green: '#4db5bd'
yellow: '#ecbe7b'
blue: '#3071db' # This is 2257a0 in Doom Emacs but I lightened it.
magenta: '#a9a1e1'
cyan: '#46d9ff'
white: '#dfdfdf'
### Dracula ###
Dracula: &Dracula
primary:
background: '#282a36'
foreground: '#f8f8f2'
cursor:
text: CellBackground
cursor: CellForeground
vi_mode_cursor:
text: CellBackground
cursor: CellForeground
search:
matches:
foreground: '#44475a'
background: '#50fa7b'
focused_match:
foreground: '#44475a'
background: '#ffb86c'
bar:
background: '#282a36'
foreground: '#f8f8f2'
line_indicator:
foreground: None
background: None
selection:
text: CellForeground
background: '#44475a'
normal:
black: '#000000'
red: '#ff5555'
green: '#50fa7b'
yellow: '#f1fa8c'
blue: '#bd93f9'
magenta: '#ff79c6'
cyan: '#8be9fd'
white: '#bfbfbf'
bright:
black: '#4d4d4d'
red: '#ff6e67'
green: '#5af78e'
yellow: '#f4f99d'
blue: '#caa9fa'
magenta: '#ff92d0'
cyan: '#9aedfe'
white: '#e6e6e6'
dim:
black: '#14151b'
red: '#ff2222'
green: '#1ef956'
yellow: '#ebf85b'
blue: '#4d5b86'
magenta: '#ff46b0'
cyan: '#59dffc'
white: '#e6e6d1'
### Gruvbox dark ###
GruvboxDark: &GruvboxDark
# Default colors
primary:
# hard contrast: background = '0x1d2021'
background: '#282828'
# soft contrast: background = '0x32302f'
foreground: '#ebdbb2'
# Normal colors
normal:
black: '#282828'
red: '#cc241d'
green: '#98971a'
yellow: '#d79921'
blue: '#458588'
magenta: '#b16286'
cyan: '#689d6a'
white: '#a89984'
# Bright colors
bright:
black: '#928374'
red: '#fb4934'
green: '#b8bb26'
yellow: '#fabd2f'
blue: '#83a598'
magenta: '#d3869b'
cyan: '#8ec07c'
white: '#ebdbb2'
### Monokai ###
MonokaiPro: &MonokaiPro
# Default colors
primary:
background: '#2D2A2E'
foreground: '#FCFCFA'
# Normal colors
normal:
black: '#403E41'
red: '#FF6188'
green: '#A9DC76'
yellow: '#FFD866'
blue: '#FC9867'
magenta: '#AB9DF2'
cyan: '#78DCE8'
white: '#FCFCFA'
# Bright colors
bright:
black: '#727072'
red: '#FF6188'
green: '#A9DC76'
yellow: '#FFD866'
blue: '#FC9867'
magenta: '#AB9DF2'
cyan: '#78DCE8'
white: '#FCFCFA'
### Nord ###
Nord: &Nord
# Default colors
primary:
background: '#2E3440'
foreground: '#D8DEE9'
# Normal colors
normal:
black: '#3B4252'
red: '#BF616A'
green: '#A3BE8C'
yellow: '#EBCB8B'
blue: '#81A1C1'
magenta: '#B48EAD'
cyan: '#88C0D0'
white: '#E5E9F0'
# Bright colors
bright:
black: '#4C566A'
red: '#BF616A'
green: '#A3BE8C'
yellow: '#EBCB8B'
blue: '#81A1C1'
magenta: '#B48EAD'
cyan: '#8FBCBB'
white: '#ECEFF4'
### Oceanic Next ###
OceanicNext: &OceanicNext
# Default colors
primary:
background: '#1b2b34'
foreground: '#d8dee9'
# Colors the cursor will use if `custom_cursor_colors` is true
cursor:
text: '#1b2b34'
cursor: '#ffffff'
# Normal colors
normal:
black: '#343d46'
red: '#EC5f67'
green: '#99C794'
yellow: '#FAC863'
blue: '#6699cc'
magenta: '#c594c5'
cyan: '#5fb3b3'
white: '#d8dee9'
# Bright colors
bright:
black: '#343d46'
red: '#EC5f67'
green: '#99C794'
yellow: '#FAC863'
blue: '#6699cc'
magenta: '#c594c5'
cyan: '#5fb3b3'
white: '#d8dee9'
### Palenight ###
Palenight: &Palenight
# Default colors
primary:
background: '#292d3e'
foreground: '#d0d0d0'
# Normal colors
normal:
black: '#292d3e'
red: '#f07178'
green: '#c3e88d'
yellow: '#ffcb6b'
blue: '#82aaff'
magenta: '#c792ea'
cyan: '#89ddff'
white: '#d0d0d0'
# Bright colors
bright:
black: '#434758'
red: '#ff8b92'
green: '#ddffa7'
yellow: '#ffe585'
blue: '#9cc4ff'
magenta: '#e1acff'
cyan: '#a3f7ff'
white: '#ffffff'
### Solarized Dark ###
SolarizedDark: &SolarizedDark
# Default colors
primary:
background: '#002b36' # base03
foreground: '#839496' # base0
# Cursor colors
cursor:
text: '#002b36' # base03
cursor: '#839496' # base0
# Normal colors
normal:
black: '#073642' # base02
red: '#dc322f' # red
green: '#859900' # green
yellow: '#b58900' # yellow
blue: '#268bd2' # blue
magenta: '#d33682' # magenta
cyan: '#2aa198' # cyan
white: '#eee8d5' # base2
# Bright colors
bright:
black: '#002b36' # base03
red: '#cb4b16' # orange
green: '#586e75' # base01
yellow: '#657b83' # base00
blue: '#839496' # base0
magenta: '#6c71c4' # violet
cyan: '#93a1a1' # base1
white: '#fdf6e3' # base3
### Solarized Light ###
SolarizedLight: &SolarizedLight
# Default colors
primary:
background: '#fdf6e3' # base3
foreground: '#657b83' # base00
# Cursor colors
cursor:
text: '#fdf6e3' # base3
cursor: '#657b83' # base00
# Normal colors
normal:
black: '#073642' # base02
red: '#dc322f' # red
green: '#859900' # green
yellow: '#b58900' # yellow
blue: '#268bd2' # blue
magenta: '#d33682' # magenta
cyan: '#2aa198' # cyan
white: '#eee8d5' # base2
# Bright colors
bright:
black: '#002b36' # base03
red: '#cb4b16' # orange
green: '#586e75' # base01
yellow: '#657b83' # base00
blue: '#839496' # base0
magenta: '#6c71c4' # violet
cyan: '#93a1a1' # base1
white: '#fdf6e3' # base3
### Tomorrow Night ###
TomorrowNight: &TomorrowNight
# Default colors
primary:
background: '#1d1f21'
foreground: '#c5c8c6'
# Colors the cursor will use if `custom_cursor_colors` is true
cursor:
text: '#1d1f21'
cursor: '#ffffff'
# Normal colors
normal:
black: '#1d1f21'
red: '#cc6666'
green: '#b5bd68'
yellow: '#e6c547'
blue: '#81a2be'
magenta: '#b294bb'
cyan: '#70c0ba'
white: '#373b41'
# Bright colors
bright:
black: '#666666'
red: '#ff3334'
green: '#9ec400'
yellow: '#f0c674'
blue: '#81a2be'
magenta: '#b77ee0'
cyan: '#54ced6'
white: '#282a2e'
######################################################################
## SET THEME: Choose ONE color scheme from those in the above list. ##
## ###################################################################
# Available themes are:
# *DoomOne
# *Dracula
# *GruvboxDark
# *MonokaiPro
# *Nord
# *OceanicNext
# *Palenight
# *SolarizedLight
# *SolarizedDark
# *TomorrowNight
colors: *Dracula
#######################################
## END OF COLOR SCHEMES ##
#######################################
# Visual Bell
#
# Any time the BEL code is received, Alacritty "rings" the visual bell. Once
# rung, the terminal background will be set to white and transition back to the
# default background color. You can control the rate of this transition by
# setting the `duration` property (represented in milliseconds). You can also
# configure the transition function by setting the `animation` property.
#
# Values for `animation`:
# - Ease
# - EaseOut
# - EaseOutSine
# - EaseOutQuad
# - EaseOutCubic
# - EaseOutQuart
# - EaseOutQuint
# - EaseOutExpo
# - EaseOutCirc
# - Linear
#
# Specifying a `duration` of `0` will disable the visual bell.
#visual_bell:
# animation: EaseOutExpo
# duration: 0
# color: '#ffffff'
selection:
#semantic_escape_chars: ",│`|:\"' ()[]{}<>\t"
# When set to `true`, selected text will be copied to the primary clipboard.
save_to_clipboard: true
# Allow terminal applications to change Alacritty's window title.
#dynamic_title: true
#cursor:
# Cursor style
#
# Values for `style`:
# - ▇ Block
# - _ Underline
# - | Beam
#style: Block
# If this is `true`, the cursor will be rendered as a hollow box when the
# window is not focused.
#unfocused_hollow: true
# Live config reload (changes require restart)
#live_config_reload: true
# Shell
#
# You can set `shell.program` to the path of your favorite shell, e.g. `/bin/fish`.
# Entries in `shell.args` are passed unmodified as arguments to the shell.
#
# Default:
# - (macOS) /bin/bash --login
# - (Linux/BSD) user login shell
# - (Windows) powershell
#shell:
# program: /bin/bash
# args:
# - --login
# Startup directory
#
# Directory the shell is started in. If this is unset, or `None`, the working
# directory of the parent process will be used.
#working_directory: None
# WinPTY backend (Windows only)
#
# Alacritty defaults to using the newer ConPTY backend if it is available,
# since it resolves a lot of bugs and is quite a bit faster. If it is not
# available, the the WinPTY backend will be used instead.
#
# Setting this option to `true` makes Alacritty use the legacy WinPTY backend,
# even if the ConPTY backend is available.
#winpty_backend: false
# Send ESC (\x1b) before characters when alt is pressed.
#alt_send_esc: true
#debug:
# Display the time it takes to redraw each frame.
#render_timer: false
# Keep the log file after quitting Alacritty.
#persistent_logging: false
# Log level
#
# Values for `log_level`:
# - None
# - Error
# - Warn
# - Info
# - Debug
# - Trace
#log_level: Warn
# Print all received window events.
#print_events: false
# Record all characters and escape sequences as test data.
#ref_test: false
#mouse:
# Click settings
#
# The `double_click` and `triple_click` settings control the time
# alacritty should wait for accepting multiple clicks as one double
# or triple click.
#double_click: { threshold: 300 }
#triple_click: { threshold: 300 }
# If this is `true`, the cursor is temporarily hidden when typing.
#hide_when_typing: false
#url:
# URL launcher
#
# This program is executed when clicking on a text which is recognized as a URL.
# The URL is always added to the command as the last parameter.
#
# When set to `None`, URL launching will be disabled completely.
#
# Default:
# - (macOS) open
# - (Linux/BSD) xdg-open
# - (Windows) explorer
#launcher:
# program: xdg-open
# args: []
# URL modifiers
#
# These are the modifiers that need to be held down for opening URLs when clicking
# on them. The available modifiers are documented in the key binding section.
#modifiers: None
# Mouse bindings
#
# Mouse bindings are specified as a list of objects, much like the key
# bindings further below.
#
# Each mouse binding will specify a:
#
# - `mouse`:
#
# - Middle
# - Left
# - Right
# - Numeric identifier such as `5`
#
# - `action` (see key bindings)
#
# And optionally:
#
# - `mods` (see key bindings)
#mouse_bindings:
# - { mouse: Middle, action: PasteSelection }
# Key bindings
#
# Key bindings are specified as a list of objects. For example, this is the
# default paste binding:
#
# `- { key: V, mods: Control|Shift, action: Paste }`
#
# Each key binding will specify a:
#
# - `key`: Identifier of the key pressed
#
# - A-Z
# - F1-F24
# - Key0-Key9
#
# A full list with available key codes can be found here:
# https://docs.rs/glutin/*/glutin/event/enum.VirtualKeyCode.html#variants
#
# Instead of using the name of the keys, the `key` field also supports using
# the scancode of the desired key. Scancodes have to be specified as a
# decimal number. This command will allow you to display the hex scancodes
# for certain keys:
#
# `showkey --scancodes`.
#
# Then exactly one of:
#
# - `chars`: Send a byte sequence to the running application
#
# The `chars` field writes the specified string to the terminal. This makes
# it possible to pass escape sequences. To find escape codes for bindings
# like `PageUp` (`"\x1b[5~"`), you can run the command `showkey -a` outside
# of tmux. Note that applications use terminfo to map escape sequences back
# to keys. It is therefore required to update the terminfo when changing an
# escape sequence.
#
# - `action`: Execute a predefined action
#
# - Copy
# - Paste
# - PasteSelection
# - IncreaseFontSize
# - DecreaseFontSize
# - ResetFontSize
# - ScrollPageUp
# - ScrollPageDown
# - ScrollLineUp
# - ScrollLineDown
# - ScrollToTop
# - ScrollToBottom
# - ClearHistory
# - Hide
# - Minimize
# - Quit
# - ToggleFullscreen
# - SpawnNewInstance
# - ClearLogNotice
# - ReceiveChar
# - None
#
# (macOS only):
# - ToggleSimpleFullscreen: Enters fullscreen without occupying another space
#
# - `command`: Fork and execute a specified command plus arguments
#
# The `command` field must be a map containing a `program` string and an
# `args` array of command line parameter strings. For example:
# `{ program: "alacritty", args: ["-e", "vttest"] }`
#
# And optionally:
#
# - `mods`: Key modifiers to filter binding actions
#
# - Command
# - Control
# - Option
# - Super
# - Shift
# - Alt
#
# Multiple `mods` can be combined using `|` like this:
# `mods: Control|Shift`.
# Whitespace and capitalization are relevant and must match the example.
#
# - `mode`: Indicate a binding for only specific terminal reported modes
#
# This is mainly used to send applications the correct escape sequences
# when in different modes.
#
# - AppCursor
# - AppKeypad
# - Alt
#
# A `~` operator can be used before a mode to apply the binding whenever
# the mode is *not* active, e.g. `~Alt`.
#
# Bindings are always filled by default, but will be replaced when a new
# binding with the same triggers is defined. To unset a default binding, it can
# be mapped to the `ReceiveChar` action. Alternatively, you can use `None` for
# a no-op if you do not wish to receive input characters for that binding.
key_bindings:
# (Windows, Linux, and BSD only)
- { key: V, mods: Control|Shift, action: Paste }
- { key: C, mods: Control|Shift, action: Copy }
- { key: Insert, mods: Shift, action: PasteSelection }
- { key: Key0, mods: Control, action: ResetFontSize }
- { key: Equals, mods: Control, action: IncreaseFontSize }
- { key: Plus, mods: Control, action: IncreaseFontSize }
- { key: Minus, mods: Control, action: DecreaseFontSize }
- { key: F11, mods: None, action: ToggleFullscreen }
- { key: Paste, mods: None, action: Paste }
- { key: Copy, mods: None, action: Copy }
- { key: L, mods: Control, action: ClearLogNotice }
- { key: L, mods: Control, chars: "\x0c" }
- { key: PageUp, mods: None, action: ScrollPageUp, mode: ~Alt }
- { key: PageDown, mods: None, action: ScrollPageDown, mode: ~Alt }
- { key: Home, mods: Shift, action: ScrollToTop, mode: ~Alt }
- { key: End, mods: Shift, action: ScrollToBottom, mode: ~Alt }

View file

@ -0,0 +1,2 @@
#!/bin/sh
paplay /usr/share/sounds/freedesktop/stereo/message.oga

View file

@ -0,0 +1,440 @@
# See dunst(5) for all configuration options
[global]
### Display ###
# 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 window manager that exports the
# _NET_ACTIVE_WINDOW property.
# This should be the case for almost all modern window managers.
#
# If this option is set to mouse or keyboard, the monitor option
# will be ignored.
follow = none
### Geometry ###
# dynamic width from 0 to 300
# width = (0, 300)
# constant width of 300
width = 600
# The maximum height of a single notification, excluding the frame.
height = 300
# Position the notification in the top right corner
origin = top-right
# Offset from the origin
offset = 10x50
# Scale factor. It is auto-detected if value is 0.
scale = 0
# Maximum number of notification (0 means no limit)
notification_limit = 0
### Progress bar ###
# Turn on the progess bar. It appears when a progress hint is passed with
# for example dunstify -h int:value:12
progress_bar = true
# Set the progress bar height. This includes the frame, so make sure
# it's at least twice as big as the frame width.
progress_bar_height = 10
# Set the frame width of the progress bar
progress_bar_frame_width = 1
# Set the minimum width for the progress bar
progress_bar_min_width = 150
# Set the maximum width for the progress bar
progress_bar_max_width = 600
# Show how many messages are currently hidden (because of
# notification_limit).
indicate_hidden = yes
# The transparency of the window. Range: [0; 100].
# This option will only work if a compositing window manager is
# present (e.g. xcompmgr, compiz, etc.). (X11 only)
transparency = 0
# Draw a line of "separator_height" pixel height between two
# notifications.
# Set to 0 to disable.
separator_height = 2
# Padding between text and separator.
padding = 8
# Horizontal padding.
horizontal_padding = 8
# Padding between text and icon.
text_icon_padding = 0
# Defines width in pixels of frame around the notification window.
# Set to 0 to disable.
frame_width = 3
# Defines color of the frame around the notification window.
frame_color = "#2f343f"
# 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 = frame
# Sort messages by urgency.
sort = yes
# 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.
# A client can set the 'transient' hint to bypass this. See the rules
# section for how to disable this if necessary
# idle_threshold = 120
### Text ###
font = pango:System San Francisco Display 12
# The spacing between lines. If the height is smaller than the
# font height, it will get raised to the font height.
line_height = 0
# Possible values are:
# full: Allow a small subset of html markup in notifications:
# <b>bold</b>
# <i>italic</i>
# <s>strikethrough</s>
# <u>underline</u>
#
# For a complete reference see
# <https://docs.gtk.org/Pango/pango_markup.html>.
#
# strip: This setting is provided for compatibility with some broken
# clients that send markup even though it's not enabled on the
# server. Dunst will try to strip the markup but the parsing is
# simplistic so using this option outside of matching rules for
# specific applications *IS GREATLY DISCOURAGED*.
#
# no: Disable markup parsing, incoming notifications will be treated as
# plain text. Dunst will not advertise that it has the body-markup
# capability if this is set as a global setting.
#
# It's important to note that markup inside the format option will be parsed
# regardless of what this is set to.
markup = full
# 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
# %n progress value if set without any extra characters
# %% Literal %
# Markup is allowed
format = "<b>%s</b>\n%b"
# Alignment of message text.
# Possible values are "left", "center" and "right".
alignment = left
# Vertical alignment of message text and icon.
# Possible values are "top", "center" and "bottom".
vertical_alignment = center
# Show age of message if message is older than show_age_threshold
# seconds.
# Set to -1 to disable.
show_age_threshold = 60
# Specify where to make an ellipsis in long lines.
# Possible values are "start", "middle" and "end".
ellipsize = middle
# Ignore newlines '\n' in notifications.
ignore_newline = no
# Stack together notifications with the same content
stack_duplicates = true
# Hide the count of stacked notifications with the same content
hide_duplicate_count = false
# Display indicators for URLs (U) and actions (A).
show_indicators = yes
### Icons ###
# Align icons left/right/off
icon_position = left
# Scale small icons up to this size, set to 0 to disable. Helpful
# for e.g. small files or high-dpi screens. In case of conflict,
# max_icon_size takes precedence over this.
min_icon_size = 0
# Scale larger icons down to this size, set to 0 to disable
max_icon_size = 32
# Paths to default icons.
icon_path = /usr/share/icons/Adwaita/16x16/status/:/usr/share/icons/Adwaita/16x16/devices/:/usr/share/icons/Adwaita/16x16/legacy/
### History ###
# 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
### Misc/Advanced ###
# dmenu path.
dmenu = /usr/bin/dmenu -p dunst:
# Browser for opening urls in context menu.
browser = /usr/bin/xdg-open
# Always run rule-defined scripts, even if the notification is suppressed
always_run_script = true
# Define the title of the windows spawned by dunst
title = Dunst
# Define the class of the windows spawned by dunst
class = Dunst
# Define the corner radius of the notification window
# in pixel size. If the radius is 0, you have no rounded
# corners.
# The radius will be automatically lowered if it exceeds half of the
# notification height to avoid clipping text and/or icons.
corner_radius = 0
# Ignore the dbus closeNotification message.
# Useful to enforce the timeout set by dunst configuration. Without this
# parameter, an application may close the notification sent before the
# user defined timeout.
ignore_dbusclose = false
### Wayland ###
# These settings are Wayland-specific. They have no effect when using X11
# Uncomment this if you want to let notications appear under fullscreen
# applications (default: overlay)
# layer = top
# Set this to true to use X11 output on Wayland.
force_xwayland = false
### Legacy
# Use the Xinerama extension instead of RandR for multi-monitor support.
# This setting is provided for compatibility with older nVidia drivers that
# do not support RandR and using it on systems that support RandR is highly
# discouraged.
#
# By enabling this setting dunst will not be able to detect when a monitor
# is connected or disconnected which might break follow mode if the screen
# layout changes.
force_xinerama = false
### mouse
# Defines list of actions for each mouse event
# Possible values are:
# * none: Don't do anything.
# * do_action: Invoke the action determined by the action_name rule. If there is no
# such action, open the context menu.
# * open_url: If the notification has exactly one url, open it. If there are multiple
# ones, open the context menu.
# * close_current: Close current notification.
# * close_all: Close all notifications.
# * context: Open context menu for the notification.
# * context_all: Open context menu for all notifications.
# These values can be strung together for each mouse event, and
# will be executed in sequence.
mouse_left_click = close_current
mouse_middle_click = do_action, close_current
mouse_right_click = close_all
# Experimental features that may or may not work correctly. Do not expect them
# to have a consistent behaviour across releases.
[experimental]
# Calculate the dpi to use on a per-monitor basis.
# If this setting is enabled the Xft.dpi value will be ignored and instead
# dunst will attempt to calculate an appropriate dpi value for each monitor
# using the resolution and physical size. This might be useful in setups
# where there are multiple screens with very different dpi values.
per_monitor_dpi = false
[urgency_low]
# IMPORTANT: colors have to be defined in quotation marks.
# Otherwise the "#" and following would be interpreted as a comment.
background = "#2f343f"
foreground = "#F9FAF9"
timeout = 10
# Icon for notifications with low urgency, uncomment to enable
#default_icon = /path/to/icon
[urgency_normal]
background = "#2f343f"
foreground = "#F9FAF9"
timeout = 10
# Icon for notifications with normal urgency, uncomment to enable
#default_icon = /path/to/icon
[urgency_critical]
background = "#D62929"
foreground = "#F9FAF9"
frame_color = "#ff0000"
timeout = 0
# Icon for notifications with critical urgency, uncomment to enable
#default_icon = /path/to/icon
# 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 (discouraged, see desktop_entry)
# body
# category
# desktop_entry
# icon
# match_transient
# msg_urgency
# stack_tag
# summary
#
# and you can override the
# background
# foreground
# format
# frame_color
# fullscreen
# new_icon
# set_stack_tag
# set_transient
# set_category
# timeout
# urgency
# skip_display
# history_ignore
# action_name
# word_wrap
# ellipsize
# alignment
#
# Shell-like globbing will get expanded.
#
# Instead of the appname filter, it's recommended to use the desktop_entry filter.
# GLib based applications export their desktop-entry name. In comparison to the appname,
# the desktop-entry won't get localized.
#
# 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: It might be helpful to run dunst -print in a terminal in order
# to find fitting options for rules.
# Disable the transient hint so that idle_threshold cannot be bypassed from the
# client
#[transient_disable]
# match_transient = yes
# set_transient = no
#
# Make the handling of transient notifications more strict by making them not
# be placed in history.
#[transient_history_ignore]
# match_transient = yes
# history_ignore = yes
# fullscreen values
# show: show the notifications, regardless if there is a fullscreen window opened
# delay: displays the new notification, if there is no fullscreen window active
# If the notification is already drawn, it won't get undrawn.
# pushback: same as delay, but when switching into fullscreen, the notification will get
# withdrawn from screen again and will get delayed like a new notification
#[fullscreen_delay_everything]
# fullscreen = delay
#[fullscreen_show_critical]
# msg_urgency = critical
# fullscreen = show
[play_sound]
summary = "*"
script = ~/.config/dunst/alert.sh
#[espeak]
# summary = "*"
# script = dunst_espeak.sh
#[script-test]
# summary = "*script*"
# script = dunst_test.sh
#[ignore]
# # This notification will not be displayed
# summary = "foobar"
# skip_display = true
#[history-ignore]
# # This notification will not be saved in history
# summary = "foobar"
# history_ignore = yes
#[skip-display]
# # This notification will not be displayed, but will be included in the history
# summary = "foobar"
# skip_display = yes
#[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
#
#[stack-volumes]
# appname = "some_volume_notifiers"
# set_stack_tag = "volume"
#
# vim: ft=cfg

View file

@ -0,0 +1,6 @@
# erstellt von KDE-Plasma, Mo. Okt. 3 18:08:55 2022
#
#include "/usr/share/themes/Breeze/gtk-2.0/gtkrc"
#gtk-theme-name="Breeze"

View file

@ -0,0 +1,5 @@
# erstellt von KDE-Plasma, Mo. Okt. 3 18:08:55 2022
#
#gtk-alternative-button-order = 1

View file

@ -0,0 +1,5 @@
[Default Applications]
inode/directory=pcmanfm-qt.desktop
text/x-log=vim.desktop
image/png=lximage-qt.desktop
application/pdf=org.gnome.Evince.desktop

View file

@ -0,0 +1,15 @@
# This file is written by xdg-user-dirs-update
# If you want to change or add directories, just edit the line you're
# interested in. All local changes will be retained on the next run.
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
# absolute path. No other format is supported.
#
XDG_DESKTOP_DIR="$HOME/"
XDG_DOWNLOAD_DIR="$HOME/Downloads"
XDG_TEMPLATES_DIR="$HOME/Templates"
XDG_PUBLICSHARE_DIR="$HOME/Public"
XDG_DOCUMENTS_DIR="$HOME/Dokumente"
XDG_MUSIC_DIR="$HOME/Musik"
XDG_PICTURES_DIR="$HOME/Bilder"
XDG_VIDEOS_DIR="$HOME/Videos"

View file

@ -0,0 +1 @@
de_DE

View file

@ -0,0 +1,17 @@
alias reboot="sudo systemctl reboot"
alias poweroff="sudo systemctl poweroff"
alias halt="sudo systemctl halt"
alias hibernate="sudo systemctl hibernate"
alias hybrid="sudo systemctl hybrid-sleep"
alias suspend="sudo systemctl suspend"
function fish_prompt
powerline-shell --shell bare $status
end
# Start X at login
if status is-login
if test -z "$DISPLAY" -a $XDG_VTNR = 1
exec startx -- -keeptty
end
end

View file

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="font">
<edit name="antialias" mode="assign">
<bool>true</bool>
</edit>
<edit name="hinting" mode="assign">
<bool>false</bool>
</edit>
<edit name="hintstyle" mode="assign">
<const>hintnone</const>
</edit>
<edit name="rgba" mode="assign">
<const>none</const>
</edit>
<edit name="autohint" mode="assign">
<bool>false</bool>
</edit>
<edit name="lcdfilter" mode="assign">
<const>lcdnone</const>
</edit>
<edit name="dpi" mode="assign">
<double>102</double>
</edit>
</match>
</fontconfig>

View file

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="font">
<edit name="antialias" mode="assign">
<bool>false</bool>
</edit>
<edit name="hinting" mode="assign">
<bool>false</bool>
</edit>
<edit name="hintstyle" mode="assign">
<const>hintnone</const>
</edit>
<edit name="rgba" mode="assign">
<const>none</const>
</edit>
<edit name="autohint" mode="assign">
<bool>false</bool>
</edit>
<edit name="lcdfilter" mode="assign">
<const>lcdnone</const>
</edit>
<edit name="dpi" mode="assign">
<double>102</double>
</edit>
</match>
</fontconfig>

View file

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="font">
<edit name="antialias" mode="assign">
<bool>true</bool>
</edit>
<edit name="hinting" mode="assign">
<bool>false</bool>
</edit>
<edit name="hintstyle" mode="assign">
<const>hintnone</const>
</edit>
<edit name="rgba" mode="assign">
<const>none</const>
</edit>
<edit name="autohint" mode="assign">
<bool>false</bool>
</edit>
<edit name="lcdfilter" mode="assign">
<const>lcdnone</const>
</edit>
<edit name="dpi" mode="assign">
<double>102</double>
</edit>
</match>
</fontconfig>

View file

@ -0,0 +1,7 @@
file:///home/simono41/Bilder Bilder
file:///home/simono41/Dokumente Dokumente
file:///home/simono41/Downloads Downloads
file:///home/simono41/Musik Musik
file:///home/simono41/Public Public
file:///home/simono41/Templates Templates
file:///home/simono41/Videos Videos

View file

@ -0,0 +1,84 @@
@define-color borders_breeze #5f6265;
@define-color content_view_bg_breeze #1b1e20;
@define-color error_color_backdrop_breeze #da4453;
@define-color error_color_breeze #da4453;
@define-color error_color_insensitive_backdrop_breeze #592930;
@define-color error_color_insensitive_breeze #592930;
@define-color insensitive_base_color_breeze #1a1d1f;
@define-color insensitive_base_fg_color_breeze #656768;
@define-color insensitive_bg_color_breeze #282c30;
@define-color insensitive_borders_breeze #3a3d41;
@define-color insensitive_fg_color_breeze #6e7173;
@define-color insensitive_selected_bg_color_breeze #282c30;
@define-color insensitive_selected_fg_color_breeze #6e7173;
@define-color insensitive_unfocused_bg_color_breeze #282c30;
@define-color insensitive_unfocused_fg_color_breeze #6e7173;
@define-color insensitive_unfocused_selected_bg_color_breeze #282c30;
@define-color insensitive_unfocused_selected_fg_color_breeze #6e7173;
@define-color link_color_breeze #1d99f3;
@define-color link_visited_color_breeze #9b59b6;
@define-color success_color_backdrop_breeze #27ae60;
@define-color success_color_breeze #27ae60;
@define-color success_color_insensitive_backdrop_breeze #1e4d34;
@define-color success_color_insensitive_breeze #1e4d34;
@define-color theme_base_color_breeze #1b1e20;
@define-color theme_bg_color_breeze #2a2e32;
@define-color theme_button_background_backdrop_breeze #31363b;
@define-color theme_button_background_backdrop_insensitive_breeze #2f3338;
@define-color theme_button_background_insensitive_breeze #2f3338;
@define-color theme_button_background_normal_breeze #31363b;
@define-color theme_button_decoration_focus_backdrop_breeze #3daee9;
@define-color theme_button_decoration_focus_backdrop_insensitive_breeze #335c72;
@define-color theme_button_decoration_focus_breeze #3daee9;
@define-color theme_button_decoration_focus_insensitive_breeze #335c72;
@define-color theme_button_decoration_hover_backdrop_breeze #3daee9;
@define-color theme_button_decoration_hover_backdrop_insensitive_breeze #335c72;
@define-color theme_button_decoration_hover_breeze #3daee9;
@define-color theme_button_decoration_hover_insensitive_breeze #335c72;
@define-color theme_button_foreground_active_backdrop_breeze #fcfcfc;
@define-color theme_button_foreground_active_backdrop_insensitive_breeze #6e7173;
@define-color theme_button_foreground_active_breeze #fcfcfc;
@define-color theme_button_foreground_active_insensitive_breeze #6e7173;
@define-color theme_button_foreground_backdrop_breeze #fcfcfc;
@define-color theme_button_foreground_backdrop_insensitive_breeze #727679;
@define-color theme_button_foreground_insensitive_breeze #727679;
@define-color theme_button_foreground_normal_breeze #fcfcfc;
@define-color theme_fg_color_breeze #fcfcfc;
@define-color theme_header_background_backdrop_breeze #2a2e32;
@define-color theme_header_background_breeze #31363b;
@define-color theme_header_background_light_breeze #2a2e32;
@define-color theme_header_foreground_backdrop_breeze #fcfcfc;
@define-color theme_header_foreground_breeze #fcfcfc;
@define-color theme_header_foreground_insensitive_backdrop_breeze #fcfcfc;
@define-color theme_header_foreground_insensitive_breeze #fcfcfc;
@define-color theme_hovering_selected_bg_color_breeze #3daee9;
@define-color theme_selected_bg_color_breeze #3daee9;
@define-color theme_selected_fg_color_breeze #fcfcfc;
@define-color theme_text_color_breeze #fcfcfc;
@define-color theme_titlebar_background_backdrop_breeze #2a2e32;
@define-color theme_titlebar_background_breeze #31363b;
@define-color theme_titlebar_background_light_breeze #2a2e32;
@define-color theme_titlebar_foreground_backdrop_breeze #fcfcfc;
@define-color theme_titlebar_foreground_breeze #fcfcfc;
@define-color theme_titlebar_foreground_insensitive_backdrop_breeze #fcfcfc;
@define-color theme_titlebar_foreground_insensitive_breeze #fcfcfc;
@define-color theme_unfocused_base_color_breeze #1b1e20;
@define-color theme_unfocused_bg_color_breeze #2a2e32;
@define-color theme_unfocused_fg_color_breeze #fcfcfc;
@define-color theme_unfocused_selected_bg_color_alt_breeze #1f485e;
@define-color theme_unfocused_selected_bg_color_breeze #1f485e;
@define-color theme_unfocused_selected_fg_color_breeze #fcfcfc;
@define-color theme_unfocused_text_color_breeze #fcfcfc;
@define-color theme_unfocused_view_bg_color_breeze #1a1d1f;
@define-color theme_unfocused_view_text_color_breeze #656768;
@define-color theme_view_active_decoration_color_breeze #3daee9;
@define-color theme_view_hover_decoration_color_breeze #3daee9;
@define-color tooltip_background_breeze #31363b;
@define-color tooltip_border_breeze #64686b;
@define-color tooltip_text_breeze #fcfcfc;
@define-color unfocused_borders_breeze #5f6265;
@define-color unfocused_insensitive_borders_breeze #3a3d41;
@define-color warning_color_backdrop_breeze #f67400;
@define-color warning_color_breeze #f67400;
@define-color warning_color_insensitive_backdrop_breeze #633914;
@define-color warning_color_insensitive_breeze #633914;

View file

@ -0,0 +1 @@
@import 'colors.css';

View file

@ -0,0 +1,15 @@
[Settings]
gtk-theme-name=Arc-Darker
gtk-icon-theme-name=Arc
gtk-font-name=Cantarell 11
gtk-cursor-theme-name=capitaine-cursors
gtk-cursor-theme-size=0
gtk-toolbar-style=GTK_TOOLBAR_BOTH_HORIZ
gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
gtk-button-images=0
gtk-menu-images=0
gtk-enable-event-sounds=1
gtk-enable-input-feedback-sounds=1
gtk-xft-antialias=1
gtk-xft-hinting=1
gtk-xft-hintstyle=hintmedium

View file

@ -0,0 +1,19 @@
# Created by lxqt-config-appearance (DO NOT EDIT!)
[Settings]
gtk-theme-name=Arc-Dark
gtk-icon-theme-name=Arc
# GTK3 ignores bold or italic attributes.
gtk-font-name=Cantarell 11
gtk-menu-images=1
gtk-button-images=1
gtk-toolbar-style=GTK_TOOLBAR_BOTH_HORIZ
gtk-cursor-theme-name=capitaine-cursors
gtk-cursor-theme-size=24
gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
gtk-enable-event-sounds=1
gtk-enable-input-feedback-sounds=1
gtk-xft-antialias=1
gtk-xft-hinting=1
gtk-xft-hintstyle=hintmedium

View file

@ -0,0 +1,20 @@
[Settings]
gtk-application-prefer-dark-theme=false
gtk-button-images=1
gtk-cursor-theme-name=capitaine-cursors
gtk-cursor-theme-size=24
gtk-decoration-layout=icon:minimize,maximize,close
gtk-enable-animations=true
gtk-enable-event-sounds=1
gtk-enable-input-feedback-sounds=1
gtk-font-name=Noto Sans, 10
gtk-icon-theme-name=Arc
gtk-menu-images=1
gtk-modules=colorreload-gtk-module
gtk-primary-button-warps-slider=false
gtk-theme-name=Arc-Darker
gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
gtk-toolbar-style=GTK_TOOLBAR_BOTH_HORIZ
gtk-xft-antialias=1
gtk-xft-hinting=1
gtk-xft-hintstyle=hintmedium

View file

@ -0,0 +1,20 @@
[Settings]
gtk-application-prefer-dark-theme=true
gtk-button-images=1
gtk-cursor-theme-name=capitaine-cursors
gtk-cursor-theme-size=24
gtk-decoration-layout=icon:minimize,maximize,close
gtk-enable-animations=true
gtk-enable-event-sounds=1
gtk-enable-input-feedback-sounds=1
gtk-font-name=Noto Sans, 10
gtk-icon-theme-name=Arc
gtk-menu-images=1
gtk-modules=colorreload-gtk-module
gtk-primary-button-warps-slider=false
gtk-theme-name=Arc-Darker
gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
gtk-toolbar-style=GTK_TOOLBAR_BOTH_HORIZ
gtk-xft-antialias=1
gtk-xft-hinting=1
gtk-xft-hintstyle=hintmedium

View file

@ -0,0 +1,9 @@
[Settings]
gtk-application-prefer-dark-theme=true
gtk-cursor-theme-name=breeze_cursors
gtk-cursor-theme-size=24
gtk-decoration-layout=icon:minimize,maximize,close
gtk-enable-animations=true
gtk-font-name=Noto Sans, 10
gtk-icon-theme-name=Arc
gtk-primary-button-warps-slider=false

View file

@ -0,0 +1,123 @@
#!/usr/bin/env python3
#
# Copyright (C) 2017 Marcel Patzwahl
# Licensed under the terms of the GNU GPL v3 only.
#
# i3blocks blocklet script to see the available updates of pacman and the AUR
import subprocess
from subprocess import check_output
import argparse
import os
import re
def create_argparse():
def _default(name, default='', arg_type=str):
val = default
if name in os.environ:
val = os.environ[name]
return arg_type(val)
strbool = lambda s: s.lower() in ['t', 'true', '1']
strlist = lambda s: s.split()
parser = argparse.ArgumentParser(description='Check for pacman updates')
parser.add_argument(
'-b',
'--base_color',
default = _default('BASE_COLOR', 'green'),
help='base color of the output(default=green)'
)
parser.add_argument(
'-u',
'--updates_available_color',
default = _default('UPDATE_COLOR', 'yellow'),
help='color of the output, when updates are available(default=yellow)'
)
parser.add_argument(
'-a',
'--aur',
action = 'store_const',
const = True,
default = _default('AUR', 'False', strbool),
help='Include AUR packages. Attn: Yaourt must be installed'
)
parser.add_argument(
'-q',
'--quiet',
action = 'store_const',
const = True,
default = _default('QUIET', 'False', strbool),
help = 'Do not produce output when system is up to date'
)
parser.add_argument(
'-w',
'--watch',
nargs='*',
default = _default('WATCH', arg_type=strlist),
help='Explicitly watch for specified packages. '
'Listed elements are treated as regular expressions for matching.'
)
return parser.parse_args()
def get_updates():
output = check_output(['checkupdates']).decode('utf-8')
if not output:
return []
updates = [line.split(' ')[0]
for line in output.split('\n')
if line]
return updates
def get_aur_updates():
output = ''
try:
output = check_output(['yaourt', '-Qua']).decode('utf-8')
except subprocess.CalledProcessError as exc:
# yaourt exits with 1 and no output if no updates are available.
# we ignore this case and go on
if not (exc.returncode == 1 and not exc.output):
raise exc
if not output:
return []
aur_updates = [line.split(' ')[0]
for line in output.split('\n')
if line.startswith('aur/')]
return aur_updates
def matching_updates(updates, watch_list):
matches = set()
for u in updates:
for w in watch_list:
if re.match(w, u):
matches.add(u)
return matches
message = "<span color='{0}'>{1}</span>"
args = create_argparse()
updates = get_updates()
if args.aur:
updates += get_aur_updates()
update_count = len(updates)
if update_count > 0:
info = str(update_count) + ' updates available'
short_info = str(update_count) + ' updates'
matches = matching_updates(updates, args.watch)
if matches:
info += ' [{0}]'.format(', '.join(matches))
short_info += '*'
print(message.format(args.updates_available_color, info))
print(message.format(args.updates_available_color, short_info))
elif not args.quiet:
print(message.format(args.base_color, 'system up to date'))

View file

@ -0,0 +1,4 @@
#!/bin/bash
set -x
if lspci | grep -e VGA -e 3D -m 1 | grep AMD; then echo $1 | sudo tee --append /sys/class/backlight/amdgpu_bl*/brightness; else echo $2 | sudo tee --append /sys/class/backlight/intel_backlight/brightness; fi

View file

@ -0,0 +1,112 @@
#!/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/>.
# Get custom IN and OUT labels if provided by command line arguments
while [[ $# -gt 1 ]]; do
key="$1"
case "$key" in
-i|--inlabel)
INLABEL="$2"
shift;;
-o|--outlabel)
OUTLABEL="$2"
shift;;
esac
shift
done
[[ -z $INLABEL ]] && INLABEL="IN "
[[ -z $OUTLABEL ]] && OUTLABEL="OUT "
# Use the provided interface, otherwise the device used for the default route.
if [[ -z $INTERFACE ]] && [[ -n $BLOCK_INSTANCE ]]; then
INTERFACE=$BLOCK_INSTANCE
elif [[ -z $INTERFACE ]]; then
INTERFACE=$(ip route | awk '/^default/ { print $5 ; exit }')
fi
# Exit if there is no default route
[[ -z "$IF" ]] && exit
# Issue #36 compliant.
if ! [ -e "/sys/class/net/${INTERFACE}/operstate" ] || \
(! [ "$TREAT_UNKNOWN_AS_UP" = "1" ] &&
! [ "`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 "$INLABEL"
rx_kib=$(( $rx_rate >> 10 ))
if hash bc 2>/dev/null && [[ "$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 "$OUTLABEL"
tx_kib=$(( $tx_rate >> 10 ))
if hash bc 2>/dev/null && [[ "$tx_rate" -gt 1048576 ]]; then
printf '%sM' "`echo "scale=1; $tx_kib / 1024" | bc`"
else
echo -n "${tx_kib}K"
fi

View file

@ -0,0 +1,137 @@
#!/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.
#
#
readarray -t output <<< $(acpi battery)
battery_count=${#output[@]}
for line in "${output[@]}";
do
percentages+=($(echo "$line" | grep -o -m1 '[0-9]\{1,3\}%' | tr -d '%'))
statuses+=($(echo "$line" | egrep -o -m1 'Discharging|Charging|AC|Full|Unknown'))
remaining=$(echo "$line" | egrep -o -m1 '[0-9][0-9]:[0-9][0-9]')
if [[ -n $remaining ]]; then
remainings+=(" ($remaining)")
else
remainings+=("")
fi
done
squares="■"
#There are 8 colors that reflect the current battery percentage when
#discharging
dis_colors=("${C1:-#FF0027}" "${C2:-#FF3B05}" "${C3:-#FFB923}"
"${C4:-#FFD000}" "${C5:-#E4FF00}" "${C6:-#ADFF00}"
"${C7:-#6DFF00}" "${C8:-#10BA00}")
charging_color="${CHARGING_COLOR:-#00AFE3}"
full_color="${FULL_COLOR:-#FFFFFF}"
ac_color="${AC_COLOR:-#535353}"
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
end=$(($battery_count - 1))
for i in $(seq 0 $end);
do
if (( percentages[$i] > 0 && percentages[$i] < 20 )); then
squares="■"
elif (( percentages[$i] >= 20 && percentages[$i] < 40 )); then
squares="■■"
elif (( percentages[$i] >= 40 && percentages[$i] < 60 )); then
squares="■■■"
elif (( percentages[$i] >= 60 && percentages[$i] < 80 )); then
squares="■■■■"
elif (( percentages[$i] >=80 )); then
squares="■■■■■"
fi
if [[ "${statuses[$i]}" = "Unknown" ]]; then
squares="<sup>?</sup>$squares"
fi
case "${statuses[$i]}" in
"Charging")
color="$charging_color"
;;
"Full")
color="$full_color"
;;
"AC")
color="$ac_color"
;;
"Discharging"|"Unknown")
if (( percentages[$i] >= 0 && percentages[$i] < 10 )); then
color="${dis_colors[0]}"
elif (( percentages[$i] >= 10 && percentages[$i] < 20 )); then
color="${dis_colors[1]}"
elif (( percentages[$i] >= 20 && percentages[$i] < 30 )); then
color="${dis_colors[2]}"
elif (( percentages[$i] >= 30 && percentages[$i] < 40 )); then
color="${dis_colors[3]}"
elif (( percentages[$i] >= 40 && percentages[$i] < 60 )); then
color="${dis_colors[4]}"
elif (( percentages[$i] >= 60 && percentages[$i] < 70 )); then
color="${dis_colors[5]}"
elif (( percentages[$i] >= 70 && percentages[$i] < 80 )); then
color="${dis_colors[6]}"
elif (( percentages[$i] >= 80 )); then
color="${dis_colors[7]}"
fi
;;
esac
# Print Battery number if there is more than one
if (( $end > 0 )) ; then
message="$message $(($i + 1)):"
fi
if [[ "$BLOCK_BUTTON" -eq 1 ]]; then
message="$message ${statuses[$i]} <span foreground=\"$color\">${percentages[$i]}%${remainings[i]}</span>"
fi
message="$message <span foreground=\"$color\">$squares</span>"
done
echo $message

View file

@ -0,0 +1,40 @@
#! /bin/sh
WIDTH=${WIDTH:-200}
HEIGHT=${HEIGHT:-200}
DATEFMT=${DATEFMT:-"+%a %d.%m.%Y %H:%M:%S"}
SHORTFMT=${SHORTFMT:-"+%H:%M:%S"}
OPTIND=1
while getopts ":f:W:H:" opt; do
case $opt in
f) DATEFMT="$OPTARG" ;;
W) WIDTH="$OPTARG" ;;
H) HEIGHT="$OPTARG" ;;
\?)
echo "Invalid option: -$OPTARG" >&2
exit 1
;;
:)
echo "Option -$OPTARG requires an argument." >&2
exit 1
;;
esac
done
case "$BLOCK_BUTTON" in
1|2|3)
# the position of the upper left corner of the popup
posX=$(($BLOCK_X - $WIDTH / 2))
posY=$(($BLOCK_Y - $HEIGHT))
i3-msg -q "exec yad --calendar \
--width=$WIDTH --height=$HEIGHT \
--undecorated --fixed \
--close-on-unfocus --no-buttons \
--posx=$posX --posy=$posY \
> /dev/null"
esac
echo "$LABEL$(date "$DATEFMT")"
echo "$LABEL$(date "$SHORTFMT")"

View file

@ -0,0 +1,240 @@
# Thank you code_nomad: http://9m.no/ꪯ鵞
#################################
#
# Backend
#
#################################
# Backend to use: "xrender" or "glx".
# GLX backend is typically much faster but depends on a sane driver.
backend = "glx";
#################################
#
# GLX backend
#
#################################
glx-no-stencil = true;
# GLX backend: Copy unmodified regions from front buffer instead of redrawing them all.
# My tests with nvidia-drivers show a 10% decrease in performance when the whole screen is modified,
# but a 20% increase when only 1/4 is.
# My tests on nouveau show terrible slowdown.
# Useful with --glx-swap-method, as well.
glx-copy-from-front = false;
# GLX backend: Use MESA_copy_sub_buffer to do partial screen update.
# My tests on nouveau shows a 200% performance boost when only 1/4 of the screen is updated.
# May break VSync and is not available on some drivers.
# Overrides --glx-copy-from-front.
# glx-use-copysubbuffermesa = true;
# GLX backend: Avoid rebinding pixmap on window damage.
# Probably could improve performance on rapid window content changes, but is known to break things on some drivers (LLVMpipe).
# Recommended if it works.
# glx-no-rebind-pixmap = true;
# GLX backend: GLX buffer swap method we assume.
# Could be undefined (0), copy (1), exchange (2), 3-6, or buffer-age (-1).
# undefined is the slowest and the safest, and the default value.
# copy is fastest, but may fail on some drivers,
# 2-6 are gradually slower but safer (6 is still faster than 0).
# Usually, double buffer means 2, triple buffer means 3.
# buffer-age means auto-detect using GLX_EXT_buffer_age, supported by some drivers.
# Useless with --glx-use-copysubbuffermesa.
# Partially breaks --resize-damage.
# Defaults to undefined.
glx-swap-method = "undefined";
#################################
#
# Shadows
#
#################################
# Enabled client-side shadows on windows.
shadow = true;
# Don't draw shadows on DND windows.
no-dnd-shadow = true;
# Avoid drawing shadows on dock/panel windows.
no-dock-shadow = true;
# Zero the part of the shadow's mask behind the window. Fix some weirdness with ARGB windows.
clear-shadow = true;
# The blur radius for shadows. (default 12)
shadow-radius = 5;
# The left offset for shadows. (default -15)
shadow-offset-x = -5;
# The top offset for shadows. (default -15)
shadow-offset-y = -5;
# The translucency for shadows. (default .75)
shadow-opacity = 0.5;
# Set if you want different colour shadows
# shadow-red = 0.0;
# shadow-green = 0.0;
# shadow-blue = 0.0;
# The shadow exclude options are helpful if you have shadows enabled. Due to the way compton draws its shadows, certain applications will have visual glitches
# (most applications are fine, only apps that do weird things with xshapes or argb are affected).
# This list includes all the affected apps I found in my testing. The "! name~=''" part excludes shadows on any "Unknown" windows, this prevents a visual glitch with the XFWM alt tab switcher.
shadow-exclude = [
"! name~=''",
"name = 'Notification'",
"name = 'Plank'",
"name = 'Docky'",
"name = 'Kupfer'",
"name = 'xfce4-notifyd'",
"name *= 'VLC'",
"name *= 'compton'",
"name *= 'Chromium'",
"name *= 'Chrome'",
"class_g = 'Conky'",
"class_g = 'Kupfer'",
"class_g = 'Synapse'",
"class_g ?= 'Notify-osd'",
"class_g ?= 'Cairo-dock'",
"class_g ?= 'Xfce4-notifyd'",
"class_g ?= 'Xfce4-power-manager'",
"_GTK_FRAME_EXTENTS@:c"
];
# Avoid drawing shadow on all shaped windows (see also: --detect-rounded-corners)
shadow-ignore-shaped = false;
#################################
#
# Opacity
#
#################################
menu-opacity = 1;
inactive-opacity = 1;
active-opacity = 1;
frame-opacity = 1;
inactive-opacity-override = false;
alpha-step = 0.06;
# Dim inactive windows. (0.0 - 1.0)
# inactive-dim = 0.2;
# Do not let dimness adjust based on window opacity.
# inactive-dim-fixed = true;
# Blur background of transparent windows. Bad performance with X Render backend. GLX backend is preferred.
# blur-background = true;
# Blur background of opaque windows with transparent frames as well.
# blur-background-frame = true;
# Do not let blur radius adjust based on window opacity.
blur-background-fixed = false;
blur-background-exclude = [
"window_type = 'dock'",
"window_type = 'desktop'"
];
#################################
#
# Fading
#
#################################
# Fade windows during opacity changes.
fading = true;
# The time between steps in a fade in milliseconds. (default 10).
fade-delta = 4;
# Opacity change between steps while fading in. (default 0.028).
fade-in-step = 0.03;
# Opacity change between steps while fading out. (default 0.03).
fade-out-step = 0.03;
# Fade windows in/out when opening/closing
# no-fading-openclose = true;
# Specify a list of conditions of windows that should not be faded.
fade-exclude = [ ];
#################################
#
# Other
#
#################################
# Try to detect WM windows and mark them as active.
mark-wmwin-focused = true;
# Mark all non-WM but override-redirect windows active (e.g. menus).
mark-ovredir-focused = true;
# Use EWMH _NET_WM_ACTIVE_WINDOW to determine which window is focused instead of using FocusIn/Out events.
# Usually more reliable but depends on a EWMH-compliant WM.
use-ewmh-active-win = true;
# Detect rounded corners and treat them as rectangular when --shadow-ignore-shaped is on.
detect-rounded-corners = true;
# Detect _NET_WM_OPACITY on client windows, useful for window managers not passing _NET_WM_OPACITY of client windows to frame windows.
# This prevents opacity being ignored for some apps.
# For example without this enabled my xfce4-notifyd is 100% opacity no matter what.
detect-client-opacity = true;
# Specify refresh rate of the screen.
# If not specified or 0, compton will try detecting this with X RandR extension.
refresh-rate = 0;
# Set VSync method. VSync methods currently available:
# none: No VSync
# drm: VSync with DRM_IOCTL_WAIT_VBLANK. May only work on some drivers.
# opengl: Try to VSync with SGI_video_sync OpenGL extension. Only work on some drivers.
# opengl-oml: Try to VSync with OML_sync_control OpenGL extension. Only work on some drivers.
# opengl-swc: Try to VSync with SGI_swap_control OpenGL extension. Only work on some drivers. Works only with GLX backend. Known to be most effective on many drivers. Does not actually control paint timing, only buffer swap is affected, so it doesnt have the effect of --sw-opti unlike other methods. Experimental.
# opengl-mswc: Try to VSync with MESA_swap_control OpenGL extension. Basically the same as opengl-swc above, except the extension we use.
# (Note some VSync methods may not be enabled at compile time.)
vsync = "opengl-swc";
# Enable DBE painting mode, intended to use with VSync to (hopefully) eliminate tearing.
# Reported to have no effect, though.
dbe = false;
# Painting on X Composite overlay window. Recommended.
paint-on-overlay = true;
# Limit compton to repaint at most once every 1 / refresh_rate second to boost performance.
# This should not be used with --vsync drm/opengl/opengl-oml as they essentially does --sw-opti's job already,
# unless you wish to specify a lower refresh rate than the actual value.
#sw-opti = true;
# Unredirect all windows if a full-screen opaque window is detected, to maximize performance for full-screen windows, like games.
# Known to cause flickering when redirecting/unredirecting windows.
# paint-on-overlay may make the flickering less obvious.
unredir-if-possible = true;
# Specify a list of conditions of windows that should always be considered focused.
focus-exclude = [ ];
# Use WM_TRANSIENT_FOR to group windows, and consider windows in the same group focused at the same time.
detect-transient = true;
# Use WM_CLIENT_LEADER to group windows, and consider windows in the same group focused at the same time.
# WM_TRANSIENT_FOR has higher priority if --detect-transient is enabled, too.
detect-client-leader = true;
#################################
#
# Window type settings
#
#################################
wintypes:
{
tooltip =
{
# fade: Fade the particular type of windows.
fade = true;
# shadow: Give those windows shadow
shadow = false;
# opacity: Default opacity for the type of windows.
opacity = 0.85;
# focus: Whether to always consider windows of this type focused.
focus = true;
};
};
opacity-rule = [
"0:_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'"
];

View file

@ -0,0 +1,240 @@
# Thank you code_nomad: http://9m.no/ꪯ鵞
#################################
#
# Backend
#
#################################
# Backend to use: "xrender" or "glx".
# GLX backend is typically much faster but depends on a sane driver.
backend = "glx";
#################################
#
# GLX backend
#
#################################
glx-no-stencil = true;
# GLX backend: Copy unmodified regions from front buffer instead of redrawing them all.
# My tests with nvidia-drivers show a 10% decrease in performance when the whole screen is modified,
# but a 20% increase when only 1/4 is.
# My tests on nouveau show terrible slowdown.
# Useful with --glx-swap-method, as well.
glx-copy-from-front = false;
# GLX backend: Use MESA_copy_sub_buffer to do partial screen update.
# My tests on nouveau shows a 200% performance boost when only 1/4 of the screen is updated.
# May break VSync and is not available on some drivers.
# Overrides --glx-copy-from-front.
# glx-use-copysubbuffermesa = true;
# GLX backend: Avoid rebinding pixmap on window damage.
# Probably could improve performance on rapid window content changes, but is known to break things on some drivers (LLVMpipe).
# Recommended if it works.
# glx-no-rebind-pixmap = true;
# GLX backend: GLX buffer swap method we assume.
# Could be undefined (0), copy (1), exchange (2), 3-6, or buffer-age (-1).
# undefined is the slowest and the safest, and the default value.
# copy is fastest, but may fail on some drivers,
# 2-6 are gradually slower but safer (6 is still faster than 0).
# Usually, double buffer means 2, triple buffer means 3.
# buffer-age means auto-detect using GLX_EXT_buffer_age, supported by some drivers.
# Useless with --glx-use-copysubbuffermesa.
# Partially breaks --resize-damage.
# Defaults to undefined.
glx-swap-method = "undefined";
#################################
#
# Shadows
#
#################################
# Enabled client-side shadows on windows.
shadow = true;
# Don't draw shadows on DND windows.
no-dnd-shadow = true;
# Avoid drawing shadows on dock/panel windows.
no-dock-shadow = true;
# Zero the part of the shadow's mask behind the window. Fix some weirdness with ARGB windows.
clear-shadow = true;
# The blur radius for shadows. (default 12)
shadow-radius = 5;
# The left offset for shadows. (default -15)
shadow-offset-x = -5;
# The top offset for shadows. (default -15)
shadow-offset-y = -5;
# The translucency for shadows. (default .75)
shadow-opacity = 0.5;
# Set if you want different colour shadows
# shadow-red = 0.0;
# shadow-green = 0.0;
# shadow-blue = 0.0;
# The shadow exclude options are helpful if you have shadows enabled. Due to the way compton draws its shadows, certain applications will have visual glitches
# (most applications are fine, only apps that do weird things with xshapes or argb are affected).
# This list includes all the affected apps I found in my testing. The "! name~=''" part excludes shadows on any "Unknown" windows, this prevents a visual glitch with the XFWM alt tab switcher.
shadow-exclude = [
"! name~=''",
"name = 'Notification'",
"name = 'Plank'",
"name = 'Docky'",
"name = 'Kupfer'",
"name = 'xfce4-notifyd'",
"name *= 'VLC'",
"name *= 'compton'",
"name *= 'Chromium'",
"name *= 'Chrome'",
"class_g = 'Conky'",
"class_g = 'Kupfer'",
"class_g = 'Synapse'",
"class_g ?= 'Notify-osd'",
"class_g ?= 'Cairo-dock'",
"class_g ?= 'Xfce4-notifyd'",
"class_g ?= 'Xfce4-power-manager'",
"_GTK_FRAME_EXTENTS@:c"
];
# Avoid drawing shadow on all shaped windows (see also: --detect-rounded-corners)
shadow-ignore-shaped = false;
#################################
#
# Opacity
#
#################################
menu-opacity = 1;
inactive-opacity = 1;
active-opacity = 1;
frame-opacity = 1;
inactive-opacity-override = false;
alpha-step = 0.06;
# Dim inactive windows. (0.0 - 1.0)
# inactive-dim = 0.2;
# Do not let dimness adjust based on window opacity.
# inactive-dim-fixed = true;
# Blur background of transparent windows. Bad performance with X Render backend. GLX backend is preferred.
# blur-background = true;
# Blur background of opaque windows with transparent frames as well.
# blur-background-frame = true;
# Do not let blur radius adjust based on window opacity.
blur-background-fixed = false;
blur-background-exclude = [
"window_type = 'dock'",
"window_type = 'desktop'"
];
#################################
#
# Fading
#
#################################
# Fade windows during opacity changes.
fading = true;
# The time between steps in a fade in milliseconds. (default 10).
fade-delta = 4;
# Opacity change between steps while fading in. (default 0.028).
fade-in-step = 0.03;
# Opacity change between steps while fading out. (default 0.03).
fade-out-step = 0.03;
# Fade windows in/out when opening/closing
# no-fading-openclose = true;
# Specify a list of conditions of windows that should not be faded.
fade-exclude = [ ];
#################################
#
# Other
#
#################################
# Try to detect WM windows and mark them as active.
mark-wmwin-focused = true;
# Mark all non-WM but override-redirect windows active (e.g. menus).
mark-ovredir-focused = true;
# Use EWMH _NET_WM_ACTIVE_WINDOW to determine which window is focused instead of using FocusIn/Out events.
# Usually more reliable but depends on a EWMH-compliant WM.
use-ewmh-active-win = true;
# Detect rounded corners and treat them as rectangular when --shadow-ignore-shaped is on.
detect-rounded-corners = true;
# Detect _NET_WM_OPACITY on client windows, useful for window managers not passing _NET_WM_OPACITY of client windows to frame windows.
# This prevents opacity being ignored for some apps.
# For example without this enabled my xfce4-notifyd is 100% opacity no matter what.
detect-client-opacity = true;
# Specify refresh rate of the screen.
# If not specified or 0, compton will try detecting this with X RandR extension.
refresh-rate = 0;
# Set VSync method. VSync methods currently available:
# none: No VSync
# drm: VSync with DRM_IOCTL_WAIT_VBLANK. May only work on some drivers.
# opengl: Try to VSync with SGI_video_sync OpenGL extension. Only work on some drivers.
# opengl-oml: Try to VSync with OML_sync_control OpenGL extension. Only work on some drivers.
# opengl-swc: Try to VSync with SGI_swap_control OpenGL extension. Only work on some drivers. Works only with GLX backend. Known to be most effective on many drivers. Does not actually control paint timing, only buffer swap is affected, so it doesnt have the effect of --sw-opti unlike other methods. Experimental.
# opengl-mswc: Try to VSync with MESA_swap_control OpenGL extension. Basically the same as opengl-swc above, except the extension we use.
# (Note some VSync methods may not be enabled at compile time.)
vsync = "opengl-swc";
# Enable DBE painting mode, intended to use with VSync to (hopefully) eliminate tearing.
# Reported to have no effect, though.
dbe = false;
# Painting on X Composite overlay window. Recommended.
paint-on-overlay = true;
# Limit compton to repaint at most once every 1 / refresh_rate second to boost performance.
# This should not be used with --vsync drm/opengl/opengl-oml as they essentially does --sw-opti's job already,
# unless you wish to specify a lower refresh rate than the actual value.
#sw-opti = true;
# Unredirect all windows if a full-screen opaque window is detected, to maximize performance for full-screen windows, like games.
# Known to cause flickering when redirecting/unredirecting windows.
# paint-on-overlay may make the flickering less obvious.
unredir-if-possible = true;
# Specify a list of conditions of windows that should always be considered focused.
focus-exclude = [ ];
# Use WM_TRANSIENT_FOR to group windows, and consider windows in the same group focused at the same time.
detect-transient = true;
# Use WM_CLIENT_LEADER to group windows, and consider windows in the same group focused at the same time.
# WM_TRANSIENT_FOR has higher priority if --detect-transient is enabled, too.
detect-client-leader = true;
#################################
#
# Window type settings
#
#################################
wintypes:
{
tooltip =
{
# fade: Fade the particular type of windows.
fade = true;
# shadow: Give those windows shadow
shadow = false;
# opacity: Default opacity for the type of windows.
opacity = 0.85;
# focus: Whether to always consider windows of this type focused.
focus = true;
};
};
opacity-rule = [
"0:_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'"
];

View file

@ -0,0 +1,657 @@
#
#====================== OLD COLOR SCHME
set $foreground #eceff1
set $background #263238
set $color0 #263238
set $color8 #37474f
set $color1 #ff9800
set $color9 #ffa74d
set $color2 #8bc34a
set $color10 #9ccc65
set $color3 #ffc107
set $color11 #ffa000
set $color4 #03a9f4
set $color12 #81d4fa
set $color5 #ea427b
set $color13 #ad1457
set $color6 #009688
set $color14 #26a69a
set $color7 #cfd8dc
set $color15 #eceff1
set $transparent #000000FF
set $FOCUS #18A4DB
set $UNFOCUS #127196
set $BORDERF #00c3FF
set $BORDERU #00245E
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# xmodmap -pke
# xev
# i3 config file (v4)
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
set $mod Mod1
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
#font pango:Noto Sans Bold 9
#font pango:Droid Sans 9
#font pango:FontAwesome 8, pango: Droid Sans Mono 8
font pango:System San Francisco Display 10
#font pango:System San Francisco Display 6
#font pango:monospace 8
# This font is widely installed, provides lots of unicode glyphs, right-to-left
# text rendering and scalability on retina/hidpi displays (thanks to pango).
#font pango:DejaVu Sans Mono 8
# Before i3 v4.8, we used to recommend this one as the default:
# font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
# The font above is very space-efficient, that is, it looks good, sharp and
# clear in small sizes. However, its unicode glyph coverage is limited, the old
# X core fonts rendering does not support right-to-left and this being a bitmap
# font, it doesnt scale on retina/hidpi displays.
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
workspace_auto_back_and_forth yes
force_display_urgency_hint 0 ms
focus_on_window_activation urgent
# start a terminal
bindsym $mod+Return exec alacritty
# kill focused window
bindsym $mod+Shift+q kill
# Menu
#bindsym $mod+d exec rofi -show run -lines 3 -bw 1 -font "Cantarell 18" -opacity "75"
bindsym $mod+d exec rofi -show run -lines 3 -eh 2 -width 100 -padding 150 -markup -opacity "85" -bw 0 -bc "#2f343f" -bg "#2f343f" -fg "#f3f4f5" -hlbg "#2f343f" -hlfg "#9575cd" -font "Droid Sans 18" -theme Arc-Dark
#bindsym $mod+d exec rofi -show run -lines 3 -eh 2 -width 100 -padding 800 -opacity "85" -bw 0 -bc "$bg-color" -bg "$bg-color" -fg "$text-color" -hlbg "$bg-color" -hlfg "#9575cd" -font "System San Francisco Display 18"
#bindsym $mod+d exec --no-startup-id i3-dmenu-desktop --dmenu='rofi -i -dmenu -font "snap 12" -bg "#222222" -fg "#888888" -hlbg "#285577" -hlfg "#ffffff" -opacity 90 -m 0 -location 2'
# start dmenu (a program launcher)
#bindsym $mod+d exec dmenu_run
# There also is the (new) i3-dmenu-desktop which only displays applications
# shipping a .desktop file. It is a wrapper around dmenu, so you need that
# installed.
bindsym $mod+shift+d exec --no-startup-id i3-dmenu-desktop
# 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
# split in horizontal orientation
bindsym $mod+h split h
# split in vertical orientation
bindsym $mod+v split v
# enter 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
# focus the parent container
bindsym $mod+a focus parent
# focus the child container
#bindsym $mod+d focus child
# Define names for default workspaces for which we configure key bindings later on.
# We use variables to avoid repeating the names in multiple places.
set $ws1 "1: Terminals "
set $ws2 "2: Browser "
set $ws3 "3: Mail "
set $ws4 "4: Office "
set $ws5 "5: Music "
set $ws6 "6: Speakprogram "
set $ws7 "7: IDE "
set $ws8 "8: Steam "
set $ws9 "9: Chat "
set $ws10 "10: Others "
# setting good windows settings for my programms
# xwininfo -tree -root
for_window [class="Alacritty"] move --no-auto-back-and-forth to workspace $ws1
for_window [class="firefox"] move --no-auto-back-and-forth to workspace $ws2
for_window [class="Thunderbird"] move --no-auto-back-and-forth to workspace $ws3
for_window [class="vlc"] move --no-auto-back-and-forth to workspace $ws5
for_window [class="libreoffice"] move --no-auto-back-and-forth to workspace $ws4
for_window [class="WPS Writer"] move --no-auto-back-and-forth to workspace $ws4
for_window [class="WPS PDF"] move --no-auto-back-and-forth to workspace $ws4
for_window [class="WPS Presentation"] move --no-auto-back-and-forth to workspace $ws4
for_window [class="WPS Spreadsheets"] move --no-auto-back-and-forth to workspace $ws4
for_window [class="VLC media player"] move --no-auto-back-and-forth to workspace $ws5
for_window [class="Mixxx"] move --no-auto-back-and-forth to workspace $ws5
for_window [class="Spotify"] move --no-auto-back-and-forth to workspace $ws5
for_window [class="TeamSpeak 3"] move --no-auto-back-and-forth to workspace $ws6
for_window [class="Mumble"] move --no-auto-back-and-forth to workspace $ws6
for_window [class="discord"] move --no-auto-back-and-forth to workspace $ws6
for_window [class="Eclipse"] move --no-auto-back-and-forth to workspace $ws7
for_window [class="Intellij"] move --no-auto-back-and-forth to workspace $ws7
for_window [class="jetbrains-idea"] move --no-auto-back-and-forth to workspace $ws7
for_window [class="jetbrains-studio"] move --no-auto-back-and-forth to workspace $ws7
for_window [class="Steam"] move --no-auto-back-and-forth to workspace $ws8
for_window [class="Telegram"] move --no-auto-back-and-forth to workspace $ws9
for_window [class="Element"] move --no-auto-back-and-forth to workspace $ws9
for_window [class="Quassel IRC"] move --no-auto-back-and-forth to workspace $ws9
# 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
bindsym $mod+9 workspace $ws9
bindsym $mod+0 workspace $ws10
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace $ws1
bindsym $mod+Shift+2 move container to workspace $ws2
bindsym $mod+Shift+3 move container to workspace $ws3
bindsym $mod+Shift+4 move container to workspace $ws4
bindsym $mod+Shift+5 move container to workspace $ws5
bindsym $mod+Shift+6 move container to workspace $ws6
bindsym $mod+Shift+7 move container to workspace $ws7
bindsym $mod+Shift+8 move container to workspace $ws8
bindsym $mod+Shift+9 move container to workspace $ws9
bindsym $mod+Shift+0 move container to workspace $ws10
# 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'"
# resize window (you can also use the mouse for that)
mode "resize" {
# These bindings trigger as soon as you enter the resize mode
# Pressing left will shrink the windows width.
# Pressing right will grow the windows width.
# Pressing up will shrink the windows height.
# Pressing down will grow the windows height.
bindsym j resize shrink width 10 px or 10 ppt
bindsym k resize grow height 10 px or 10 ppt
bindsym l resize shrink height 10 px or 10 ppt
bindsym odiaeresis resize grow width 10 px or 10 ppt
# same bindings, but for the arrow keys
bindsym Left resize shrink width 10 px or 10 ppt
bindsym Down resize grow height 10 px or 10 ppt
bindsym Up resize shrink height 10 px or 10 ppt
bindsym Right resize grow width 10 px or 10 ppt
# back to normal: Enter or Escape or $mod+r
bindsym Return mode "default"
bindsym Escape mode "default"
bindsym $mod+r mode "default"
}
bindsym $mod+r mode "resize"
set $bg-color #2f343f
set $inactive-bg-color #2f343f
set $text-color #f3f4f5
set $inactive-text-color #676E7D
set $urgent-bg-color #E53935
# window colors
# border background text indicator
client.focused $bg-color $bg-color $text-color #00ff00
client.unfocused $inactive-bg-color $inactive-bg-color $inactive-text-color #00ff00
client.focused_inactive $inactive-bg-color $inactive-bg-color $inactive-text-color #00ff00
client.urgent $urgent-bg-color $urgent-bg-color $text-color #00ff00
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
#client.focused #81a2be #81a2be #1d1f21 #282a2e
#client.focused_inactive #373b41 #373b41 #969896 #282a2e
#client.unfocused #282a2e #282a2e #969896 #282a2e
#client.urgent #373b41 #cc6666 #ffffff #cc6666
# Status-Bar
#exec_always --no-startup-id $HOME/.config/polybar/launch.sh --cuts
bar {
font pango:System San Francisco Display, FontAwesome 12
position top
status_command i3status-rs ~/.config/i3status-rust/config.toml
colors {
#separator #666666
#background #222222
#statusline #dddddd
#focused_workspace #0088CC #0088CC #ffffff
#active_workspace #333333 #333333 #ffffff
#inactive_workspace #333333 #333333 #888888
#urgent_workspace #2f343a #900000 #ffffff
#background #eceff1
background $bg-color
statusline #263238
#separator #556270
separator #757575
#colors outline background number
#focused_workspace $color6 $color6 $color15
active_workspace $color6 $color6 $color15
#inactive_workspace $color7 $color7 $color6
#urgent_workspace $color13 $color13 $color15
focused_workspace $bg-color $bg-color $text-color
inactive_workspace $inactive-bg-color $inactive-bg-color $inactive-text-color
urgent_workspace $urgent-bg-color $urgent-bg-color $text-color
}
}
# Benutzerdefiniert
# Fenster zu einem Scratchpad
bindsym $mod+Shift+minus move scratchpad
# Zeige das scratcpad window
bindsym $mod+minus scratchpad show
# Starte Programme über Tastaurkombination
# Press $mod+o followed by either f to launch firefox,
# Escape or Return to the default mode, respectively.
set $mode_launcher Launch: [f]irefox [t]hunderbird [p]avucontrol [a]randr file[m]anager
bindsym $mod+o mode "$mode_launcher"
mode "$mode_launcher" {
bindsym f exec firefox
bindsym t exec thunderbird
bindsym p exec pavucontrol
bindsym a exec arandr
bindsym m exec pcmanfm
bindsym Escape mode "default"
bindsym Return mode "default"
}
bindsym $mod+b exec firefox
bindsym $mod+t exec pcmanfm
bindsym $mod+shift+t exec thunderbird
bindsym $mod+n exec alacritty -e nmtui
bindsym $mod+y exec clipmenu
bindsym $mod+shift+y exec passdmenu -P -x clipboard
#bindsym $mod+o exec termite -e /usr/bin/alsamixer
#bindsym $mod+y exec alacritty -e ncmpcpp
# Alsa-Steuerung & Lautstärke einstellen
#bindsym $mod+i exec amixer set Speaker 5%+
#bindsym $mod+u exec amixer set Speaker 5%-
bindsym $mod+i exec pamixer --allow-boost -i 5
bindsym $mod+shift+i exec pamixer --allow-boost -d 5
bindsym $mod+shift+v exec "if pamixer --get-mute; then pamixer --unmute; else pamixer --mute; fi"
#bindsym $mod+shift+v exec amixer set Speaker toggle
#bindsym $mod+shift+h exec amixer set Capture toggle
# https://i3wm.org/docs/userguide.html#assign_workspace
# xprop
# Einstellungen für spezielle Programme (exact match instead of substring)
for_window [class="(?i)vlc"] floating disable border none
for_window [class="(?i)virtualbox"] floating enable border normal
for_window [class="(?i)claws-mail"] floating enable border normal
for_window [class="mplayer"] floating disable border none
for_window [title="Wicd"] floating enable border normal
for_window [title="galculator"] floating enable border normal
for_window [title="Verbindungsinformationen"] floating enable border normal
for_window [title="Lautstärkeregler"] floating enable border normal
for_window [title="Freundesliste"] floating enable border normal
# Einstellungen Fensterverhalten für bestimmte Programme im Terminal
for_window [class="Alpine"] floating enable border none
for_window [class="calcurse"] floating enable border none
for_window [class="newsbeuter"] floating enable border none
for_window [class="weechat"] floating enable border none
# Starter für Progs im Terminal
bindsym $mod+F1 exec alacritty -e arch-install
bindsym $mod+F2 exec alacritty -e htop
# assign special properties
for_window [class="^Pavucontrol$"] floating enable
for_window [title="MonoDevelop External Console"] floating enable
for_window [class="^Shutter$"] floating enable
# Enables floating windows of the chrome extension "Videostream for Chromecast"
for_window [instance="^crx_cnciopoikihiagdjbjpnocolokfelagl$"] floating enable
# The Chrome "Page Unresponsive" dialog is not floating...
for_window [title="Page Unresponsive"] floating enable
# Share your screen from Google Cast extension
for_window [title="Share your screen - Google Cast"] floating enable
# TeamSpeak new features window
for_window [class="^TeamSpeak 3$" title="^New TeamSpeak Features"] floating enable
# Android Device Monitor startup window
for_window [class="^Monitor$" instance="^Monitor$" title="^Monitor$"] floating enable
# chromeIPass "No logins found." window
for_window [title="^chromeIPass$"] floating enable
# Jetbrains
for_window [class="^com-intellij-updater-Runner$" title="^Update$"] floating enable
for_window [instance="^sun-awt-X11-XDialogPeer$" title="^Complete Installation$"] floating enable
# Unity
for_window [class="^Unity$" title="^Starting Unity...$"] floating enable
for_window [class="^Unity$" title="^Hold On$"] floating enable
for_window [class="^Unity$" title="^Preparing Package$"] floating enable
for_window [class="^Unity$" title="^Importing Package$"] floating enable
# https://github.com/ValveSoftware/steam-for-linux/issues/1040
for_window [class="^Steam$" title="*"] floating enable
for_window [class="^Steam$" title="*"] resize set 480 640
# Main Window
for_window [class="^Steam$" title="^Steam$"] floating disable
#for_window [class="^Steam$" title="^Friends$"] floating enable
#for_window [class="^Steam$" title="Steam - News"] floating enable
#for_window [class="^Steam$" title=".* - Chat"] floating enable
#for_window [class="^Steam$" title="^Settings$"] floating enable
#for_window [class="^Steam$" title=".* - event started"] floating enable
#for_window [class="^Steam$" title=".* CD key"] floating enable
#for_window [class="^Steam$" title="^Steam - Self Updater$"] floating enable
#for_window [class="^Steam$" title="^Screenshot Uploader$"] floating enable
#for_window [class="^Steam$" title="^Steam Guard - Computer Authorization Required$"] floating enable
#for_window [class="^Steam$" title="Steam-Bibliotheksordner$"] floating enable
#for_window [class="^Steam$" title="Neuen Steam-Bibliotheksordner auswählen oder erstellen:$"] floating enable
#for_window [class="^Steam$" title="Freundesliste"] floating enable
#for_window [title="^Steam Keyboard$"] floating enable
# There is no specific property for windows that should be floating (eg. the WM_NAME is the device name (PC1))
for_window [class="^PacketTracer6$"] floating enable
for_window [class="^PacketTracer6$" title="PT Activity"] floating disable
for_window [class="^PacketTracer6$" title="Cisco Packet Tracer"] floating disable
# Alsa-Steuerung & Lautstärke einstellen
bindsym XF86AudioRaiseVolume exec pamixer --allow-boost -i 5
bindsym XF86AudioLowerVolume exec pamixer --allow-boost -d 5
bindsym XF86AudioMute exec "if pamixer --get-mute; then pamixer --unmute; else pamixer --mute; fi"
bindsym XF86AudioMicMute exec amixer set Capture toggle
#bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume 0 +5% #increase sound volume
#bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume 0 -5% #decrease sound volume
#bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 0 toggle # mute sound
# Steuerung der Helligkeit
#bindsym XF86MonBrightnessUp exec xbacklight +10
#bindsym XF86MonBrightnessDown exec xbacklight -10
#bindsym XF86MonBrightnessUp exec xbacklight -inc 20 # increase screen brightness
#bindsym XF86MonBrightnessDown exec xbacklight -dec 20 # decrease screen brightness
bindsym XF86MonBrightnessUp exec "if lspci | grep -e VGA -e 3D -m 1 | grep AMD; then expr $(cat /sys/class/backlight/amdgpu_bl*/brightness) + 20 | sudo tee --append /sys/class/backlight/amdgpu_bl*/brightness; else expr $(cat /sys/class/backlight/intel_backlight/brightness) + 100 | sudo tee --append /sys/class/backlight/intel_backlight/brightness; fi"
bindsym XF86MonBrightnessDown exec "if lspci | grep -e VGA -e 3D -m 1 | grep AMD; then expr $(cat /sys/class/backlight/amdgpu_bl*/brightness) - 20 | sudo tee --append /sys/class/backlight/amdgpu_bl*/brightness; else expr $(cat /sys/class/backlight/intel_backlight/brightness) - 100 | sudo tee --append /sys/class/backlight/intel_backlight/brightness; fi"
# Touchpad controls
bindsym XF86TouchpadToggle exec /usr/bin/touchpad_toggle # toggle touchpad
# Media player controls
bindsym XF86AudioPlay exec playerctl play
bindsym XF86AudioPause exec playerctl pause
bindsym XF86AudioNext exec playerctl next
bindsym XF86AudioPrev exec playerctl previous
# monitor-picture
bindsym $mod+shift+p exec scrot -e 'mv $f ~/Bilder/' --silent --quality 50
#bindsym a+Print exec scrot -u -e 'mv $f ~/Bilder/' --silent --quality 50
bindsym $mod+p exec sleep 1 && scrot --select -e 'mv $f ~/Bilder/' --quality 50
# Power control script - a useful replacement for the normal i3 exiting keybind.
# https://wiki.archlinux.org/index.php/i3#Shutdown.2C_reboot.2C_lock_screen
set $mode_system System (1) lock, (e) logout, (s) suspend, (h) hibernate, (r) reboot, (d) shutdown
mode "$mode_system" {
bindsym 1 exec --no-startup-id ~/scripte/i3exit lock, mode "default"
bindsym e exec --no-startup-id ~/scripte/i3exit logout, mode "default"
bindsym s exec --no-startup-id ~/scripte/i3exit suspend, mode "default"
bindsym h exec --no-startup-id ~/scripte/i3exit hibernate, mode "default"
bindsym r exec --no-startup-id ~/scripte/i3exit reboot, mode "default"
bindsym d exec --no-startup-id ~/scripte/i3exit shutdown, mode "default"
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+x mode "$mode_system"
set $backlight_system Brightness (1) 10%, (2) 20%, (3) 30%, (4) 40%, (5) 50%, (6) 60%, (7) 70%, (8) 80%, (9) 100%, (0) 0%
mode "$backlight_system" {
bindsym 1 exec "~/.config/i3/backlight_system.sh 50 500"
bindsym 2 exec "~/.config/i3/backlight_system.sh 75 700"
bindsym 3 exec "~/.config/i3/backlight_system.sh 100 900"
bindsym 4 exec "~/.config/i3/backlight_system.sh 125 1100"
bindsym 5 exec "~/.config/i3/backlight_system.sh 150 1300"
bindsym 6 exec "~/.config/i3/backlight_system.sh 175 1500"
bindsym 7 exec "~/.config/i3/backlight_system.sh 200 1700"
bindsym 8 exec "~/.config/i3/backlight_system.sh 225 1900"
bindsym 9 exec "~/.config/i3/backlight_system.sh 255 2100"
bindsym 0 exec "~/.config/i3/backlight_system.sh 0 0"
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+m mode "$backlight_system"
set $hue_light Phillips-Hue Light (1) 10%, (2) 20%, (3) 30%, (4) 40%, (5) 50%, (6) 60%, (7) 70%, (8) 80%, (9) 100%, (0) 0%
mode "$hue_light" {
bindsym 1 exec "~/.config/i3/hui_light.sh true 50"
bindsym 2 exec "~/.config/i3/hui_light.sh true 75"
bindsym 3 exec "~/.config/i3/hui_light.sh true 100"
bindsym 4 exec "~/.config/i3/hui_light.sh true 125"
bindsym 5 exec "~/.config/i3/hui_light.sh true 150"
bindsym 6 exec "~/.config/i3/hui_light.sh true 175"
bindsym 7 exec "~/.config/i3/hui_light.sh true 200"
bindsym 8 exec "~/.config/i3/hui_light.sh true 225"
bindsym 9 exec "~/.config/i3/hui_light.sh true 255"
bindsym 0 exec "~/.config/i3/hui_light.sh false 0"
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+u mode "$hue_light"
set $hue_light_color Phillips-Hue Color (r) Red, (g) Green, (b) Blue
mode "$hue_light_color" {
bindsym r exec "~/.config/i3/hui_light_color.sh 0"
bindsym g exec "~/.config/i3/hui_light_color.sh 25500"
bindsym b exec "~/.config/i3/hui_light_color.sh 46920"
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+shift+u mode "$hue_light_color"
## Manual management of external displays
# Set the shortcuts and what they do
set $mode_display Ext Screen (v) eDP ON, (h) HDMI ON, (x) eDP OFF, (y) HDMI OFF
mode "$mode_display" {
bindsym v exec --no-startup-id xrandr --output eDP --auto --right-of HDMI-A-0, mode "default"
bindsym h exec --no-startup-id xrandr --output HDMI-A-0 --auto --left-of eDP, mode "default"
bindsym x exec --no-startup-id xrandr --output eDP --auto --off, mode "default"
bindsym y exec --no-startup-id xrandr --output HDMI-A-0 --auto --off, mode "default"
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
# Declare here the shortcut to bring the display selection menu
bindsym $mod+Shift+m mode "$mode_display"
#RUN-Menü aufrufen
#bindsym $mod+p exec --no-startup-id i3-input -F 'exec %s' -P 'Auführen: '
# springen von Workspace zu workspace mit oder ohne container
workspace_auto_back_and_forth yes
bindsym $mod+z workspace back_and_forth
bindsym $mod+Shift+z move container to workspace back_and_forth; workspace back_and_forth
# display resoulution
#exec xrandr --output DP-0 --off --output DVI-D-0 --primary --mode 1920x1080 --pos 3840x0 --rotate normal --output DVI-D-1 --mode 1920x1080 --pos 0x0 --rotate normal --output DP-1 --off --output HDMI-0 --mode 1920x1080 --pos 1920x0 --rotate normal
exec --no-startup-id ~/.screenlayout/monitor.sh
# background
exec_always --no-startup-id feh --bg-scale /opt/deadc0de-remix-os/desktop-bilder/Hyllian-Suite.jpg
#exec_always --no-startup-id feh --bg-scale /opt/deadc0de-os-code/background.jpg
# conky ;-)
exec --no-startup-id /opt/.Conky/startconky.sh now
# transparent background termite
#exec --no-startup-id picom -b --config ~/.config/i3/picom.conf
# volumeicon
#exec --no-startup-id volumeicon
# Networkmanager
#exec --no-startup-id nm-applet
# Bluetooth
exec --no-startup-id blueman-applet
# Start clipmenud
exec --no-startup-id "clipmenud"
# Start xscreensaver
exec --no-startup-id "xscreensaver -no-splash"
# Start Pulseaudio Server
#already started
#exec --no-startup-id "pulseaudio --start"
# Start dunst-notifyd Service
exec --no-startup-id "dunst"
# Start ntfy
exec --no-startup-id "/usr/bin/ntfy subscribe --config /etc/ntfy/client.yml --from-config"
# Start volumeicon tray paystray (pulseaudio)
#exec --no-startup-id "pasystray --notify=all"
# imwheel faster scrolling (deactivated sound bug)
#exec --no-startup-id imwheel
# authentication manager
exec --no-startup-id lxpolkit
# xfce4-power-manager
exec --no-startup-id xfce4-power-manager
# start gnome-keyring-daemon
#exec --no-startup-id /usr/bin/gnome-keyring-daemon --start --components=ssh,secrets,pkcs11
# notify service from smartphone
#exec --no-startup-id /opt/an2linuxserver/an2linuxserver.py
# starting Steam
#exec --no-startup-id sleep 30 && steam-native
#######
# i3lock
#convert image.jpg -resize $(xdpyinfo | grep dimensions | sed -r 's/^[^0-9]*([0-9]+x[0-9]+).*$/\1/') RGB:- | i3lock --raw $(xdpyinfo | grep dimensions | sed -r 's/^[^0-9]*([0-9]+x[0-9]+).*$/\1/'):rgb --image /dev/stdin
#bindsym $mod+shift+x exec i3lock -c 000000
bindsym $mod+shift+x exec xtrlock
### i3-gaps stuff ###
# Necessary for i3-gaps to work properly (pixel can be any value)
for_window [class="^.*"] border pixel 3
# Smart Gaps
smart_gaps on
# Smart Borders
smart_borders on
# Set inner/outer gaps
gaps inner 12
gaps outer -2
# Gaps mode
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"
}
exec notify-send -a i3 "loaded" "Welcome to i3."

View file

@ -0,0 +1,48 @@
#!/bin/bash
# Source: http://askubuntu.com/a/450136
URGENT_VALUE=90
PREV_TOTAL=0
PREV_IDLE=0
cpuFile="/tmp/.cpu"
if [[ -f "${cpuFile}" ]]; then
fileCont=$(cat "${cpuFile}")
PREV_TOTAL=$(echo "${fileCont}" | head -n 1)
PREV_IDLE=$(echo "${fileCont}" | tail -n 1)
fi
CPU=(`cat /proc/stat | grep '^cpu '`) # Get the total CPU statistics.
unset CPU[0] # Discard the "cpu" prefix.
IDLE=${CPU[4]} # Get the idle CPU time.
# Calculate the total CPU time.
TOTAL=0
for VALUE in "${CPU[@]:0:4}"; do
let "TOTAL=$TOTAL+$VALUE"
done
if [[ "${PREV_TOTAL}" != "" ]] && [[ "${PREV_IDLE}" != "" ]]; then
# Calculate the CPU usage since we last checked.
let "DIFF_IDLE=$IDLE-$PREV_IDLE"
let "DIFF_TOTAL=$TOTAL-$PREV_TOTAL"
let "DIFF_USAGE=(1000*($DIFF_TOTAL-$DIFF_IDLE)/$DIFF_TOTAL+5)/10"
echo "${DIFF_USAGE}%"
echo "${DIFF_USAGE}%"
echo ""
else
echo "?"
echo "?"
echo ""
fi
# Remember the total and idle CPU times for the next check.
echo "${TOTAL}" > "${cpuFile}"
echo "${IDLE}" >> "${cpuFile}"
if [[ "${DIFF_USAGE}" -gt 0 ]] && [[ "${DIFF_USAGE}" -gt "${URGENT_VALUE}" ]]; then
exit 33
fi

View file

@ -0,0 +1,92 @@
#!/usr/bin/env bash
#
# Copyright (C) 2016 James Murphy
# Licensed under the terms of the GNU GPL v2 only.
#
# i3blocks blocklet script to monitor disk io
label="${LABEL:-""}"
dt="${DT:-5}"
MB_only="${MB_ONLY:-0}"
kB_only="${KB_ONLY:-0}"
width="${WIDTH:-4}"
MB_precision="${MB_PRECISION:-1}"
kB_precision="${KB_PRECISION:-0}"
regex="${REGEX:-$BLOCK_INSTANCE}"
regex="${regex:-/^(s|h)d[a-zA-Z]+/}"
threshold="${THRESHOLD:-0}"
warn_color="${WARN_COLOR:-#FF0000}"
sep="${SEPARATOR:-/}"
unit_suffix="${SUFFIX:-B/s}"
function list_devices {
echo "Devices iostat reports that match our regex:"
iostat | awk '$1~/^(s|h)d[a-zA-Z]+/{print $1}'
}
while getopts L:t:w:p:P:R:s:ST:C:lLMmKkh opt; do
case "$opt" in
L) label="$OPTARG" ;;
t) dt="$OPTARG" ;;
w) width="$OPTARG" ;;
p) kB_precision="$OPTARG" ;;
P) MB_precision="$OPTARG" ;;
R) regex="$OPTARG" ;;
s) sep="$OPTARG" ;;
S) unit_suffix="" ;;
T) threshold="$OPTARG" ;;
C) warn_color="$OPTARG" ;;
l) list_devices; exit 0 ;;
M|m) MB_only=1 ;;
K|k) kB_only=1 ;;
h) printf \
"Usage: disk-io [-t time] [-w width] [-p kB_precision] [-P MB_precision] [-R regex] [-s separator] [-S] [-T threshold [-C warn_color]] [-k|-M] [-l] [-h]
Options:
-L\tLabel to put in front of the text. Default: $label
-t\tTime interval in seconds between measurements. Default: $dt
-w\tThe width of printed floats. Default: $width
-p\tThe precision of kB/s floats. Default: $kB_precision
-P\tThe precision of MB/s floats. Default: $MB_precision
-R\tRegex that devices must match. Default: $regex
-s\tSeparator to put between rates. Default: $sep
-S\tShort units, omit B/s in kB/s and MB/s.
-T\tRate in kB/s to exceed to trigger a warning. Default: not enabled
-C\tColor to change the blocklet to warn the user. Default: $warn_color
-l\tList devices that iostat reports
-M\tDo not switch between MB/s and kB/s, use only MB/s
-k\tDo not switch between MB/s and kB/s, use only kB/s
-h\tShow this help text
" && exit 0;;
esac
done
iostat -dyz "$dt" | awk -v sep="$sep" "
BEGIN {
rx = wx = 0;
}
{
if(\$0 == \"\") {
if ($threshold > 0 && (rx >= $threshold || wx >= $threshold)) {
printf \"<span color='$warn_color'>\";
}
printf \"$label\";
if(!$kB_only && ($MB_only || rx >= 1024 || wx >= 1024)) {
printf \"%-$width.${MB_precision}f%s%$width.${MB_precision}f M$unit_suffix\", rx/1024, sep, wx/1024;
}
else {
printf \"%-$width.${kB_precision}f%s%$width.${kB_precision}f k$unit_suffix\", rx, sep, wx;
}
if ($threshold > 0 && (rx >= $threshold || wx >= $threshold)) {
printf \"</span>\";
}
printf \"\n\";
fflush(stdout);
}
else if(\$1~/^Device:?/) {
rx = wx = 0;
}
else if(\$1~$regex) {
rx += \$3;
wx += \$4;
}
}"

View file

@ -0,0 +1,38 @@
#!/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 '
/\/.*/ {
# full text
print $4
# short text
print $4
use=$5
# no need to continue parsing
exit 0
}
END {
gsub(/%$/,"",use)
if (100 - use < alert_low) {
# color
print "#FF0000"
}
}
'

View file

@ -0,0 +1,4 @@
#!/bin/bash
set -x
curl --location --request PUT 'http://192.168.1.123/api/EYlLGomum-wwCSoil1oRkIpcmYORn3KR03201tQg/lights/1/state' --header 'Content-Type: text/plain' --data-raw '{"on":'$1', "bri": '$2'}'

View file

@ -0,0 +1,4 @@
#!/bin/bash
set -x
curl --location --request PUT 'http://192.168.1.123/api/EYlLGomum-wwCSoil1oRkIpcmYORn3KR03201tQg/lights/1/state' --header 'Content-Type: text/plain' --data-raw '{"hue":'$1'}'

View file

@ -0,0 +1,342 @@
# 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
command=$SCRIPT_DIR/$BLOCK_NAME
color=#E0E0E0
# 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=/usr/lib/i3blocks/$BLOCK_NAME
separator_block_width=7
markup=pango
#[mediaplayer]
#command=printf "<span font_family=\"FontAwesome\"></span> %s" "$(mpc current )"
#instance=mpd
#interval=5
#signal=10
#color=#E0E0E0
#color=#556270
#color=#FE4365
#[batterybar]
#command=~/.config/i3/batterybar
#label=bat:
#interval=60
#markup=pango
#min_width=bat: ■■■■■
#color=#E0E0E0
# Discharging colors low to high
#C1=#FF0027
#C2=#FF3B05
#C3=#FFB923
#C4=#FFD000
#C5=#E4FF00
#C6=#ADFF00
#C7=#6DFF00
#C8=#10BA00
#CHARGING_COLOR=#00AFE3
#FULL_COLOR=#FFFFFF
#AC_COLOR=#535353
# 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]
#command=printf "<span font_family=\"FontAwesome\"> </span> %s" "$(amixer get Speaker | grep -E -o '[0-9]{1,3}?%' | head -1)"
#command=printf "<span font_family=\"FontAwesome\"> </span> %s" "$(amixer get PCM | grep -E -o '[0-9]{1,3}?%' | head -1)"
#command=printf "<span font_family=\"FontAwesome\"> </span> %s" "$(pamixer --get-volume-human)"
#label=♪
# instance=Master
# instance=PCM
#interval=1
#color=#E0E0E0
#color=#556270
#signal=10
#[loading]
#command=printf "<span font_family=\"FontAwesome\">  </span> %s" "$(awk {'print $1,$2,$3 '} /proc/loadavg)"
#interval=2
#color=#E0E0E0
#color=#556270
#separator=true
# Memory usage
#
# The type defaults to "mem" if the instance is not specified.
#[memory]
#command=printf "<span font_family=\"FontAwesome\">  </span> %s" "$(bash ~/.config/i3/mem)"
#separator=false
#color=#E0E0E0
#color=#556270
#interval=30
#separator=true
#[temperature]
#command=printf "<span font_family=\"FontAwesome\">  </span> %s" "$(bash ~/.config/i3/sensors.sh)"
#color=#E0E0E0
#color=#556270
#interval=5
#[vpn]
#command=printf "<span font_family=\"FontAwesome\"> %s </span>" "$(bash ~/.config/i3/vpn.sh)"
#label= VPN
#color=#E0E0E0
#color=#556270
#interval=5
[disk]
command=~/.config/i3/disk.sh
interval=1
label=
color=#E0E0E0
#[weather]
#command=printf "<span font_family=\"Weather Icons\"> %s </span>" "$(ruby ~/.config/i3/weather.rb)"
#interval=300
#color=#556270
#separator=true
#[memory]
#label=SWAP
#instance=swap
#separator=false
#interval=30
# 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]
#command=printf "<span font_family=\"FontAwesome\"></span> %s" "$(/usr/bin/i3blocks/$BLOCK_NAME)"
#instance=/mnt/data
#interval=30
# 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.
#[wifi]
#instance=wlp3s0
#interval=10
#separator=false
# [bandwidth]
#command=printf "<span font_family=\"FontAwesome\"></span> %s" "$(/usr/lib/i3blocks/$BLOCK_NAME)"
#instance=eth0
#interval=5
# CPU usage
#
# The script may be called with -w and -c switches to specify thresholds,
# see the script for details.
# Battery indicator
#
# The battery instance defaults to 0.
#[battery]
#label=BAT
#label=⚡
#instance=1
#interval=30
# Date Time
#
# Generic media player support
#
# This displays "ARTIST - SONG" if a music is playing.
# Supported players are: spotify, vlc, audacious, xmms2, mplayer, and others.
#[mediaplayer]
#instance=spotify
#interval=5
#signal=10
# OpenVPN support
#
#Support multiple VPN, with colors.
# 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=TEMP
#interval=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+11 i3blocks
#[keyindicator]
#instance=CAPS
#interval=once
#signal=11
#[keyindicator]
#instance=NUM
#interval=once
#signal=11
#[usb]
#command=~/.config/i3/usb
#markup=pango
#signal=1
#interval=10
#color=#E0E0E0
#IGNORE_LIST=[]
#IGNORE_LIST=["sdd1", "mapper/sda1_crypt"]
#INFO_TEXT_COLOR=white
#MOUNTED_COLOR=green
#PLUGGED_COLOR=gray
#LOCKED_COLOR=gray
#UNLOCKED_NOT_MOUNTED_COLOR=yellow
#PARTITIONLESS_COLOR=red
#PARTITIONLESS_TEXT=no partitions
#SEPARATOR=<span color='gray'> | </span>
#LOCKED_INDICATOR=
#UNLOCKED_INDICATOR=
#READONLY_INDICATOR=ro
#TRUNCATE_FS_LABELS=[not set by default, accepts +/- integers]
#[shutdown_menu]
#full_text=Quit
# If you are using FontAwesome, we recommend the power-off icon:
# http://fontawesome.io/icon/power-off/
#command=~/.config/i3/shutdown_menu
#FG_COLOR=#bbbbbb
#BG_COLOR=#111111
#HLFG_COLOR=#111111
#HLBG_COLOR=#bbbbbb
#BORDER_COLOR=#222222
#ROFI_TEXT=Menu:
#ROFI_OPTIONS=-width 11 -location 3 -hide-scrollbar -bw 2
#ZENITY_TITLE=Menu
#ZENITY_TEXT=Action:
#ZENITY_OPTIONS=--column= --hide-header
#ENABLE_CONFIRMATIONS=true (must be true or false)
#LAUNCHER=rofi (must be rofi or zenity)
#LOCKSCRIPT=i3lock --color=${BG_COLOR#"#"}
#[pacman-updates]
#label=
#command=~/.config/i3/arch-update
#markup=pango
#interval= 3600
#QUIET=true
#WATCH=^linux.* ^pacman.*
#BASE_COLOR=#5fff5f
#UPDATE_COLOR=#FFFF85
#AUR=true
#[arch-update]
#command=~/.config/i3/arch-update
#label=Updates:
#interval=3600
#markup=pango
#[disk-io]
#command=~/.config/i3/disk-io
#command=$SCRIPT_DIR/disk-io -w 3 -M -P 0
#interval=persist
#markup=pango
#LABEL=
#instance=/^sda/
#DT=5
#MB_ONLY=0 #0 or 1
#KB_ONLY=0 #0 or 1
#WIDTH=4
#MB_PRECISION=1
#KB_PRECISION=0
#REGEX=/^(s|h)d[a-zA-Z]+/
#THRESHOLD=0
#WARN_COLOR="#FF0000"
#SEPARATOR=/
#PREFIX=
#SUFFIX="B/s"
#[calendar]
#command=~/.config/i3/calendar
#interval=1
#LABEL=
#DATEFMT=+%H:%M:%S
# SHORTFMT=+%H:%M:%S
#HEIGHT=180
#WIDTH=220
[time]
command=printf "<span font_family=\"FontAwesome\">  </span> %s\n" "$(date '+%b %a %d %Y | %H:%M:%S ')"
interval=1
color=#E0E0E0
#color=#556270
separator=true
[key_layout]
command=~/.config/i3/key_layout
label=Layout
interval=30
color=#E0E0E0
# Query my default IP address only on startup
[ip]
command=ip addr | grep 'inet' | grep -v inet6 | grep -vE '127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1
label=IP
interval=30
color=#E0E0E0
#[bandwidth]
#command=~/.config/i3/bandwidth
#interval=5
#INTERFACE=enp2s0f1
#INLABEL="IN "
#OUTLABEL="OUT "
#TREAT_UNKNOWN_AS_UP=0
#[monitors]
#command=~/.config/i3/monitor_manager
#interval=once
#color=#E0E0E0
#SHOW_ON_OFF=1
#SHOW_NAMES=1
#SHOW_PRIMARY=1
#SHOW_MODE=1
#SHOW_BLANKED=1
#SHOW_DUPLICATE=1
#SHOW_ROTATION=1
#SHOW_REFLECTION=1
#SHOW_BRIGHTNESS=1
#SHOW_BRIGHTNESS_VALUE=0
#SHOW_UP_DOWN=1
#FONT_FAMILY=DejaVu Sans Mono
#FONT_SIZE=11
#CLOSE_TO_BOUNDARY_BUFFER=20

View file

@ -0,0 +1,342 @@
# 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
command=$SCRIPT_DIR/$BLOCK_NAME/$BLOCK_NAME
color=#E0E0E0
# 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=/usr/lib/i3blocks/$BLOCK_NAME/$BLOCK_NAME
separator_block_width=7
markup=pango
#[mediaplayer]
#command=printf "<span font_family=\"FontAwesome\"></span> %s" "$(mpc current )"
#instance=mpd
#interval=5
#signal=10
#color=#E0E0E0
#color=#556270
#color=#FE4365
#[batterybar]
#command=~/.config/i3/batterybar
#label=bat:
#interval=60
#markup=pango
#min_width=bat: ■■■■■
#color=#E0E0E0
# Discharging colors low to high
#C1=#FF0027
#C2=#FF3B05
#C3=#FFB923
#C4=#FFD000
#C5=#E4FF00
#C6=#ADFF00
#C7=#6DFF00
#C8=#10BA00
#CHARGING_COLOR=#00AFE3
#FULL_COLOR=#FFFFFF
#AC_COLOR=#535353
# 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]
#command=printf "<span font_family=\"FontAwesome\"> </span> %s" "$(amixer get Speaker | grep -E -o '[0-9]{1,3}?%' | head -1)"
#command=printf "<span font_family=\"FontAwesome\"> </span> %s" "$(amixer get PCM | grep -E -o '[0-9]{1,3}?%' | head -1)"
command=printf "<span font_family=\"FontAwesome\"> </span> %s\n" "$(pamixer --get-volume-human)"
#label=♪
# instance=Master
# instance=PCM
interval=1
color=#E0E0E0
#color=#556270
signal=10
[loading]
command=printf "<span font_family=\"FontAwesome\">  </span> %s\n" "$(awk {'print $1,$2,$3 '} /proc/loadavg)"
interval=2
color=#E0E0E0
#color=#556270
separator=true
# Memory usage
#
# The type defaults to "mem" if the instance is not specified.
[memory]
command=printf "<span font_family=\"FontAwesome\">  </span> %s\n" "$(bash ~/.config/i3/mem)"
separator=false
color=#E0E0E0
#color=#556270
interval=30
separator=true
[temperature]
command=printf "<span font_family=\"FontAwesome\">  </span> %s\n" "$(bash ~/.config/i3/sensors.sh)"
color=#E0E0E0
#color=#556270
interval=5
[vpn]
command=printf "<span font_family=\"FontAwesome\"> %s </span>\n" "$(bash ~/.config/i3/vpn.sh)"
label= VPN
color=#E0E0E0
#color=#556270
interval=5
#[disk]
#command=~/.config/i3/disk.sh
#interval=1
#label=
#color=#E0E0E0
#[weather]
#command=printf "<span font_family=\"Weather Icons\"> %s </span>" "$(ruby ~/.config/i3/weather.rb)"
#interval=300
#color=#556270
#separator=true
#[memory]
#label=SWAP
#instance=swap
#separator=false
#interval=30
# 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]
#command=printf "<span font_family=\"FontAwesome\"></span> %s" "$(/usr/bin/i3blocks/$BLOCK_NAME)"
#instance=/mnt/data
#interval=30
# 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.
#[wifi]
#instance=wlp3s0
#interval=10
#separator=false
# [bandwidth]
#command=printf "<span font_family=\"FontAwesome\"></span> %s" "$(/usr/lib/i3blocks/$BLOCK_NAME)"
#instance=eth0
#interval=5
# CPU usage
#
# The script may be called with -w and -c switches to specify thresholds,
# see the script for details.
# Battery indicator
#
# The battery instance defaults to 0.
#[battery]
#label=BAT
#label=⚡
#instance=1
#interval=30
# Date Time
#
# Generic media player support
#
# This displays "ARTIST - SONG" if a music is playing.
# Supported players are: spotify, vlc, audacious, xmms2, mplayer, and others.
#[mediaplayer]
#instance=spotify
#interval=5
#signal=10
# OpenVPN support
#
#Support multiple VPN, with colors.
# 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=TEMP
#interval=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+11 i3blocks
#[keyindicator]
#instance=CAPS
#interval=once
#signal=11
#[keyindicator]
#instance=NUM
#interval=once
#signal=11
#[usb]
#command=~/.config/i3/usb
#markup=pango
#signal=1
#interval=10
#color=#E0E0E0
#IGNORE_LIST=[]
#IGNORE_LIST=["sdd1", "mapper/sda1_crypt"]
#INFO_TEXT_COLOR=white
#MOUNTED_COLOR=green
#PLUGGED_COLOR=gray
#LOCKED_COLOR=gray
#UNLOCKED_NOT_MOUNTED_COLOR=yellow
#PARTITIONLESS_COLOR=red
#PARTITIONLESS_TEXT=no partitions
#SEPARATOR=<span color='gray'> | </span>
#LOCKED_INDICATOR=
#UNLOCKED_INDICATOR=
#READONLY_INDICATOR=ro
#TRUNCATE_FS_LABELS=[not set by default, accepts +/- integers]
#[shutdown_menu]
#full_text=Quit
# If you are using FontAwesome, we recommend the power-off icon:
# http://fontawesome.io/icon/power-off/
#command=~/.config/i3/shutdown_menu
#FG_COLOR=#bbbbbb
#BG_COLOR=#111111
#HLFG_COLOR=#111111
#HLBG_COLOR=#bbbbbb
#BORDER_COLOR=#222222
#ROFI_TEXT=Menu:
#ROFI_OPTIONS=-width 11 -location 3 -hide-scrollbar -bw 2
#ZENITY_TITLE=Menu
#ZENITY_TEXT=Action:
#ZENITY_OPTIONS=--column= --hide-header
#ENABLE_CONFIRMATIONS=true (must be true or false)
#LAUNCHER=rofi (must be rofi or zenity)
#LOCKSCRIPT=i3lock --color=${BG_COLOR#"#"}
#[pacman-updates]
#label=
#command=~/.config/i3/arch-update
#markup=pango
#interval= 3600
#QUIET=true
#WATCH=^linux.* ^pacman.*
#BASE_COLOR=#5fff5f
#UPDATE_COLOR=#FFFF85
#AUR=true
#[arch-update]
#command=~/.config/i3/arch-update
#label=Updates:
#interval=3600
#markup=pango
#[disk-io]
#command=~/.config/i3/disk-io
#command=$SCRIPT_DIR/disk-io -w 3 -M -P 0
#interval=persist
#markup=pango
#LABEL=
#instance=/^sda/
#DT=5
#MB_ONLY=0 #0 or 1
#KB_ONLY=0 #0 or 1
#WIDTH=4
#MB_PRECISION=1
#KB_PRECISION=0
#REGEX=/^(s|h)d[a-zA-Z]+/
#THRESHOLD=0
#WARN_COLOR="#FF0000"
#SEPARATOR=/
#PREFIX=
#SUFFIX="B/s"
#[calendar]
#command=~/.config/i3/calendar
#interval=1
#LABEL=
#DATEFMT=+%H:%M:%S
# SHORTFMT=+%H:%M:%S
#HEIGHT=180
#WIDTH=220
#[time]
#command=printf "<span font_family=\"FontAwesome\">  </span> %s" "$(date '+%b %a %d %Y | %H:%M:%S ')"
#interval=1
#color=#E0E0E0
#color=#556270
#separator=true
#[key_layout]
#command=~/.config/i3/key_layout
#label=Layout
#interval=30
#color=#E0E0E0
# Query my default IP address only on startup
#[ip]
#command=ip addr | grep 'inet' | grep -v inet6 | grep -vE '127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1
#label=IP
#interval=30
#color=#E0E0E0
#[bandwidth]
#command=~/.config/i3/bandwidth
#interval=5
#INTERFACE=enp2s0f1
#INLABEL="IN "
#OUTLABEL="OUT "
#TREAT_UNKNOWN_AS_UP=0
#[monitors]
#command=~/.config/i3/monitor_manager
#interval=once
#color=#E0E0E0
#SHOW_ON_OFF=1
#SHOW_NAMES=1
#SHOW_PRIMARY=1
#SHOW_MODE=1
#SHOW_BLANKED=1
#SHOW_DUPLICATE=1
#SHOW_ROTATION=1
#SHOW_REFLECTION=1
#SHOW_BRIGHTNESS=1
#SHOW_BRIGHTNESS_VALUE=0
#SHOW_UP_DOWN=1
#FONT_FAMILY=DejaVu Sans Mono
#FONT_SIZE=11
#CLOSE_TO_BOUNDARY_BUFFER=20

View file

@ -0,0 +1,338 @@
# 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
command=$SCRIPT_DIR/$BLOCK_NAME
color=#E0E0E0
# 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=/usr/lib/i3blocks/$BLOCK_NAME
separator_block_width=7
markup=pango
#[mediaplayer]
#command=printf "<span font_family=\"FontAwesome\"></span> %s" "$(mpc current )"
#instance=mpd
#interval=5
#signal=10
#color=#E0E0E0
#color=#556270
#color=#FE4365
[batterybar]
command=~/.config/i3/batterybar
label=bat:
interval=5
markup=pango
min_width=bat: ■■■■■
color=#E0E0E0
# Discharging colors low to high
#C1=#FF0027
#C2=#FF3B05
#C3=#FFB923
#C4=#FFD000
#C5=#E4FF00
#C6=#ADFF00
#C7=#6DFF00
#C8=#10BA00
#CHARGING_COLOR=#00AFE3
#FULL_COLOR=#FFFFFF
#AC_COLOR=#535353
# 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]
#command=printf "<span font_family=\"FontAwesome\"> </span> %s" "$(amixer get Speaker | grep -E -o '[0-9]{1,3}?%' | head -1)"
command=printf "<span font_family=\"FontAwesome\"> </span> %s" "$(pamixer --get-volume-human)"
#label=♪
# instance=Master
# instance=PCM
interval=1
color=#E0E0E0
#color=#556270
signal=10
[loading]
command=printf "<span font_family=\"FontAwesome\">  </span> %s" "$(awk {'print $1,$2,$3 '} /proc/loadavg)"
interval=2
color=#E0E0E0
#color=#556270
separator=true
# Memory usage
#
# The type defaults to "mem" if the instance is not specified.
[memory]
command=printf "<span font_family=\"FontAwesome\">  </span> %s" "$(bash ~/.config/i3/mem)"
separator=false
color=#E0E0E0
#color=#556270
interval=30
separator=true
[temperature]
command=printf "<span font_family=\"FontAwesome\">  </span> %s" "$(bash ~/.config/i3/sensors.sh)"
color=#E0E0E0
#color=#556270
interval=5
[vpn]
command=printf "<span font_family=\"FontAwesome\"> %s </span>" "$(bash ~/.config/i3/vpn.sh)"
label= VPN
color=#E0E0E0
#color=#556270
interval=5
[disk]
command=~/.config/i3/disk.sh
interval=1
label=
color=#E0E0E0
#[weather]
#command=printf "<span font_family=\"Weather Icons\"> %s </span>" "$(ruby ~/.config/i3/weather.rb)"
#interval=300
#color=#556270
#separator=true
#[memory]
#label=SWAP
#instance=swap
#separator=false
#interval=30
# 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]
#command=printf "<span font_family=\"FontAwesome\"></span> %s" "$(/usr/bin/i3blocks/$BLOCK_NAME)"
#instance=/mnt/data
#interval=30
# 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.
#[wifi]
#instance=wlp3s0
#interval=10
#separator=false
# [bandwidth]
#command=printf "<span font_family=\"FontAwesome\"></span> %s" "$(/usr/lib/i3blocks/$BLOCK_NAME)"
#instance=eth0
#interval=5
# CPU usage
#
# The script may be called with -w and -c switches to specify thresholds,
# see the script for details.
# Battery indicator
#
# The battery instance defaults to 0.
#[battery]
#label=BAT
#label=⚡
#instance=1
#interval=30
# Date Time
#
# Generic media player support
#
# This displays "ARTIST - SONG" if a music is playing.
# Supported players are: spotify, vlc, audacious, xmms2, mplayer, and others.
#[mediaplayer]
#instance=spotify
#interval=5
#signal=10
# OpenVPN support
#
#Support multiple VPN, with colors.
# 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=TEMP
#interval=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+11 i3blocks
#[keyindicator]
#instance=CAPS
#interval=once
#signal=11
#[keyindicator]
#instance=NUM
#interval=once
#signal=11
#[usb]
#command=~/.config/i3/usb
#markup=pango
#signal=1
#interval=10
#IGNORE_LIST=[]
#IGNORE_LIST=["sdd1", "mapper/sda1_crypt"]
#INFO_TEXT_COLOR=white
#MOUNTED_COLOR=green
#PLUGGED_COLOR=gray
#LOCKED_COLOR=gray
#UNLOCKED_NOT_MOUNTED_COLOR=yellow
#PARTITIONLESS_COLOR=red
#PARTITIONLESS_TEXT=no partitions
#SEPARATOR=<span color='gray'> | </span>
#LOCKED_INDICATOR=
#UNLOCKED_INDICATOR=
#READONLY_INDICATOR=ro
#TRUNCATE_FS_LABELS=[not set by default, accepts +/- integers]
#[shutdown_menu]
#full_text=Quit
# If you are using FontAwesome, we recommend the power-off icon:
# http://fontawesome.io/icon/power-off/
#command=~/.config/i3/shutdown_menu
#FG_COLOR=#bbbbbb
#BG_COLOR=#111111
#HLFG_COLOR=#111111
#HLBG_COLOR=#bbbbbb
#BORDER_COLOR=#222222
#ROFI_TEXT=Menu:
#ROFI_OPTIONS=-width 11 -location 3 -hide-scrollbar -bw 2
#ZENITY_TITLE=Menu
#ZENITY_TEXT=Action:
#ZENITY_OPTIONS=--column= --hide-header
#ENABLE_CONFIRMATIONS=true (must be true or false)
#LAUNCHER=rofi (must be rofi or zenity)
#LOCKSCRIPT=i3lock --color=${BG_COLOR#"#"}
#[pacman-updates]
#label=
#command=~/.config/i3/arch-update
#markup=pango
#interval= 3600
#QUIET=true
#WATCH=^linux.* ^pacman.*
#BASE_COLOR=#5fff5f
#UPDATE_COLOR=#FFFF85
#AUR=true
#[arch-update]
#command=~/.config/i3/arch-update
#label=Updates:
#interval=3600
#markup=pango
#[disk-io]
#command=~/.config/i3/disk-io
#command=$SCRIPT_DIR/disk-io -w 3 -M -P 0
#interval=persist
#markup=pango
#LABEL=
#instance=/^sda/
#DT=5
#MB_ONLY=0 #0 or 1
#KB_ONLY=0 #0 or 1
#WIDTH=4
#MB_PRECISION=1
#KB_PRECISION=0
#REGEX=/^(s|h)d[a-zA-Z]+/
#THRESHOLD=0
#WARN_COLOR="#FF0000"
#SEPARATOR=/
#PREFIX=
#SUFFIX="B/s"
#[calendar]
#command=~/.config/i3/calendar
#interval=1
#LABEL=
#DATEFMT=+%H:%M:%S
# SHORTFMT=+%H:%M:%S
#HEIGHT=180
#WIDTH=220
[time]
command=printf "<span font_family=\"FontAwesome\">  </span> %s" "$(date '+%b %a %d %Y | %H:%M:%S ')"
interval=1
color=#E0E0E0
#color=#556270
separator=true
[key_layout]
command=~/.config/i3/key_layout
label=Layout
interval=30
color=#E0E0E0
# Query my default IP address only on startup
[ip]
command=ip addr | grep 'inet' | grep -v inet6 | grep -vE '127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1
interval=once
#[bandwidth]
#command=~/.config/i3/bandwidth
#interval=5
#INTERFACE=enp2s0f1
#INLABEL="IN "
#OUTLABEL="OUT "
#TREAT_UNKNOWN_AS_UP=0
[monitors]
command=~/.config/i3/monitor_manager
interval=once
color=#E0E0E0
#SHOW_ON_OFF=1
#SHOW_NAMES=1
#SHOW_PRIMARY=1
#SHOW_MODE=1
#SHOW_BLANKED=1
#SHOW_DUPLICATE=1
#SHOW_ROTATION=1
#SHOW_REFLECTION=1
#SHOW_BRIGHTNESS=1
#SHOW_BRIGHTNESS_VALUE=0
#SHOW_UP_DOWN=1
#FONT_FAMILY=DejaVu Sans Mono
#FONT_SIZE=11
#CLOSE_TO_BOUNDARY_BUFFER=20

View file

@ -0,0 +1,23 @@
#!/usr/bin/env bash
# Copyright 2016 Patrick Haun
# Edited: Denis Kadyshev
#
# 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/>.
setxkbmap -query | awk '
BEGIN{layout="";variant=""}
/^layout/{layout=$2}
/^variant/{variant=" ("$2")"}
END{printf(" %s\n%s\n",layout,variant)}'

View file

@ -0,0 +1,20 @@
#!/bin/bash
#INSTANCE="${BLOCK_INSTANCE:-1}"
INSTANCE="1,2,3"
URGENT_VALUE=90
LOAD=$(cat /proc/loadavg | awk -F ' ' '{print $'"${INSTANCE}"'}')
if [[ "${LOAD}" != "" ]]; then
LOAD_PERC=$(echo "scale=0; ${LOAD} * 100" | bc -l)
LOAD_PERC=${LOAD_PERC%.*}
echo "${LOAD}"
echo "${LOAD}"
echo ""
if [[ "${LOAD_PERC}" -ge "${URGENT_VALUE}" ]]; then
exit 33
fi
fi

View file

@ -0,0 +1,8 @@
#!/bin/bash
# Show used and total memory
available=$(awk '/MemAvailable/ {$2=$2/1024; printf("%3.2f\n", $2)}' /proc/meminfo)
total=$(awk '/MemTotal/ {$2=$2/1024**2; printf("%3.1f\n", $2)}' /proc/meminfo )
echo "${available}"
echo ""

View file

@ -0,0 +1,728 @@
#!/usr/bin/env python3
#
# Copyright (c) 2016 James Murphy
# Licensed under the GPL version 2 only
#
# monitor_manager is an i3blocks blocklet script to quickly manage your
# connected output devices
from tkinter import *
from tkinter import messagebox
from shutil import which
import tkinter.font as font
from subprocess import call, check_output, CalledProcessError
import re
import os
DESKTOP_SYMBOL = "\uf108"
UP_ARROW = "\uf062"
DOWN_ARROW = "\uf063"
UNBLANKED_SYMBOL = "\uf06e"
BLANKED_SYMBOL = "\uf070"
NOT_CLONED_SYMBOL = "\uf096"
PRIMARY_SYMBOL = "\uf005"
SECONDARY_SYMBOL = "\uf006"
CLONED_SYMBOL = "\uf24d"
ROTATION_NORMAL = "\uf151"
ROTATION_LEFT = "\uf191"
ROTATION_RIGHT = "\uf152"
ROTATION_INVERTED = "\uf150"
REFLECTION_NORMAL = "\uf176"
REFLECTION_X = "\uf07e"
REFLECTION_Y = "\uf07d"
REFLECTION_XY = "\uf047"
TOGGLE_ON = "\uf205"
TOGGLE_OFF = "\uf204"
APPLY_SYMBOL = "\uf00c"
CANCEL_SYMBOL = "\uf00d"
ARANDR_SYMBOL = "\uf085"
REFRESH_SYMBOL = "\uf021"
strbool = lambda s: s.lower() in ['t', 'true', '1']
def _default(name, default='', arg_type=strbool):
val = default
if name in os.environ:
val = os.environ[name]
return arg_type(val)
SHOW_ON_OFF = _default("SHOW_ON_OFF","1")
SHOW_NAMES = _default("SHOW_NAMES", "1")
SHOW_PRIMARY = _default("SHOW_PRIMARY", "1")
SHOW_MODE = _default("SHOW_MODE", "1")
SHOW_BLANKED = _default("SHOW_BLANKED", "1")
SHOW_DUPLICATE = _default("SHOW_DUPLICATE", "1")
SHOW_ROTATION = _default("SHOW_ROTATION", "1")
SHOW_REFLECTION = _default("SHOW_REFLECTION", "1")
SHOW_BRIGHTNESS = _default("SHOW_BRIGHTNESS", "1")
SHOW_BRIGHTNESS_VALUE = _default("SHOW_BRIGHTNESS_VALUE", "0")
SHOW_UP_DOWN = _default("SHOW_UP_DOWN", "1")
FONTAWESOME_FONT_FAMILY = "FontAwesome"
FONTAWESOME_FONT_SIZE = 11
FONTAWESOME_FONT = (FONTAWESOME_FONT_FAMILY, FONTAWESOME_FONT_SIZE)
DEFAULT_FONT_FAMILY = _default("FONT_FAMILY","DejaVu Sans Mono", str)
DEFAULT_FONT_SIZE = _default("FONT_SIZE", 11, int)
DEFAULT_FONT = (DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE)
BRIGHTNESS_SLIDER_HANDLE_LENGTH = 20
BRIGHTNESS_SLIDER_WIDTH = 15
BRIGHTNESS_SLIDER_LENGTH = 50
WINDOW_CLOSE_TO_BOUNDARY_BUFFER = _default("CLOSE_TO_BOUNDARY_BUFFER", 20, int)
class Output:
def __init__(self, name=None, w=None, h=None, x=None, y=None, rate=None,
active=False, primary=False, sameAs=None, blanked=False, rotation="normal",
reflection="normal", brightness=1.0):
self.name = name
self.w = w
self.h = h
self.x = x
self.y = y
self.rate = rate
self.active = active
self.primary = primary
self.sameAs = sameAs
self.blanked = blanked
self.modes = []
self.currentModeIndex = None
self.preferredModeIndex = None
self.row = None
self.rotation = rotation
self.reflection = reflection
self.brightness = brightness
def setPreferredMode(self):
if self.preferredModeIndex != None:
self.setMode(self.preferredModeIndex)
elif self.modes != None:
self.setMode(0)
def setMode(self, index):
self.w, self.h, self.rate = self.modes[index]
self.currentModeIndex = index
def realOutputs():
outputs = []
xrandrText = check_output(["xrandr","--verbose"],universal_newlines=True)
outputBlocks = re.split(r'\n(?=\S)', xrandrText, re.MULTILINE)
infoPattern = re.compile(
r'^(\S+)' # output name
' connected ' # must be connected
'(primary )?' # check if primary output
'((\d+)x(\d+)\+(\d+)\+(\d+) )?' # width x height + xoffset + yoffset
'(\(\S+\) )?' # mode code (0x4a)
'(normal|left|inverted|right)? ?' # rotation
'(X axis|Y axis|X and Y axis)?') # reflection
brightnessPattern = re.compile(r'^\tBrightness: ([\d.]+)', re.MULTILINE)
modePattern = re.compile(r'^ (\d+)x(\d+)[^\n]*?\n +h:[^\n]*?\n +v:[^\n]*?([\d.]+)Hz$', re.MULTILINE)
for outputBlock in outputBlocks:
output = Output()
infoMatch = infoPattern.match(outputBlock)
if infoMatch:
output.name = infoMatch.group(1)
if infoMatch.group(2):
output.primary = True
if infoMatch.group(3):
output.active = True
output.w, output.h, output.x, output.y = map(int,infoMatch.group(4, 5, 6, 7))
if infoMatch.group(9):
output.rotation = infoMatch.group(9)
if output.rotation in ["left", "right"]:
output.w, output.h = output.h, output.w
if infoMatch.group(10):
if infoMatch.group(10) == "X axis":
output.reflection = "x"
elif infoMatch.group(10) == "Y axis":
output.reflection = "y"
elif infoMatch.group(10) == "X and Y axis":
output.reflection = "xy"
else:
output.reflection = "normal"
else:
output.reflection = "normal"
brightnessMatch = brightnessPattern.search(outputBlock)
if brightnessMatch:
try:
brightness = float(brightnessMatch.group(1))
output.brightness = brightness
if abs(brightness) < 1e-09:
output.blanked = True
except ValueError:
pass
modeMatches = modePattern.finditer(outputBlock)
for i, modeMatch in enumerate(modeMatches):
if "*current" in modeMatch.group(0):
output.currentModeIndex = i
output.rate = modeMatch.group(3)
if "+preferred" in modeMatch.group(0):
output.preferredModeIndex = i
output.modes.append(modeMatch.group(1,2,3))
outputs.append(output)
outputs.sort(key=lambda m: m.x if m.x != None else -1)
prev = None
for output in outputs:
if prev != None and output.active and prev.active and output.x == prev.x:
output.sameAs = prev.name
else:
prev = output
return outputs
def modestr(mode):
return "{}x{}@{}".format(*mode)
def status(self):
if self.active:
if self.sameAs == None or self.sameAs == self.name:
if self.w and self.h and self.rate:
return "{}x{}@{}".format(self.w, self.h, self.rate)
else:
return "auto"
else:
return "duplicate {}".format(self.sameAs)
else:
return "Inactive"
def __str__(self):
return "{} {}x{}+{}+{} active:{}, primary:{}\nmodes:{}\ncurrentIndex:{} preferredIndex:{}".format(
self.name, self.w, self.h, self.x, self.y, self.active, self.primary, self.modes, self.currentModeIndex, self.preferredModeIndex)
class MonitorManager():
def __init__(self, root):
self.root = root
self.root.withdraw()
self.root.resizable(0,0)
self.root.wm_title("Monitor Manager")
self.frame = None
self.outputs = []
self.hardRefreshList()
style = {'relief':FLAT, 'padx':1, 'pady':1, 'anchor':'w', 'font':FONTAWESOME_FONT}
self.infoLabel = Label(self.root, text="", **style)
self.infoLabel.config(font=DEFAULT_FONT)
self.bottomRow = []
self.applyButton = Button(self.root, text=APPLY_SYMBOL, **style)
self.bottomRow.append(self.applyButton)
self.refreshButton = Button(self.root, text=REFRESH_SYMBOL, **style)
self.bottomRow.append(self.refreshButton)
if which("arandr"):
self.arandrButton = Button(self.root, text=ARANDR_SYMBOL, **style)
self.bottomRow.append(self.arandrButton)
else:
self.arandrButton = None
self.cancelButton = Button(self.root, text=CANCEL_SYMBOL, **style)
self.bottomRow.append(self.cancelButton)
self.infoLabel.grid(row=1,column=0, columnspan=len(self.bottomRow))
self.gridRow(2, self.bottomRow)
self.moveToMouse()
self.root.deiconify()
def registerBindings(self):
self.root.bind("<Return>", self.handleApply)
self.root.bind("<Escape>", self.handleCancel)
self.applyButton.bind("<Button-1>", self.handleApply)
self.setInfo(self.applyButton, "Apply changes")
self.refreshButton.bind("<Button-1>", self.hardRefreshList)
self.setInfo(self.refreshButton, "Refresh list")
if self.arandrButton:
self.arandrButton.bind("<Button-1>", self.handleArandr)
self.setInfo(self.arandrButton, "Launch aRandR")
self.cancelButton.bind("<Button-1>", self.handleCancel)
self.setInfo(self.cancelButton, "Cancel")
for toggleButton in self.toggleButtons:
toggleButton.bind("<Button-1>", self.toggleActive)
toggleButton.bind("<Button-4>", self.handleUp)
toggleButton.bind("<Button-5>", self.handleDown)
self.setInfo(toggleButton, "Turn output on/off")
for primaryButton in self.primaryButtons:
primaryButton.bind("<Button-1>", self.setPrimary)
self.setInfo(primaryButton, "Set primary output")
for blankedButton in self.blankedButtons:
blankedButton.bind("<Button-1>", self.toggleBlanked)
self.setInfo(blankedButton, "Show/hide output")
for duplicateButton in self.duplicateButtons:
duplicateButton.bind("<Button-1>", self.toggleDuplicate)
self.setInfo(duplicateButton, "Duplicate another output")
for rotateButton in self.rotateButtons:
rotateButton.bind("<Button-1>", self.cycleRotation)
self.setInfo(rotateButton, "Rotate output")
for reflectButton in self.reflectButtons:
reflectButton.bind("<Button-1>", self.cycleReflection)
self.setInfo(reflectButton, "Reflect output")
for brightnessSlider in self.brightnessSliders:
brightnessSlider.bind("<ButtonRelease-1>", self.updateBrightness)
self.setInfo(brightnessSlider, "Adjust brightness")
for upButton in self.upButtons:
upButton.bind("<Button-1>", self.handleUp)
upButton.bind("<Button-4>", self.handleUp)
upButton.bind("<Button-5>", self.handleDown)
self.setInfo(upButton, "Move up")
for downButton in self.downButtons:
downButton.bind("<Button-1>", self.handleDown)
downButton.bind("<Button-4>", self.handleUp)
downButton.bind("<Button-5>", self.handleDown)
self.setInfo(downButton, "Move down")
def gridRow(self, row, widgets):
column = 0
for w in widgets:
w.grid(row=row, column=column)
column += 1
def moveToMouse(self):
root = self.root
root.update_idletasks()
width = root.winfo_reqwidth()
height = root.winfo_reqheight()
x = root.winfo_pointerx() - width//2
y = root.winfo_pointery() - height//2
screen_width = root.winfo_screenwidth()
screen_height = root.winfo_screenheight()
if x+width > screen_width - WINDOW_CLOSE_TO_BOUNDARY_BUFFER:
x = screen_width - WINDOW_CLOSE_TO_BOUNDARY_BUFFER - width
elif x < WINDOW_CLOSE_TO_BOUNDARY_BUFFER:
x = WINDOW_CLOSE_TO_BOUNDARY_BUFFER
if y+height > screen_height - WINDOW_CLOSE_TO_BOUNDARY_BUFFER:
y = screen_height - WINDOW_CLOSE_TO_BOUNDARY_BUFFER - height
elif y < WINDOW_CLOSE_TO_BOUNDARY_BUFFER:
y = WINDOW_CLOSE_TO_BOUNDARY_BUFFER
root.geometry('+{}+{}'.format(x, y))
def setInfo(self, widget, info):
widget.bind("<Enter>", lambda e: self.infoLabel.config(text=info, fg="black"))
widget.bind("<Leave>", lambda e: self.infoLabel.config(text=""))
def handleApply(self, e=None):
self.root.after_idle(self.doHandleApply)
def doHandleApply(self):
if not self.getUserConfirmationIfDangerousConfiguration():
return
command = ["xrandr"]
if not self.existsPrimary():
command += ["--noprimary"]
partition = self.sameAsPartition()
prevFirstActive = None
for p in partition:
firstActive = None
for output in p:
command += ["--output", output.name]
if output.active:
if firstActive == None:
firstActive = output
else:
command += ["--same-as", firstActive.name]
if output.primary:
command += ["--primary"]
if prevFirstActive != None:
command += ["--right-of", prevFirstActive.name]
if output.w != None and output.h != None and output.rate != None:
command += ["--mode", "{}x{}".format(output.w,output.h)]
command += ["--rate", output.rate ]
else:
command += ["--auto"]
command += ["--brightness", str(output.brightness)]
command += ["--rotate", output.rotation]
command += ["--reflect", output.reflection]
else:
command += ["--off"]
if firstActive:
prevFirstActive = firstActive
self.root.after_idle(lambda: self.executeXrandrCommand(command))
def executeXrandrCommand(self, command):
try:
check_output(command, universal_newlines=True)
except CalledProcessError as err:
self.infoLabel.config(text="xrandr returned nonzero exit status {}".format(err.returncode), fg="red")
def getUserConfirmationIfDangerousConfiguration(self):
result = "yes"
if all(map(lambda o: o.blanked or not o.active, self.outputs)):
result = messagebox.askquestion("All blanked or off",
"All ouputs are set to be turned off or blanked, continue?",
icon="warning")
return result == "yes"
def sameAsPartition(self):
partition = []
for output in self.outputs:
place = None
for p in partition:
if place != None:
break;
for o in p:
if place == None and (output.sameAs == o.name or o.sameAs == output.name):
place = p
break;
if place:
place.append(output)
else:
partition.append([output])
return partition
def handleCancel(self, e=None):
self.root.destroy()
def handleArandr(self, e=None):
call(["i3-msg", "-q", "exec", "arandr"])
self.root.destroy()
def handleUp(self, e):
row = e.widget.output.row
if row > 0:
self.swapOutputRows(row-1, row)
self.softRefreshList()
def handleDown(self, e):
row = e.widget.output.row
n = len(self.outputs)
if row + 1 < n:
self.swapOutputRows(row, row+1)
self.softRefreshList()
def swapOutputRows(self, row1, row2):
outputs = self.outputs
outputs[row1],outputs[row2] = outputs[row2],outputs[row1]
outputs[row1].row = row1
outputs[row2].row = row2
for widget in self.frame.grid_slaves(row=row2):
widget.output = outputs[row2]
for widget in self.frame.grid_slaves(row=row1):
widget.output = outputs[row1]
def setPrimary(self, e):
output = e.widget.output
output.primary = not output.primary
for otherOutput in self.outputs:
if otherOutput != output:
otherOutput.primary = False
self.softRefreshList()
def existsPrimary(self):
for output in self.outputs:
if output.primary:
return True
return False
def toggleActive(self, e):
output = e.widget.output
output.active = not output.active
if output.active:
output.setPreferredMode()
else:
for otherOutput in self.outputs:
if otherOutput.sameAs == output.name:
otherOutput.sameAs = None
self.softRefreshList()
def toggleBlanked(self, e):
output = e.widget.output
if output.blanked:
output.blanked = False
output.brightness = 1.0
else:
output.blanked = True
output.brightness = 0.0
self.softRefreshList()
def updateBrightness(self, e):
output = e.widget.output
output.brightness = .01 * e.widget.get()
output.blanked = False
if abs(output.brightness) < 1e-09:
output.blanked = True
self.softRefreshList()
def cycleRotation(self, e):
output = e.widget.output
if output.rotation == "normal":
output.rotation = "right"
elif output.rotation == "right":
output.rotation = "inverted"
elif output.rotation == "inverted":
output.rotation = "left"
else:
output.rotation = "normal"
self.softRefreshList()
def rotationSymbol(self, rotation):
return {
"normal": ROTATION_NORMAL,
"left": ROTATION_LEFT,
"right": ROTATION_RIGHT,
"inverted": ROTATION_INVERTED,
}[rotation]
def cycleReflection(self, e):
output = e.widget.output
if output.reflection == "normal":
output.reflection = "x"
elif output.reflection == "x":
output.reflection = "y"
elif output.reflection == "y":
output.reflection = "xy"
else:
output.reflection = "normal"
self.softRefreshList()
def reflectionSymbol(self, reflection):
return {
"normal": REFLECTION_NORMAL,
"x": REFLECTION_X,
"y": REFLECTION_Y,
"xy": REFLECTION_XY,
}[reflection]
def toggleDuplicate(self, e):
duplicateButton = e.widget
optionMenu = duplicateButton.statusOptionMenu
output = optionMenu.output
if output.sameAs != None:
output.sameAs = None
self.setMenuToOutput(optionMenu, output)
else:
self.setMenuToDuplicate(optionMenu)
self.softRefreshList()
def getDuplicableOutputsFor(self, output):
return [o for o in self.outputs if o != output and o.sameAs == None]
def softRefreshList(self, e=None):
for widget in set().union(self.nameLabels, self.primaryButtons,
self.statusOptionMenus, self.blankedButtons,
self.duplicateButtons, self.rotateButtons, self.reflectButtons,
self.brightnessSliders, self.upButtons, self.downButtons):
widget.config(fg="gray" if not widget.output.active else "black")
for widget in self.toggleButtons:
widget.config(text=TOGGLE_ON if widget.output.active else TOGGLE_OFF)
for widget in self.nameLabels:
widget.config(text=widget.output.name)
for widget in self.primaryButtons:
widget.config(text=PRIMARY_SYMBOL if widget.output.primary else SECONDARY_SYMBOL)
if not widget.output.primary:
widget.config(fg="gray")
for widget in self.statusOptionMenus:
widget.config(text=widget.output.status())
if widget.output.sameAs != None:
self.setMenuToDuplicate(widget)
self.setInfo(widget, "Select output to duplicate")
else:
self.setMenuToOutput(widget, widget.output)
self.setInfo(widget, "Select output mode")
for widget in self.blankedButtons:
widget.config(text=BLANKED_SYMBOL if widget.output.blanked else UNBLANKED_SYMBOL)
for widget in self.duplicateButtons:
widget.config(text=CLONED_SYMBOL if widget.output.sameAs else NOT_CLONED_SYMBOL)
for widget in self.rotateButtons:
widget.config(text=self.rotationSymbol(widget.output.rotation))
for widget in self.reflectButtons:
widget.config(text=self.reflectionSymbol(widget.output.reflection))
for widget in self.brightnessSliders:
widget.set(int(100*widget.output.brightness))
def hardRefreshList(self, e=None):
self.outputs = Output.realOutputs()
self.root.after_idle(self.populateGrid)
def populateGrid(self):
oldFrame = self.frame
self.frame = Frame(self.root)
self.frame.grid(row=0, column=0, columnspan=len(self.bottomRow))
self.toggleButtons = []
self.nameLabels = []
self.primaryButtons = []
self.statusOptionMenus = []
self.blankedButtons = []
self.duplicateButtons = []
self.rotateButtons = []
self.reflectButtons = []
self.brightnessSliders = []
self.upButtons = []
self.downButtons = []
for row, output in enumerate(self.outputs):
self.makeLabelRow(output, row)
self.registerBindings()
if oldFrame:
oldFrame.destroy()
def makeLabelRow(self, output, row):
output.row = row
style = {'relief':FLAT, 'padx':1, 'pady':1, 'anchor':'w'}
widgets = []
toggleButton = Button(self.frame, font=FONTAWESOME_FONT, **style)
toggleButton.output = output
self.toggleButtons.append(toggleButton)
if SHOW_ON_OFF:
widgets.append(toggleButton)
nameLabel = Label(self.frame, font=DEFAULT_FONT)
nameLabel.output = output
self.nameLabels.append(nameLabel)
if SHOW_NAMES:
widgets.append(nameLabel)
primaryButton = Button(self.frame, font=FONTAWESOME_FONT, **style)
primaryButton.output = output
self.primaryButtons.append(primaryButton)
if not output.primary:
primaryButton.config(fg="gray")
if SHOW_PRIMARY:
widgets.append(primaryButton)
var = StringVar(self.frame)
statusOptionMenu = OptionMenu(self.frame, var, None)
statusOptionMenu.output = output
statusOptionMenu.var = var
statusOptionMenu.config(relief=FLAT)
self.statusOptionMenus.append(statusOptionMenu)
if SHOW_MODE or SHOW_DUPLICATE:
widgets.append(statusOptionMenu)
blankedButton = Button(self.frame, font=FONTAWESOME_FONT, **style)
blankedButton.output = output
self.blankedButtons.append(blankedButton)
if SHOW_BLANKED:
widgets.append(blankedButton)
duplicateButton = Button(self.frame, font=FONTAWESOME_FONT, **style)
duplicateButton.statusOptionMenu = statusOptionMenu
duplicateButton.output = output
self.duplicateButtons.append(duplicateButton)
if SHOW_DUPLICATE:
widgets.append(duplicateButton)
rotateButton = Button(self.frame, font=FONTAWESOME_FONT, **style)
rotateButton.output = output
self.rotateButtons.append(rotateButton)
if SHOW_ROTATION:
widgets.append(rotateButton)
reflectButton = Button(self.frame, font=FONTAWESOME_FONT, **style)
reflectButton.output = output
self.reflectButtons.append(reflectButton)
if SHOW_REFLECTION:
widgets.append(reflectButton)
brightnessSlider = Scale(self.frame, orient="horizontal", from_=0, to=100,
length=BRIGHTNESS_SLIDER_LENGTH, showvalue=SHOW_BRIGHTNESS_VALUE,
sliderlength=BRIGHTNESS_SLIDER_HANDLE_LENGTH,
width=BRIGHTNESS_SLIDER_WIDTH, font=FONTAWESOME_FONT)
brightnessSlider.output = output
self.brightnessSliders.append(brightnessSlider)
if SHOW_BRIGHTNESS:
widgets.append(brightnessSlider)
upButton = Button(self.frame, text=UP_ARROW, font=FONTAWESOME_FONT, **style)
upButton.output = output
self.upButtons.append(upButton)
if SHOW_UP_DOWN:
widgets.append(upButton)
downButton = Button(self.frame, text=DOWN_ARROW, font=FONTAWESOME_FONT, **style)
downButton.output = output
self.downButtons.append(downButton)
if SHOW_UP_DOWN:
widgets.append(downButton)
for widget in widgets:
widget.output = output
self.gridRow(row, widgets)
self.softRefreshList()
def setMenuToOutput(self, optionMenu, output):
menu = optionMenu["menu"]
var = optionMenu.var
modes = output.modes
menu.delete(0, END)
for i, mode in enumerate(modes):
label = Output.modestr(mode)
menu.add_command(label=label, command=setLabelAndOutputModeFunc(var,label,output,i))
if output.currentModeIndex != None:
var.set(Output.modestr(modes[output.currentModeIndex]))
elif output.preferredModeIndex != None:
var.set(Output.modestr(modes[output.preferredModeIndex]))
elif len(modes) > 0:
var.set(Output.modestr(modes[0]))
def setMenuToDuplicate(self, optionMenu):
menu = optionMenu["menu"]
var = optionMenu.var
output = optionMenu.output
menu.delete(0, END)
duplicables = self.getDuplicableOutputsFor(output)
defaultIndex = 0
for i,otherOutput in enumerate(duplicables):
label = otherOutput.name
menu.add_command(label=label, command=setLabelAndSameAsFunc(var,label,output))
if label == output.sameAs:
defaultIndex = i
if len(duplicables) > 0:
var.set(menu.entrycget(defaultIndex, "label"))
output.sameAs = menu.entrycget(defaultIndex, "label")
else:
var.set("None")
def handleFocusOut(self, event):
self.root.destroy()
def setLabelAndOutputModeFunc(var, label, output, i):
def func():
var.set(label)
output.setMode(i)
return func
def setLabelAndSameAsFunc(var, sameAs, output):
def func():
var.set(sameAs)
output.sameAs = sameAs
return func
if os.environ.get('BLOCK_BUTTON') == "1":
if os.fork() != 0:
root = Tk()
if DEFAULT_FONT_FAMILY and DEFAULT_FONT_SIZE:
font.nametofont("TkDefaultFont").config(family=DEFAULT_FONT_FAMILY, size=DEFAULT_FONT_SIZE)
manager = MonitorManager(root)
root.mainloop()
else:
print(DESKTOP_SYMBOL)
else:
print(DESKTOP_SYMBOL)

View file

@ -0,0 +1,246 @@
# Thank you code_nomad: http://9m.no/ꪯ鵞
# and Arch Wiki contributors: https://wiki.archlinux.org/index.php/Compton
#
# ▀ ▄▀▀
# ▄▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄▄▄ ▄▄▄ ▄▄▄ ▄ ▄▄ ▄▄█▄▄
# █▀ ▀█ █ █▀ ▀ █▀ ▀█ █ █ █ █▀ ▀ █▀ ▀█ █▀ █ █
# █ █ █ █ █ █ █ █ █ █ █ █ █ █ █
# ██▄█▀ ▄▄█▄▄ ▀█▄▄▀ ▀█▄█▀ █ █ █ █ ▀█▄▄▀ ▀█▄█▀ █ █ █
# █
# ▀
#
#################################
#
# Backend
#
#################################
# Backend to use: "xrender" or "glx".
# GLX backend is typically much faster but depends on a sane driver.
backend = "glx";
#################################
#
# GLX backend
#
#################################
glx-no-stencil = true;
# GLX backend: Copy unmodified regions from front buffer instead of redrawing them all.
# My tests with nvidia-drivers show a 10% decrease in performance when the whole screen is modified,
# but a 20% increase when only 1/4 is.
# My tests on nouveau show terrible slowdown.
glx-copy-from-front = false;
# GLX backend: Use MESA_copy_sub_buffer to do partial screen update.
# My tests on nouveau shows a 200% performance boost when only 1/4 of the screen is updated.
# May break VSync and is not available on some drivers.
# Overrides --glx-copy-from-front.
# glx-use-copysubbuffermesa = true;
# GLX backend: Avoid rebinding pixmap on window damage.
# Probably could improve performance on rapid window content changes, but is known to break things on some drivers (LLVMpipe).
# Recommended if it works.
# glx-no-rebind-pixmap = true;
# GLX backend: GLX buffer swap method we assume.
# Could be undefined (0), copy (1), exchange (2), 3-6, or buffer-age (-1).
# undefined is the slowest and the safest, and the default value.
# copy is fastest, but may fail on some drivers,
# 2-6 are gradually slower but safer (6 is still faster than 0).
# Usually, double buffer means 2, triple buffer means 3.
# buffer-age means auto-detect using GLX_EXT_buffer_age, supported by some drivers.
# Useless with --glx-use-copysubbuffermesa.
# Partially breaks --resize-damage.
# Defaults to undefined.
#glx-swap-method = "undefined";
#################################
#
# Shadows
#
#################################
# Enabled client-side shadows on windows.
shadow = true;
# The blur radius for shadows. (default 12)
shadow-radius = 5;
# The left offset for shadows. (default -15)
shadow-offset-x = -5;
# The top offset for shadows. (default -15)
shadow-offset-y = -5;
# The translucency for shadows. (default .75)
shadow-opacity = 0.5;
# Set if you want different colour shadows
# shadow-red = 0.0;
# shadow-green = 0.0;
# shadow-blue = 0.0;
# The shadow exclude options are helpful if you have shadows enabled. Due to the way picom draws its shadows, certain applications will have visual glitches
# (most applications are fine, only apps that do weird things with xshapes or argb are affected).
# This list includes all the affected apps I found in my testing. The "! name~=''" part excludes shadows on any "Unknown" windows, this prevents a visual glitch with the XFWM alt tab switcher.
shadow-exclude = [
"! name~=''",
"name = 'Notification'",
"name = 'Plank'",
"name = 'Docky'",
"name = 'Kupfer'",
"name = 'xfce4-notifyd'",
"name *= 'VLC'",
"name *= 'compton'",
"name *= 'picom'",
"name *= 'Chromium'",
"name *= 'Chrome'",
"name *= 'Firefox'",
"name *= 'Thunderbird'",
"class_g = 'Firefox' && argb",
"class_g = 'Conky'",
"class_g = 'Kupfer'",
"class_g = 'Synapse'",
"class_g ?= 'Notify-osd'",
"class_g ?= 'Cairo-dock'",
"class_g ?= 'Xfce4-notifyd'",
"class_g ?= 'Xfce4-power-manager'",
"_GTK_FRAME_EXTENTS@:c",
"_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'"
];
# Avoid drawing shadow on all shaped windows (see also: --detect-rounded-corners)
shadow-ignore-shaped = false;
#################################
#
# Opacity
#
#################################
inactive-opacity = 1;
active-opacity = 1;
frame-opacity = 1;
inactive-opacity-override = false;
opacity-rule = [
"90:class_g = 'Termite' && focused",
"60:class_g = 'Termite' && !focused"
];
# Dim inactive windows. (0.0 - 1.0)
# inactive-dim = 0.2;
# Do not let dimness adjust based on window opacity.
# inactive-dim-fixed = true;
# Blur background of transparent windows. Bad performance with X Render backend. GLX backend is preferred.
# blur-background = true;
# Blur background of opaque windows with transparent frames as well.
# blur-background-frame = true;
# Do not let blur radius adjust based on window opacity.
blur-background-fixed = false;
blur-background-exclude = [
"window_type = 'dock'",
"window_type = 'desktop'"
];
#################################
#
# Fading
#
#################################
# Fade windows during opacity changes.
fading = true;
# The time between steps in a fade in milliseconds. (default 10).
fade-delta = 4;
# Opacity change between steps while fading in. (default 0.028).
fade-in-step = 0.03;
# Opacity change between steps while fading out. (default 0.03).
fade-out-step = 0.03;
# Fade windows in/out when opening/closing
# no-fading-openclose = true;
# Specify a list of conditions of windows that should not be faded.
fade-exclude = [ ];
#################################
#
# Other
#
#################################
# Try to detect WM windows and mark them as active.
mark-wmwin-focused = true;
# Mark all non-WM but override-redirect windows active (e.g. menus).
mark-ovredir-focused = true;
# Use EWMH _NET_WM_ACTIVE_WINDOW to determine which window is focused instead of using FocusIn/Out events.
# Usually more reliable but depends on a EWMH-compliant WM.
use-ewmh-active-win = true;
# Detect rounded corners and treat them as rectangular when --shadow-ignore-shaped is on.
detect-rounded-corners = true;
# Detect _NET_WM_OPACITY on client windows, useful for window managers not passing _NET_WM_OPACITY of client windows to frame windows.
# This prevents opacity being ignored for some apps.
# For example without this enabled my xfce4-notifyd is 100% opacity no matter what.
detect-client-opacity = true;
# Specify refresh rate of the screen.
# If not specified or 0, picom will try detecting this with X RandR extension.
refresh-rate = 0;
# Vertical synchronization: match the refresh rate of the monitor
vsync = false;
# Enable DBE painting mode, intended to use with VSync to (hopefully) eliminate tearing.
# Reported to have no effect, though.
dbe = false;
# Limit picom to repaint at most once every 1 / refresh_rate second to boost performance.
# This should not be used with --vsync drm/opengl/opengl-oml as they essentially does --sw-opti's job already,
# unless you wish to specify a lower refresh rate than the actual value.
#sw-opti = true;
# Unredirect all windows if a full-screen opaque window is detected, to maximize performance for full-screen windows, like games.
# Known to cause flickering when redirecting/unredirecting windows.
unredir-if-possible = true;
# Specify a list of conditions of windows that should always be considered focused.
focus-exclude = [ ];
# Use WM_TRANSIENT_FOR to group windows, and consider windows in the same group focused at the same time.
detect-transient = true;
# Use WM_CLIENT_LEADER to group windows, and consider windows in the same group focused at the same time.
# WM_TRANSIENT_FOR has higher priority if --detect-transient is enabled, too.
detect-client-leader = true;
#################################
#
# Window type settings
#
#################################
wintypes:
{
tooltip =
{
# fade: Fade the particular type of windows.
fade = true;
# shadow: Give those windows shadow
shadow = false;
# opacity: Default opacity for the type of windows.
opacity = 0.85;
# focus: Whether to always consider windows of this type focused.
focus = true;
};
menu = { shadow = false; };
dropdown_menu = { shadow = false; };
popup_menu = { shadow = false; };
utility = { shadow = false; };
};
######################
#
# XSync
# See: https://github.com/yshui/picom/commit/b18d46bcbdc35a3b5620d817dd46fbc76485c20d
#
######################
# Use X Sync fence to sync clients' draw calls. Needed on nvidia-drivers with GLX backend for some users.
xrender-sync-fence = true;

View file

@ -0,0 +1,5 @@
#!/bin/bash
gpu_temp=$(sensors | awk '/Sensor 2/ {print $3}')
cpu_temp=$(sensors | awk '/Tctl/ {print $2}')
echo "CPU: ${cpu_temp}|GPU ${gpu_temp}"

View file

@ -0,0 +1,186 @@
#!/usr/bin/env bash
#
# Use rofi/zenity to change system runstate thanks to systemd.
#
# Note: this currently relies on associative array support in the shell.
#
# Inspired from i3pystatus wiki:
# https://github.com/enkore/i3pystatus/wiki/Shutdown-Menu
#
# Copyright 2015 Benjamin Chrétien <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/>.
#######################################################################
# BEGIN CONFIG #
#######################################################################
# Use a custom lock script
#LOCKSCRIPT="i3lock-extra -m pixelize"
# Colors: FG (foreground), BG (background), HL (highlighted)
FG_COLOR="${FG_COLOR:-#bbbbbb}"
BG_COLOR="${BG_COLOR:-#111111}"
HLFG_COLOR="${HLFG_COLOR:-#111111}"
HLBG_COLOR="${HLBG_COLOR:-#bbbbbb}"
BORDER_COLOR="${BORDER_COLOR:-#222222}"
# Options not related to colors
ROFI_TEXT="${ROFI_TEXT:-Menu:}"
ROFI_OPTIONS=(${ROFI_OPTIONS:--width 11 -location 3 -hide-scrollbar -bw 2})
# Zenity options
ZENITY_TITLE="${ZENITY_TITLE:-Menu}"
ZENITY_TEXT="${ZENITY_TEXT:-Action:}"
ZENITY_OPTIONS=(${ZENITY_OPTIONS:---column= --hide-header})
#######################################################################
# END CONFIG #
#######################################################################
# Whether to ask for user's confirmation
enable_confirmation=${ENABLE_CONFIRMATIONS:-false}
# Preferred launcher if both are available
preferred_launcher="${LAUNCHER:-rofi}"
usage="$(basename "$0") [-h] [-c] [-p name] -- display a menu for shutdown, reboot, lock etc.
where:
-h show this help text
-c ask for user confirmation
-p preferred launcher (rofi or zenity)
This script depends on:
- systemd,
- i3,
- rofi or zenity."
# Check whether the user-defined launcher is valid
launcher_list=(rofi zenity)
function check_launcher() {
if [[ ! "${launcher_list[@]}" =~ (^|[[:space:]])"$1"($|[[:space:]]) ]]; then
echo "Supported launchers: ${launcher_list[*]}"
exit 1
else
# Get array with unique elements and preferred launcher first
# Note: uniq expects a sorted list, so we cannot use it
i=1
launcher_list=($(for l in "$1" "${launcher_list[@]}"; do printf "%i %s\n" "$i" "$l"; let i+=1; done \
| sort -uk2 | sort -nk1 | cut -d' ' -f2- | tr '\n' ' '))
fi
}
# Parse CLI arguments
while getopts "hcp:" option; do
case "${option}" in
h) echo "${usage}"
exit 0
;;
c) enable_confirmation=true
;;
p) preferred_launcher="${OPTARG}"
check_launcher "${preferred_launcher}"
;;
*) exit 1
;;
esac
done
check_launcher "${preferred_launcher}"
# Check whether a command exists
function command_exists() {
command -v "$1" &> /dev/null 2>&1
}
# systemctl required
if ! command_exists systemctl ; then
exit 1
fi
# menu defined as an associative array
typeset -A menu
# Menu with keys/commands
menu=(
[Shutdown]="systemctl poweroff"
[Reboot]="systemctl reboot"
[Hibernate]="systemctl hibernate"
[Suspend]="systemctl suspend"
[Halt]="systemctl halt"
[Lock]="${LOCKSCRIPT:-i3lock --color=${BG_COLOR#"#"}}"
[Logout]="i3-msg exit"
[Cancel]=""
)
menu_nrows=${#menu[@]}
# Menu entries that may trigger a confirmation message
menu_confirm="Shutdown Reboot Hibernate Suspend Halt Logout"
launcher_exe=""
launcher_options=""
rofi_colors=""
function prepare_launcher() {
if [[ "$1" == "rofi" ]]; then
rofi_colors=(-bc "${BORDER_COLOR}" -bg "${BG_COLOR}" -fg "${FG_COLOR}" \
-hlfg "${HLFG_COLOR}" -hlbg "${HLBG_COLOR}")
launcher_exe="rofi"
launcher_options=(-dmenu -i -lines "${menu_nrows}" -p "${ROFI_TEXT}" \
"${rofi_colors}" "${ROFI_OPTIONS[@]}")
elif [[ "$1" == "zenity" ]]; then
launcher_exe="zenity"
launcher_options=(--list --title="${ZENITY_TITLE}" --text="${ZENITY_TEXT}" \
"${ZENITY_OPTIONS[@]}")
fi
}
for l in "${launcher_list[@]}"; do
if command_exists "${l}" ; then
prepare_launcher "${l}"
break
fi
done
# No launcher available
if [[ -z "${launcher_exe}" ]]; then
exit 1
fi
launcher=(${launcher_exe} "${launcher_options[@]}")
selection="$(printf '%s\n' "${!menu[@]}" | sort | "${launcher[@]}")"
function ask_confirmation() {
if [ "${launcher_exe}" == "rofi" ]; then
confirmed=$(echo -e "Yes\nNo" | rofi -dmenu -i -lines 2 -p "${selection}?" \
"${rofi_colors}" "${ROFI_OPTIONS[@]}")
[ "${confirmed}" == "Yes" ] && confirmed=0
elif [ "${launcher_exe}" == "zenity" ]; then
zenity --question --text "Are you sure you want to ${selection,,}?"
confirmed=$?
fi
if [ "${confirmed}" == 0 ]; then
i3-msg -q "exec ${menu[${selection}]}"
fi
}
if [[ $? -eq 0 && ! -z ${selection} ]]; then
if [[ "${enable_confirmation}" = true && \
${menu_confirm} =~ (^|[[:space:]])"${selection}"($|[[:space:]]) ]]; then
ask_confirmation
else
i3-msg -q "exec ${menu[${selection}]}"
fi
fi

View file

@ -0,0 +1,368 @@
#!/usr/bin/env python3
#
# Copyright (C) 2015 James Murphy
# Licensed under the terms of the GNU GPL v2 only.
#
# i3blocks blocklet script to output connected usb storage device info.
import os
def _default(name, default='', arg_type=str):
val = default
if name in os.environ:
val = os.environ[name]
return arg_type(val)
###############################################################################
# BEGIN CONFIG
# Most of these can be specified as command line options, run with --help for
# more information.
# You may edit any of the following entries. DO NOT delete any of them, else
# the main script will have unpredictable behavior.
###############################################################################
# Color options, can be a color name or #RRGGBB
INFO_TEXT_COLOR = _default("INFO_TEXT_COLOR", "white")
MOUNTED_COLOR = _default("MOUNTED_COLOR", "green")
PLUGGED_COLOR = _default("PLUGGED_COLOR", "gray")
LOCKED_COLOR = _default("LOCKED_COLOR", "gray")
UNLOCKED_NOT_MOUNTED_COLOR = _default("UNLOCKED_NOT_MOUNTED_COLOR", "yellow")
PARTITIONLESS_COLOR = _default("PARTITIONLESS_COLOR", "red")
# Default texts
PARTITIONLESS_TEXT = _default("PARTITIONLESS_TEXT", "no partitions")
SEPARATOR = _default("SEPARATOR", "<span color='gray'> | </span>")
# Indicate whether an encrypted partition is locked/unlocked, "" is allowed.
LOCKED_INDICATOR = _default("LOCKED_INDICATOR", "\uf023 ")
UNLOCKED_INDICATOR = _default("UNLOCKED_INDICATOR", "\uf09c ")
# Shows instead of space available when a partition is mounted readonly
READONLY_INDICATOR = _default("READONLY_INDICATOR", "ro")
# Maximum length of a filesystem label to display. Use None to disable
# truncation, a positive integer to right truncate to that many characters, or
# a negative integer to left truncate to that many characters. Setting this
# option to 0 will disable the displaying of filesystem labels.
TRUNCATE_FS_LABELS = _default("TRUNCASE_FS_LABELS", None)
# List of devices to ignore. Must be a valid python3 representation of a list
# of strings
IGNORE_LIST = _default("IGNORE_LIST", "[]")
if IGNORE_LIST:
import ast
IGNORE_LIST = list(map(lambda p:
p if p.startswith("/")
else "/dev/{}".format(p),
ast.literal_eval(IGNORE_LIST)
))
# Edit this function to ignore certain devices (e.g. those that are always
# plugged in).
# The dictionary udev_attributes_dict contains all the attributes given by
# udevadm info --query=propery --name=$path
def ignore(path, udev_attributes_dict):
# E.g. how to ignore devices whose device name begins with /dev/sda
#if udev_attributes_dict["DEVNAME"].startswith("/dev/sda"):
# return True
return False
# Edit this function to ignore devices before the udev attributes are
# computed in order to save time and memory.
def fastIgnore(path):
if path in IGNORE_LIST:
return True
# E.g. how to to ignore devices whose path begins with /dev/sda
#if path.startswith("/dev/sda"):
# return True
# E.g. how to ignore a fixed set of paths
#if path in [ "/dev/path1", "/dev/path2", "/dev/path3" ]:
# return True
return False
###############################################################################
# END CONFIG
# DO NOT EDIT ANYTHING AFTER THIS POINT UNLESS YOU KNOW WHAT YOU ARE DOING
###############################################################################
from subprocess import check_output
import argparse
def pangoEscape(text):
return text.replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;")
def getLeafDevicePaths():
lines = check_output(['lsblk', '-spndo', 'NAME'], universal_newlines=True)
lines = lines.split("\n")
lines = filter(None, lines)
return lines
def getKernelName(path):
return check_output(['lsblk', '-ndso', 'KNAME', path],
universal_newlines=True).rstrip("\n")
def getDeviceType(path):
return check_output(['lsblk', '-no', 'TYPE', path],
universal_newlines=True).strip()
def getFSType(path):
global attributeMaps
return attributeMaps[path].get("ID_FS_TYPE")
def isLUKSPartition(path):
return getFSType(path) == "crypto_LUKS"
def isSwapPartition(path):
return getFSType(path) == "swap"
def getFSLabel(path):
global attributeMaps
label = attributeMaps[path].get("ID_FS_LABEL_ENC", "")
if label:
label = label.encode().decode("unicode-escape")
if type(TRUNCATE_FS_LABELS) == int:
if TRUNCATE_FS_LABELS >= 0:
label = label[:TRUNCATE_FS_LABELS]
elif TRUNCATE_FS_LABELS < 0:
label = label[TRUNCATE_FS_LABELS:]
return label
def getFSOptions(path):
lines = check_output(['findmnt', '-no', 'FS-OPTIONS', path],
universal_newlines=True).strip()
lines = lines.split(",")
return lines
def isReadOnly(path):
return "ro" in getFSOptions(path)
def isExtendedPartitionMarker(path):
global attributeMaps
MARKERS = ["0xf", "0x5"]
return attributeMaps[path].get("ID_PART_ENTRY_TYPE") in MARKERS
def getMountPoint(path):
return check_output(['lsblk', '-ndo', 'MOUNTPOINT', path],
universal_newlines=True).rstrip("\n")
def getSpaceAvailable(path):
lines = check_output(['df', '-h', '--output=avail', path],
universal_newlines=True)
lines = lines.split("\n")
if len(lines) != 3:
return ""
else:
return lines[1].strip()
def getLockedCryptOutput(path):
form = "<span color='{}'>[{}{}]</span>"
kname = pangoEscape(getKernelName(path))
output = form.format(LOCKED_COLOR, LOCKED_INDICATOR, kname)
return output
def getParentKernelName(path):
lines = check_output(['lsblk', '-nso', 'KNAME', path],
universal_newlines=True)
lines = lines.split("\n")
if len(lines) > 2:
return lines[1].rstrip("\n")
else:
return ""
def getUnlockedCryptOutput(path):
mountPoint = getMountPoint(path)
if mountPoint:
color = MOUNTED_COLOR
if isReadOnly(path):
spaceAvail = READONLY_INDICATOR
else:
spaceAvail = pangoEscape(getSpaceAvailable(path))
mountPoint = "<i>{}</i>:".format(pangoEscape(mountPoint))
else:
color = UNLOCKED_NOT_MOUNTED_COLOR
spaceAvail = ""
kernelName = pangoEscape(getKernelName(path))
parentKernelName = pangoEscape(getParentKernelName(path))
block = "<span color='{}'>[{}{}:{}]</span>"
block = block.format(color, UNLOCKED_INDICATOR, parentKernelName, kernelName)
label = pangoEscape(getFSLabel(path))
if label:
label = '"{}"'.format(label)
items = [block, label, mountPoint, spaceAvail]
return " ".join(filter(None, items))
def getSwapOutput(path):
return ""
def getUnencryptedPartitionOutput(path):
mountPoint = getMountPoint(path)
if mountPoint:
color = MOUNTED_COLOR
if isReadOnly(path):
spaceAvail = READONLY_INDICATOR
else:
spaceAvail = pangoEscape(getSpaceAvailable(path))
mountPoint = "<i>{}</i>:".format(pangoEscape(mountPoint))
else:
color = PLUGGED_COLOR
spaceAvail = ""
kernelName = pangoEscape(getKernelName(path))
block = "<span color='{}'>[{}]</span>"
block = block.format(color, kernelName)
label = pangoEscape(getFSLabel(path))
if label:
label = '"{}"'.format(label)
items = [block, label, mountPoint, spaceAvail]
return " ".join(filter(None, items))
def getDiskWithNoPartitionsOutput(path):
form = "<span color='{}'>[{}] {}</span>"
kernelName = pangoEscape(getKernelName(path))
return form.format(PARTITIONLESS_COLOR, kernelName, PARTITIONLESS_TEXT)
def getOutput(path):
if isSwapPartition(path):
return getSwapOutput(path)
t = getDeviceType(path)
if t == "part":
if isExtendedPartitionMarker(path):
return ""
elif isLUKSPartition(path):
return getLockedCryptOutput(path)
else:
return getUnencryptedPartitionOutput(path)
elif t == "disk":
return getDiskWithNoPartitionsOutput(path)
elif t == "crypt":
return getUnlockedCryptOutput(path)
elif t == "rom" :
return ""
def makeAttributeMap(path):
attributeMap = {}
lines = check_output(
['udevadm','info','--query=property','--name={}'.format(path)],
universal_newlines=True)
lines = lines.split("\n")
for line in lines:
if line:
key, val = line.split("=", maxsplit=1)
attributeMap[key] = val
return attributeMap
def getAttributeMaps(paths):
return {path : makeAttributeMap(path) for path in paths}
def parseArguments():
parser = argparse.ArgumentParser(prog="usb.py",
description="i3blocks blocklet script to output connected"
" usb storage device info")
parser.add_argument("--info-text-color", nargs=1,
help="Set the info text color. "
"Default: {}".format(INFO_TEXT_COLOR))
parser.add_argument("--mounted-color", nargs=1,
help="Set the color of mounted devices. "
"Default: {}".format(MOUNTED_COLOR))
parser.add_argument("--plugged-color", nargs=1,
help="Set the color of plugged devices. "
"Default: {}".format(PLUGGED_COLOR))
parser.add_argument("--locked-color", nargs=1,
help="Set the color of locked crypt devices. "
"Default: {}".format(LOCKED_COLOR))
parser.add_argument("--unlocked-not-mounted-color", nargs=1,
help="Set the color of unlocked not mounted crypt devices. "
"Default: {}".format(UNLOCKED_NOT_MOUNTED_COLOR))
parser.add_argument("--partitionless-color", nargs=1,
help="Set the color of devicees with no partitions. "
"Defaut: {}".format(PARTITIONLESS_COLOR))
parser.add_argument("--partitionless-text", nargs=1,
help="Set the text to display for a device with no partitions. "
"Default: {}".format(PARTITIONLESS_TEXT))
parser.add_argument("--separator", nargs=1,
help="Set the separator between devices. "
"Default: {}".format(SEPARATOR))
parser.add_argument("--locked-indicator", nargs=1,
help="Set the indicator to use for a locked crypt device. "
"Default: {}".format(LOCKED_INDICATOR))
parser.add_argument("--unlocked-indicator", nargs=1,
help="Set the indicator to use for an unlocked crypt device. "
"Default: {}".format(UNLOCKED_INDICATOR))
parser.add_argument("--readonly-indicator", nargs=1,
help="Set the indicator to use for a readonly device. "
"Default: {}".format(READONLY_INDICATOR))
parser.add_argument("--truncate-fs-labels", type=int, nargs=1,
help="Trucate device labels to a certain number of characters, must be"
"an integer."
"Default: {}".format(TRUNCATE_FS_LABELS))
parser.add_argument("-i", "--ignore", action="append",
help="Ignore a device by path. "
"If path doesn't begin with / then it is assumed to be in /dev/")
args = parser.parse_args()
setParsedArgs(args)
def setParsedArgs(args):
if args.info_text_color != None:
global INFO_TEXT_COLOR
INFO_TEXT_COLOR = args.info_text_color[0]
if args.mounted_color != None:
global MOUNTED_COLOR
MOUNTED_COLOR = args.mounted_color[0]
if args.plugged_color != None:
global PLUGGED_COLOR
PLUGGED_COLOR = args.plugged_color[0]
if args.locked_color != None:
global LOCKED_COLOR
LOCKED_COLOR = args.locked_color[0]
if args.unlocked_not_mounted_color != None:
global UNLOCKED_NOT_MOUNTED_COLOR
UNLOCKED_NOT_MOUNTED_COLOR = args.unlocked_not_mounted_color[0]
if args.partitionless_color != None:
global PARTITIONLESS_COLOR
PARTITIONLESS_COLOR = args.partitionless_color[0]
if args.partitionless_text != None:
global PARTITIONLESS_TEXT
PARTITIONLESS_TEXT = args.partitionless_text[0]
if args.separator != None:
global SEPARATOR
SEPARATOR = args.separator[0]
if args.locked_indicator != None:
global LOCKED_INDICATOR
LOCKED_INDICATOR = args.locked_indicator[0]
if args.unlocked_indicator != None:
global UNLOCKED_INDICATOR
UNLOCKED_INDICATOR = args.unlocked_indicator[0]
if args.readonly_indicator != None:
global READONLY_INDICATOR
READONLY_INDICATOR = args.readonly_indicator[0]
if args.truncate_fs_labels != None:
global TRUNCATE_FS_LABELS
TRUNCATE_FS_LABELS = args.truncate_fs_labels[0]
if args.ignore != None:
args.ignore = list(map(lambda p:
p if p.startswith("/") else "/dev/{}".format(p), args.ignore))
global fastIgnore
oldFastIgnore = fastIgnore
def newFastIgnore(path):
return oldFastIgnore(path) or path in args.ignore
fastIgnore = newFastIgnore
parseArguments()
leaves = getLeafDevicePaths()
leaves = [path for path in leaves if not fastIgnore(path)]
attributeMaps = getAttributeMaps(leaves)
leaves = (path for path in leaves if not ignore(path, attributeMaps[path]))
outputs = filter(None, map(getOutput, leaves))
output = SEPARATOR.join(outputs)
if output:
output = "<span color='{}'>{}</span>".format(INFO_TEXT_COLOR, output)
print(output)
print(output)

View file

@ -0,0 +1,9 @@
#!/bin/bash
#
# Use nmcli to display the VPN status
#
if ip link | grep -q tun; then
echo ""
else
echo ""
fi

View file

@ -0,0 +1,59 @@
#!/usr/bin/env ruby
# Fetch weather for your city from OpenWeatherMap
# You need an API key to fetch data, and store the API key inside ENV
# export I3_OWM_APIKEY="0986273cf8ac41578b90bcc90bc559b4"
# Depends on Weather Icons: https://erikflowers.github.io/weather-icons/
require 'open-uri'
require 'json'
# Get info from open weather map
class Weather
API = 'http://api.openweathermap.org/data/2.5/weather?id=CITY&units=metric&APPID=APIKEY'
API_KEY = 'API-KEY-HERE'
attr_accessor :api_url, :weather
def initialize(city)
@api_url = API.gsub('CITY', city).gsub('APIKEY', API_KEY)
@weather = contact_openweathermap
end
# Public - Return formated response - temperature / weather
#
# Returns String
def show
info = @weather['weather'][0]['main']
temp = @weather['main']['temp']
"#{temp}#{icon(info)} #{info}"
end
private
# Private - Use FontAwesome icons to show the weather conditions
#
# Returns Unicode char
def icon(weather)
case weather
when 'Fog' then ''
when /Clear/ then ' '
when /Rain/ then ''
when /Cloud/ then ''
when /Snow/ then ''
else
''
end
end
# Private - Fetch information from OpenWeatherMap
#
# Returns Hash
def contact_openweathermap
JSON.parse(open(@api_url).read)
end
end
# city = 'Zagreb'
city_id = '6618983'
out = Weather.new(city_id).show
puts "#{out}"

View file

@ -0,0 +1,71 @@
[theme]
name = "slick"
[theme.overrides]
idle_bg = "#2f343f"
idle_fg = "#f3f4f5"
[icons]
name = "awesome"
#[icons.overrides]
#bat = " | | "
#bat_full = " |X| "
#bat_charging = " |^| "
#bat_discharging = " |v| "
[[block]]
block = "networkmanager"
on_click = "wezterm start nmtui"
interface_name_exclude = ["br\\-[0-9a-f]{12}", "docker\\d+"]
interface_name_include = []
device_format = "{icon} {ap} {ips}"
ap_format = "{ssid} {strength}"
#[[block]]
#block = "net"
#on_click = "wezterm start nmtui"
#device = "wlan0"
#format = " {ssid} {signal_strength} {ip} {speed_down;K*b} {graph_down:8;M*_b#50}"
#interval = 1
[[block]]
block = "disk_space"
path = "/"
alias = "/"
info_type = "available"
unit = "GB"
interval = 20
warning = 20.0
alert = 10.0
[[block]]
block = "memory"
display_type = "memory"
format_mem = "{mem_used_percents}"
format_swap = "{swap_used_percents}"
[[block]]
block = "cpu"
interval = 1
format = "{barchart} {utilization} {frequency}"
[[block]]
block = "load"
interval = 1
format = "{1m}"
[[block]]
block = "sound"
on_click = "pavucontrol-qt"
[[block]]
block = "time"
interval = 1
format = "%a %Y-%m-%d %H:%M:%S"
[[block]]
block = "uptime"
[[block]]
block = "battery"
interval = 10
format = "{percentage} {time}"

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,9 @@
[Sizes]
SplitterPos=200
ViewsIconSize=24
WindowSize=@Size(944 1031)
[Window]
DirTree=true
StatusBar=true
ToolBar=true

View file

@ -0,0 +1,4 @@
[General]
ControlGTKThemeEnabled=false
__userfile__=true
size=@Size(675 1031)

View file

@ -0,0 +1,2 @@
[General]
size=@Size(626 1031)

View file

@ -0,0 +1,2 @@
[General]
__userfile__=true

View file

@ -0,0 +1,2 @@
[General]
size=@Size(944 1031)

View file

@ -0,0 +1,19 @@
[General]
__userfile__=true
icon_follow_color_scheme=true
icon_theme=Arc
tool_button_style=ToolButtonTextBesideIcon
[Palette]
base_color=#ffffff
highlight_color=#308cc6
highlighted_text_color=#ffffff
link_color=#0000ff
link_visited_color=#ff00ff
text_color=#000000
window_color=#efefef
window_text_color=#000000
[Qt]
font="Cantarell,12,-1,5,50,0,0,0,0,0"
style=qt5ct-style

View file

@ -0,0 +1,6 @@
[General]
__userfile__=true
[Mouse]
cursor_size=24
cursor_theme=capitaine-cursors

View file

@ -0,0 +1,2 @@
[General]
__userfile__=true

View file

@ -0,0 +1,27 @@
sort=-time
layer=overlay
background-color=#2e3440
width=300
height=110
border-size=2
border-color=#88c0d0
border-radius=15
icons=0
max-icon-size=64
default-timeout=5000
ignore-timeout=1
font=monospace 14
[urgency=low]
border-color=#cccccc
[urgency=normal]
border-color=#d08770
[urgency=high]
border-color=#bf616a
default-timeout=0
[category=mpd]
default-timeout=2000
group-by=category

View file

@ -0,0 +1,601 @@
##############################################################
## This is an example configuration file. Copy it to ##
## $XDG_CONFIG_HOME/ncmpcpp/config or $HOME/.ncmpcpp/config ##
## and set up your preferences. ##
##############################################################
#
##### directories ######
##
## Directory for storing ncmpcpp related files. Changing it is useful if you
## want to store everything somewhere else and provide command line setting for
## alternative location to config file which defines that while launching
## ncmpcpp.
##
#
ncmpcpp_directory = ~/.config/ncmpcpp
#
##
## Directory for storing downloaded lyrics. It defaults to ~/.lyrics since other
## MPD clients (eg. ncmpc) also use that location.
##
#
#lyrics_directory = ~/.lyrics
#
##### connection settings #####
#
mpd_host = localhost
#
mpd_port = 6600
#
#mpd_connection_timeout = 5
#
## Needed for tag editor and file operations to work.
##
#mpd_music_dir = ~/music
#
#mpd_crossfade_time = 5
#
# Exclude pattern for random song action
# http://www.boost.org/doc/libs/1_46_1/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html
#random_exclude_pattern = "^(temp|midi_songs).*"
#
##### music visualizer #####
##
## In order to make music visualizer work with MPD you need to use the fifo
## output. Its format parameter has to be set to 44100:16:1 for mono
## visualization or 44100:16:2 for stereo visualization. As an example here is
## the relevant section for mpd.conf:
##
## audio_output {
## type "fifo"
## name "Visualizer feed"
## path "/tmp/mpd.fifo"
## format "44100:16:2"
## }
##
## If the visualization on occasion diverges from the audio output, please set
## 'buffer_time' parameter of your audio output in mpd.conf to '100000' (100ms)
## or less to prevent that from happening.
##
## Note: If you're using Mopidy, an address of a udpsink gstreamer's output is
## also accepted. For example, the following section in mopidy.conf:
##
## [audio]
## output = tee name=t ! queue ! autoaudiosink t.
## ! queue ! audio/x-raw,rate=44100,channels=2,format=S16LE
## ! udpsink host=localhost port=5555
##
## will make localhost:5555 available as a source of data for the stereo
## visualizer.
##
#
visualizer_data_source = /tmp/mpd.fifo
#
##
## Note: Below parameter is needed for ncmpcpp to determine which output
## provides data for visualizer and reset it at the beginning of visualization
## to synchronize with audio.
##
#
#visualizer_output_name = Visualizer feed
#
##
## If you set format to 44100:16:2, make it 'yes'.
##
#visualizer_in_stereo = yes
#
##
## Note: set below to >=10 only if you have synchronization issues with
## visualization and audio.
##
#
#visualizer_sync_interval = 0
#
##
## Note: To enable spectrum frequency visualization you need to compile ncmpcpp
## with fftw3 support.
##
#
## Available values: spectrum, wave, wave_filled, ellipse.
##
#visualizer_type = spectrum
#
## visualizer_type can be spectrum, wave, or ellipse
visualizer_type = "spectrum" (spectrum/wave)
visualizer_color = 41, 83, 119, 155, 185, 215, 209, 203, 197, 161
#visualizer_fps = 60
#
visualizer_autoscale = yes
#
visualizer_look = ●▮
#
#visualizer_color = blue, cyan, green, yellow, magenta, red
#
## Alternative subset of 256 colors for terminals that support it.
##
#visualizer_color = 47, 83, 119, 155, 191, 227, 221, 215, 209, 203, 197, 161
#
##
## Note: The next few visualization options apply to the spectrum visualizer.
##
#
## Use unicode block characters for a smoother, more continuous look.
## This will override the visualizer_look option. With transparent terminals
## and visualizer_in_stereo set, artifacts may be visible on the bottom half of
## the visualization.
#
#visualizer_spectrum_smooth_look = yes
#
## A value between 1 and 5 inclusive. Specifying a larger value makes the
## visualizer look at a larger slice of time, which results in less jumpy
## visualizer output.
#
#visualizer_spectrum_dft_size = 2
#
#visualizer_spectrum_gain = 10
#
## Left-most frequency of visualizer in Hz, must be less than HZ MAX
#
#visualizer_spectrum_hz_min = 20
#
## Right-most frequency of visualizer in Hz, must be greater than HZ MIN
#
#visualizer_spectrum_hz_max = 20000
#
##### system encoding #####
##
## ncmpcpp should detect your charset encoding but if it failed to do so, you
## can specify charset encoding you are using here.
##
## Note: You can see whether your ncmpcpp build supports charset detection by
## checking output of `ncmpcpp --version`.
##
## Note: Since MPD uses UTF-8 by default, setting this option makes sense only
## if your encoding is different.
##
#
#system_encoding = ""
#
##### delays #####
#
## Time of inactivity (in seconds) after playlist highlighting will be disabled
## (0 = always on).
##
#playlist_disable_highlight_delay = 5
#
## Defines how long messages are supposed to be visible.
##
#message_delay_time = 5
#
##### song format #####
##
## For a song format you can use:
##
## %l - length
## %f - filename
## %D - directory
## %a - artist
## %A - album artist
## %t - title
## %b - album
## %y - date
## %n - track number (01/12 -> 01)
## %N - full track info (01/12 -> 01/12)
## %g - genre
## %c - composer
## %p - performer
## %d - disc
## %C - comment
## %P - priority
## $R - begin right alignment
##
## If you want to make sure that a part of the format is displayed only when
## certain tags are present, you can archieve it by grouping them with brackets,
## e.g. '{%a - %t}' will be evaluated to 'ARTIST - TITLE' if both tags are
## present or '' otherwise. It is also possible to define a list of
## alternatives by providing several groups and separating them with '|',
## e.g. '{%t}|{%f}' will be evaluated to 'TITLE' or 'FILENAME' if the former is
## not present.
##
## Note: If you want to set limit on maximal length of a tag, just put the
## appropriate number between % and character that defines tag type, e.g. to
## make album take max. 20 terminal cells, use '%20b'.
##
## In addition, formats support markers used for text attributes. They are
## followed by character '$'. After that you can put:
##
## - 0 - default window color (discards all other colors)
## - 1 - black
## - 2 - red
## - 3 - green
## - 4 - yellow
## - 5 - blue
## - 6 - magenta
## - 7 - cyan
## - 8 - white
## - 9 - end of current color
## - b - bold text
## - u - underline text
## - r - reverse colors
## - a - use alternative character set
##
## If you don't want to use a non-color attribute anymore, just put it again,
## but this time insert character '/' between '$' and attribute character,
## e.g. {$b%t$/b}|{$r%f$/r} will display bolded title tag or filename with
## reversed colors.
##
## If you want to use 256 colors and/or background colors in formats (the naming
## scheme is described below in section about color definitions), it can be done
## with the syntax $(COLOR), e.g. to set the artist tag to one of the
## non-standard colors and make it have yellow background, you need to write
## $(197_yellow)%a$(end). Note that for standard colors this is interchangable
## with attributes listed above.
##
## Note: colors can be nested.
##
#
#song_list_format = {%a - }{%t}|{$8%f$9}$R{$3%l$9}
#
#song_status_format = {{%a{ "%b"{ (%y)}} - }{%t}}|{%f}
#
#song_library_format = {%n - }{%t}|{%f}
#
#alternative_header_first_line_format = $b$1$aqqu$/a$9 {%t}|{%f} $1$atqq$/a$9$/b
#
#alternative_header_second_line_format = {{$4$b%a$/b$9}{ - $7%b$9}{ ($4%y$9)}}|{%D}
#
#current_item_prefix = $(yellow)$r
#
#current_item_suffix = $/r$(end)
#
#current_item_inactive_column_prefix = $(white)$r
#
#current_item_inactive_column_suffix = $/r$(end)
#
#now_playing_prefix = $b
#
#now_playing_suffix = $/b
#
#browser_playlist_prefix = "$2playlist$9 "
#
#selected_item_prefix = $6
#
#selected_item_suffix = $9
#
#modified_item_prefix = $3> $9
#
##
## Note: attributes are not supported for the following variables.
##
#song_window_title_format = {%a - }{%t}|{%f}
##
## Note: Below variables are used for sorting songs in browser. The sort mode
## determines how songs are sorted, and can be used in combination with a sort
## format to specify a custom sorting format. Available values for
## browser_sort_mode are "type", "name", "mtime", "format" and "none".
##
#
#browser_sort_mode = type
#
#browser_sort_format = {%a - }{%t}|{%f} {%l}
#
##### columns settings #####
##
## syntax of song columns list format is "column column etc."
##
## - syntax for each column is:
##
## (width of the column)[color of the column]{displayed tag}
##
## Note: Width is by default in %, if you want a column to have fixed size, add
## 'f' after the value, e.g. (10)[white]{a} will be the column that take 10% of
## screen (so the real width will depend on actual screen size), whereas
## (10f)[white]{a} will take 10 terminal cells, no matter how wide the screen
## is.
##
## - color is optional (if you want the default one, leave the field empty).
##
## Note: You can give a column additional attributes by putting appropriate
## character after displayed tag character. Available attributes are:
##
## - r - column will be right aligned
## - E - if tag is empty, empty tag marker won't be displayed
##
## You can also:
##
## - give a column custom name by putting it after attributes, separated with
## character ':', e.g. {lr:Length} gives you right aligned column of lengths
## named "Length".
##
## - define sequence of tags, that have to be displayed in case predecessor is
## empty in a way similar to the one in classic song format, i.e. using '|'
## character, e.g. {a|c|p:Owner} creates column named "Owner" that tries to
## display artist tag and then composer and performer if previous ones are not
## available.
##
#
#song_columns_list_format = (20)[]{a} (6f)[green]{NE} (50)[white]{t|f:Title} (20)[cyan]{b} (7f)[magenta]{l}
#
##### various settings #####
#
##
## Note: Custom command that will be executed each time song changes. Useful for
## notifications etc.
##
#execute_on_song_change = ""
#
##
## Note: Custom command that will be executed each time player state
## changes. The environment variable MPD_PLAYER_STATE is set to the current
## state (either unknown, play, pause, or stop) for its duration.
##
#
#execute_on_player_state_change = ""
#
#playlist_show_mpd_host = no
#
#playlist_show_remaining_time = no
#
#playlist_shorten_total_times = no
#
#playlist_separate_albums = no
#
##
## Note: Possible display modes: classic, columns.
##
#playlist_display_mode = columns
#
#browser_display_mode = classic
#
#search_engine_display_mode = classic
#
#playlist_editor_display_mode = classic
#
#discard_colors_if_item_is_selected = yes
#
#show_duplicate_tags = yes
#
#incremental_seeking = yes
#
#seek_time = 1
#
#volume_change_step = 2
#
#autocenter_mode = no
#
#centered_cursor = no
#
##
## Note: You can specify third character which will be used to build 'empty'
## part of progressbar.
##
#progressbar_look = =>
#
## Available values: database, playlist.
##
#default_place_to_search_in = database
#
## Available values: classic, alternative.
##
#user_interface = classic
#
#data_fetching_delay = yes
#
## Available values: artist, album_artist, date, genre, composer, performer.
##
#media_library_primary_tag = artist
#
#media_library_albums_split_by_date = yes
#
#media_library_hide_album_dates = no
#
## Available values: wrapped, normal.
##
#default_find_mode = wrapped
#
#default_tag_editor_pattern = %n - %t
#
#header_visibility = yes
#
#statusbar_visibility = yes
#
## Show the "Connected to ..." message on startup
#connected_message_on_startup = yes
#
#titles_visibility = yes
#
#header_text_scrolling = yes
#
#cyclic_scrolling = no
#
#lyrics_fetchers = azlyrics, genius, musixmatch, sing365, metrolyrics, justsomelyrics, jahlyrics, plyrics, tekstowo, zeneszoveg, internet
#
#follow_now_playing_lyrics = no
#
#fetch_lyrics_for_current_song_in_background = no
#
#store_lyrics_in_song_dir = no
#
#generate_win32_compatible_filenames = yes
#
#allow_for_physical_item_deletion = no
#
##
## Note: If you set this variable, ncmpcpp will try to get info from last.fm in
## language you set and if it fails, it will fall back to english. Otherwise it
## will use english the first time.
##
## Note: Language has to be expressed as an ISO 639 alpha-2 code.
##
#lastfm_preferred_language = en
#
#space_add_mode = add_remove
#
#show_hidden_files_in_local_browser = no
#
##
## How shall screen switcher work?
##
## - "previous" - switch between the current and previous screen.
## - "screen1,...,screenN" - switch between given sequence of screens.
##
## Screens available for use: help, playlist, browser, search_engine,
## media_library, playlist_editor, tag_editor, outputs, visualizer, clock,
## lyrics, last_fm.
##
#screen_switcher_mode = playlist, browser
#
##
## Note: You can define startup screen by choosing screen from the list above.
##
#startup_screen = playlist
#
##
## Note: You can define startup slave screen by choosing screen from the list
## above or an empty value for no slave screen.
##
#startup_slave_screen = ""
#
#startup_slave_screen_focus = no
#
##
## Default width of locked screen (in %). Acceptable values are from 20 to 80.
##
#
#locked_screen_width_part = 50
#
#ask_for_locked_screen_width_part = yes
#
#jump_to_now_playing_song_at_start = yes
#
#ask_before_clearing_playlists = yes
#
#clock_display_seconds = no
#
#display_volume_level = yes
#
#display_bitrate = no
#
#display_remaining_time = no
#
## Available values: none, basic, extended, perl.
##
#regular_expressions = perl
#
##
## Note: if below is enabled, ncmpcpp will ignore leading "The" word while
## sorting items in browser, tags in media library, etc.
##
#ignore_leading_the = no
#
##
## Note: if below is enabled, ncmpcpp will ignore diacritics while searching and
## filtering lists. This takes an effect only if boost was compiled with ICU
## support.
##
#ignore_diacritics = no
#
#block_search_constraints_change_if_items_found = yes
#
#mouse_support = yes
#
#mouse_list_scroll_whole_page = no
#
#lines_scrolled = 5
#
#empty_tag_marker = <empty>
#
#tags_separator = " | "
#
#tag_editor_extended_numeration = no
#
#media_library_sort_by_mtime = no
#
#enable_window_title = yes
#
##
## Note: You can choose default search mode for search engine. Available modes
## are:
##
## - 1 - use mpd built-in searching (no regexes, pattern matching)
##
## - 2 - use ncmpcpp searching (pattern matching with support for regexes, but
## if your mpd is on a remote machine, downloading big database to process
## it can take a while
##
## - 3 - match only exact values (this mode uses mpd function for searching in
## database and local one for searching in current playlist)
##
#
#search_engine_default_search_mode = 1
#
#external_editor = nano
#
## Note: set to yes if external editor is a console application.
##
#use_console_editor = yes
#
##### colors definitions #####
##
## It is possible to set a background color by setting a color value
## "<foreground>_<background>", e.g. red_black will set foregound color to red
## and background color to black.
##
## In addition, for terminals that support 256 colors it is possible to set one
## of them by using a number in range [1, 256] instead of color name,
## e.g. numerical value corresponding to red_black is 2_1. To find out if the
## terminal supports 256 colors, run ncmpcpp and check out the bottom of the
## help screen for list of available colors and their numerical values.
##
## What is more, there are two special values for the background color:
## "transparent" and "current". The first one explicitly sets the background to
## be transparent, while the second one allows you to preserve current
## background color and change only the foreground one. It's used implicitly
## when background color is not specified.
##
## Moreover, it is possible to attach format information to selected color
## variables by appending to their end a colon followed by one or more format
## flags, e.g. black:b or red:ur. The following variables support this syntax:
## visualizer_color, color1, color2, empty_tag_color, volume_color,
## state_line_color, state_flags_color, progressbar_color,
## progressbar_elapsed_color, player_state_color, statusbar_time_color,
## alternative_ui_separator_color.
##
## Note: due to technical limitations of older ncurses version, if 256 colors
## are used there is a possibility that you'll be able to use only colors with
## transparent background.
#
#colors_enabled = yes
#
#empty_tag_color = cyan
#
#header_window_color = default
#
#volume_color = default
#
#state_line_color = default
#
#state_flags_color = default:b
#
#main_window_color = yellow
#
#color1 = white
#
#color2 = green
#
#progressbar_color = black:b
#
#progressbar_elapsed_color = green:b
#
#statusbar_color = default
#
#statusbar_time_color = default:b
#
#player_state_color = default:b
#
#alternative_ui_separator_color = black:b
#
#window_border_color = green
#
#active_window_border = red
#

View file

@ -0,0 +1,2 @@
[Recent]
Files=@Invalid()

View file

@ -0,0 +1,118 @@
[Behavior]
AutoSelectionDelay=600
BookmarkOpenMethod=current_tab
ConfirmDelete=true
ConfirmTrash=false
CtrlRightClick=false
NoUsbTrash=false
QuickExec=false
RecentFilesNumber=0
SelectNewFiles=false
SingleClick=false
SingleWindowMode=false
UseTrash=true
[Desktop]
AllSticky=false
BgColor=#000000
DesktopCellMargins=@Size(3 1)
DesktopIconSize=48
DesktopShortcuts=@Invalid()
FgColor=#ffffff
Font="Sans Serif,9,-1,5,50,0,0,0,0,0"
HideItems=false
LastSlide=
OpenWithDefaultFileManager=false
PerScreenWallpaper=false
ShadowColor=#000000
ShowHidden=false
SlideShowInterval=0
SortColumn=name
SortFolderFirst=true
SortHiddenLast=false
SortOrder=ascending
TransformWallpaper=false
Wallpaper=
WallpaperDialogSize=@Size(700 500)
WallpaperDialogSplitterPos=200
WallpaperDirectory=
WallpaperMode=none
WallpaperRandomize=false
WorkAreaMargins=12, 12, 12, 12
[FolderView]
BackupAsHidden=false
BigIconSize=48
CustomColumnWidths=@Invalid()
FolderViewCellMargins=@Size(3 3)
HiddenColumns=@Invalid()
Mode=icon
NoItemTooltip=false
ScrollPerPixel=true
ShadowHidden=true
ShowFilter=false
ShowFullNames=true
ShowHidden=false
SidePaneIconSize=24
SmallIconSize=24
SortCaseSensitive=false
SortColumn=name
SortFolderFirst=true
SortHiddenLast=false
SortOrder=ascending
ThumbnailIconSize=128
[Places]
HiddenPlaces=@Invalid()
[Search]
ContentPatterns=@Invalid()
MaxSearchHistory=0
NamePatterns=@Invalid()
searchContentCaseInsensitive=false
searchContentRegexp=true
searchNameCaseInsensitive=false
searchNameRegexp=true
searchRecursive=false
searchhHidden=false
[System]
Archiver=lxqt-archiver
FallbackIconThemeName=oxygen
OnlyUserTemplates=false
SIUnit=false
SuCommand=lxqt-sudo %s
TemplateRunApp=false
TemplateTypeOnce=false
Terminal=wezterm
[Thumbnail]
MaxExternalThumbnailFileSize=-1
MaxThumbnailFileSize=4096
ShowThumbnails=true
ThumbnailLocalFilesOnly=true
[Volume]
AutoRun=true
CloseOnUnmount=true
MountOnStartup=true
MountRemovable=true
[Window]
AlwaysShowTabs=true
FixedHeight=480
FixedWidth=640
LastWindowHeight=789
LastWindowMaximized=false
LastWindowWidth=960
PathBarButtons=true
RememberWindowSize=true
ReopenLastTabs=false
ShowMenuBar=true
ShowTabClose=true
SidePaneMode=places
SidePaneVisible=true
SplitView=false
SplitterPos=150
SwitchToNewTab=false
TabPaths=@Invalid()

View file

@ -0,0 +1,30 @@
[config]
bm_open_method=0
[volume]
mount_on_startup=1
mount_removable=1
autorun=1
[autorun]
x-content/win32-software=pcmanfm
[ui]
always_show_tabs=0
max_tab_chars=32
win_width=640
win_height=480
maximized=1
splitter_pos=150
media_in_new_tab=0
desktop_folder_new_win=0
change_tab_on_drop=1
close_on_unmount=1
focus_previous=0
side_pane_mode=places
view_mode=icon
show_hidden=1
sort=name;ascending;
toolbar=newtab;navigation;home;
show_statusbar=1
pathbar_mode_buttons=0

View file

@ -0,0 +1,116 @@
[Added Associations]
application/json=code-oss.desktop;vim.desktop;
application/pdf=org.gnome.Evince.desktop;com.github.xournalpp.xournalpp.desktop;
application/vnd.openxmlformats-officedocument.wordprocessingml.document=libreoffice-writer.desktop;
application/x-extension-htm=firefox.desktop;
application/x-extension-html=firefox.desktop;
application/x-extension-shtml=firefox.desktop;
application/x-extension-xht=firefox.desktop;
application/x-extension-xhtml=firefox.desktop;
application/x-ms-dos-executable=wine.desktop;
application/x-raw-disk-image-xz-compressed=org.gnome.FileRoller.desktop;
application/x-shellscript=vim.desktop;
application/x-xz-compressed-tar=engrampa.desktop;
application/x-yaml=vim.desktop;
application/xhtml+xml=firefox.desktop;
application/xml=vim.desktop;
audio/flac=vlc.desktop;
audio/mpeg=vlc.desktop;
audio/x-opus+ogg=vlc.desktop;
audio/x-vorbis+ogg=vlc.desktop;
image/png=lximage-qt.desktop;org.xfce.ristretto.desktop;imv.desktop;feh.desktop;org.gnome.eog.desktop;
inode/directory=xfce4-file-manager.desktop;pcmanfm.desktop;pcmanfm-qt.desktop;
text/csv=vim.desktop;
text/html=firefox.desktop;
text/plain=vim.desktop;
video/mp4=vlc.desktop;
video/x-matroska=vlc.desktop;
x-scheme-handler/chrome=firefox.desktop;
x-scheme-handler/geo=openstreetmap-geo-handler.desktop;
x-scheme-handler/http=firefox.desktop;
x-scheme-handler/https=firefox.desktop;
x-scheme-handler/mailto=thunderbird.desktop;userapp-Thunderbird-Y331Y1.desktop;
x-scheme-handler/tel=org.kde.kdeconnect.handler.desktop;
x-scheme-handler/trash=xfce4-file-manager.desktop;
application/x-smb-server=thunar.desktop;pcmanfm.desktop;
application/x-smb-workgroup=pcmanfm.desktop;thunar.desktop;
image/tiff=lximage-qt.desktop;
image/svg+xml=lximage-qt.desktop;
image/jpeg=lximage-qt.desktop;
image/gif=lximage-qt.desktop;
image/bmp=lximage-qt.desktop;
application/vnd.rar=xarchiver.desktop;org.gnome.FileRoller.desktop;
video/quicktime=vlc.desktop;
text/x-log=vim.desktop;code-oss.desktop;
x-scheme-handler/mid=userapp-Thunderbird-Y331Y1.desktop;
x-scheme-handler/news=userapp-Thunderbird-7E70Y1.desktop;
x-scheme-handler/snews=userapp-Thunderbird-7E70Y1.desktop;
x-scheme-handler/nntp=userapp-Thunderbird-7E70Y1.desktop;
x-scheme-handler/feed=userapp-Thunderbird-PY6YY1.desktop;
application/rss+xml=userapp-Thunderbird-PY6YY1.desktop;
application/x-extension-rss=userapp-Thunderbird-PY6YY1.desktop;
x-scheme-handler/webcal=userapp-Thunderbird-IT7VY1.desktop;
x-scheme-handler/webcals=userapp-Thunderbird-IT7VY1.desktop;
[Default Applications]
application/json=vim.desktop
application/pcx=lximage-qt.desktop
application/pdf=org.gnome.Evince.desktop
application/vnd.openxmlformats-officedocument.wordprocessingml.document=libreoffice-writer.desktop
application/x-extension-htm=firefox.desktop
application/x-extension-html=firefox.desktop
application/x-extension-shtml=firefox.desktop
application/x-extension-xht=firefox.desktop
application/x-extension-xhtml=firefox.desktop
application/x-shellscript=vim.desktop
application/x-xz-compressed-tar=engrampa.desktop
application/x-yaml=vim.desktop
application/xhtml+xml=firefox.desktop
audio/flac=vlc.desktop
audio/x-opus+ogg=vlc.desktop
audio/x-vorbis+ogg=vlc.desktop
image/bmp=lximage-qt.desktop
image/gif=lximage-qt.desktop
image/jpeg=lximage-qt.desktop
image/jpg=lximage-qt.desktop
image/png=lximage-qt.desktop
image/svg+xml=lximage-qt.desktop
image/svg-xml=lximage-qt.desktop
image/tiff=lximage-qt.desktop
image/x-bmp=lximage-qt.desktop
image/x-pcx=lximage-qt.desktop
image/x-portable-bitmap=lximage-qt.desktop
image/x-portable-greymap=lximage-qt.desktop
image/x-portable-pixmap=lximage-qt.desktop
image/x-targa=lximage-qt.desktop
image/x-tga=lximage-qt.desktop
inode/directory=pcmanfm.desktop
text/html=firefox.desktop
text/plain=vim.desktop
video/mp4=vlc.desktop
video/x-matroska=vlc.desktop
x-scheme-handler/chrome=firefox.desktop
x-scheme-handler/discord-402572971681644545=discord-402572971681644545.desktop
x-scheme-handler/discord-516565141911765022=discord-516565141911765022.desktop
x-scheme-handler/geo=openstreetmap-geo-handler.desktop;
x-scheme-handler/http=firefox.desktop;
x-scheme-handler/https=firefox.desktop;
x-scheme-handler/jetbrains=jetbrains-toolbox.desktop
x-scheme-handler/mailto=userapp-Thunderbird-Y331Y1.desktop
x-scheme-handler/tel=org.kde.kdeconnect.handler.desktop;
x-scheme-handler/trash=xfce4-file-manager.desktop
application/x-smb-server=pcmanfm.desktop
application/x-smb-workgroup=pcmanfm.desktop
video/quicktime=vlc.desktop
message/rfc822=userapp-Thunderbird-Y331Y1.desktop
x-scheme-handler/mid=userapp-Thunderbird-Y331Y1.desktop
x-scheme-handler/news=userapp-Thunderbird-7E70Y1.desktop
x-scheme-handler/snews=userapp-Thunderbird-7E70Y1.desktop
x-scheme-handler/nntp=userapp-Thunderbird-7E70Y1.desktop
x-scheme-handler/feed=userapp-Thunderbird-PY6YY1.desktop
application/rss+xml=userapp-Thunderbird-PY6YY1.desktop
application/x-extension-rss=userapp-Thunderbird-PY6YY1.desktop
x-scheme-handler/webcal=userapp-Thunderbird-IT7VY1.desktop
text/calendar=userapp-Thunderbird-IT7VY1.desktop
application/x-extension-ics=userapp-Thunderbird-IT7VY1.desktop
x-scheme-handler/webcals=userapp-Thunderbird-IT7VY1.desktop

View file

@ -0,0 +1,4 @@
[ColorScheme]
active_colors=#ffffff, #383C4A, #979797, #5e5c5b, #302f2e, #4a4947, #ffffff, #ffffff, #ffffff, #3d3d3d, #2F343F, #e7e4e0, #5294e2, #f9f9f9, #5294e2, #a70b06, #5c5b5a, #ffffff, #3f3f36, #ffffff
disabled_colors=#808080, #383C4A, #979797, #5e5c5b, #302f2e, #4a4947, #808080, #ffffff, #808080, #3d3d3d, #2F343F, #e7e4e0, #5294e2, #808080, #5294e2, #a70b06, #5c5b5a, #ffffff, #3f3f36, #ffffff
inactive_colors=#ffffff, #383C4A, #979797, #5e5c5b, #302f2e, #4a4947, #ffffff, #ffffff, #ffffff, #3d3d3d, #2F343F, #e7e4e0, #5294e2, #f9f9f9, #5294e2, #a70b06, #5c5b5a, #ffffff, #3f3f36, #ffffff

View file

@ -0,0 +1,4 @@
[ColorScheme]
active_colors=#000000, #F5F6F7, #ffffff, #F3F3F3, #9f9d9a, #b8b5b2, #000000, #ffffff, #000000, #ffffff, #E7E8EB, #b1aeab, #5492DF, #ffffff, #0000ff, #ff0000, #f7f5f3, #000000, #ffffdc, #000000
disabled_colors=#bebebe, #F5F6F7, #ffffff, #F3F3F3, #9f9d9a, #b8b5b2, #bebebe, #ffffff, #bebebe, #efebe7, #E7E8EB, #b1aeab, #9f9d9a, #ffffff, #0000ff, #ff0000, #f7f5f3, #000000, #ffffdc, #000000
inactive_colors=#000000, #F5F6F7, #ffffff, #F3F3F3, #9f9d9a, #b8b5b2, #000000, #ffffff, #000000, #ffffff, #E7E8EB, #b1aeab, #5492DF, #ffffff, #0000ff, #ff0000, #f7f5f3, #000000, #ffffdc, #000000

View file

@ -0,0 +1,35 @@
[Appearance]
color_scheme_path=~/.config/qt5ct/colors/arc-dark.conf
custom_palette=true
icon_theme=Arc
standard_dialogs=default
style=Fusion
[Fonts]
fixed=@Variant(\0\0\0@\0\0\0\x12\0\x43\0\x61\0n\0t\0\x61\0r\0\x65\0l\0l@(\0\0\0\0\0\0\xff\xff\xff\xff\x5\x1\0\x32\x10)
general=@Variant(\0\0\0@\0\0\0\x12\0\x43\0\x61\0n\0t\0\x61\0r\0\x65\0l\0l@(\0\0\0\0\0\0\xff\xff\xff\xff\x5\x1\0\x32\x10)
[Interface]
activate_item_on_single_click=1
buttonbox_layout=3
cursor_flash_time=1000
dialog_buttons_have_icons=1
double_click_interval=400
gui_effects=@Invalid()
keyboard_scheme=4
menus_have_icons=true
show_shortcuts_in_context_menus=true
stylesheets=@Invalid()
toolbutton_style=4
underline_shortcut=1
wheel_scroll_lines=3
[QSSEditor]
geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\0\x8d\0\0\0\xf6\0\0\x3\xf\0\0\x2\xe8\0\0\0\x8d\0\0\0\xf6\0\0\x3\xf\0\0\x2\xe8\0\0\0\0\0\0\0\0\a\x80\0\0\0\x8d\0\0\0\xf6\0\0\x3\xf\0\0\x2\xe8)
[SettingsWindow]
geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\0\0\0\0\0\0\0\0\x3\xa9\0\0\x4\0\0\0\0\0\0\0\0\0\0\0\x2\xf0\0\0\x2t\0\0\0\0\x2\0\0\0\a\x80\0\0\0\0\0\0\0\0\0\0\x3\xa9\0\0\x4\0)
[Troubleshooting]
force_raster_widgets=1
ignored_applications=@Invalid()

View file

View file

@ -0,0 +1,68 @@
# anchor, where to display sov, top, bottom, left, right, center
anchor center
# margin, distance from edges if anchor is set
margin 0
# show timeout in millisecs
timeout 200
# distance between workspaces
gap 20
# columns
columns 5
# thumbnail to workspace ratio
ratio 8
# font face, use any string that is output by fc-list
font_face Terminus (TTF):style=Bold
# margin size around text
text_margin_size 7
# margin top size over text
text_margin_top_size 4
# title text size
text_title_size 14
# title text color
text_title_color #FFFFFFFF
# description text size
text_description_size 12
# description text color
text_description_color #999999FF
# workspace number text size
text_workspace_size 18
# workspace number text color
text_workspace_color #FFFFFFFF
# workspace number x shift
text_workspace_xshift 11
# workspace number y shift
text_workspace_yshift -17
# border color
border_color #BCBCBCFF
# background color
background_color #222222FF
# focused background color
background_color_focused #444444FF
# window color
window_color #000000AA
# empty thumb color
empty_color #111111FF
# empty thumb border
empty_frame_color #555555FF

View file

@ -0,0 +1,123 @@
#!/usr/bin/env python3
#
# Copyright (C) 2017 Marcel Patzwahl
# Licensed under the terms of the GNU GPL v3 only.
#
# i3blocks blocklet script to see the available updates of pacman and the AUR
import subprocess
from subprocess import check_output
import argparse
import os
import re
def create_argparse():
def _default(name, default='', arg_type=str):
val = default
if name in os.environ:
val = os.environ[name]
return arg_type(val)
strbool = lambda s: s.lower() in ['t', 'true', '1']
strlist = lambda s: s.split()
parser = argparse.ArgumentParser(description='Check for pacman updates')
parser.add_argument(
'-b',
'--base_color',
default = _default('BASE_COLOR', 'green'),
help='base color of the output(default=green)'
)
parser.add_argument(
'-u',
'--updates_available_color',
default = _default('UPDATE_COLOR', 'yellow'),
help='color of the output, when updates are available(default=yellow)'
)
parser.add_argument(
'-a',
'--aur',
action = 'store_const',
const = True,
default = _default('AUR', 'False', strbool),
help='Include AUR packages. Attn: Yaourt must be installed'
)
parser.add_argument(
'-q',
'--quiet',
action = 'store_const',
const = True,
default = _default('QUIET', 'False', strbool),
help = 'Do not produce output when system is up to date'
)
parser.add_argument(
'-w',
'--watch',
nargs='*',
default = _default('WATCH', arg_type=strlist),
help='Explicitly watch for specified packages. '
'Listed elements are treated as regular expressions for matching.'
)
return parser.parse_args()
def get_updates():
output = check_output(['checkupdates']).decode('utf-8')
if not output:
return []
updates = [line.split(' ')[0]
for line in output.split('\n')
if line]
return updates
def get_aur_updates():
output = ''
try:
output = check_output(['yaourt', '-Qua']).decode('utf-8')
except subprocess.CalledProcessError as exc:
# yaourt exits with 1 and no output if no updates are available.
# we ignore this case and go on
if not (exc.returncode == 1 and not exc.output):
raise exc
if not output:
return []
aur_updates = [line.split(' ')[0]
for line in output.split('\n')
if line.startswith('aur/')]
return aur_updates
def matching_updates(updates, watch_list):
matches = set()
for u in updates:
for w in watch_list:
if re.match(w, u):
matches.add(u)
return matches
message = "<span color='{0}'>{1}</span>"
args = create_argparse()
updates = get_updates()
if args.aur:
updates += get_aur_updates()
update_count = len(updates)
if update_count > 0:
info = str(update_count) + ' updates available'
short_info = str(update_count) + ' updates'
matches = matching_updates(updates, args.watch)
if matches:
info += ' [{0}]'.format(', '.join(matches))
short_info += '*'
print(message.format(args.updates_available_color, info))
print(message.format(args.updates_available_color, short_info))
elif not args.quiet:
print(message.format(args.base_color, 'system up to date'))

View file

@ -0,0 +1,112 @@
#!/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/>.
# Get custom IN and OUT labels if provided by command line arguments
while [[ $# -gt 1 ]]; do
key="$1"
case "$key" in
-i|--inlabel)
INLABEL="$2"
shift;;
-o|--outlabel)
OUTLABEL="$2"
shift;;
esac
shift
done
[[ -z $INLABEL ]] && INLABEL="IN "
[[ -z $OUTLABEL ]] && OUTLABEL="OUT "
# Use the provided interface, otherwise the device used for the default route.
if [[ -z $INTERFACE ]] && [[ -n $BLOCK_INSTANCE ]]; then
INTERFACE=$BLOCK_INSTANCE
elif [[ -z $INTERFACE ]]; then
INTERFACE=$(ip route | awk '/^default/ { print $5 ; exit }')
fi
# Exit if there is no default route
[[ -z "$IF" ]] && exit
# Issue #36 compliant.
if ! [ -e "/sys/class/net/${INTERFACE}/operstate" ] || \
(! [ "$TREAT_UNKNOWN_AS_UP" = "1" ] &&
! [ "`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 "$INLABEL"
rx_kib=$(( $rx_rate >> 10 ))
if hash bc 2>/dev/null && [[ "$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 "$OUTLABEL"
tx_kib=$(( $tx_rate >> 10 ))
if hash bc 2>/dev/null && [[ "$tx_rate" -gt 1048576 ]]; then
printf '%sM' "`echo "scale=1; $tx_kib / 1024" | bc`"
else
echo -n "${tx_kib}K"
fi

View file

@ -0,0 +1,137 @@
#!/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.
#
#
readarray -t output <<< $(acpi battery)
battery_count=${#output[@]}
for line in "${output[@]}";
do
percentages+=($(echo "$line" | grep -o -m1 '[0-9]\{1,3\}%' | tr -d '%'))
statuses+=($(echo "$line" | egrep -o -m1 'Discharging|Charging|AC|Full|Unknown'))
remaining=$(echo "$line" | egrep -o -m1 '[0-9][0-9]:[0-9][0-9]')
if [[ -n $remaining ]]; then
remainings+=(" ($remaining)")
else
remainings+=("")
fi
done
squares="■"
#There are 8 colors that reflect the current battery percentage when
#discharging
dis_colors=("${C1:-#FF0027}" "${C2:-#FF3B05}" "${C3:-#FFB923}"
"${C4:-#FFD000}" "${C5:-#E4FF00}" "${C6:-#ADFF00}"
"${C7:-#6DFF00}" "${C8:-#10BA00}")
charging_color="${CHARGING_COLOR:-#00AFE3}"
full_color="${FULL_COLOR:-#FFFFFF}"
ac_color="${AC_COLOR:-#535353}"
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
end=$(($battery_count - 1))
for i in $(seq 0 $end);
do
if (( percentages[$i] > 0 && percentages[$i] < 20 )); then
squares="■"
elif (( percentages[$i] >= 20 && percentages[$i] < 40 )); then
squares="■■"
elif (( percentages[$i] >= 40 && percentages[$i] < 60 )); then
squares="■■■"
elif (( percentages[$i] >= 60 && percentages[$i] < 80 )); then
squares="■■■■"
elif (( percentages[$i] >=80 )); then
squares="■■■■■"
fi
if [[ "${statuses[$i]}" = "Unknown" ]]; then
squares="<sup>?</sup>$squares"
fi
case "${statuses[$i]}" in
"Charging")
color="$charging_color"
;;
"Full")
color="$full_color"
;;
"AC")
color="$ac_color"
;;
"Discharging"|"Unknown")
if (( percentages[$i] >= 0 && percentages[$i] < 10 )); then
color="${dis_colors[0]}"
elif (( percentages[$i] >= 10 && percentages[$i] < 20 )); then
color="${dis_colors[1]}"
elif (( percentages[$i] >= 20 && percentages[$i] < 30 )); then
color="${dis_colors[2]}"
elif (( percentages[$i] >= 30 && percentages[$i] < 40 )); then
color="${dis_colors[3]}"
elif (( percentages[$i] >= 40 && percentages[$i] < 60 )); then
color="${dis_colors[4]}"
elif (( percentages[$i] >= 60 && percentages[$i] < 70 )); then
color="${dis_colors[5]}"
elif (( percentages[$i] >= 70 && percentages[$i] < 80 )); then
color="${dis_colors[6]}"
elif (( percentages[$i] >= 80 )); then
color="${dis_colors[7]}"
fi
;;
esac
# Print Battery number if there is more than one
if (( $end > 0 )) ; then
message="$message $(($i + 1)):"
fi
if [[ "$BLOCK_BUTTON" -eq 1 ]]; then
message="$message ${statuses[$i]} <span foreground=\"$color\">${percentages[$i]}%${remainings[i]}</span>"
fi
message="$message <span foreground=\"$color\">$squares</span>"
done
echo $message

View file

@ -0,0 +1,40 @@
#! /bin/sh
WIDTH=${WIDTH:-200}
HEIGHT=${HEIGHT:-200}
DATEFMT=${DATEFMT:-"+%a %d.%m.%Y %H:%M:%S"}
SHORTFMT=${SHORTFMT:-"+%H:%M:%S"}
OPTIND=1
while getopts ":f:W:H:" opt; do
case $opt in
f) DATEFMT="$OPTARG" ;;
W) WIDTH="$OPTARG" ;;
H) HEIGHT="$OPTARG" ;;
\?)
echo "Invalid option: -$OPTARG" >&2
exit 1
;;
:)
echo "Option -$OPTARG requires an argument." >&2
exit 1
;;
esac
done
case "$BLOCK_BUTTON" in
1|2|3)
# the position of the upper left corner of the popup
posX=$(($BLOCK_X - $WIDTH / 2))
posY=$(($BLOCK_Y - $HEIGHT))
i3-msg -q "exec yad --calendar \
--width=$WIDTH --height=$HEIGHT \
--undecorated --fixed \
--close-on-unfocus --no-buttons \
--posx=$posX --posy=$posY \
> /dev/null"
esac
echo "$LABEL$(date "$DATEFMT")"
echo "$LABEL$(date "$SHORTFMT")"

View file

@ -0,0 +1,234 @@
# Thank you code_nomad: http://9m.no/ꪯ鵞
#################################
#
# Backend
#
#################################
# Backend to use: "xrender" or "glx".
# GLX backend is typically much faster but depends on a sane driver.
backend = "glx";
#################################
#
# GLX backend
#
#################################
glx-no-stencil = true;
# GLX backend: Copy unmodified regions from front buffer instead of redrawing them all.
# My tests with nvidia-drivers show a 10% decrease in performance when the whole screen is modified,
# but a 20% increase when only 1/4 is.
# My tests on nouveau show terrible slowdown.
# Useful with --glx-swap-method, as well.
glx-copy-from-front = false;
# GLX backend: Use MESA_copy_sub_buffer to do partial screen update.
# My tests on nouveau shows a 200% performance boost when only 1/4 of the screen is updated.
# May break VSync and is not available on some drivers.
# Overrides --glx-copy-from-front.
# glx-use-copysubbuffermesa = true;
# GLX backend: Avoid rebinding pixmap on window damage.
# Probably could improve performance on rapid window content changes, but is known to break things on some drivers (LLVMpipe).
# Recommended if it works.
# glx-no-rebind-pixmap = true;
# GLX backend: GLX buffer swap method we assume.
# Could be undefined (0), copy (1), exchange (2), 3-6, or buffer-age (-1).
# undefined is the slowest and the safest, and the default value.
# copy is fastest, but may fail on some drivers,
# 2-6 are gradually slower but safer (6 is still faster than 0).
# Usually, double buffer means 2, triple buffer means 3.
# buffer-age means auto-detect using GLX_EXT_buffer_age, supported by some drivers.
# Useless with --glx-use-copysubbuffermesa.
# Partially breaks --resize-damage.
# Defaults to undefined.
glx-swap-method = "undefined";
#################################
#
# Shadows
#
#################################
# Enabled client-side shadows on windows.
shadow = true;
# Don't draw shadows on DND windows.
no-dnd-shadow = true;
# Avoid drawing shadows on dock/panel windows.
no-dock-shadow = true;
# Zero the part of the shadow's mask behind the window. Fix some weirdness with ARGB windows.
clear-shadow = true;
# The blur radius for shadows. (default 12)
shadow-radius = 5;
# The left offset for shadows. (default -15)
shadow-offset-x = -5;
# The top offset for shadows. (default -15)
shadow-offset-y = -5;
# The translucency for shadows. (default .75)
shadow-opacity = 0.5;
# Set if you want different colour shadows
# shadow-red = 0.0;
# shadow-green = 0.0;
# shadow-blue = 0.0;
# The shadow exclude options are helpful if you have shadows enabled. Due to the way compton draws its shadows, certain applications will have visual glitches
# (most applications are fine, only apps that do weird things with xshapes or argb are affected).
# This list includes all the affected apps I found in my testing. The "! name~=''" part excludes shadows on any "Unknown" windows, this prevents a visual glitch with the XFWM alt tab switcher.
shadow-exclude = [
"! name~=''",
"name = 'Notification'",
"name = 'Plank'",
"name = 'Docky'",
"name = 'Kupfer'",
"name = 'xfce4-notifyd'",
"name *= 'VLC'",
"name *= 'compton'",
"name *= 'Chromium'",
"name *= 'Chrome'",
"class_g = 'Conky'",
"class_g = 'Kupfer'",
"class_g = 'Synapse'",
"class_g ?= 'Notify-osd'",
"class_g ?= 'Cairo-dock'",
"class_g ?= 'Xfce4-notifyd'",
"class_g ?= 'Xfce4-power-manager'",
"_GTK_FRAME_EXTENTS@:c"
];
# Avoid drawing shadow on all shaped windows (see also: --detect-rounded-corners)
shadow-ignore-shaped = false;
#################################
#
# Opacity
#
#################################
menu-opacity = 1;
inactive-opacity = 1;
active-opacity = 1;
frame-opacity = 1;
inactive-opacity-override = false;
alpha-step = 0.06;
# Dim inactive windows. (0.0 - 1.0)
# inactive-dim = 0.2;
# Do not let dimness adjust based on window opacity.
# inactive-dim-fixed = true;
# Blur background of transparent windows. Bad performance with X Render backend. GLX backend is preferred.
# blur-background = true;
# Blur background of opaque windows with transparent frames as well.
# blur-background-frame = true;
# Do not let blur radius adjust based on window opacity.
blur-background-fixed = false;
blur-background-exclude = [
"window_type = 'dock'",
"window_type = 'desktop'"
];
#################################
#
# Fading
#
#################################
# Fade windows during opacity changes.
fading = true;
# The time between steps in a fade in milliseconds. (default 10).
fade-delta = 4;
# Opacity change between steps while fading in. (default 0.028).
fade-in-step = 0.03;
# Opacity change between steps while fading out. (default 0.03).
fade-out-step = 0.03;
# Fade windows in/out when opening/closing
# no-fading-openclose = true;
# Specify a list of conditions of windows that should not be faded.
fade-exclude = [ ];
#################################
#
# Other
#
#################################
# Try to detect WM windows and mark them as active.
mark-wmwin-focused = true;
# Mark all non-WM but override-redirect windows active (e.g. menus).
mark-ovredir-focused = true;
# Use EWMH _NET_WM_ACTIVE_WINDOW to determine which window is focused instead of using FocusIn/Out events.
# Usually more reliable but depends on a EWMH-compliant WM.
use-ewmh-active-win = true;
# Detect rounded corners and treat them as rectangular when --shadow-ignore-shaped is on.
detect-rounded-corners = true;
# Detect _NET_WM_OPACITY on client windows, useful for window managers not passing _NET_WM_OPACITY of client windows to frame windows.
# This prevents opacity being ignored for some apps.
# For example without this enabled my xfce4-notifyd is 100% opacity no matter what.
detect-client-opacity = true;
# Specify refresh rate of the screen.
# If not specified or 0, compton will try detecting this with X RandR extension.
refresh-rate = 0;
# Set VSync method. VSync methods currently available:
# none: No VSync
# drm: VSync with DRM_IOCTL_WAIT_VBLANK. May only work on some drivers.
# opengl: Try to VSync with SGI_video_sync OpenGL extension. Only work on some drivers.
# opengl-oml: Try to VSync with OML_sync_control OpenGL extension. Only work on some drivers.
# opengl-swc: Try to VSync with SGI_swap_control OpenGL extension. Only work on some drivers. Works only with GLX backend. Known to be most effective on many drivers. Does not actually control paint timing, only buffer swap is affected, so it doesnt have the effect of --sw-opti unlike other methods. Experimental.
# opengl-mswc: Try to VSync with MESA_swap_control OpenGL extension. Basically the same as opengl-swc above, except the extension we use.
# (Note some VSync methods may not be enabled at compile time.)
vsync = "opengl-swc";
# Enable DBE painting mode, intended to use with VSync to (hopefully) eliminate tearing.
# Reported to have no effect, though.
dbe = false;
# Painting on X Composite overlay window. Recommended.
paint-on-overlay = true;
# Limit compton to repaint at most once every 1 / refresh_rate second to boost performance.
# This should not be used with --vsync drm/opengl/opengl-oml as they essentially does --sw-opti's job already,
# unless you wish to specify a lower refresh rate than the actual value.
#sw-opti = true;
# Unredirect all windows if a full-screen opaque window is detected, to maximize performance for full-screen windows, like games.
# Known to cause flickering when redirecting/unredirecting windows.
# paint-on-overlay may make the flickering less obvious.
unredir-if-possible = true;
# Specify a list of conditions of windows that should always be considered focused.
focus-exclude = [ ];
# Use WM_TRANSIENT_FOR to group windows, and consider windows in the same group focused at the same time.
detect-transient = true;
# Use WM_CLIENT_LEADER to group windows, and consider windows in the same group focused at the same time.
# WM_TRANSIENT_FOR has higher priority if --detect-transient is enabled, too.
detect-client-leader = true;
#################################
#
# Window type settings
#
#################################
wintypes:
{
tooltip =
{
# fade: Fade the particular type of windows.
fade = true;
# shadow: Give those windows shadow
shadow = false;
# opacity: Default opacity for the type of windows.
opacity = 0.85;
# focus: Whether to always consider windows of this type focused.
focus = true;
};
};

View file

@ -0,0 +1,653 @@
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# xmodmap -pke
# xev
# i3 config file (v4)
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
set $mod Mod1
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
#font pango:Noto Sans Bold 9
#font pango:Droid Sans 9
#font pango:FontAwesome 8, pango: Droid Sans Mono 8
#font pango:System San Francisco Display 10
#font pango:System San Francisco Display 6
#font pango:monospace 8
set $bg-color #2f343f
set $inactive-bg-color #2f343f
set $text-color #f3f4f5
set $inactive-text-color #676E7D
set $urgent-bg-color #E53935
#font pango:Terminus (TTF) Bold 12
font pango:Hack Nerd Font 13
#font pango:Hack 12
# window colors
# border background text indicat>
client.focused $bg-color $bg-color $text-color #00ff00
client.unfocused $inactive-bg-color $inactive-bg-color $inactive-text-color #00ff00
client.focused_inactive $inactive-bg-color $inactive-bg-color $inactive-text-color #00ff00
client.urgent $urgent-bg-color $urgent-bg-color $text-color #00ff00
# This font is widely installed, provides lots of unicode glyphs, right-to-left
# text rendering and scalability on retina/hidpi displays (thanks to pango).
#font pango:DejaVu Sans Mono 8
# Before i3 v4.8, we used to recommend this one as the default:
# font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
# The font above is very space-efficient, that is, it looks good, sharp and
# clear in small sizes. However, its unicode glyph coverage is limited, the old
# X core fonts rendering does not support right-to-left and this being a bitmap
# font, it doesnt scale on retina/hidpi displays.
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
workspace_auto_back_and_forth yes
force_display_urgency_hint 0 ms
focus_on_window_activation urgent
# start a terminal
bindsym $mod+Return exec wezterm
# kill focused window
bindsym $mod+Shift+q kill
# Menu
#bindsym $mod+d exec rofi -show run -lines 3 -bw 1 -font "Cantarell 18" -opacity "75"
bindsym $mod+d exec fuzzel
#bindsym $mod+d exec wofi --show run --width 900 --height 200
#bindsym $mod+d exec rofi -show run -lines 3 -eh 2 -width 100 -padding 800 -opacity "85" -bw 0 -bc "$bg-color" -bg "$bg-color" -fg "$text-color" -hlbg "$bg-color" -hlfg "#9575cd" -font "System San Francisco Display 18"
#bindsym $mod+d exec --no-startup-id i3-dmenu-desktop --dmenu='rofi -i -dmenu -font "snap 12" -bg "#222222" -fg "#888888" -hlbg "#285577" -hlfg "#ffffff" -opacity 90 -m 0 -location 2'
# start dmenu (a program launcher)
#bindsym $mod+d exec dmenu_run
#bindsym $mod+d exec j4-dmenu-desktop --dmenu='bemenu -i --nb "#3f3f3f" --nf "#dcdccc" --fn "pango:DejaVu Sans Mono 12"' --term='termite'
# There also is the (new) i3-dmenu-desktop which only displays applications
# shipping a .desktop file. It is a wrapper around dmenu, so you need that
# installed.
# bindsym $mod+d exec --no-startup-id i3-dmenu-desktop
# 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
# split in horizontal orientation
bindsym $mod+h split h
# split in vertical orientation
bindsym $mod+v split v
# enter 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
# focus the parent container
bindsym $mod+a focus parent
# focus the child container
#bindsym $mod+d focus child
# Define names for default workspaces for which we configure key bindings later on.
# We use variables to avoid repeating the names in multiple places.
#set $ws1 "1: Terminals "
#set $ws2 "2: Browser "
#set $ws3 "3: Mail "
#set $ws4 "4: Office "
#set $ws5 "5: Music "
#set $ws6 "6: Speakprogram "
#set $ws7 "7: IDE "
#set $ws8 "8: Steam "
#set $ws9 "9: Chat "
#set $ws10 "10: Others "
bindsym --no-repeat $mod+1 workspace number 1; exec "echo 1 > /tmp/sov"
bindsym --no-repeat $mod+2 workspace number 2; exec "echo 1 > /tmp/sov"
bindsym --no-repeat $mod+3 workspace number 3; exec "echo 1 > /tmp/sov"
bindsym --no-repeat $mod+4 workspace number 4; exec "echo 1 > /tmp/sov"
bindsym --no-repeat $mod+5 workspace number 5; exec "echo 1 > /tmp/sov"
bindsym --no-repeat $mod+6 workspace number 6; exec "echo 1 > /tmp/sov"
bindsym --no-repeat $mod+7 workspace number 7; exec "echo 1 > /tmp/sov"
bindsym --no-repeat $mod+8 workspace number 8; exec "echo 1 > /tmp/sov"
bindsym --no-repeat $mod+9 workspace number 9; exec "echo 1 > /tmp/sov"
bindsym --no-repeat $mod+0 workspace number 10; exec "echo 1 > /tmp/sov"
bindsym --release $mod+1 exec "echo 0 > /tmp/sov"
bindsym --release $mod+2 exec "echo 0 > /tmp/sov"
bindsym --release $mod+3 exec "echo 0 > /tmp/sov"
bindsym --release $mod+4 exec "echo 0 > /tmp/sov"
bindsym --release $mod+5 exec "echo 0 > /tmp/sov"
bindsym --release $mod+6 exec "echo 0 > /tmp/sov"
bindsym --release $mod+7 exec "echo 0 > /tmp/sov"
bindsym --release $mod+8 exec "echo 0 > /tmp/sov"
bindsym --release $mod+9 exec "echo 0 > /tmp/sov"
bindsym --release $mod+0 exec "echo 0 > /tmp/sov"
bindsym $mod+Shift+1 move container to workspace number 1
bindsym $mod+Shift+2 move container to workspace number 2
bindsym $mod+Shift+3 move container to workspace number 3
bindsym $mod+Shift+4 move container to workspace number 4
bindsym $mod+Shift+5 move container to workspace number 5
bindsym $mod+Shift+6 move container to workspace number 6
bindsym $mod+Shift+7 move container to workspace number 7
bindsym $mod+Shift+8 move container to workspace number 8
bindsym $mod+Shift+9 move container to workspace number 9
bindsym $mod+Shift+0 move container to workspace number 10
bindsym $mod+Ctrl+1 [workspace="1"] move workspace to output current
bindsym $mod+Ctrl+2 [workspace="2"] move workspace to output current
bindsym $mod+Ctrl+3 [workspace="3"] move workspace to output current
bindsym $mod+Ctrl+4 [workspace="4"] move workspace to output current
bindsym $mod+Ctrl+5 [workspace="5"] move workspace to output current
bindsym $mod+Ctrl+6 [workspace="6"] move workspace to output current
bindsym $mod+Ctrl+7 [workspace="7"] move workspace to output current
bindsym $mod+Ctrl+8 [workspace="8"] move workspace to output current
bindsym $mod+Ctrl+9 [workspace="9"] move workspace to output current
bindsym $mod+Ctrl+0 [workspace="10"] move workspace to output current
# 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 reload
# exit sway (logs you out of your Wayland session)
bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'
# resize window (you can also use the mouse for that)
mode "resize" {
# These bindings trigger as soon as you enter the resize mode
# Pressing left will shrink the windows width.
# Pressing right will grow the windows width.
# Pressing up will shrink the windows height.
# Pressing down will grow the windows height.
bindsym j resize shrink width 10 px or 10 ppt
bindsym k resize grow height 10 px or 10 ppt
bindsym l resize shrink height 10 px or 10 ppt
bindsym odiaeresis resize grow width 10 px or 10 ppt
# same bindings, but for the arrow keys
bindsym Left resize shrink width 10 px or 10 ppt
bindsym Down resize grow height 10 px or 10 ppt
bindsym Up resize shrink height 10 px or 10 ppt
bindsym Right resize grow width 10 px or 10 ppt
# back to normal: Enter or Escape or $mod+r
bindsym Return mode "default"
bindsym Escape mode "default"
bindsym $mod+r mode "default"
}
bindsym $mod+r mode "resize"
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
#client.focused #81a2be #81a2be #1d1f21 #282a2e
#client.focused_inactive #373b41 #373b41 #969896 #282a2e
#client.unfocused #282a2e #282a2e #969896 #282a2e
#client.urgent #373b41 #cc6666 #ffffff #cc6666
# Status-Bar
#exec_always --no-startup-id $HOME/.config/polybar/launch.sh --cuts
bar {
swaybar_command /usr/bin/swaybar
#font pango:Terminus (TTF) Bold 12
font pango:Hack Nerd Font 13
#font pango:Hack 12
#font pango:DejaVu Sans Mono, FontAwesome 12
position top
status_command i3status-rs ~/.config/i3status-rust/config.toml
# https://fontawesome.com/v4/cheatsheet/
separator_symbol 
colors {
background $bg-color
statusline #263238
separator #757575
#colors outline background number
active_workspace #009688 #009688 #eceff1
focused_workspace $bg-color $bg-color $text-color
inactive_workspace $inactive-bg-color $inactive-bg-color $inactive-text-color
urgent_workspace $urgent-bg-color $urgent-bg-color $text-color
}
}
input * {
dwt enabled
tap enabled
natural_scroll disabled
middle_emulation enabled
repeat_rate 100
repeat_delay 250
xkb_layout de
xkb_variant nodeadkeys
xkb_options grp:alt_space_toggle
}
seat seat0 xcursor_theme capitaine-cursors 16
# display resoulution
output eDP-1 pos 0 0 res 1920x1080
exec_always import-gsettings \
gtk-theme:Arc-Dark \
icon-theme:Arc \
cursor-theme:capitaine-cursors
# background
output "*" background ~/desktop-bilder/background.jpg fill
# You can get the names of your inputs by running: swaymsg -t get_inputs
# Read `man 5 sway-input` for more information about this section.
# Benutzerdefiniert
# Fenster zu einem Scratchpad
bindsym $mod+Shift+minus move scratchpad
# Zeige das scratcpad window
bindsym $mod+minus scratchpad show
# Starte Programme über Tastaurkombination
# Press $mod+o followed by either f to launch firefox,
# Escape or Return to the default mode, respectively.
set $mode_launcher Launch: [f]irefox [t]hunderbird [p]avucontrol [w]displays file[m]anager
bindsym $mod+o mode "$mode_launcher"
mode "$mode_launcher" {
bindsym f exec firefox
bindsym t exec thunderbird
bindsym p exec pavucontrol-qt
bindsym w exec wdisplays
bindsym m exec pcmanfm-qt
bindsym Escape mode "default"
bindsym Return mode "default"
}
bindsym $mod+b exec firefox
bindsym $mod+t exec pcmanfm-qt
bindsym $mod+shift+t exec thunderbird
bindsym $mod+n exec wezterm start nmtui
#bindsym $mod+y exec clipmenu
#bindsym $mod+shift+y exec passdmenu -P -x clipboard
#bindsym $mod+o exec termite -e /usr/bin/alsamixer
#bindsym $mod+y exec alacritty -e ncmpcpp
# Alsa-Steuerung & Lautstärke einstellen
#bindsym $mod+i exec amixer set Speaker 5%+
#bindsym $mod+u exec amixer set Speaker 5%-
bindsym $mod+i exec pamixer --allow-boost -i 5
bindsym $mod+shift+i exec pamixer --allow-boost -d 5
bindsym $mod+shift+v exec "if pamixer --get-mute; then pamixer --unmute; else pamixer --mute; fi"
#bindsym $mod+shift+v exec amixer set Speaker toggle
#bindsym $mod+shift+h exec amixer set Capture toggle
# https://i3wm.org/docs/userguide.html#assign_workspace
# xprop
# Einstellungen für spezielle Programme (exact match instead of substring)
for_window [app_id="foot"] border pixel 1
for_window [app_id="iwgtk"] floating enable
for_window [app_id="blueman-manager"] floating enable
for_window [app_id="blueman-manager"] resize set 1000 600
for_window [app_id="pavucontrol"] floating enable
for_window [app_id="org.gnome.Nautilus"] floating enable
for_window [app_id="gnome-system-monitor"] floating enable; resize shrink down 100px; resize shrink up 100px
for_window [app_id="wdisplays"] floating enable
for_window [app_id="wdisplays"] resize set 1000 600
for_window [app_id="pavucontrol"] floating enable
for_window [app_id="pavucontrol"] resize set 1000 600
for_window [app_id="imv"] floating enable
for_window [app_id="pamac-manager"] floating enable
for_window [class="(?i)vlc"] floating disable border none
for_window [class="(?i)virtualbox"] floating enable border normal
for_window [class="(?i)claws-mail"] floating enable border normal
for_window [class="mplayer"] floating disable border none
for_window [title="Wicd"] floating enable border normal
for_window [title="galculator"] floating enable border normal
for_window [title="Verbindungsinformationen"] floating enable border normal
for_window [title="Lautstärkeregler"] floating enable border normal
for_window [title="Freundesliste"] floating enable border normal
# Einstellungen Fensterverhalten für bestimmte Programme im Terminal
for_window [class="Alpine"] floating enable border none
for_window [class="calcurse"] floating enable border none
for_window [class="newsbeuter"] floating enable border none
for_window [class="weechat"] floating enable border none
# Starter für Progs im Terminal
bindsym $mod+F1 exec wezterm start arch-install
bindsym $mod+F2 exec wezterm start bashtop
bindsym $mod+F3 exec wezterm start nmtui
# assign special properties
for_window [class="^Pavucontrol$"] floating enable
for_window [title="MonoDevelop External Console"] floating enable
for_window [class="^Shutter$"] floating enable
# Enables floating windows of the chrome extension "Videostream for Chromecast"
for_window [instance="^crx_cnciopoikihiagdjbjpnocolokfelagl$"] floating enable
# The Chrome "Page Unresponsive" dialog is not floating...
for_window [title="Page Unresponsive"] floating enable
# Share your screen from Google Cast extension
for_window [title="Share your screen - Google Cast"] floating enable
# TeamSpeak new features window
for_window [class="^TeamSpeak 3$" title="^New TeamSpeak Features"] floating enable
# Android Device Monitor startup window
for_window [class="^Monitor$" instance="^Monitor$" title="^Monitor$"] floating enable
# chromeIPass "No logins found." window
for_window [title="^chromeIPass$"] floating enable
# Jetbrains
for_window [class="^com-intellij-updater-Runner$" title="^Update$"] floating enable
for_window [instance="^sun-awt-X11-XDialogPeer$" title="^Complete Installation$"] floating enable
# Unity
for_window [class="^Unity$" title="^Starting Unity...$"] floating enable
for_window [class="^Unity$" title="^Hold On$"] floating enable
for_window [class="^Unity$" title="^Preparing Package$"] floating enable
for_window [class="^Unity$" title="^Importing Package$"] floating enable
# https://github.com/ValveSoftware/steam-for-linux/issues/1040
for_window [class="^Steam$" title="^Friends$"] floating enable
for_window [class="^Steam$" title="Steam - News"] floating enable
for_window [class="^Steam$" title=".* - Chat"] floating enable
for_window [class="^Steam$" title="^Settings$"] floating enable
for_window [class="^Steam$" title=".* - event started"] floating enable
for_window [class="^Steam$" title=".* CD key"] floating enable
for_window [class="^Steam$" title="^Steam - Self Updater$"] floating enable
for_window [class="^Steam$" title="^Screenshot Uploader$"] floating enable
for_window [class="^Steam$" title="^Steam Guard - Computer Authorization Required$"] floating enable
for_window [class="^Steam$" title="Steam-Bibliotheksordner$"] floating enable
for_window [class="^Steam$" title="Neuen Steam-Bibliotheksordner auswählen oder erstellen:$"] floating enable
for_window [title="^Steam Keyboard$"] floating enable
#for_window [title="^Steam$"] floating enable
# There is no specific property for windows that should be floating (eg. the WM_NAME is the device name (PC1))
for_window [class="^PacketTracer6$"] floating enable
for_window [class="^PacketTracer6$" title="PT Activity"] floating disable
for_window [class="^PacketTracer6$" title="Cisco Packet Tracer"] floating disable
# Alsa-Steuerung & Lautstärke einstellen
bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle
bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5% && pamixer --get-volume > /tmp/wob
bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5% && pamixer --get-volume > /tmp/wob
# Steuerung der Helligkeit
bindsym XF86MonBrightnessDown exec brightnessctl set 5%- | sed -En 's/.*\(([0-9]+)%\).*/\1/p' > /tmp/wob
bindsym XF86MonBrightnessUp exec brightnessctl set +5% | sed -En 's/.*\(([0-9]+)%\).*/\1/p' > /tmp/wob
# Touchpad controls
bindsym XF86TouchpadToggle exec /usr/bin/touchpad_toggle # toggle touchpad
# Media player controls
bindsym XF86AudioPlay exec playerctl play
bindsym XF86AudioPause exec playerctl pause
bindsym XF86AudioNext exec playerctl next
bindsym XF86AudioPrev exec playerctl previous
# monitor-picture
# 1. Capture a Selection
bindsym Print exec grim -g "$(slurp)" $(xdg-user-dir PICTURES)/$(date +'%Y-%m-%d-%H%M%S_grim.png')
# 2. Capture the actually Display
bindsym $mod+Shift+Print exec grim -o $(swaymsg -t get_outputs | jq -r '.[] | select(.focused) | .name') $(xdg-user-dir PICTURES)/$(date +'%Y-%m-%d-%H%M%S_grim.png')
bindsym $mod+p exec wlogout -p layer-shell
# Power control script - a useful replacement for the normal i3 exiting keybind.
# https://wiki.archlinux.org/index.php/i3#Shutdown.2C_reboot.2C_lock_screen
set $mode_system System (1) lock, (e) logout, (s) suspend, (h) hibernate, (r) reboot, (d) shutdown
mode "$mode_system" {
bindsym 1 exec --no-startup-id ~/scripte/swayexit lock, mode "default"
bindsym e exec --no-startup-id ~/scripte/swayexit logout, mode "default"
bindsym s exec --no-startup-id ~/scripte/swayexit suspend, mode "default"
bindsym h exec --no-startup-id ~/scripte/swayexit hibernate, mode "default"
bindsym r exec --no-startup-id ~/scripte/swayexit reboot, mode "default"
bindsym d exec --no-startup-id ~/scripte/swayexit shutdown, mode "default"
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+x mode "$mode_system"
set $backlight_system Brightness (1) 10%, (2) 20%, (3) 30%, (4) 40%, (5) 50%, (6) 60%, (7) 70%, (8) 80%, (9) 100%, (0) 0%
mode "$backlight_system" {
bindsym 1 exec "~/.config/i3/backlight_system.sh 50 500"
bindsym 2 exec "~/.config/i3/backlight_system.sh 75 700"
bindsym 3 exec "~/.config/i3/backlight_system.sh 100 900"
bindsym 4 exec "~/.config/i3/backlight_system.sh 125 1100"
bindsym 5 exec "~/.config/i3/backlight_system.sh 150 1300"
bindsym 6 exec "~/.config/i3/backlight_system.sh 175 1500"
bindsym 7 exec "~/.config/i3/backlight_system.sh 200 1700"
bindsym 8 exec "~/.config/i3/backlight_system.sh 225 1900"
bindsym 9 exec "~/.config/i3/backlight_system.sh 255 2100"
bindsym 0 exec "~/.config/i3/backlight_system.sh 0 0"
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+m mode "$backlight_system"
set $hue_light Phillips-Hue Light (1) 10%, (2) 20%, (3) 30%, (4) 40%, (5) 50%, (6) 60%, (7) 70%, (8) 80%, (9) 100%, (0) 0%
mode "$hue_light" {
bindsym 1 exec "~/.config/i3/hui_light.sh true 50"
bindsym 2 exec "~/.config/i3/hui_light.sh true 75"
bindsym 3 exec "~/.config/i3/hui_light.sh true 100"
bindsym 4 exec "~/.config/i3/hui_light.sh true 125"
bindsym 5 exec "~/.config/i3/hui_light.sh true 150"
bindsym 6 exec "~/.config/i3/hui_light.sh true 175"
bindsym 7 exec "~/.config/i3/hui_light.sh true 200"
bindsym 8 exec "~/.config/i3/hui_light.sh true 225"
bindsym 9 exec "~/.config/i3/hui_light.sh true 255"
bindsym 0 exec "~/.config/i3/hui_light.sh false 0"
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+u mode "$hue_light"
set $hue_light_color Phillips-Hue Color (r) Red, (g) Green, (b) Blue
mode "$hue_light_color" {
bindsym r exec "~/.config/i3/hui_light_color.sh 0"
bindsym g exec "~/.config/i3/hui_light_color.sh 25500"
bindsym b exec "~/.config/i3/hui_light_color.sh 46920"
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+shift+u mode "$hue_light_color"
## Manual management of external displays
# Set the shortcuts and what they do
set $mode_display Ext Screen (v) eDP ON, (h) HDMI ON, (x) eDP OFF, (y) HDMI OFF
mode "$mode_display" {
bindsym v exec --no-startup-id output eDP-1 enable && output eDP-1 pos 1920 0 res 1920x1080
bindsym h exec --no-startup-id output HDMI-A-1 enable && output HDMI-A-1 pos 1920 0 res 1920x1080
bindsym x exec --no-startup-id output eDP-1 disable
bindsym y exec --no-startup-id output HDMI-A-1 disable
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
# For use a Virtual VNC Connection with wayvnc
#swaymsg create_output
# springen von Workspace zu workspace mit oder ohne container
workspace_auto_back_and_forth yes
bindsym $mod+z workspace back_and_forth
bindsym $mod+Shift+z move container to workspace back_and_forth; workspace back_and_forth
# volumeicon
#exec --no-startup-id volumeicon
# Networkmanager
#exec --no-startup-id nm-applet
# Bluetooth
exec --no-startup-id blueman-applet
# Start xscreensaver
#exec --no-startup-id "xscreensaver -no-splash"
# Start Pulseaudio Server
#already started
#exec --no-startup-id "pulseaudio --start"
# Start mako-notifyd Service
exec --no-startup-id "mako -c .config/mako/config"
# Start volumeicon tray paystray (pulseaudio)
#exec --no-startup-id "pasystray --notify=all"
# imwheel faster scrolling (deactivated sound bug)
#exec --no-startup-id imwheel
# authentication manager
exec --no-startup-id lxpolkit
# xfce4-power-manager
#exec --no-startup-id xfce4-power-manager
# start gnome-keyring-daemon
#exec --no-startup-id /usr/bin/gnome-keyring-daemon --start --components=ssh,secrets,pkcs11
# notify service from smartphone
#exec --no-startup-id /opt/an2linuxserver/an2linuxserver.py
# Adjust the color temperature of your screen according to your surroundings.
#exec gammastep
# starting Steam
#exec --no-startup-id sleep 30 && steam-native
exec swayidle -w \
timeout 300 'swaylock -f' \
timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \
before-sleep 'swaylock -f'
exec rm -f /tmp/wob && mkfifo /tmp/wob && tail -f /tmp/wob | wob
exec rm -f /tmp/sov && mkfifo /tmp/sov && tail -f /tmp/sov | sov
#######
# swaylock
#convert image.jpg -resize $(xdpyinfo | grep dimensions | sed -r 's/^[^0-9]*([0-9]+x[0-9]+).*$/\1/') RGB:- | i3lock --raw $(xdpyinfo | grep dimensions | sed -r 's/^[^0-9]*([0-9]+x[0-9]+).*$/\1/'):rgb --image /dev/stdin
bindsym $mod+shift+x exec swaylock -c 000000
#bindsym $mod+shift+b exec xtrlock
### i3-gaps stuff ###
# Necessary for i3-gaps to work properly (pixel can be any value)
for_window [class="^.*"] border pixel 3
# Smart Gaps
smart_gaps on
# Smart Borders
smart_borders on
# Set inner/outer gaps
gaps inner 12
gaps outer -2
# Gaps mode
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"
}
default_border none
default_floating_border normal
#xwayland disable
include /etc/sway/config.d/*
exec notify-send "loaded" "Welcome to sway."

View file

@ -0,0 +1,48 @@
#!/bin/bash
# Source: http://askubuntu.com/a/450136
URGENT_VALUE=90
PREV_TOTAL=0
PREV_IDLE=0
cpuFile="/tmp/.cpu"
if [[ -f "${cpuFile}" ]]; then
fileCont=$(cat "${cpuFile}")
PREV_TOTAL=$(echo "${fileCont}" | head -n 1)
PREV_IDLE=$(echo "${fileCont}" | tail -n 1)
fi
CPU=(`cat /proc/stat | grep '^cpu '`) # Get the total CPU statistics.
unset CPU[0] # Discard the "cpu" prefix.
IDLE=${CPU[4]} # Get the idle CPU time.
# Calculate the total CPU time.
TOTAL=0
for VALUE in "${CPU[@]:0:4}"; do
let "TOTAL=$TOTAL+$VALUE"
done
if [[ "${PREV_TOTAL}" != "" ]] && [[ "${PREV_IDLE}" != "" ]]; then
# Calculate the CPU usage since we last checked.
let "DIFF_IDLE=$IDLE-$PREV_IDLE"
let "DIFF_TOTAL=$TOTAL-$PREV_TOTAL"
let "DIFF_USAGE=(1000*($DIFF_TOTAL-$DIFF_IDLE)/$DIFF_TOTAL+5)/10"
echo "${DIFF_USAGE}%"
echo "${DIFF_USAGE}%"
echo ""
else
echo "?"
echo "?"
echo ""
fi
# Remember the total and idle CPU times for the next check.
echo "${TOTAL}" > "${cpuFile}"
echo "${IDLE}" >> "${cpuFile}"
if [[ "${DIFF_USAGE}" -gt 0 ]] && [[ "${DIFF_USAGE}" -gt "${URGENT_VALUE}" ]]; then
exit 33
fi

View file

@ -0,0 +1,92 @@
#!/usr/bin/env bash
#
# Copyright (C) 2016 James Murphy
# Licensed under the terms of the GNU GPL v2 only.
#
# i3blocks blocklet script to monitor disk io
label="${LABEL:-""}"
dt="${DT:-5}"
MB_only="${MB_ONLY:-0}"
kB_only="${KB_ONLY:-0}"
width="${WIDTH:-4}"
MB_precision="${MB_PRECISION:-1}"
kB_precision="${KB_PRECISION:-0}"
regex="${REGEX:-$BLOCK_INSTANCE}"
regex="${regex:-/^(s|h)d[a-zA-Z]+/}"
threshold="${THRESHOLD:-0}"
warn_color="${WARN_COLOR:-#FF0000}"
sep="${SEPARATOR:-/}"
unit_suffix="${SUFFIX:-B/s}"
function list_devices {
echo "Devices iostat reports that match our regex:"
iostat | awk '$1~/^(s|h)d[a-zA-Z]+/{print $1}'
}
while getopts L:t:w:p:P:R:s:ST:C:lLMmKkh opt; do
case "$opt" in
L) label="$OPTARG" ;;
t) dt="$OPTARG" ;;
w) width="$OPTARG" ;;
p) kB_precision="$OPTARG" ;;
P) MB_precision="$OPTARG" ;;
R) regex="$OPTARG" ;;
s) sep="$OPTARG" ;;
S) unit_suffix="" ;;
T) threshold="$OPTARG" ;;
C) warn_color="$OPTARG" ;;
l) list_devices; exit 0 ;;
M|m) MB_only=1 ;;
K|k) kB_only=1 ;;
h) printf \
"Usage: disk-io [-t time] [-w width] [-p kB_precision] [-P MB_precision] [-R regex] [-s separator] [-S] [-T threshold [-C warn_color]] [-k|-M] [-l] [-h]
Options:
-L\tLabel to put in front of the text. Default: $label
-t\tTime interval in seconds between measurements. Default: $dt
-w\tThe width of printed floats. Default: $width
-p\tThe precision of kB/s floats. Default: $kB_precision
-P\tThe precision of MB/s floats. Default: $MB_precision
-R\tRegex that devices must match. Default: $regex
-s\tSeparator to put between rates. Default: $sep
-S\tShort units, omit B/s in kB/s and MB/s.
-T\tRate in kB/s to exceed to trigger a warning. Default: not enabled
-C\tColor to change the blocklet to warn the user. Default: $warn_color
-l\tList devices that iostat reports
-M\tDo not switch between MB/s and kB/s, use only MB/s
-k\tDo not switch between MB/s and kB/s, use only kB/s
-h\tShow this help text
" && exit 0;;
esac
done
iostat -dyz "$dt" | awk -v sep="$sep" "
BEGIN {
rx = wx = 0;
}
{
if(\$0 == \"\") {
if ($threshold > 0 && (rx >= $threshold || wx >= $threshold)) {
printf \"<span color='$warn_color'>\";
}
printf \"$label\";
if(!$kB_only && ($MB_only || rx >= 1024 || wx >= 1024)) {
printf \"%-$width.${MB_precision}f%s%$width.${MB_precision}f M$unit_suffix\", rx/1024, sep, wx/1024;
}
else {
printf \"%-$width.${kB_precision}f%s%$width.${kB_precision}f k$unit_suffix\", rx, sep, wx;
}
if ($threshold > 0 && (rx >= $threshold || wx >= $threshold)) {
printf \"</span>\";
}
printf \"\n\";
fflush(stdout);
}
else if(\$1~/^Device:?/) {
rx = wx = 0;
}
else if(\$1~$regex) {
rx += \$3;
wx += \$4;
}
}"

View file

@ -0,0 +1,38 @@
#!/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 '
/\/.*/ {
# full text
print $4
# short text
print $4
use=$5
# no need to continue parsing
exit 0
}
END {
gsub(/%$/,"",use)
if (100 - use < alert_low) {
# color
print "#FF0000"
}
}
'

View file

@ -0,0 +1,5 @@
if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then
export XKB_DEFAULT_LAYOUT=us,de
export XKB_DEFAULT_OPTIONS=grp:win_space_toggle
sway
fi

View file

@ -0,0 +1,342 @@
# 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
command=$SCRIPT_DIR/$BLOCK_NAME
color=#E0E0E0
# 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=/usr/lib/i3blocks/$BLOCK_NAME
separator_block_width=7
markup=pango
#[mediaplayer]
#command=printf "<span font_family=\"FontAwesome\"></span> %s" "$(mpc current )"
#instance=mpd
#interval=5
#signal=10
#color=#E0E0E0
#color=#556270
#color=#FE4365
#[batterybar]
#command=~/.config/i3/batterybar
#label=bat:
#interval=60
#markup=pango
#min_width=bat: ■■■■■
#color=#E0E0E0
# Discharging colors low to high
#C1=#FF0027
#C2=#FF3B05
#C3=#FFB923
#C4=#FFD000
#C5=#E4FF00
#C6=#ADFF00
#C7=#6DFF00
#C8=#10BA00
#CHARGING_COLOR=#00AFE3
#FULL_COLOR=#FFFFFF
#AC_COLOR=#535353
# 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]
#command=printf "<span font_family=\"FontAwesome\"> </span> %s" "$(amixer get Speaker | grep -E -o '[0-9]{1,3}?%' | head -1)"
#command=printf "<span font_family=\"FontAwesome\"> </span> %s" "$(amixer get PCM | grep -E -o '[0-9]{1,3}?%' | head -1)"
#command=printf "<span font_family=\"FontAwesome\"> </span> %s" "$(pamixer --get-volume-human)"
#label=♪
# instance=Master
# instance=PCM
#interval=1
#color=#E0E0E0
#color=#556270
#signal=10
#[loading]
#command=printf "<span font_family=\"FontAwesome\">  </span> %s" "$(awk {'print $1,$2,$3 '} /proc/loadavg)"
#interval=2
#color=#E0E0E0
#color=#556270
#separator=true
# Memory usage
#
# The type defaults to "mem" if the instance is not specified.
#[memory]
#command=printf "<span font_family=\"FontAwesome\">  </span> %s" "$(bash ~/.config/i3/mem)"
#separator=false
#color=#E0E0E0
#color=#556270
#interval=30
#separator=true
#[temperature]
#command=printf "<span font_family=\"FontAwesome\">  </span> %s" "$(bash ~/.config/i3/sensors.sh)"
#color=#E0E0E0
#color=#556270
#interval=5
#[vpn]
#command=printf "<span font_family=\"FontAwesome\"> %s </span>" "$(bash ~/.config/i3/vpn.sh)"
#label= VPN
#color=#E0E0E0
#color=#556270
#interval=5
[disk]
command=~/.config/sway/disk.sh
interval=1
label=
color=#E0E0E0
#[weather]
#command=printf "<span font_family=\"Weather Icons\"> %s </span>" "$(ruby ~/.config/i3/weather.rb)"
#interval=300
#color=#556270
#separator=true
#[memory]
#label=SWAP
#instance=swap
#separator=false
#interval=30
# 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]
#command=printf "<span font_family=\"FontAwesome\"></span> %s" "$(/usr/bin/i3blocks/$BLOCK_NAME)"
#instance=/mnt/data
#interval=30
# 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.
#[wifi]
#instance=wlp3s0
#interval=10
#separator=false
# [bandwidth]
#command=printf "<span font_family=\"FontAwesome\"></span> %s" "$(/usr/lib/i3blocks/$BLOCK_NAME)"
#instance=eth0
#interval=5
# CPU usage
#
# The script may be called with -w and -c switches to specify thresholds,
# see the script for details.
# Battery indicator
#
# The battery instance defaults to 0.
#[battery]
#label=BAT
#label=⚡
#instance=1
#interval=30
# Date Time
#
# Generic media player support
#
# This displays "ARTIST - SONG" if a music is playing.
# Supported players are: spotify, vlc, audacious, xmms2, mplayer, and others.
#[mediaplayer]
#instance=spotify
#interval=5
#signal=10
# OpenVPN support
#
#Support multiple VPN, with colors.
# 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=TEMP
#interval=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+11 i3blocks
#[keyindicator]
#instance=CAPS
#interval=once
#signal=11
#[keyindicator]
#instance=NUM
#interval=once
#signal=11
#[usb]
#command=~/.config/i3/usb
#markup=pango
#signal=1
#interval=10
#color=#E0E0E0
#IGNORE_LIST=[]
#IGNORE_LIST=["sdd1", "mapper/sda1_crypt"]
#INFO_TEXT_COLOR=white
#MOUNTED_COLOR=green
#PLUGGED_COLOR=gray
#LOCKED_COLOR=gray
#UNLOCKED_NOT_MOUNTED_COLOR=yellow
#PARTITIONLESS_COLOR=red
#PARTITIONLESS_TEXT=no partitions
#SEPARATOR=<span color='gray'> | </span>
#LOCKED_INDICATOR=
#UNLOCKED_INDICATOR=
#READONLY_INDICATOR=ro
#TRUNCATE_FS_LABELS=[not set by default, accepts +/- integers]
#[shutdown_menu]
#full_text=Quit
# If you are using FontAwesome, we recommend the power-off icon:
# http://fontawesome.io/icon/power-off/
#command=~/.config/i3/shutdown_menu
#FG_COLOR=#bbbbbb
#BG_COLOR=#111111
#HLFG_COLOR=#111111
#HLBG_COLOR=#bbbbbb
#BORDER_COLOR=#222222
#ROFI_TEXT=Menu:
#ROFI_OPTIONS=-width 11 -location 3 -hide-scrollbar -bw 2
#ZENITY_TITLE=Menu
#ZENITY_TEXT=Action:
#ZENITY_OPTIONS=--column= --hide-header
#ENABLE_CONFIRMATIONS=true (must be true or false)
#LAUNCHER=rofi (must be rofi or zenity)
#LOCKSCRIPT=i3lock --color=${BG_COLOR#"#"}
#[pacman-updates]
#label=
#command=~/.config/i3/arch-update
#markup=pango
#interval= 3600
#QUIET=true
#WATCH=^linux.* ^pacman.*
#BASE_COLOR=#5fff5f
#UPDATE_COLOR=#FFFF85
#AUR=true
#[arch-update]
#command=~/.config/i3/arch-update
#label=Updates:
#interval=3600
#markup=pango
[disk-io]
command=~/.config/sway/disk-io
#command=$SCRIPT_DIR/disk-io -w 3 -M -P 0
interval=persist
#markup=pango
#LABEL=
#instance=/^sda/
#DT=5
#MB_ONLY=0 #0 or 1
#KB_ONLY=0 #0 or 1
#WIDTH=4
#MB_PRECISION=1
#KB_PRECISION=0
#REGEX=/^(s|h)d[a-zA-Z]+/
#THRESHOLD=0
#WARN_COLOR="#FF0000"
#SEPARATOR=/
#PREFIX=
#SUFFIX="B/s"
#[calendar]
#command=~/.config/i3/calendar
#interval=1
#LABEL=
#DATEFMT=+%H:%M:%S
# SHORTFMT=+%H:%M:%S
#HEIGHT=180
#WIDTH=220
[time]
command=printf "<span font_family=\"FontAwesome\">  </span> %s\n" "$(date '+%b %a %d %Y | %H:%M:%S ')"
interval=1
color=#E0E0E0
#color=#556270
separator=true
#[key_layout]
#command=~/.config/i3/key_layout
#label=Layout
#interval=30
#color=#E0E0E0
# Query my default IP address only on startup
[ip]
command=ip addr | grep 'inet' | grep -v inet6 | grep -vE '127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1
label=IP
interval=30
color=#E0E0E0
#[bandwidth]
#command=~/.config/i3/bandwidth
#interval=5
#INTERFACE=enp2s0f1
#INLABEL="IN "
#OUTLABEL="OUT "
#TREAT_UNKNOWN_AS_UP=0
#[monitors]
#command=~/.config/i3/monitor_manager
#interval=once
#color=#E0E0E0
#SHOW_ON_OFF=1
#SHOW_NAMES=1
#SHOW_PRIMARY=1
#SHOW_MODE=1
#SHOW_BLANKED=1
#SHOW_DUPLICATE=1
#SHOW_ROTATION=1
#SHOW_REFLECTION=1
#SHOW_BRIGHTNESS=1
#SHOW_BRIGHTNESS_VALUE=0
#SHOW_UP_DOWN=1
#FONT_FAMILY=DejaVu Sans Mono
#FONT_SIZE=11
#CLOSE_TO_BOUNDARY_BUFFER=20

View file

@ -0,0 +1,342 @@
# 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
command=$SCRIPT_DIR/$BLOCK_NAME/$BLOCK_NAME
color=#E0E0E0
# 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=/usr/lib/i3blocks/$BLOCK_NAME/$BLOCK_NAME
separator_block_width=7
markup=pango
#[mediaplayer]
#command=printf "<span font_family=\"FontAwesome\"></span> %s" "$(mpc current )"
#instance=mpd
#interval=5
#signal=10
#color=#E0E0E0
#color=#556270
#color=#FE4365
[batterybar]
command=~/.config/sway/batterybar
#label=bat:
interval=60
markup=pango
#min_width=bat: ■■■■■
color=#E0E0E0
# Discharging colors low to high
#C1=#FF0027
#C2=#FF3B05
#C3=#FFB923
#C4=#FFD000
#C5=#E4FF00
#C6=#ADFF00
#C7=#6DFF00
#C8=#10BA00
#CHARGING_COLOR=#00AFE3
#FULL_COLOR=#FFFFFF
#AC_COLOR=#535353
# 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]
#command=printf "<span font_family=\"FontAwesome\"> </span> %s" "$(amixer get Speaker | grep -E -o '[0-9]{1,3}?%' | head -1)"
#command=printf "<span font_family=\"FontAwesome\"> </span> %s" "$(amixer get PCM | grep -E -o '[0-9]{1,3}?%' | head -1)"
command=printf "<span font_family=\"FontAwesome\"> </span> %s\n" "$(pamixer --get-volume-human)"
#label=♪
# instance=Master
# instance=PCM
interval=1
color=#E0E0E0
#color=#556270
signal=10
[loading]
command=printf "<span font_family=\"FontAwesome\">  </span> %s\n" "$(awk {'print $1,$2,$3 '} /proc/loadavg)"
interval=2
color=#E0E0E0
#color=#556270
separator=true
# Memory usage
#
# The type defaults to "mem" if the instance is not specified.
[memory]
command=printf "<span font_family=\"FontAwesome\">  </span> %s\n" "$(bash ~/.config/sway/mem)"
separator=false
color=#E0E0E0
#color=#556270
interval=30
separator=true
[temperature]
command=printf "<span font_family=\"FontAwesome\">  </span> %s\n" "$(bash ~/.config/sway/sensors.sh)"
color=#E0E0E0
#color=#556270
interval=5
[vpn]
command=printf "<span font_family=\"FontAwesome\"> %s </span>\n" "$(bash ~/.config/sway/vpn.sh)"
label= VPN
color=#E0E0E0
#color=#556270
interval=5
#[disk]
#command=~/.config/i3/disk.sh
#interval=1
#label=
#color=#E0E0E0
#[weather]
#command=printf "<span font_family=\"Weather Icons\"> %s </span>" "$(ruby ~/.config/i3/weather.rb)"
#interval=300
#color=#556270
#separator=true
#[memory]
#label=SWAP
#instance=swap
#separator=false
#interval=30
# 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]
#command=printf "<span font_family=\"FontAwesome\"></span> %s" "$(/usr/bin/i3blocks/$BLOCK_NAME)"
#instance=/mnt/data
#interval=30
# 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.
#[wifi]
#instance=wlp3s0
#interval=10
#separator=false
# [bandwidth]
#command=printf "<span font_family=\"FontAwesome\"></span> %s" "$(/usr/lib/i3blocks/$BLOCK_NAME)"
#instance=eth0
#interval=5
# CPU usage
#
# The script may be called with -w and -c switches to specify thresholds,
# see the script for details.
# Battery indicator
#
# The battery instance defaults to 0.
#[battery]
#label=BAT
#label=⚡
#instance=1
#interval=30
# Date Time
#
# Generic media player support
#
# This displays "ARTIST - SONG" if a music is playing.
# Supported players are: spotify, vlc, audacious, xmms2, mplayer, and others.
#[mediaplayer]
#instance=spotify
#interval=5
#signal=10
# OpenVPN support
#
#Support multiple VPN, with colors.
# 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=TEMP
#interval=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+11 i3blocks
#[keyindicator]
#instance=CAPS
#interval=once
#signal=11
#[keyindicator]
#instance=NUM
#interval=once
#signal=11
#[usb]
#command=~/.config/i3/usb
#markup=pango
#signal=1
#interval=10
#color=#E0E0E0
#IGNORE_LIST=[]
#IGNORE_LIST=["sdd1", "mapper/sda1_crypt"]
#INFO_TEXT_COLOR=white
#MOUNTED_COLOR=green
#PLUGGED_COLOR=gray
#LOCKED_COLOR=gray
#UNLOCKED_NOT_MOUNTED_COLOR=yellow
#PARTITIONLESS_COLOR=red
#PARTITIONLESS_TEXT=no partitions
#SEPARATOR=<span color='gray'> | </span>
#LOCKED_INDICATOR=
#UNLOCKED_INDICATOR=
#READONLY_INDICATOR=ro
#TRUNCATE_FS_LABELS=[not set by default, accepts +/- integers]
#[shutdown_menu]
#full_text=Quit
# If you are using FontAwesome, we recommend the power-off icon:
# http://fontawesome.io/icon/power-off/
#command=~/.config/i3/shutdown_menu
#FG_COLOR=#bbbbbb
#BG_COLOR=#111111
#HLFG_COLOR=#111111
#HLBG_COLOR=#bbbbbb
#BORDER_COLOR=#222222
#ROFI_TEXT=Menu:
#ROFI_OPTIONS=-width 11 -location 3 -hide-scrollbar -bw 2
#ZENITY_TITLE=Menu
#ZENITY_TEXT=Action:
#ZENITY_OPTIONS=--column= --hide-header
#ENABLE_CONFIRMATIONS=true (must be true or false)
#LAUNCHER=rofi (must be rofi or zenity)
#LOCKSCRIPT=i3lock --color=${BG_COLOR#"#"}
#[pacman-updates]
#label=
#command=~/.config/i3/arch-update
#markup=pango
#interval= 3600
#QUIET=true
#WATCH=^linux.* ^pacman.*
#BASE_COLOR=#5fff5f
#UPDATE_COLOR=#FFFF85
#AUR=true
#[arch-update]
#command=~/.config/i3/arch-update
#label=Updates:
#interval=3600
#markup=pango
#[disk-io]
#command=~/.config/i3/disk-io
#command=$SCRIPT_DIR/disk-io -w 3 -M -P 0
#interval=persist
#markup=pango
#LABEL=
#instance=/^sda/
#DT=5
#MB_ONLY=0 #0 or 1
#KB_ONLY=0 #0 or 1
#WIDTH=4
#MB_PRECISION=1
#KB_PRECISION=0
#REGEX=/^(s|h)d[a-zA-Z]+/
#THRESHOLD=0
#WARN_COLOR="#FF0000"
#SEPARATOR=/
#PREFIX=
#SUFFIX="B/s"
#[calendar]
#command=~/.config/i3/calendar
#interval=1
#LABEL=
#DATEFMT=+%H:%M:%S
# SHORTFMT=+%H:%M:%S
#HEIGHT=180
#WIDTH=220
#[time]
#command=printf "<span font_family=\"FontAwesome\">  </span> %s" "$(date '+%b %a %d %Y | %H:%M:%S ')"
#interval=1
#color=#E0E0E0
#color=#556270
#separator=true
#[key_layout]
#command=~/.config/i3/key_layout
#label=Layout
#interval=30
#color=#E0E0E0
# Query my default IP address only on startup
#[ip]
#command=ip addr | grep 'inet' | grep -v inet6 | grep -vE '127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1
#label=IP
#interval=30
#color=#E0E0E0
#[bandwidth]
#command=~/.config/i3/bandwidth
#interval=5
#INTERFACE=enp2s0f1
#INLABEL="IN "
#OUTLABEL="OUT "
#TREAT_UNKNOWN_AS_UP=0
#[monitors]
#command=~/.config/i3/monitor_manager
#interval=once
#color=#E0E0E0
#SHOW_ON_OFF=1
#SHOW_NAMES=1
#SHOW_PRIMARY=1
#SHOW_MODE=1
#SHOW_BLANKED=1
#SHOW_DUPLICATE=1
#SHOW_ROTATION=1
#SHOW_REFLECTION=1
#SHOW_BRIGHTNESS=1
#SHOW_BRIGHTNESS_VALUE=0
#SHOW_UP_DOWN=1
#FONT_FAMILY=DejaVu Sans Mono
#FONT_SIZE=11
#CLOSE_TO_BOUNDARY_BUFFER=20

View file

@ -0,0 +1,338 @@
# 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
command=$SCRIPT_DIR/$BLOCK_NAME
color=#E0E0E0
# 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=/usr/lib/i3blocks/$BLOCK_NAME
separator_block_width=7
markup=pango
#[mediaplayer]
#command=printf "<span font_family=\"FontAwesome\"></span> %s" "$(mpc current )"
#instance=mpd
#interval=5
#signal=10
#color=#E0E0E0
#color=#556270
#color=#FE4365
[batterybar]
command=~/.config/i3/batterybar
label=bat:
interval=5
markup=pango
min_width=bat: ■■■■■
color=#E0E0E0
# Discharging colors low to high
#C1=#FF0027
#C2=#FF3B05
#C3=#FFB923
#C4=#FFD000
#C5=#E4FF00
#C6=#ADFF00
#C7=#6DFF00
#C8=#10BA00
#CHARGING_COLOR=#00AFE3
#FULL_COLOR=#FFFFFF
#AC_COLOR=#535353
# 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]
#command=printf "<span font_family=\"FontAwesome\"> </span> %s" "$(amixer get Speaker | grep -E -o '[0-9]{1,3}?%' | head -1)"
command=printf "<span font_family=\"FontAwesome\"> </span> %s" "$(pamixer --get-volume-human)"
#label=♪
# instance=Master
# instance=PCM
interval=1
color=#E0E0E0
#color=#556270
signal=10
[loading]
command=printf "<span font_family=\"FontAwesome\">  </span> %s" "$(awk {'print $1,$2,$3 '} /proc/loadavg)"
interval=2
color=#E0E0E0
#color=#556270
separator=true
# Memory usage
#
# The type defaults to "mem" if the instance is not specified.
[memory]
command=printf "<span font_family=\"FontAwesome\">  </span> %s" "$(bash ~/.config/i3/mem)"
separator=false
color=#E0E0E0
#color=#556270
interval=30
separator=true
[temperature]
command=printf "<span font_family=\"FontAwesome\">  </span> %s" "$(bash ~/.config/i3/sensors.sh)"
color=#E0E0E0
#color=#556270
interval=5
[vpn]
command=printf "<span font_family=\"FontAwesome\"> %s </span>" "$(bash ~/.config/i3/vpn.sh)"
label= VPN
color=#E0E0E0
#color=#556270
interval=5
[disk]
command=~/.config/i3/disk.sh
interval=1
label=
color=#E0E0E0
#[weather]
#command=printf "<span font_family=\"Weather Icons\"> %s </span>" "$(ruby ~/.config/i3/weather.rb)"
#interval=300
#color=#556270
#separator=true
#[memory]
#label=SWAP
#instance=swap
#separator=false
#interval=30
# 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]
#command=printf "<span font_family=\"FontAwesome\"></span> %s" "$(/usr/bin/i3blocks/$BLOCK_NAME)"
#instance=/mnt/data
#interval=30
# 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.
#[wifi]
#instance=wlp3s0
#interval=10
#separator=false
# [bandwidth]
#command=printf "<span font_family=\"FontAwesome\"></span> %s" "$(/usr/lib/i3blocks/$BLOCK_NAME)"
#instance=eth0
#interval=5
# CPU usage
#
# The script may be called with -w and -c switches to specify thresholds,
# see the script for details.
# Battery indicator
#
# The battery instance defaults to 0.
#[battery]
#label=BAT
#label=⚡
#instance=1
#interval=30
# Date Time
#
# Generic media player support
#
# This displays "ARTIST - SONG" if a music is playing.
# Supported players are: spotify, vlc, audacious, xmms2, mplayer, and others.
#[mediaplayer]
#instance=spotify
#interval=5
#signal=10
# OpenVPN support
#
#Support multiple VPN, with colors.
# 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=TEMP
#interval=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+11 i3blocks
#[keyindicator]
#instance=CAPS
#interval=once
#signal=11
#[keyindicator]
#instance=NUM
#interval=once
#signal=11
#[usb]
#command=~/.config/i3/usb
#markup=pango
#signal=1
#interval=10
#IGNORE_LIST=[]
#IGNORE_LIST=["sdd1", "mapper/sda1_crypt"]
#INFO_TEXT_COLOR=white
#MOUNTED_COLOR=green
#PLUGGED_COLOR=gray
#LOCKED_COLOR=gray
#UNLOCKED_NOT_MOUNTED_COLOR=yellow
#PARTITIONLESS_COLOR=red
#PARTITIONLESS_TEXT=no partitions
#SEPARATOR=<span color='gray'> | </span>
#LOCKED_INDICATOR=
#UNLOCKED_INDICATOR=
#READONLY_INDICATOR=ro
#TRUNCATE_FS_LABELS=[not set by default, accepts +/- integers]
#[shutdown_menu]
#full_text=Quit
# If you are using FontAwesome, we recommend the power-off icon:
# http://fontawesome.io/icon/power-off/
#command=~/.config/i3/shutdown_menu
#FG_COLOR=#bbbbbb
#BG_COLOR=#111111
#HLFG_COLOR=#111111
#HLBG_COLOR=#bbbbbb
#BORDER_COLOR=#222222
#ROFI_TEXT=Menu:
#ROFI_OPTIONS=-width 11 -location 3 -hide-scrollbar -bw 2
#ZENITY_TITLE=Menu
#ZENITY_TEXT=Action:
#ZENITY_OPTIONS=--column= --hide-header
#ENABLE_CONFIRMATIONS=true (must be true or false)
#LAUNCHER=rofi (must be rofi or zenity)
#LOCKSCRIPT=i3lock --color=${BG_COLOR#"#"}
#[pacman-updates]
#label=
#command=~/.config/i3/arch-update
#markup=pango
#interval= 3600
#QUIET=true
#WATCH=^linux.* ^pacman.*
#BASE_COLOR=#5fff5f
#UPDATE_COLOR=#FFFF85
#AUR=true
#[arch-update]
#command=~/.config/i3/arch-update
#label=Updates:
#interval=3600
#markup=pango
#[disk-io]
#command=~/.config/i3/disk-io
#command=$SCRIPT_DIR/disk-io -w 3 -M -P 0
#interval=persist
#markup=pango
#LABEL=
#instance=/^sda/
#DT=5
#MB_ONLY=0 #0 or 1
#KB_ONLY=0 #0 or 1
#WIDTH=4
#MB_PRECISION=1
#KB_PRECISION=0
#REGEX=/^(s|h)d[a-zA-Z]+/
#THRESHOLD=0
#WARN_COLOR="#FF0000"
#SEPARATOR=/
#PREFIX=
#SUFFIX="B/s"
#[calendar]
#command=~/.config/i3/calendar
#interval=1
#LABEL=
#DATEFMT=+%H:%M:%S
# SHORTFMT=+%H:%M:%S
#HEIGHT=180
#WIDTH=220
[time]
command=printf "<span font_family=\"FontAwesome\">  </span> %s" "$(date '+%b %a %d %Y | %H:%M:%S ')"
interval=1
color=#E0E0E0
#color=#556270
separator=true
[key_layout]
command=~/.config/i3/key_layout
label=Layout
interval=30
color=#E0E0E0
# Query my default IP address only on startup
[ip]
command=ip addr | grep 'inet' | grep -v inet6 | grep -vE '127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1
interval=once
#[bandwidth]
#command=~/.config/i3/bandwidth
#interval=5
#INTERFACE=enp2s0f1
#INLABEL="IN "
#OUTLABEL="OUT "
#TREAT_UNKNOWN_AS_UP=0
[monitors]
command=~/.config/i3/monitor_manager
interval=once
color=#E0E0E0
#SHOW_ON_OFF=1
#SHOW_NAMES=1
#SHOW_PRIMARY=1
#SHOW_MODE=1
#SHOW_BLANKED=1
#SHOW_DUPLICATE=1
#SHOW_ROTATION=1
#SHOW_REFLECTION=1
#SHOW_BRIGHTNESS=1
#SHOW_BRIGHTNESS_VALUE=0
#SHOW_UP_DOWN=1
#FONT_FAMILY=DejaVu Sans Mono
#FONT_SIZE=11
#CLOSE_TO_BOUNDARY_BUFFER=20

View file

@ -0,0 +1,23 @@
#!/usr/bin/env bash
# Copyright 2016 Patrick Haun
# Edited: Denis Kadyshev
#
# 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/>.
setxkbmap -query | awk '
BEGIN{layout="";variant=""}
/^layout/{layout=$2}
/^variant/{variant=" ("$2")"}
END{printf("%s%s",layout,variant)}'

View file

@ -0,0 +1,20 @@
#!/bin/bash
#INSTANCE="${BLOCK_INSTANCE:-1}"
INSTANCE="1,2,3"
URGENT_VALUE=90
LOAD=$(cat /proc/loadavg | awk -F ' ' '{print $'"${INSTANCE}"'}')
if [[ "${LOAD}" != "" ]]; then
LOAD_PERC=$(echo "scale=0; ${LOAD} * 100" | bc -l)
LOAD_PERC=${LOAD_PERC%.*}
echo "${LOAD}"
echo "${LOAD}"
echo ""
if [[ "${LOAD_PERC}" -ge "${URGENT_VALUE}" ]]; then
exit 33
fi
fi

View file

@ -0,0 +1,8 @@
#!/bin/bash
# Show used and total memory
available=$(awk '/MemAvailable/ {$2=$2/1024; printf("%3.2f\n", $2)}' /proc/meminfo)
total=$(awk '/MemTotal/ {$2=$2/1024**2; printf("%3.1f\n", $2)}' /proc/meminfo )
echo "${available}"
echo ""

View file

@ -0,0 +1,728 @@
#!/usr/bin/env python3
#
# Copyright (c) 2016 James Murphy
# Licensed under the GPL version 2 only
#
# monitor_manager is an i3blocks blocklet script to quickly manage your
# connected output devices
from tkinter import *
from tkinter import messagebox
from shutil import which
import tkinter.font as font
from subprocess import call, check_output, CalledProcessError
import re
import os
DESKTOP_SYMBOL = "\uf108"
UP_ARROW = "\uf062"
DOWN_ARROW = "\uf063"
UNBLANKED_SYMBOL = "\uf06e"
BLANKED_SYMBOL = "\uf070"
NOT_CLONED_SYMBOL = "\uf096"
PRIMARY_SYMBOL = "\uf005"
SECONDARY_SYMBOL = "\uf006"
CLONED_SYMBOL = "\uf24d"
ROTATION_NORMAL = "\uf151"
ROTATION_LEFT = "\uf191"
ROTATION_RIGHT = "\uf152"
ROTATION_INVERTED = "\uf150"
REFLECTION_NORMAL = "\uf176"
REFLECTION_X = "\uf07e"
REFLECTION_Y = "\uf07d"
REFLECTION_XY = "\uf047"
TOGGLE_ON = "\uf205"
TOGGLE_OFF = "\uf204"
APPLY_SYMBOL = "\uf00c"
CANCEL_SYMBOL = "\uf00d"
ARANDR_SYMBOL = "\uf085"
REFRESH_SYMBOL = "\uf021"
strbool = lambda s: s.lower() in ['t', 'true', '1']
def _default(name, default='', arg_type=strbool):
val = default
if name in os.environ:
val = os.environ[name]
return arg_type(val)
SHOW_ON_OFF = _default("SHOW_ON_OFF","1")
SHOW_NAMES = _default("SHOW_NAMES", "1")
SHOW_PRIMARY = _default("SHOW_PRIMARY", "1")
SHOW_MODE = _default("SHOW_MODE", "1")
SHOW_BLANKED = _default("SHOW_BLANKED", "1")
SHOW_DUPLICATE = _default("SHOW_DUPLICATE", "1")
SHOW_ROTATION = _default("SHOW_ROTATION", "1")
SHOW_REFLECTION = _default("SHOW_REFLECTION", "1")
SHOW_BRIGHTNESS = _default("SHOW_BRIGHTNESS", "1")
SHOW_BRIGHTNESS_VALUE = _default("SHOW_BRIGHTNESS_VALUE", "0")
SHOW_UP_DOWN = _default("SHOW_UP_DOWN", "1")
FONTAWESOME_FONT_FAMILY = "FontAwesome"
FONTAWESOME_FONT_SIZE = 11
FONTAWESOME_FONT = (FONTAWESOME_FONT_FAMILY, FONTAWESOME_FONT_SIZE)
DEFAULT_FONT_FAMILY = _default("FONT_FAMILY","DejaVu Sans Mono", str)
DEFAULT_FONT_SIZE = _default("FONT_SIZE", 11, int)
DEFAULT_FONT = (DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE)
BRIGHTNESS_SLIDER_HANDLE_LENGTH = 20
BRIGHTNESS_SLIDER_WIDTH = 15
BRIGHTNESS_SLIDER_LENGTH = 50
WINDOW_CLOSE_TO_BOUNDARY_BUFFER = _default("CLOSE_TO_BOUNDARY_BUFFER", 20, int)
class Output:
def __init__(self, name=None, w=None, h=None, x=None, y=None, rate=None,
active=False, primary=False, sameAs=None, blanked=False, rotation="normal",
reflection="normal", brightness=1.0):
self.name = name
self.w = w
self.h = h
self.x = x
self.y = y
self.rate = rate
self.active = active
self.primary = primary
self.sameAs = sameAs
self.blanked = blanked
self.modes = []
self.currentModeIndex = None
self.preferredModeIndex = None
self.row = None
self.rotation = rotation
self.reflection = reflection
self.brightness = brightness
def setPreferredMode(self):
if self.preferredModeIndex != None:
self.setMode(self.preferredModeIndex)
elif self.modes != None:
self.setMode(0)
def setMode(self, index):
self.w, self.h, self.rate = self.modes[index]
self.currentModeIndex = index
def realOutputs():
outputs = []
xrandrText = check_output(["xrandr","--verbose"],universal_newlines=True)
outputBlocks = re.split(r'\n(?=\S)', xrandrText, re.MULTILINE)
infoPattern = re.compile(
r'^(\S+)' # output name
' connected ' # must be connected
'(primary )?' # check if primary output
'((\d+)x(\d+)\+(\d+)\+(\d+) )?' # width x height + xoffset + yoffset
'(\(\S+\) )?' # mode code (0x4a)
'(normal|left|inverted|right)? ?' # rotation
'(X axis|Y axis|X and Y axis)?') # reflection
brightnessPattern = re.compile(r'^\tBrightness: ([\d.]+)', re.MULTILINE)
modePattern = re.compile(r'^ (\d+)x(\d+)[^\n]*?\n +h:[^\n]*?\n +v:[^\n]*?([\d.]+)Hz$', re.MULTILINE)
for outputBlock in outputBlocks:
output = Output()
infoMatch = infoPattern.match(outputBlock)
if infoMatch:
output.name = infoMatch.group(1)
if infoMatch.group(2):
output.primary = True
if infoMatch.group(3):
output.active = True
output.w, output.h, output.x, output.y = map(int,infoMatch.group(4, 5, 6, 7))
if infoMatch.group(9):
output.rotation = infoMatch.group(9)
if output.rotation in ["left", "right"]:
output.w, output.h = output.h, output.w
if infoMatch.group(10):
if infoMatch.group(10) == "X axis":
output.reflection = "x"
elif infoMatch.group(10) == "Y axis":
output.reflection = "y"
elif infoMatch.group(10) == "X and Y axis":
output.reflection = "xy"
else:
output.reflection = "normal"
else:
output.reflection = "normal"
brightnessMatch = brightnessPattern.search(outputBlock)
if brightnessMatch:
try:
brightness = float(brightnessMatch.group(1))
output.brightness = brightness
if abs(brightness) < 1e-09:
output.blanked = True
except ValueError:
pass
modeMatches = modePattern.finditer(outputBlock)
for i, modeMatch in enumerate(modeMatches):
if "*current" in modeMatch.group(0):
output.currentModeIndex = i
output.rate = modeMatch.group(3)
if "+preferred" in modeMatch.group(0):
output.preferredModeIndex = i
output.modes.append(modeMatch.group(1,2,3))
outputs.append(output)
outputs.sort(key=lambda m: m.x if m.x != None else -1)
prev = None
for output in outputs:
if prev != None and output.active and prev.active and output.x == prev.x:
output.sameAs = prev.name
else:
prev = output
return outputs
def modestr(mode):
return "{}x{}@{}".format(*mode)
def status(self):
if self.active:
if self.sameAs == None or self.sameAs == self.name:
if self.w and self.h and self.rate:
return "{}x{}@{}".format(self.w, self.h, self.rate)
else:
return "auto"
else:
return "duplicate {}".format(self.sameAs)
else:
return "Inactive"
def __str__(self):
return "{} {}x{}+{}+{} active:{}, primary:{}\nmodes:{}\ncurrentIndex:{} preferredIndex:{}".format(
self.name, self.w, self.h, self.x, self.y, self.active, self.primary, self.modes, self.currentModeIndex, self.preferredModeIndex)
class MonitorManager():
def __init__(self, root):
self.root = root
self.root.withdraw()
self.root.resizable(0,0)
self.root.wm_title("Monitor Manager")
self.frame = None
self.outputs = []
self.hardRefreshList()
style = {'relief':FLAT, 'padx':1, 'pady':1, 'anchor':'w', 'font':FONTAWESOME_FONT}
self.infoLabel = Label(self.root, text="", **style)
self.infoLabel.config(font=DEFAULT_FONT)
self.bottomRow = []
self.applyButton = Button(self.root, text=APPLY_SYMBOL, **style)
self.bottomRow.append(self.applyButton)
self.refreshButton = Button(self.root, text=REFRESH_SYMBOL, **style)
self.bottomRow.append(self.refreshButton)
if which("arandr"):
self.arandrButton = Button(self.root, text=ARANDR_SYMBOL, **style)
self.bottomRow.append(self.arandrButton)
else:
self.arandrButton = None
self.cancelButton = Button(self.root, text=CANCEL_SYMBOL, **style)
self.bottomRow.append(self.cancelButton)
self.infoLabel.grid(row=1,column=0, columnspan=len(self.bottomRow))
self.gridRow(2, self.bottomRow)
self.moveToMouse()
self.root.deiconify()
def registerBindings(self):
self.root.bind("<Return>", self.handleApply)
self.root.bind("<Escape>", self.handleCancel)
self.applyButton.bind("<Button-1>", self.handleApply)
self.setInfo(self.applyButton, "Apply changes")
self.refreshButton.bind("<Button-1>", self.hardRefreshList)
self.setInfo(self.refreshButton, "Refresh list")
if self.arandrButton:
self.arandrButton.bind("<Button-1>", self.handleArandr)
self.setInfo(self.arandrButton, "Launch aRandR")
self.cancelButton.bind("<Button-1>", self.handleCancel)
self.setInfo(self.cancelButton, "Cancel")
for toggleButton in self.toggleButtons:
toggleButton.bind("<Button-1>", self.toggleActive)
toggleButton.bind("<Button-4>", self.handleUp)
toggleButton.bind("<Button-5>", self.handleDown)
self.setInfo(toggleButton, "Turn output on/off")
for primaryButton in self.primaryButtons:
primaryButton.bind("<Button-1>", self.setPrimary)
self.setInfo(primaryButton, "Set primary output")
for blankedButton in self.blankedButtons:
blankedButton.bind("<Button-1>", self.toggleBlanked)
self.setInfo(blankedButton, "Show/hide output")
for duplicateButton in self.duplicateButtons:
duplicateButton.bind("<Button-1>", self.toggleDuplicate)
self.setInfo(duplicateButton, "Duplicate another output")
for rotateButton in self.rotateButtons:
rotateButton.bind("<Button-1>", self.cycleRotation)
self.setInfo(rotateButton, "Rotate output")
for reflectButton in self.reflectButtons:
reflectButton.bind("<Button-1>", self.cycleReflection)
self.setInfo(reflectButton, "Reflect output")
for brightnessSlider in self.brightnessSliders:
brightnessSlider.bind("<ButtonRelease-1>", self.updateBrightness)
self.setInfo(brightnessSlider, "Adjust brightness")
for upButton in self.upButtons:
upButton.bind("<Button-1>", self.handleUp)
upButton.bind("<Button-4>", self.handleUp)
upButton.bind("<Button-5>", self.handleDown)
self.setInfo(upButton, "Move up")
for downButton in self.downButtons:
downButton.bind("<Button-1>", self.handleDown)
downButton.bind("<Button-4>", self.handleUp)
downButton.bind("<Button-5>", self.handleDown)
self.setInfo(downButton, "Move down")
def gridRow(self, row, widgets):
column = 0
for w in widgets:
w.grid(row=row, column=column)
column += 1
def moveToMouse(self):
root = self.root
root.update_idletasks()
width = root.winfo_reqwidth()
height = root.winfo_reqheight()
x = root.winfo_pointerx() - width//2
y = root.winfo_pointery() - height//2
screen_width = root.winfo_screenwidth()
screen_height = root.winfo_screenheight()
if x+width > screen_width - WINDOW_CLOSE_TO_BOUNDARY_BUFFER:
x = screen_width - WINDOW_CLOSE_TO_BOUNDARY_BUFFER - width
elif x < WINDOW_CLOSE_TO_BOUNDARY_BUFFER:
x = WINDOW_CLOSE_TO_BOUNDARY_BUFFER
if y+height > screen_height - WINDOW_CLOSE_TO_BOUNDARY_BUFFER:
y = screen_height - WINDOW_CLOSE_TO_BOUNDARY_BUFFER - height
elif y < WINDOW_CLOSE_TO_BOUNDARY_BUFFER:
y = WINDOW_CLOSE_TO_BOUNDARY_BUFFER
root.geometry('+{}+{}'.format(x, y))
def setInfo(self, widget, info):
widget.bind("<Enter>", lambda e: self.infoLabel.config(text=info, fg="black"))
widget.bind("<Leave>", lambda e: self.infoLabel.config(text=""))
def handleApply(self, e=None):
self.root.after_idle(self.doHandleApply)
def doHandleApply(self):
if not self.getUserConfirmationIfDangerousConfiguration():
return
command = ["xrandr"]
if not self.existsPrimary():
command += ["--noprimary"]
partition = self.sameAsPartition()
prevFirstActive = None
for p in partition:
firstActive = None
for output in p:
command += ["--output", output.name]
if output.active:
if firstActive == None:
firstActive = output
else:
command += ["--same-as", firstActive.name]
if output.primary:
command += ["--primary"]
if prevFirstActive != None:
command += ["--right-of", prevFirstActive.name]
if output.w != None and output.h != None and output.rate != None:
command += ["--mode", "{}x{}".format(output.w,output.h)]
command += ["--rate", output.rate ]
else:
command += ["--auto"]
command += ["--brightness", str(output.brightness)]
command += ["--rotate", output.rotation]
command += ["--reflect", output.reflection]
else:
command += ["--off"]
if firstActive:
prevFirstActive = firstActive
self.root.after_idle(lambda: self.executeXrandrCommand(command))
def executeXrandrCommand(self, command):
try:
check_output(command, universal_newlines=True)
except CalledProcessError as err:
self.infoLabel.config(text="xrandr returned nonzero exit status {}".format(err.returncode), fg="red")
def getUserConfirmationIfDangerousConfiguration(self):
result = "yes"
if all(map(lambda o: o.blanked or not o.active, self.outputs)):
result = messagebox.askquestion("All blanked or off",
"All ouputs are set to be turned off or blanked, continue?",
icon="warning")
return result == "yes"
def sameAsPartition(self):
partition = []
for output in self.outputs:
place = None
for p in partition:
if place != None:
break;
for o in p:
if place == None and (output.sameAs == o.name or o.sameAs == output.name):
place = p
break;
if place:
place.append(output)
else:
partition.append([output])
return partition
def handleCancel(self, e=None):
self.root.destroy()
def handleArandr(self, e=None):
call(["i3-msg", "-q", "exec", "arandr"])
self.root.destroy()
def handleUp(self, e):
row = e.widget.output.row
if row > 0:
self.swapOutputRows(row-1, row)
self.softRefreshList()
def handleDown(self, e):
row = e.widget.output.row
n = len(self.outputs)
if row + 1 < n:
self.swapOutputRows(row, row+1)
self.softRefreshList()
def swapOutputRows(self, row1, row2):
outputs = self.outputs
outputs[row1],outputs[row2] = outputs[row2],outputs[row1]
outputs[row1].row = row1
outputs[row2].row = row2
for widget in self.frame.grid_slaves(row=row2):
widget.output = outputs[row2]
for widget in self.frame.grid_slaves(row=row1):
widget.output = outputs[row1]
def setPrimary(self, e):
output = e.widget.output
output.primary = not output.primary
for otherOutput in self.outputs:
if otherOutput != output:
otherOutput.primary = False
self.softRefreshList()
def existsPrimary(self):
for output in self.outputs:
if output.primary:
return True
return False
def toggleActive(self, e):
output = e.widget.output
output.active = not output.active
if output.active:
output.setPreferredMode()
else:
for otherOutput in self.outputs:
if otherOutput.sameAs == output.name:
otherOutput.sameAs = None
self.softRefreshList()
def toggleBlanked(self, e):
output = e.widget.output
if output.blanked:
output.blanked = False
output.brightness = 1.0
else:
output.blanked = True
output.brightness = 0.0
self.softRefreshList()
def updateBrightness(self, e):
output = e.widget.output
output.brightness = .01 * e.widget.get()
output.blanked = False
if abs(output.brightness) < 1e-09:
output.blanked = True
self.softRefreshList()
def cycleRotation(self, e):
output = e.widget.output
if output.rotation == "normal":
output.rotation = "right"
elif output.rotation == "right":
output.rotation = "inverted"
elif output.rotation == "inverted":
output.rotation = "left"
else:
output.rotation = "normal"
self.softRefreshList()
def rotationSymbol(self, rotation):
return {
"normal": ROTATION_NORMAL,
"left": ROTATION_LEFT,
"right": ROTATION_RIGHT,
"inverted": ROTATION_INVERTED,
}[rotation]
def cycleReflection(self, e):
output = e.widget.output
if output.reflection == "normal":
output.reflection = "x"
elif output.reflection == "x":
output.reflection = "y"
elif output.reflection == "y":
output.reflection = "xy"
else:
output.reflection = "normal"
self.softRefreshList()
def reflectionSymbol(self, reflection):
return {
"normal": REFLECTION_NORMAL,
"x": REFLECTION_X,
"y": REFLECTION_Y,
"xy": REFLECTION_XY,
}[reflection]
def toggleDuplicate(self, e):
duplicateButton = e.widget
optionMenu = duplicateButton.statusOptionMenu
output = optionMenu.output
if output.sameAs != None:
output.sameAs = None
self.setMenuToOutput(optionMenu, output)
else:
self.setMenuToDuplicate(optionMenu)
self.softRefreshList()
def getDuplicableOutputsFor(self, output):
return [o for o in self.outputs if o != output and o.sameAs == None]
def softRefreshList(self, e=None):
for widget in set().union(self.nameLabels, self.primaryButtons,
self.statusOptionMenus, self.blankedButtons,
self.duplicateButtons, self.rotateButtons, self.reflectButtons,
self.brightnessSliders, self.upButtons, self.downButtons):
widget.config(fg="gray" if not widget.output.active else "black")
for widget in self.toggleButtons:
widget.config(text=TOGGLE_ON if widget.output.active else TOGGLE_OFF)
for widget in self.nameLabels:
widget.config(text=widget.output.name)
for widget in self.primaryButtons:
widget.config(text=PRIMARY_SYMBOL if widget.output.primary else SECONDARY_SYMBOL)
if not widget.output.primary:
widget.config(fg="gray")
for widget in self.statusOptionMenus:
widget.config(text=widget.output.status())
if widget.output.sameAs != None:
self.setMenuToDuplicate(widget)
self.setInfo(widget, "Select output to duplicate")
else:
self.setMenuToOutput(widget, widget.output)
self.setInfo(widget, "Select output mode")
for widget in self.blankedButtons:
widget.config(text=BLANKED_SYMBOL if widget.output.blanked else UNBLANKED_SYMBOL)
for widget in self.duplicateButtons:
widget.config(text=CLONED_SYMBOL if widget.output.sameAs else NOT_CLONED_SYMBOL)
for widget in self.rotateButtons:
widget.config(text=self.rotationSymbol(widget.output.rotation))
for widget in self.reflectButtons:
widget.config(text=self.reflectionSymbol(widget.output.reflection))
for widget in self.brightnessSliders:
widget.set(int(100*widget.output.brightness))
def hardRefreshList(self, e=None):
self.outputs = Output.realOutputs()
self.root.after_idle(self.populateGrid)
def populateGrid(self):
oldFrame = self.frame
self.frame = Frame(self.root)
self.frame.grid(row=0, column=0, columnspan=len(self.bottomRow))
self.toggleButtons = []
self.nameLabels = []
self.primaryButtons = []
self.statusOptionMenus = []
self.blankedButtons = []
self.duplicateButtons = []
self.rotateButtons = []
self.reflectButtons = []
self.brightnessSliders = []
self.upButtons = []
self.downButtons = []
for row, output in enumerate(self.outputs):
self.makeLabelRow(output, row)
self.registerBindings()
if oldFrame:
oldFrame.destroy()
def makeLabelRow(self, output, row):
output.row = row
style = {'relief':FLAT, 'padx':1, 'pady':1, 'anchor':'w'}
widgets = []
toggleButton = Button(self.frame, font=FONTAWESOME_FONT, **style)
toggleButton.output = output
self.toggleButtons.append(toggleButton)
if SHOW_ON_OFF:
widgets.append(toggleButton)
nameLabel = Label(self.frame, font=DEFAULT_FONT)
nameLabel.output = output
self.nameLabels.append(nameLabel)
if SHOW_NAMES:
widgets.append(nameLabel)
primaryButton = Button(self.frame, font=FONTAWESOME_FONT, **style)
primaryButton.output = output
self.primaryButtons.append(primaryButton)
if not output.primary:
primaryButton.config(fg="gray")
if SHOW_PRIMARY:
widgets.append(primaryButton)
var = StringVar(self.frame)
statusOptionMenu = OptionMenu(self.frame, var, None)
statusOptionMenu.output = output
statusOptionMenu.var = var
statusOptionMenu.config(relief=FLAT)
self.statusOptionMenus.append(statusOptionMenu)
if SHOW_MODE or SHOW_DUPLICATE:
widgets.append(statusOptionMenu)
blankedButton = Button(self.frame, font=FONTAWESOME_FONT, **style)
blankedButton.output = output
self.blankedButtons.append(blankedButton)
if SHOW_BLANKED:
widgets.append(blankedButton)
duplicateButton = Button(self.frame, font=FONTAWESOME_FONT, **style)
duplicateButton.statusOptionMenu = statusOptionMenu
duplicateButton.output = output
self.duplicateButtons.append(duplicateButton)
if SHOW_DUPLICATE:
widgets.append(duplicateButton)
rotateButton = Button(self.frame, font=FONTAWESOME_FONT, **style)
rotateButton.output = output
self.rotateButtons.append(rotateButton)
if SHOW_ROTATION:
widgets.append(rotateButton)
reflectButton = Button(self.frame, font=FONTAWESOME_FONT, **style)
reflectButton.output = output
self.reflectButtons.append(reflectButton)
if SHOW_REFLECTION:
widgets.append(reflectButton)
brightnessSlider = Scale(self.frame, orient="horizontal", from_=0, to=100,
length=BRIGHTNESS_SLIDER_LENGTH, showvalue=SHOW_BRIGHTNESS_VALUE,
sliderlength=BRIGHTNESS_SLIDER_HANDLE_LENGTH,
width=BRIGHTNESS_SLIDER_WIDTH, font=FONTAWESOME_FONT)
brightnessSlider.output = output
self.brightnessSliders.append(brightnessSlider)
if SHOW_BRIGHTNESS:
widgets.append(brightnessSlider)
upButton = Button(self.frame, text=UP_ARROW, font=FONTAWESOME_FONT, **style)
upButton.output = output
self.upButtons.append(upButton)
if SHOW_UP_DOWN:
widgets.append(upButton)
downButton = Button(self.frame, text=DOWN_ARROW, font=FONTAWESOME_FONT, **style)
downButton.output = output
self.downButtons.append(downButton)
if SHOW_UP_DOWN:
widgets.append(downButton)
for widget in widgets:
widget.output = output
self.gridRow(row, widgets)
self.softRefreshList()
def setMenuToOutput(self, optionMenu, output):
menu = optionMenu["menu"]
var = optionMenu.var
modes = output.modes
menu.delete(0, END)
for i, mode in enumerate(modes):
label = Output.modestr(mode)
menu.add_command(label=label, command=setLabelAndOutputModeFunc(var,label,output,i))
if output.currentModeIndex != None:
var.set(Output.modestr(modes[output.currentModeIndex]))
elif output.preferredModeIndex != None:
var.set(Output.modestr(modes[output.preferredModeIndex]))
elif len(modes) > 0:
var.set(Output.modestr(modes[0]))
def setMenuToDuplicate(self, optionMenu):
menu = optionMenu["menu"]
var = optionMenu.var
output = optionMenu.output
menu.delete(0, END)
duplicables = self.getDuplicableOutputsFor(output)
defaultIndex = 0
for i,otherOutput in enumerate(duplicables):
label = otherOutput.name
menu.add_command(label=label, command=setLabelAndSameAsFunc(var,label,output))
if label == output.sameAs:
defaultIndex = i
if len(duplicables) > 0:
var.set(menu.entrycget(defaultIndex, "label"))
output.sameAs = menu.entrycget(defaultIndex, "label")
else:
var.set("None")
def handleFocusOut(self, event):
self.root.destroy()
def setLabelAndOutputModeFunc(var, label, output, i):
def func():
var.set(label)
output.setMode(i)
return func
def setLabelAndSameAsFunc(var, sameAs, output):
def func():
var.set(sameAs)
output.sameAs = sameAs
return func
if os.environ.get('BLOCK_BUTTON') == "1":
if os.fork() != 0:
root = Tk()
if DEFAULT_FONT_FAMILY and DEFAULT_FONT_SIZE:
font.nametofont("TkDefaultFont").config(family=DEFAULT_FONT_FAMILY, size=DEFAULT_FONT_SIZE)
manager = MonitorManager(root)
root.mainloop()
else:
print(DESKTOP_SYMBOL)
else:
print(DESKTOP_SYMBOL)

View file

@ -0,0 +1,5 @@
#!/bin/bash
gpu_temp=$(sensors | awk '/temp1/ {print $2}')
cpu_temp=$(sensors | awk '/Tctl/ {print $2}')
echo "CPU: ${cpu_temp} | GPU ${gpu_temp}"

View file

@ -0,0 +1,186 @@
#!/usr/bin/env bash
#
# Use rofi/zenity to change system runstate thanks to systemd.
#
# Note: this currently relies on associative array support in the shell.
#
# Inspired from i3pystatus wiki:
# https://github.com/enkore/i3pystatus/wiki/Shutdown-Menu
#
# Copyright 2015 Benjamin Chrétien <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/>.
#######################################################################
# BEGIN CONFIG #
#######################################################################
# Use a custom lock script
#LOCKSCRIPT="i3lock-extra -m pixelize"
# Colors: FG (foreground), BG (background), HL (highlighted)
FG_COLOR="${FG_COLOR:-#bbbbbb}"
BG_COLOR="${BG_COLOR:-#111111}"
HLFG_COLOR="${HLFG_COLOR:-#111111}"
HLBG_COLOR="${HLBG_COLOR:-#bbbbbb}"
BORDER_COLOR="${BORDER_COLOR:-#222222}"
# Options not related to colors
ROFI_TEXT="${ROFI_TEXT:-Menu:}"
ROFI_OPTIONS=(${ROFI_OPTIONS:--width 11 -location 3 -hide-scrollbar -bw 2})
# Zenity options
ZENITY_TITLE="${ZENITY_TITLE:-Menu}"
ZENITY_TEXT="${ZENITY_TEXT:-Action:}"
ZENITY_OPTIONS=(${ZENITY_OPTIONS:---column= --hide-header})
#######################################################################
# END CONFIG #
#######################################################################
# Whether to ask for user's confirmation
enable_confirmation=${ENABLE_CONFIRMATIONS:-false}
# Preferred launcher if both are available
preferred_launcher="${LAUNCHER:-rofi}"
usage="$(basename "$0") [-h] [-c] [-p name] -- display a menu for shutdown, reboot, lock etc.
where:
-h show this help text
-c ask for user confirmation
-p preferred launcher (rofi or zenity)
This script depends on:
- systemd,
- i3,
- rofi or zenity."
# Check whether the user-defined launcher is valid
launcher_list=(rofi zenity)
function check_launcher() {
if [[ ! "${launcher_list[@]}" =~ (^|[[:space:]])"$1"($|[[:space:]]) ]]; then
echo "Supported launchers: ${launcher_list[*]}"
exit 1
else
# Get array with unique elements and preferred launcher first
# Note: uniq expects a sorted list, so we cannot use it
i=1
launcher_list=($(for l in "$1" "${launcher_list[@]}"; do printf "%i %s\n" "$i" "$l"; let i+=1; done \
| sort -uk2 | sort -nk1 | cut -d' ' -f2- | tr '\n' ' '))
fi
}
# Parse CLI arguments
while getopts "hcp:" option; do
case "${option}" in
h) echo "${usage}"
exit 0
;;
c) enable_confirmation=true
;;
p) preferred_launcher="${OPTARG}"
check_launcher "${preferred_launcher}"
;;
*) exit 1
;;
esac
done
check_launcher "${preferred_launcher}"
# Check whether a command exists
function command_exists() {
command -v "$1" &> /dev/null 2>&1
}
# systemctl required
if ! command_exists systemctl ; then
exit 1
fi
# menu defined as an associative array
typeset -A menu
# Menu with keys/commands
menu=(
[Shutdown]="systemctl poweroff"
[Reboot]="systemctl reboot"
[Hibernate]="systemctl hibernate"
[Suspend]="systemctl suspend"
[Halt]="systemctl halt"
[Lock]="${LOCKSCRIPT:-i3lock --color=${BG_COLOR#"#"}}"
[Logout]="i3-msg exit"
[Cancel]=""
)
menu_nrows=${#menu[@]}
# Menu entries that may trigger a confirmation message
menu_confirm="Shutdown Reboot Hibernate Suspend Halt Logout"
launcher_exe=""
launcher_options=""
rofi_colors=""
function prepare_launcher() {
if [[ "$1" == "rofi" ]]; then
rofi_colors=(-bc "${BORDER_COLOR}" -bg "${BG_COLOR}" -fg "${FG_COLOR}" \
-hlfg "${HLFG_COLOR}" -hlbg "${HLBG_COLOR}")
launcher_exe="rofi"
launcher_options=(-dmenu -i -lines "${menu_nrows}" -p "${ROFI_TEXT}" \
"${rofi_colors}" "${ROFI_OPTIONS[@]}")
elif [[ "$1" == "zenity" ]]; then
launcher_exe="zenity"
launcher_options=(--list --title="${ZENITY_TITLE}" --text="${ZENITY_TEXT}" \
"${ZENITY_OPTIONS[@]}")
fi
}
for l in "${launcher_list[@]}"; do
if command_exists "${l}" ; then
prepare_launcher "${l}"
break
fi
done
# No launcher available
if [[ -z "${launcher_exe}" ]]; then
exit 1
fi
launcher=(${launcher_exe} "${launcher_options[@]}")
selection="$(printf '%s\n' "${!menu[@]}" | sort | "${launcher[@]}")"
function ask_confirmation() {
if [ "${launcher_exe}" == "rofi" ]; then
confirmed=$(echo -e "Yes\nNo" | rofi -dmenu -i -lines 2 -p "${selection}?" \
"${rofi_colors}" "${ROFI_OPTIONS[@]}")
[ "${confirmed}" == "Yes" ] && confirmed=0
elif [ "${launcher_exe}" == "zenity" ]; then
zenity --question --text "Are you sure you want to ${selection,,}?"
confirmed=$?
fi
if [ "${confirmed}" == 0 ]; then
i3-msg -q "exec ${menu[${selection}]}"
fi
}
if [[ $? -eq 0 && ! -z ${selection} ]]; then
if [[ "${enable_confirmation}" = true && \
${menu_confirm} =~ (^|[[:space:]])"${selection}"($|[[:space:]]) ]]; then
ask_confirmation
else
i3-msg -q "exec ${menu[${selection}]}"
fi
fi

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 KiB

View file

@ -0,0 +1,34 @@
#!/bin/sh
lock() {
i3lock
}
case "$1" in
lock)
swaylock -c 000000
;;
logout)
killall sway
;;
suspend)
echo -n mem | sudo tee --append /sys/power/state
#lock && dbus-send --system --print-reply --type=method_call --reply-timeout=2000 --dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Suspend
;;
hibernate)
echo -n disk | sudo tee --append /sys/power/state
#lock && dbus-send --system --print-reply --type=method_call --reply-timeout=2000 --dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Hibernate
;;
reboot)
sudo openrc-shutdown --reboot now
#dbus-send --system --print-reply --type=method_call --reply-timeout=2000 --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart
;;
shutdown)
sudo openrc-shutdown --poweroff now
#dbus-send --system --print-reply --type=method_call --reply-timeout=2000 --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop
;;
*)
echo "Usage: $0 {lock|logout|suspend|hibernate|reboot|shutdown}"
exit 2
esac
exit 0

View file

@ -0,0 +1,30 @@
#!/bin/sh
lock() {
i3lock
}
case "$1" in
lock)
swaylock -c 000000
;;
logout)
killall sway
;;
suspend)
lock && systemctl suspend
;;
hibernate)
lock && systemctl hibernate
;;
reboot)
systemctl reboot
;;
shutdown)
systemctl poweroff
;;
*)
echo "Usage: $0 {lock|logout|suspend|hibernate|reboot|shutdown}"
exit 2
esac
exit 0

View file

@ -0,0 +1,368 @@
#!/usr/bin/env python3
#
# Copyright (C) 2015 James Murphy
# Licensed under the terms of the GNU GPL v2 only.
#
# i3blocks blocklet script to output connected usb storage device info.
import os
def _default(name, default='', arg_type=str):
val = default
if name in os.environ:
val = os.environ[name]
return arg_type(val)
###############################################################################
# BEGIN CONFIG
# Most of these can be specified as command line options, run with --help for
# more information.
# You may edit any of the following entries. DO NOT delete any of them, else
# the main script will have unpredictable behavior.
###############################################################################
# Color options, can be a color name or #RRGGBB
INFO_TEXT_COLOR = _default("INFO_TEXT_COLOR", "white")
MOUNTED_COLOR = _default("MOUNTED_COLOR", "green")
PLUGGED_COLOR = _default("PLUGGED_COLOR", "gray")
LOCKED_COLOR = _default("LOCKED_COLOR", "gray")
UNLOCKED_NOT_MOUNTED_COLOR = _default("UNLOCKED_NOT_MOUNTED_COLOR", "yellow")
PARTITIONLESS_COLOR = _default("PARTITIONLESS_COLOR", "red")
# Default texts
PARTITIONLESS_TEXT = _default("PARTITIONLESS_TEXT", "no partitions")
SEPARATOR = _default("SEPARATOR", "<span color='gray'> | </span>")
# Indicate whether an encrypted partition is locked/unlocked, "" is allowed.
LOCKED_INDICATOR = _default("LOCKED_INDICATOR", "\uf023 ")
UNLOCKED_INDICATOR = _default("UNLOCKED_INDICATOR", "\uf09c ")
# Shows instead of space available when a partition is mounted readonly
READONLY_INDICATOR = _default("READONLY_INDICATOR", "ro")
# Maximum length of a filesystem label to display. Use None to disable
# truncation, a positive integer to right truncate to that many characters, or
# a negative integer to left truncate to that many characters. Setting this
# option to 0 will disable the displaying of filesystem labels.
TRUNCATE_FS_LABELS = _default("TRUNCASE_FS_LABELS", None)
# List of devices to ignore. Must be a valid python3 representation of a list
# of strings
IGNORE_LIST = _default("IGNORE_LIST", "[]")
if IGNORE_LIST:
import ast
IGNORE_LIST = list(map(lambda p:
p if p.startswith("/")
else "/dev/{}".format(p),
ast.literal_eval(IGNORE_LIST)
))
# Edit this function to ignore certain devices (e.g. those that are always
# plugged in).
# The dictionary udev_attributes_dict contains all the attributes given by
# udevadm info --query=propery --name=$path
def ignore(path, udev_attributes_dict):
# E.g. how to ignore devices whose device name begins with /dev/sda
#if udev_attributes_dict["DEVNAME"].startswith("/dev/sda"):
# return True
return False
# Edit this function to ignore devices before the udev attributes are
# computed in order to save time and memory.
def fastIgnore(path):
if path in IGNORE_LIST:
return True
# E.g. how to to ignore devices whose path begins with /dev/sda
#if path.startswith("/dev/sda"):
# return True
# E.g. how to ignore a fixed set of paths
#if path in [ "/dev/path1", "/dev/path2", "/dev/path3" ]:
# return True
return False
###############################################################################
# END CONFIG
# DO NOT EDIT ANYTHING AFTER THIS POINT UNLESS YOU KNOW WHAT YOU ARE DOING
###############################################################################
from subprocess import check_output
import argparse
def pangoEscape(text):
return text.replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;")
def getLeafDevicePaths():
lines = check_output(['lsblk', '-spndo', 'NAME'], universal_newlines=True)
lines = lines.split("\n")
lines = filter(None, lines)
return lines
def getKernelName(path):
return check_output(['lsblk', '-ndso', 'KNAME', path],
universal_newlines=True).rstrip("\n")
def getDeviceType(path):
return check_output(['lsblk', '-no', 'TYPE', path],
universal_newlines=True).strip()
def getFSType(path):
global attributeMaps
return attributeMaps[path].get("ID_FS_TYPE")
def isLUKSPartition(path):
return getFSType(path) == "crypto_LUKS"
def isSwapPartition(path):
return getFSType(path) == "swap"
def getFSLabel(path):
global attributeMaps
label = attributeMaps[path].get("ID_FS_LABEL_ENC", "")
if label:
label = label.encode().decode("unicode-escape")
if type(TRUNCATE_FS_LABELS) == int:
if TRUNCATE_FS_LABELS >= 0:
label = label[:TRUNCATE_FS_LABELS]
elif TRUNCATE_FS_LABELS < 0:
label = label[TRUNCATE_FS_LABELS:]
return label
def getFSOptions(path):
lines = check_output(['findmnt', '-no', 'FS-OPTIONS', path],
universal_newlines=True).strip()
lines = lines.split(",")
return lines
def isReadOnly(path):
return "ro" in getFSOptions(path)
def isExtendedPartitionMarker(path):
global attributeMaps
MARKERS = ["0xf", "0x5"]
return attributeMaps[path].get("ID_PART_ENTRY_TYPE") in MARKERS
def getMountPoint(path):
return check_output(['lsblk', '-ndo', 'MOUNTPOINT', path],
universal_newlines=True).rstrip("\n")
def getSpaceAvailable(path):
lines = check_output(['df', '-h', '--output=avail', path],
universal_newlines=True)
lines = lines.split("\n")
if len(lines) != 3:
return ""
else:
return lines[1].strip()
def getLockedCryptOutput(path):
form = "<span color='{}'>[{}{}]</span>"
kname = pangoEscape(getKernelName(path))
output = form.format(LOCKED_COLOR, LOCKED_INDICATOR, kname)
return output
def getParentKernelName(path):
lines = check_output(['lsblk', '-nso', 'KNAME', path],
universal_newlines=True)
lines = lines.split("\n")
if len(lines) > 2:
return lines[1].rstrip("\n")
else:
return ""
def getUnlockedCryptOutput(path):
mountPoint = getMountPoint(path)
if mountPoint:
color = MOUNTED_COLOR
if isReadOnly(path):
spaceAvail = READONLY_INDICATOR
else:
spaceAvail = pangoEscape(getSpaceAvailable(path))
mountPoint = "<i>{}</i>:".format(pangoEscape(mountPoint))
else:
color = UNLOCKED_NOT_MOUNTED_COLOR
spaceAvail = ""
kernelName = pangoEscape(getKernelName(path))
parentKernelName = pangoEscape(getParentKernelName(path))
block = "<span color='{}'>[{}{}:{}]</span>"
block = block.format(color, UNLOCKED_INDICATOR, parentKernelName, kernelName)
label = pangoEscape(getFSLabel(path))
if label:
label = '"{}"'.format(label)
items = [block, label, mountPoint, spaceAvail]
return " ".join(filter(None, items))
def getSwapOutput(path):
return ""
def getUnencryptedPartitionOutput(path):
mountPoint = getMountPoint(path)
if mountPoint:
color = MOUNTED_COLOR
if isReadOnly(path):
spaceAvail = READONLY_INDICATOR
else:
spaceAvail = pangoEscape(getSpaceAvailable(path))
mountPoint = "<i>{}</i>:".format(pangoEscape(mountPoint))
else:
color = PLUGGED_COLOR
spaceAvail = ""
kernelName = pangoEscape(getKernelName(path))
block = "<span color='{}'>[{}]</span>"
block = block.format(color, kernelName)
label = pangoEscape(getFSLabel(path))
if label:
label = '"{}"'.format(label)
items = [block, label, mountPoint, spaceAvail]
return " ".join(filter(None, items))
def getDiskWithNoPartitionsOutput(path):
form = "<span color='{}'>[{}] {}</span>"
kernelName = pangoEscape(getKernelName(path))
return form.format(PARTITIONLESS_COLOR, kernelName, PARTITIONLESS_TEXT)
def getOutput(path):
if isSwapPartition(path):
return getSwapOutput(path)
t = getDeviceType(path)
if t == "part":
if isExtendedPartitionMarker(path):
return ""
elif isLUKSPartition(path):
return getLockedCryptOutput(path)
else:
return getUnencryptedPartitionOutput(path)
elif t == "disk":
return getDiskWithNoPartitionsOutput(path)
elif t == "crypt":
return getUnlockedCryptOutput(path)
elif t == "rom" :
return ""
def makeAttributeMap(path):
attributeMap = {}
lines = check_output(
['udevadm','info','--query=property','--name={}'.format(path)],
universal_newlines=True)
lines = lines.split("\n")
for line in lines:
if line:
key, val = line.split("=", maxsplit=1)
attributeMap[key] = val
return attributeMap
def getAttributeMaps(paths):
return {path : makeAttributeMap(path) for path in paths}
def parseArguments():
parser = argparse.ArgumentParser(prog="usb.py",
description="i3blocks blocklet script to output connected"
" usb storage device info")
parser.add_argument("--info-text-color", nargs=1,
help="Set the info text color. "
"Default: {}".format(INFO_TEXT_COLOR))
parser.add_argument("--mounted-color", nargs=1,
help="Set the color of mounted devices. "
"Default: {}".format(MOUNTED_COLOR))
parser.add_argument("--plugged-color", nargs=1,
help="Set the color of plugged devices. "
"Default: {}".format(PLUGGED_COLOR))
parser.add_argument("--locked-color", nargs=1,
help="Set the color of locked crypt devices. "
"Default: {}".format(LOCKED_COLOR))
parser.add_argument("--unlocked-not-mounted-color", nargs=1,
help="Set the color of unlocked not mounted crypt devices. "
"Default: {}".format(UNLOCKED_NOT_MOUNTED_COLOR))
parser.add_argument("--partitionless-color", nargs=1,
help="Set the color of devicees with no partitions. "
"Defaut: {}".format(PARTITIONLESS_COLOR))
parser.add_argument("--partitionless-text", nargs=1,
help="Set the text to display for a device with no partitions. "
"Default: {}".format(PARTITIONLESS_TEXT))
parser.add_argument("--separator", nargs=1,
help="Set the separator between devices. "
"Default: {}".format(SEPARATOR))
parser.add_argument("--locked-indicator", nargs=1,
help="Set the indicator to use for a locked crypt device. "
"Default: {}".format(LOCKED_INDICATOR))
parser.add_argument("--unlocked-indicator", nargs=1,
help="Set the indicator to use for an unlocked crypt device. "
"Default: {}".format(UNLOCKED_INDICATOR))
parser.add_argument("--readonly-indicator", nargs=1,
help="Set the indicator to use for a readonly device. "
"Default: {}".format(READONLY_INDICATOR))
parser.add_argument("--truncate-fs-labels", type=int, nargs=1,
help="Trucate device labels to a certain number of characters, must be"
"an integer."
"Default: {}".format(TRUNCATE_FS_LABELS))
parser.add_argument("-i", "--ignore", action="append",
help="Ignore a device by path. "
"If path doesn't begin with / then it is assumed to be in /dev/")
args = parser.parse_args()
setParsedArgs(args)
def setParsedArgs(args):
if args.info_text_color != None:
global INFO_TEXT_COLOR
INFO_TEXT_COLOR = args.info_text_color[0]
if args.mounted_color != None:
global MOUNTED_COLOR
MOUNTED_COLOR = args.mounted_color[0]
if args.plugged_color != None:
global PLUGGED_COLOR
PLUGGED_COLOR = args.plugged_color[0]
if args.locked_color != None:
global LOCKED_COLOR
LOCKED_COLOR = args.locked_color[0]
if args.unlocked_not_mounted_color != None:
global UNLOCKED_NOT_MOUNTED_COLOR
UNLOCKED_NOT_MOUNTED_COLOR = args.unlocked_not_mounted_color[0]
if args.partitionless_color != None:
global PARTITIONLESS_COLOR
PARTITIONLESS_COLOR = args.partitionless_color[0]
if args.partitionless_text != None:
global PARTITIONLESS_TEXT
PARTITIONLESS_TEXT = args.partitionless_text[0]
if args.separator != None:
global SEPARATOR
SEPARATOR = args.separator[0]
if args.locked_indicator != None:
global LOCKED_INDICATOR
LOCKED_INDICATOR = args.locked_indicator[0]
if args.unlocked_indicator != None:
global UNLOCKED_INDICATOR
UNLOCKED_INDICATOR = args.unlocked_indicator[0]
if args.readonly_indicator != None:
global READONLY_INDICATOR
READONLY_INDICATOR = args.readonly_indicator[0]
if args.truncate_fs_labels != None:
global TRUNCATE_FS_LABELS
TRUNCATE_FS_LABELS = args.truncate_fs_labels[0]
if args.ignore != None:
args.ignore = list(map(lambda p:
p if p.startswith("/") else "/dev/{}".format(p), args.ignore))
global fastIgnore
oldFastIgnore = fastIgnore
def newFastIgnore(path):
return oldFastIgnore(path) or path in args.ignore
fastIgnore = newFastIgnore
parseArguments()
leaves = getLeafDevicePaths()
leaves = [path for path in leaves if not fastIgnore(path)]
attributeMaps = getAttributeMaps(leaves)
leaves = (path for path in leaves if not ignore(path, attributeMaps[path]))
outputs = filter(None, map(getOutput, leaves))
output = SEPARATOR.join(outputs)
if output:
output = "<span color='{}'>{}</span>".format(INFO_TEXT_COLOR, output)
print(output)
print(output)

View file

@ -0,0 +1,9 @@
#!/bin/bash
#
# Use nmcli to display the VPN status
#
if ip link | grep -q tun; then
echo ""
else
echo ""
fi

View file

@ -0,0 +1,59 @@
#!/usr/bin/env ruby
# Fetch weather for your city from OpenWeatherMap
# You need an API key to fetch data, and store the API key inside ENV
# export I3_OWM_APIKEY="0986273cf8ac41578b90bcc90bc559b4"
# Depends on Weather Icons: https://erikflowers.github.io/weather-icons/
require 'open-uri'
require 'json'
# Get info from open weather map
class Weather
API = 'http://api.openweathermap.org/data/2.5/weather?id=CITY&units=metric&APPID=APIKEY'
API_KEY = 'API-KEY-HERE'
attr_accessor :api_url, :weather
def initialize(city)
@api_url = API.gsub('CITY', city).gsub('APIKEY', API_KEY)
@weather = contact_openweathermap
end
# Public - Return formated response - temperature / weather
#
# Returns String
def show
info = @weather['weather'][0]['main']
temp = @weather['main']['temp']
"#{temp}#{icon(info)} #{info}"
end
private
# Private - Use FontAwesome icons to show the weather conditions
#
# Returns Unicode char
def icon(weather)
case weather
when 'Fog' then ''
when /Clear/ then ' '
when /Rain/ then ''
when /Cloud/ then ''
when /Snow/ then ''
else
''
end
end
# Private - Fetch information from OpenWeatherMap
#
# Returns Hash
def contact_openweathermap
JSON.parse(open(@api_url).read)
end
end
# city = 'Zagreb'
city_id = '6618983'
out = Weather.new(city_id).show
puts "#{out}"

View file

@ -0,0 +1,132 @@
local wezterm = require "wezterm"
local my_colors = {
a = { fg = "#24283b", bg = "#7aa2f7" },
b = { fg = "#7aa2f7", bg = "#3b4261" },
c = { fg = "#828bb8", bg = "#1e2030" }
}
local separators = {
main = { left = '', right = '' },
sub = { left = '', right = '' },
}
wezterm.on(
'format-tab-title',
function(tab, tabs, panes, config, hover, max_width)
local tab_title = {
st = " " .. tab.active_pane.title .. " ",
bg = my_colors.b.bg,
fg = my_colors.b.fg,
}
local separator = {
st = separators.sub.left,
bg = my_colors.b.bg,
fg = my_colors.b.fg,
}
if tab.is_active then
tab_title.bg = my_colors.a.bg
tab_title.fg = my_colors.a.fg
separator.st = separators.main.left
separator.fg = my_colors.a.bg
if tab.tab_index + 1 == #tabs then
separator.bg = my_colors.c.bg
else
separator.bg = my_colors.b.bg
end
else
if tab.tab_index + 1 == #tabs then
separator.st = separators.main.left
separator.fg = my_colors.b.bg
separator.bg = my_colors.c.bg
elseif tabs[tab.tab_index + 2].is_active then
separator.st = separators.main.left
separator.fg = my_colors.b.bg
separator.bg = my_colors.a.bg
end
end
return {
{ Background = { Color = tab_title.bg } },
{ Foreground = { Color = tab_title.fg } },
{ Text = tab_title.st },
{ Background = { Color = separator.bg } },
{ Foreground = { Color = separator.fg } },
{ Text = separator.st }
}
end
)
wezterm.on(
'update-right-status',
function(window, pane)
local date_format = " %I:%M %p " .. separators.sub.right .. " %A " .. separators.sub.right .. " %B %-d "
local date = wezterm.strftime(date_format)
local bat = " "
for _, b in ipairs(wezterm.battery_info()) do
if b.state == "Charging" then
bat = bat .. ""
elseif b.state == "Unknown" then
bat = bat .. ""
elseif b.state_of_charge <= 0.2 then
bat = bat .. ""
else
bat = bat .. ""
end
bat = bat .. string.format('%.0f%%', b.state_of_charge * 100) .. " "
end
window:set_right_status(
wezterm.format {
{ Foreground = { Color = my_colors.b.bg } },
{ Background = { Color = my_colors.c.bg } },
{ Text = separators.main.right },
{ Foreground = { Color = my_colors.b.fg } },
{ Background = { Color = my_colors.b.bg } },
{ Text = bat },
{ Foreground = { Color = my_colors.a.bg } },
{ Background = { Color = my_colors.b.bg } },
{ Text = separators.main.right },
{ Foreground = { Color = my_colors.a.fg } },
{ Background = { Color = my_colors.a.bg } },
{ Text = date },
}
)
end
)
return {
colors = {
tab_bar = {
background = my_colors.c.bg,
active_tab = {
bg_color = my_colors.a.bg,
fg_color = my_colors.a.fg
},
inactive_tab = {
bg_color = my_colors.c.bg,
fg_color = my_colors.c.fg
},
new_tab = {
bg_color = my_colors.c.bg,
fg_color = my_colors.c.fg
}
}
},
use_fancy_tab_bar = false,
tab_bar_at_bottom = true,
tab_max_width = 100,
font_size = 11.0,
font = wezterm.font_with_fallback {
"JetBrains Mono",
"HackGenNerd Console"
},
use_ime = true,
color_scheme = "tokyonight-storm",
initial_cols = 140,
initial_rows = 39,
window_padding = {
right = 0,
left = 0,
top = 0,
bottom = 0,
},
}

View file

@ -0,0 +1,99 @@
[xfdesktop-version-4.10.3+-rcfile_format]
4.10.3+=true
[/home/simono41/PycharmProjects]
row=5
col=2
[/home/simono41/Repository]
row=1
col=2
[/home/simono41/Musik]
row=8
col=1
[/home/simono41/notes.txt]
row=1
col=1
[/home/simono41/Pictures]
row=7
col=1
[/home/simono41/Schreibtisch]
row=5
col=1
[/home/simono41/Templates]
row=4
col=1
[/home/simono41/Music]
row=3
col=0
[/home/simono41/Public]
row=6
col=1
[/home/simono41/Sync]
row=2
col=2
[/home/simono41/CLionProjects]
row=4
col=2
[/home/simono41/Desktop]
row=7
col=0
[/home/simono41/aur-builds]
row=2
col=1
[/home/simono41/Documents]
row=6
col=0
[/home/simono41/repos]
row=0
col=2
[/home/simono41/Downloads]
row=4
col=0
[/home/simono41/scripte]
row=0
col=1
[/home/simono41/Dokumente]
row=5
col=0
[/home/simono41/IdeaProjects]
row=3
col=2
[/home/simono41/Bilder]
row=8
col=0
[/home/simono41/Videos]
row=3
col=1
[Papierkorb]
row=0
col=0
[/]
row=1
col=0
[/home/simono41]
row=2
col=0

View file

@ -0,0 +1 @@
/home/simono41/.config/xfce4/desktop/icons.screen0-1904x1037.rc

View file

@ -0,0 +1,3 @@
TerminalEmulator=custom-TerminalEmulator
FileManager=pcmanfm

View file

@ -0,0 +1,12 @@
app=eog
last_user=
last_extension=png
screenshot_dir=file:/home/simono41/Bilder
enable_imgur_upload=true
show_in_folder=true
action=1
delay=2
region=3
show_mouse=0
show_border=1

Some files were not shown because too many files have changed in this diff Show more