blablabla

This commit is contained in:
crazzy_fingers 2022-05-02 16:40:07 -04:00
parent c79edba267
commit 0666601981
45 changed files with 81265 additions and 0 deletions

12
.aliases Normal file
View File

@ -0,0 +1,12 @@
alias pkgbin="doas xbps-install --repository hostdir/binpkgs"
alias sl1="nvim /home/loftur/void-packages/srcpkgs/slstatus/files/config.h"
alias sl2="cd /home/loftur/void-packages && ./xbps-src -f pkg slstatus && xi -f slstatus"
alias dw1="nvim /home/loftur/void-packages/srcpkgs/dwm/files/config.h"
alias dw2="cd /home/loftur/void-packages && ./xbps-src -f pkg dwm && xi -f dwm"
alias hb1="nvim /home/loftur/void-packages/srcpkgs/herbe/files/config.h"
alias hb2="cd /home/loftur/void-packages && ./xbps-src -f pkg herbe && xi -f herbe"
alias vup="doas xbps-install -Su && doas xbps-remove -Oo"
alias vupo="doas xbps-install -Su && doas xbps-remove -Oo && doas shutdown -h now"
alias clean-xbps-src="./xbps-src clean-repocache && ./xbps-src clean && ./xbps-src remove-autodeps && ./xbps-src purge-distfiles"
alias mkernel=" cd /home/loftur/void-packages &&./xbps-src -f pkg linux5.17 && xi -f linux5.17"
alias ugrub="doas grub-mkconfig -o /boot/grub/grub.cfg"

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,647 @@
# See this wiki page for more info:
# https://github.com/dylanaraps/neofetch/wiki/Customizing-Info
print_info() {
info title
info underline
# info "Host" model
info "$(color 7)" distro
info "$(color 7)├$(color 8) Kernel" kernel
info "$(color 7)└$(color 8) Packages" packages
prin
info "$(color 7)" wm
info "$(color 7)├$(color 8) Theme" theme
info "$(color 7)└$(color 8) Icons" icons
prin
info "$(color 7)" term
info "$(color 7)├$(color 8) Shell" shell
info "$(color 7)└$(color 8) Font" term_font
prin
info "$(color 7)" cpu
info "$(color 7)├$(color 8) Memory" memory
info "$(color 7)└$(color 8) GPU" gpu
#info "$(color 7)└$(color 8) Resolution" resolution
# info "Disk" disk
# info "WM Theme" wm_theme
# info "Theme" theme
# info "Icons" icons
# info "DE" de
# info "WM" wm
# info "CPU Usage" cpu_usage
# info "Battery" battery
# info "Font" font
# info "Song" song
# [[ $player ]] && prin "Music Player" "$player"
# info "Local IP" local_ip
# info "Public IP" public_ip
# info "Users" users
# info "Locale" locale # This only works on glibc systems.
info cols
}
# Kernel
# Shorten the output of the kernel function.
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --kernel_shorthand
# Supports: Everything except *BSDs (except PacBSD and PC-BSD)
#
# Example:
# on: '4.8.9-1-ARCH'
# off: 'Linux 4.8.9-1-ARCH'
kernel_shorthand="on"
# Distro
# Shorten the output of the distro function
#
# Default: 'off'
# Values: 'on', 'off', 'tiny'
# Flag: --distro_shorthand
# Supports: Everything except Windows and Haiku
distro_shorthand="off"
# Show/Hide OS Architecture.
# Show 'x86_64', 'x86' and etc in 'Distro:' output.
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --os_arch
#
# Example:
# on: 'Arch Linux x86_64'
# off: 'Arch Linux'
os_arch="on"
# Uptime
# Shorten the output of the uptime function
#
# Default: 'on'
# Values: 'on', 'off', 'tiny'
# Flag: --uptime_shorthand
#
# Example:
# on: '2 days, 10 hours, 3 mins'
# off: '2 days, 10 hours, 3 minutes'
# tiny: '2d 10h 3m'
uptime_shorthand="on"
# Memory
# Show memory pecentage in output.
#
# Default: 'off'
# Values: 'on', 'off'
# Flag: --memory_percent
#
# Example:
# on: '1801MiB / 7881MiB (22%)'
# off: '1801MiB / 7881MiB'
memory_percent="on"
# Packages
# Show/Hide Package Manager names.
#
# Default: 'tiny'
# Values: 'on', 'tiny' 'off'
# Flag: --package_managers
#
# Example:
# on: '998 (pacman), 8 (flatpak), 4 (snap)'
# tiny: '908 (pacman, flatpak, snap)'
# off: '908'
package_managers="on"
# Shell
# Show the path to $SHELL
#
# Default: 'off'
# Values: 'on', 'off'
# Flag: --shell_path
#
# Example:
# on: '/bin/bash'
# off: 'bash'
shell_path="off"
# Show $SHELL version
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --shell_version
#
# Example:
# on: 'bash 4.4.5'
# off: 'bash'
shell_version="on"
# CPU
# CPU speed type
#
# Default: 'bios_limit'
# Values: 'scaling_cur_freq', 'scaling_min_freq', 'scaling_max_freq', 'bios_limit'.
# Flag: --speed_type
# Supports: Linux with 'cpufreq'
# NOTE: Any file in '/sys/devices/system/cpu/cpu0/cpufreq' can be used as a value.
speed_type="bios_limit"
# CPU speed shorthand
#
# Default: 'off'
# Values: 'on', 'off'.
# Flag: --speed_shorthand
# NOTE: This flag is not supported in systems with CPU speed less than 1 GHz
#
# Example:
# on: 'i7-6500U (4) @ 3.1GHz'
# off: 'i7-6500U (4) @ 3.100GHz'
speed_shorthand="on"
# Enable/Disable CPU brand in output.
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --cpu_brand
#
# Example:
# on: 'Intel i7-6500U'
# off: 'i7-6500U (4)'
cpu_brand="off"
# CPU Speed
# Hide/Show CPU speed.
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --cpu_speed
#
# Example:
# on: 'Intel i7-6500U (4) @ 3.1GHz'
# off: 'Intel i7-6500U (4)'
cpu_speed="on"
# CPU Cores
# Display CPU cores in output
#
# Default: 'logical'
# Values: 'logical', 'physical', 'off'
# Flag: --cpu_cores
# Support: 'physical doesn't work on BSD.
#
# Example:
# logical: 'Intel i7-6500U (4) @ 3.1GHz' (All virtual cores)
# physical: 'Intel i7-6500U (2) @ 3.1GHz' (All physical cores)
# off: 'Intel i7-6500U @ 3.1GHz'
cpu_cores="logical"
# CPU Temperature
# Hide/Show CPU temperature.
# Note the temperature is added to the regular CPU function.
#
# Default: 'off'
# Values: 'C', 'F', 'off'
# Flag: --cpu_temp
# Supports: Linux, BSD
# NOTE: For FreeBSD and NetBSD-based systems, you'll need to enable
# coretemp kernel module. This only supports newer Intel processors.
#
# Example:
# C: 'Intel i7-6500U (4) @ 3.1GHz [27.2°C]'
# F: 'Intel i7-6500U (4) @ 3.1GHz [82.0°F]'
# off: 'Intel i7-6500U (4) @ 3.1GHz'
cpu_temp="off"
# GPU
# Enable/Disable GPU Brand
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --gpu_brand
#
# Example:
# on: 'AMD HD 7950'
# off: 'HD 7950'
gpu_brand="on"
# Which GPU to display
#
# Default: 'all'
# Values: 'all', 'dedicated', 'integrated'
# Flag: --gpu_type
# Supports: Linux
#
# Example:
# all:
# GPU1: AMD HD 7950
# GPU2: Intel Integrated Graphics
#
# dedicated:
# GPU1: AMD HD 7950
#
# integrated:
# GPU1: Intel Integrated Graphics
gpu_type="all"
# Resolution
# Display refresh rate next to each monitor
# Default: 'off'
# Values: 'on', 'off'
# Flag: --refresh_rate
# Supports: Doesn't work on Windows.
#
# Example:
# on: '1920x1080 @ 60Hz'
# off: '1920x1080'
refresh_rate="off"
# Gtk Theme / Icons / Font
# Shorten output of GTK Theme / Icons / Font
#
# Default: 'off'
# Values: 'on', 'off'
# Flag: --gtk_shorthand
#
# Example:
# on: 'Numix, Adwaita'
# off: 'Numix [GTK2], Adwaita [GTK3]'
gtk_shorthand="off"
# Enable/Disable gtk2 Theme / Icons / Font
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --gtk2
#
# Example:
# on: 'Numix [GTK2], Adwaita [GTK3]'
# off: 'Adwaita [GTK3]'
gtk2="on"
# Enable/Disable gtk3 Theme / Icons / Font
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --gtk3
#
# Example:
# on: 'Numix [GTK2], Adwaita [GTK3]'
# off: 'Numix [GTK2]'
gtk3="on"
# IP Address
# Website to ping for the public IP
#
# Default: 'http://ident.me'
# Values: 'url'
# Flag: --ip_host
public_ip_host="http://ident.me"
# Public IP timeout.
#
# Default: '2'
# Values: 'int'
# Flag: --ip_timeout
public_ip_timeout=2
# Disk
# Which disks to display.
# The values can be any /dev/sdXX, mount point or directory.
# NOTE: By default we only show the disk info for '/'.
#
# Default: '/'
# Values: '/', '/dev/sdXX', '/path/to/drive'.
# Flag: --disk_show
#
# Example:
# disk_show=('/' '/dev/sdb1'):
# 'Disk (/): 74G / 118G (66%)'
# 'Disk (/mnt/Videos): 823G / 893G (93%)'
#
# disk_show=('/'):
# 'Disk (/): 74G / 118G (66%)'
#
disk_show=('/')
# Disk subtitle.
# What to append to the Disk subtitle.
#
# Default: 'mount'
# Values: 'mount', 'name', 'dir'
# Flag: --disk_subtitle
#
# Example:
# name: 'Disk (/dev/sda1): 74G / 118G (66%)'
# 'Disk (/dev/sdb2): 74G / 118G (66%)'
#
# mount: 'Disk (/): 74G / 118G (66%)'
# 'Disk (/mnt/Local Disk): 74G / 118G (66%)'
# 'Disk (/mnt/Videos): 74G / 118G (66%)'
#
# dir: 'Disk (/): 74G / 118G (66%)'
# 'Disk (Local Disk): 74G / 118G (66%)'
# 'Disk (Videos): 74G / 118G (66%)'
disk_subtitle="dir"
# Song
# Manually specify a music player.
#
# Default: 'auto'
# Values: 'auto', 'player-name'
# Flag: --music_player
#
# Available values for 'player-name':
#
# amarok
# audacious
# banshee
# bluemindo
# clementine
# cmus
# deadbeef
# deepin-music
# dragon
# elisa
# exaile
# gnome-music
# gmusicbrowser
# guayadeque
# iTunes
# juk
# lollypop
# mocp
# mopidy
# mpd
# netease-cloud-music
# pogo
# pragha
# qmmp
# quodlibet
# rhythmbox
# sayonara
# smplayer
# spotify
# tomahawk
# vlc
# xmms2d
# yarock
music_player="auto"
# Format to display song information.
#
# Default: '%artist% - %album% - %title%'
# Values: '%artist%', '%album%', '%title%'
# Flag: --song_format
#
# Example:
# default: 'Song: Jet - Get Born - Sgt Major'
song_format="%artist% - %album% - %title%"
# Print the Artist, Album and Title on separate lines
#
# Default: 'off'
# Values: 'on', 'off'
# Flag: --song_shorthand
#
# Example:
# on: 'Artist: The Fratellis'
# 'Album: Costello Music'
# 'Song: Chelsea Dagger'
#
# off: 'Song: The Fratellis - Costello Music - Chelsea Dagger'
song_shorthand="off"
# 'mpc' arguments (specify a host, password etc).
#
# Default: ''
# Example: mpc_args=(-h HOST -P PASSWORD)
mpc_args=()
# Text Colors
# Text Colors
#
# Default: 'distro'
# Values: 'distro', 'num' 'num' 'num' 'num' 'num' 'num'
# Flag: --colors
#
# Each number represents a different part of the text in
# this order: 'title', '@', 'underline', 'subtitle', 'colon', 'info'
#
# Example:
# colors=(distro) - Text is colored based on Distro colors.
# colors=(4 6 1 8 8 6) - Text is colored in the order above.
colors=(distro)
# Text Options
# Toggle bold text
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --bold
bold="on"
# Enable/Disable Underline
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --underline
underline_enabled="on"
# Underline character
#
# Default: '-'
# Values: 'string'
# Flag: --underline_char
underline_char="-"
# Info Separator
# Replace the default separator with the specified string.
#
# Default: ':'
# Flag: --separator
#
# Example:
# separator="->": 'Shell-> bash'
# separator=" =": 'WM = dwm'
separator=" ➜"
# Color Blocks
# Color block range
# The range of colors to print.
#
# Default: '0', '7'
# Values: 'num'
# Flag: --block_range
#
# Example:
#
# Display colors 0-7 in the blocks. (8 colors)
# neofetch --block_range 0 7
#
# Display colors 0-15 in the blocks. (16 colors)
# neofetch --block_range 0 15
block_range=(0 7)
# Toggle color blocks
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --color_blocks
color_blocks="off"
# Color block width in spaces
#
# Default: '3'
# Values: 'num'
# Flag: --block_width
block_width=3
# Color block height in lines
#
# Default: '1'
# Values: 'num'
# Flag: --block_height
block_height=1
# Progress Bars
# Bar characters
#
# Default: '-', '='
# Values: 'string', 'string'
# Flag: --bar_char
#
# Example:
# neofetch --bar_char 'elapsed' 'total'
# neofetch --bar_char '-' '='
bar_char_elapsed="-"
bar_char_total="="
# Toggle Bar border
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --bar_border
bar_border="on"
# Progress bar length in spaces
# Number of chars long to make the progress bars.
#
# Default: '15'
# Values: 'num'
# Flag: --bar_length
bar_length=15
# Progress bar colors
# When set to distro, uses your distro's logo colors.
#
# Default: 'distro', 'distro'
# Values: 'distro', 'num'
# Flag: --bar_colors
#
# Example:
# neofetch --bar_colors 3 4
# neofetch --bar_colors distro 5
bar_color_elapsed="distro"
bar_color_total="distro"
# Info display
# Display a bar with the info.
#
# Default: 'off'
# Values: 'bar', 'infobar', 'barinfo', 'off'
# Flags: --cpu_display
# --memory_display
# --battery_display
# --disk_display
#
# Example:
# bar: '[---=======]'
# infobar: 'info [---=======]'
# barinfo: '[---=======] info'
# off: 'info'
cpu_display="off"
memory_display="info"
battery_display="bar"
disk_display="bar"
# Backend Settings
# Image backend.
#
# Default: 'ascii'
# Values: 'ascii', 'caca', 'chafa', 'jp2a', 'iterm2', 'off',
# 'termpix', 'pixterm', 'tycat', 'w3m', 'kitty'
# Flag: --backend
image_backend="kitty"
# Image Source
#
# Which image or ascii file to display.
#
# Default: 'auto'
# Values: 'auto', 'ascii', 'wallpaper', '/path/to/img', '/path/to/ascii', '/path/to/dir/'
# 'command output (neofetch --ascii "$(fortune | cowsay -W 30)")'
# Flag: --source
#
# NOTE: 'auto' will pick the best image source for whatever image backend is used.
# In ascii mode, distro ascii art will be used and in an image mode, your
# wallpaper will be used.
image_source="/home/talljoe/.config/neofetch/nix-snowflake.png"
# Ascii Options
# Ascii distro
# Which distro's ascii art to display.
#
# Default: 'auto'
# Values: 'auto', 'distro_name'
# Flag: --ascii_distro
#
# NOTE: Arch and Ubuntu have 'old' logo variants.
# Change this to 'arch_old' or 'ubuntu_old' to use the old logos.
# NOTE: Ubuntu has flavor variants.
# Change this to 'Lubuntu', 'Xubuntu', 'Ubuntu-GNOME' or 'Ubuntu-Budgie' to use the flavors.
# NOTE: Arch, Crux and Gentoo have a smaller logo variant.
# Change this to 'arch_small', 'crux_small' or 'gentoo_small' to use the small logos.
ascii_distro="auto"
# Ascii Colors
#
# Default: 'distro'
# Values: 'distro', 'num' 'num' 'num' 'num' 'num' 'num'
# Flag: --ascii_colors
#
# Example:
# ascii_colors=(distro) - Ascii is colored based on Distro colors.
# ascii_colors=(4 6 1 8 8 6) - Ascii is colored using these colors.
ascii_colors=(distro)
# Bold ascii logo
# Whether or not to bold the ascii logo.
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --ascii_bold
ascii_bold="on"
# Image Options
# Image loop
# Setting this to on will make neofetch redraw the image constantly until
# Ctrl+C is pressed. This fixes display issues in some terminal emulators.
#
# Default: 'off'
# Values: 'on', 'off'
# Flag: --loop
image_loop="off"
# Thumbnail directory
#
# Default: '~/.cache/thumbnails/neofetch'
# Values: 'dir'
thumbnail_dir="${XDG_CACHE_HOME:-${HOME}/.cache}/thumbnails/neofetch"
# Crop mode
#
# Default: 'normal'
# Values: 'normal', 'fit', 'fill'
# Flag: --crop_mode
#
# See this wiki page to learn about the fit and fill options.
# https://github.com/dylanaraps/neofetch/wiki/What-is-Waifu-Crop%3F
crop_mode="normal"
# Crop offset
# Note: Only affects 'normal' crop mode.
#
# Default: 'center'
# Values: 'northwest', 'north', 'northeast', 'west', 'center'
# 'east', 'southwest', 'south', 'southeast'
# Flag: --crop_offset
crop_offset="center"
# Image size
# The image is half the terminal width by default.
#
# Default: 'auto'
# Values: 'auto', '00px', '00%', 'none'
# Flags: --image_size
# --size
image_size="auto"
# Gap between image and text
#
# Default: '3'
# Values: 'num', '-num'
# Flag: --gap
gap=3
# Image offsets
# Only works with the w3m backend.
#
# Default: '0'
# Values: 'px'
# Flags: --xoffset
# --yoffset
yoffset=0
xoffset=0
# Image background color
# Only works with the w3m backend.
#
# Default: ''
# Values: 'color', 'blue'
# Flag: --bg_color
background_color=
# Misc Options
# Stdout mode
# Turn off all colors and disables image backend (ASCII/Image).
# Useful for piping into another command.
# Default: 'off'
# Values: 'on', 'off'
stdout="off"

208
.config/sway/config Normal file
View File

@ -0,0 +1,208 @@
# Default config for sway
#
# Copy this to ~/.config/sway/config and edit it to your liking.
#
# Read `man 5 sway` for a complete reference.
#default_border none
for_window [title="^.*"] title_format ""
#default_border normal 1
#default_floating_border normal 0
default_border pixel
default_floating_border pixel
### Variables
#
# Logo key. Use Mod1 for Alt.
set $mod Mod4
# Home row direction keys, like vim
set $left h
set $down j
set $up k
set $right l
# Your preferred terminal emulator
set $term foot
# Your preferred application launcher
# Note: pass the final command to swaymsg so that the resulting window can be opened
# on the original workspace that the command was run on.
set $menu dmenu_path | dmenu | xargs swaymsg exec --
set $rofi rofi -show run
### Output configuration
#
# Default wallpaper (more resolutions are available in /usr/share/backgrounds/sway/)
output * bg /home/loftur/Downloads/void.png fill
#
# Example configuration:
#
# output HDMI-A-1 resolution 1920x1080 position 1920,0
#
# You can get the names of your outputs by running: swaymsg -t get_outputs
### Idle configuration
#
# Example configuration:
#
# exec swayidle -w \
# timeout 300 'swaylock -f -c 000000' \
# timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \
# before-sleep 'swaylock -f -c 000000'
#
# This will lock your screen after 300 seconds of inactivity, then turn off
# your displays after another 300 seconds, and turn your screens back on when
# resumed. It will also lock your screen before your computer goes to sleep.
### Input configuration
#
# Example configuration:
#
# input "2:14:SynPS/2_Synaptics_TouchPad" {
# dwt enabled
# tap enabled
# natural_scroll enabled
# middle_emulation enabled
# }
#
# 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.
### Key bindings
#
# Basics:
#
# Start a terminal
bindsym $mod+Return exec $term
# Kill focused window
bindsym $mod+Shift+q kill
# Start your launcher
bindsym $mod+d exec $rofi
# Drag floating windows by holding down $mod and left mouse button.
# Resize them with right mouse button + $mod.
# Despite the name, also works for non-floating windows.
# Change normal to inverse to use left mouse button for resizing and right
# mouse button for dragging.
floating_modifier $mod normal
# Reload the configuration file
bindsym $mod+Shift+c 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'
#Moving around:#
# Move your focus around
bindsym $mod+$left focus left
bindsym $mod+$down focus down
bindsym $mod+$up focus up
bindsym $mod+$right focus right
# Or use $mod+[up|down|left|right]
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# Move the focused window with the same, but add Shift
bindsym $mod+Shift+$left move left
bindsym $mod+Shift+$down move down
bindsym $mod+Shift+$up move up
bindsym $mod+Shift+$right move right
# Ditto, with arrow 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
#
# Workspaces:
#
# Switch to workspace
bindsym $mod+1 workspace number 1
bindsym $mod+2 workspace number 2
bindsym $mod+3 workspace number 3
bindsym $mod+4 workspace number 4
bindsym $mod+5 workspace number 5
bindsym $mod+6 workspace number 6
bindsym $mod+7 workspace number 7
bindsym $mod+8 workspace number 8
bindsym $mod+9 workspace number 9
bindsym $mod+0 workspace number 10
# Move focused container to workspace
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
# Note: workspaces can have any name you want, not just numbers.
# We just use 1-10 as the default.
#
# Layout stuff:
#
# You can "split" the current object of your focus with
# $mod+b or $mod+v, for horizontal and vertical splits
# respectively.
bindsym $mod+b splith
bindsym $mod+v splitv
# Switch the current container between different layout styles
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
# Make the current focus fullscreen
bindsym $mod+f fullscreen
# Toggle the current focus between tiling and floating mode
bindsym $mod+Shift+space floating toggle
# Swap focus between the tiling area and the floating area
bindsym $mod+space focus mode_toggle
# Move focus to the parent container
bindsym $mod+a focus parent
#
# Scratchpad:
#
# Sway has a "scratchpad", which is a bag of holding for windows.
# You can send windows there and get them back later.
# Move the currently focused window to the scratchpad
bindsym $mod+Shift+minus move scratchpad
# Show the next scratchpad window or hide the focused scratchpad window.
# If there are multiple scratchpad windows, this command cycles through them.
bindsym $mod+minus scratchpad show
#
# Resizing containers:
#
mode "resize" {
# left will shrink the containers width
# right will grow the containers width
# up will shrink the containers height
# down will grow the containers height
bindsym $left resize shrink width 10px
bindsym $down resize grow height 10px
bindsym $up resize shrink height 10px
bindsym $right resize grow width 10px
# Ditto, with arrow keys
bindsym Left resize shrink width 10px
bindsym Down resize grow height 10px
bindsym Up resize shrink height 10px
bindsym Right resize grow width 10px
# Return to default mode
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"
bar {
swaybar_command waybar
workspace_buttons yes
}

147
.config/waybar/config Normal file
View File

@ -0,0 +1,147 @@
// vim:ft=json
{
"layer": "top",
"height": 22,
"position": "top",
// Choose the order of the modules
"modules-left": ["sway/workspaces", "sway/mode"],
"modules-center": ["sway/window"],
"modules-right": ["idle_inhibitor", "temperature", "cpu", "memory","custom/alsa", "network", "battery", "clock", "tray"],
// Modules configuration
"sway/workspaces": {
"disable-scroll": true,
"all-outputs": false,
"format": "{icon}",
"format-icons": {
"1": "",
"2": "",
"3": "",
"4": "",
"5": "",
}
},
"sway/mode": {
"format": " {}",
"max-length": 20
},
"tray": {
// "icon-size": 21,
"spacing": 10
},
"clock": {
"interval": 30,
"format": "{:%a %d %b %H:%M} ",
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>"
},
"cpu": {
"interval": 5,
"format": " {usage}%",
"states": {
"good": 10,
"warning": 40,
"critical": 90
}
},
"memory": {
"interval": 30,
"format": " {}%",
"states": {
"good": 50,
"warning": 70,
"critical": 80
}
},
"battery": {
"format": "{icon} {capacity}%",
"format-icons": ["", "", "", "", ""],
"format-charging": " {capacity}%",
// If battery is in the full state (from full until next state value)
// hide it.
"format-full": "",
"format-charging-full": "",
"interval": 60,
"states": {
"full": 100,
"good": 95,
"warning": 20,
"critical": 5
}
},
"network": {
"interval": 60,
"format": "Unknown",
"format-wifi": "{icon} ({signalStrength}%)",
"format-ethernet": "{icon}",
"format-disconnected": "{icon}",
"format-alt": "{ipaddr}/{cidr} {icon}",
"format-icons": {
"wifi": [""],
"ethernet": [""],
"disconnected": ["睊"]
},
"max-length": 20,
"format-alt-click": "click-left",
"tooltip": true,
"tooltip-format-wifi": "{essid}||{signaldBm}dB||{frequency}MHz\n{ipaddr}/{cidr}\n{bandwidthUpBits}/{bandwidthDownBits}",
"tooltip-format-ethernet": "{ipaddr}/{cidr}\n{bandwidthUpBits}/{bandwidthDownBits}",
"tooltip-format": ""
},
"pulseaudio": {
"scroll-step": 2,
"format": "{icon} {volume}%",
"format-bluetooth": "{icon}{volume}%",
"format-muted": "",
"format-icons": {
"headphones": "",
"handsfree": "",
"headset": "",
"phone": [""],
"portable": "",
"car": "",
"default": ["", "", ""]
},
"on-click": "pactl set-sink-mute @DEFAULT_SINK@ toggle",
"on-click-right": "pavucontrol",
"tooltip": false
},
"temperature": {
"interval": 5,
"critical-threshold": 80,
"format-critical": " {temperatureC}°C",
"format": " {temperatureC}°C"
},
"custom/weather": {
"exec": "~/.config/waybar/weather.sh",
"format": "{}",
"return-type": "json",
"interval": 600
},
"custom/alsa": {
"exec": "amixer get Master | sed -nre 's/.*\\[off\\].*/ muted/p; s/.*\\[(.*%)\\].*/ \\1/p'",
"on-click": "amixer set Master toggle; pkill -x -RTMIN+11 waybar",
"on-scroll-up": "amixer set Master 1+; pkill -x -RTMIN+11 waybar",
"on-scroll-down": "amixer set Master 1-; pkill -x -RTMIN+11 waybar",
"signal": 11,
"interval": 10,
"tooltip": false
},
"custom/power": {
"format": "⏻",
"on-click": "nwgbar -o 0.2",
"escape": true,
"tooltip": false
},
"idle_inhibitor": {
"format": "{icon}",
"format-icons": {
"activated": "",
"deactivated": ""
}
}
}

View File

@ -0,0 +1,19 @@
@define-color background #282828;
@define-color foreground #d5c4a1;
@define-color cursor #d5c4a1;
@define-color color0 #282828;
@define-color color1 #fb4934;
@define-color color2 #b8bb26;
@define-color color3 #fabd2f;
@define-color color4 #83a598;
@define-color color5 #d3869b;
@define-color color6 #8ec07c;
@define-color color7 #d5c4a1;
@define-color color8 #665c54;
@define-color color9 #fb4934;
@define-color color10 #b8bb26;
@define-color color11 #fabd2f;
@define-color color12 #83a598;
@define-color color13 #d3869b;
@define-color color14 #8ec07c;
@define-color color15 #fbf1c7;

149
.config/waybar/style.css Normal file
View File

@ -0,0 +1,149 @@
@import "./gruvbox.css";
* {
background-color: @background;
color: @foreground;
border: none;
border-radius: 0;
font-family: Hack Nerd Font;
font-size: 14px;
min-height: 0;
}
/* Dont forget commas after each module! */
#clock,
#battery,
#cpu,
#memory,
#network,
#pulseaudio,
#tray,
#backlight,
#temperature,
#custom-media,
#custom-pacman,
#custom-redshift,
#custom-btheadphones,
#idle_inhibitor
{
background-color: @background;
padding: 0 5px;
margin: 0 2px;
color: @foreground;
}
/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */
#workspaces button:hover {
background: @background;
box-shadow: inherit;
border-bottom: 1px solid #ffffff;
}
#workspaces button {
padding: 0 5px;
color: @foreground;
}
#workspaces button.focused {
color: @color3;
border-bottom: 1px solid @color3;
}
#mode {
color: @color9;
}
@keyframes blink {
to {
color: black;
}
}
#battery.warning:not(.charging) {
color: @color3;
}
#battery.critical:not(.charging) {
color: @color1;
}
#battery.charging{
color: @color2;
}
#cpu {
color: @foreground;
}
#cpu.warning{
color: @color3;
}
#cpu.critical{
color: @color1;
}
#temperature {
color: @foreground;
}
#temperature.critical{
color: @color1;
}
#memory {
color: @foreground;
}
#memory.warning {
color: @color3;
}
#memory.critical {
color: @color1;
}
#network {
color: @foreground;
}
#idle_inhibitor.activated {
color: @color3;
}
#pulseaudio {
color: @foreground;
}
#custom-media.custom-spotify {
color: @color2;
}
#custom-btheadphones.bat-good {
color: @color2;
}
#custom-btheadphones.bat-warning {
color: @color3;
}
#custom-btheadphones.bat-critical {
color: @color1;
}
#custom-btheadphones.bat-unknown {
color: @color6;
}
#custom-btheadphones.blocked {
color: @color1;
}
/*
* Available but unset
#custom-btheadphones.disconnected {
}
*/
/* IDEA: Instead of using a separate icon,
* use same as for backlight control and make it change
* the color based on this class.
* Not clear how to do this in css,
*/
#custom-redshift.active{
color: @color3;
}

199
.config/waybar/test/config Normal file
View File

@ -0,0 +1,199 @@
// vim:ft=json
{
"layer": "top",
"height": 22,
"position": "top",
// Choose the order of the modules
"modules-left": ["sway/workspaces", "sway/mode"],
"modules-center": ["idle_inhibitor", "custom/pacman", "temperature", "cpu", "memory","pulseaudio", "network", "battery", "backlight", "custom/redshift", "custom/btheadphones"],
"modules-right": ["custom/media", "clock", "tray"],
// Modules configuration
"sway/workspaces": {
"disable-scroll": true,
"all-outputs": false,
"format": "{icon}",
"format-icons": {
"1": "",
"2": "",
"3": ""
}
},
"sway/mode": {
"format": " {}",
"max-length": 20
},
"tray": {
// "icon-size": 21,
"spacing": 10
},
"clock": {
"interval": 30,
"format": "{:%a %d %b %H:%M} ",
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>"
},
"cpu": {
"interval": 5,
"format": " {usage}%",
"states": {
"good": 10,
"warning": 40,
"critical": 90
}
},
"memory": {
"interval": 30,
"format": " {}%",
"states": {
"good": 50,
"warning": 70,
"critical": 80
}
},
"battery": {
"format": "{icon} {capacity}%",
"format-icons": ["", "", "", "", ""],
"format-charging": "{capacity}%",
// If battery is in the full state (from full until next state value)
// hide it.
"format-full": "",
"format-charging-full": "",
"interval": 60,
"states": {
"full": 100,
"good": 95,
"warning": 20,
"critical": 5
}
},
"network": {
"interval": 60,
"format": "Unknown",
"format-wifi": "{icon} ({signalStrength}%)",
"format-ethernet": "{icon}",
"format-disconnected": "{icon}",
"format-alt": "{ipaddr}/{cidr} {icon}",
"format-icons": {
"wifi": [""],
"ethernet": [""],
"disconnected": ["睊"]
},
"max-length": 20,
"format-alt-click": "click-left",
"tooltip": true,
"tooltip-format-wifi": "{essid}||{signaldBm}dB||{frequency}MHz\n{ipaddr}/{cidr}\n{bandwidthUpBits}/{bandwidthDownBits}",
"tooltip-format-ethernet": "{ipaddr}/{cidr}\n{bandwidthUpBits}/{bandwidthDownBits}",
"tooltip-format": ""
},
"pulseaudio": {
"scroll-step": 2,
"format": "{icon} {volume}%",
"format-bluetooth": "{icon}{volume}%",
"format-muted": "",
"format-icons": {
"headphones": "",
"handsfree": "",
"headset": "",
"phone": [""],
"portable": "",
"car": "",
"default": ["", "", ""]
},
"on-click": "pactl set-sink-mute @DEFAULT_SINK@ toggle",
"on-click-right": "pavucontrol",
"tooltip": false
},
"backlight": {
"format-icons": ["🌑","🌒","🌓","🌔","🌕"],
"device": "intel_backlight",
"format": "{icon}",
"interval": 5,
"format-alt": "{icon}{percent}%",
"format-alt-click": "click-right",
"on-scroll-up": "light -A 5",
"on-scroll-down": "light -U 5"
},
"temperature": {
"interval": 5,
"critical-threshold": 80,
"format-critical": " {temperatureC}°C",
"format": " {temperatureC}°C"
},
"custom/weather": {
"exec": "~/.config/waybar/weather.sh",
"format": "{}",
"return-type": "json",
"interval": 600
},
"custom/power": {
"format": "⏻",
"on-click": "nwgbar -o 0.2",
"escape": true,
"tooltip": false
},
"custom/media": {
"format": "{icon} {}",
"return-type": "json",
"max-length": 40,
"format-icons": {
"spotify": "",
"default": "🎜"
},
"escape": true,
"exec": "$HOME/.config/waybar/scripts/mediaplayer.py --player spotify 2> /dev/null",
"on-click": "playerctl play-pause",
"tooltip": false
},
"custom/pacman": {
"format": "{icon}{}",
"return-type": "json",
"interval": 3600,
"exec": "$HOME/.config/waybar/scripts/pacupdates.sh",
"exec-if": "ping -c 1 8.8.8.8",
"tooltip": true,
"exec-on-event":true,
"format-icons": {
"pending updates": " ",
"updated": ""
}
},
"custom/redshift": {
"format": "{icon}",
"return-type": "json",
"exec": "$HOME/bin/launch_redshift.sh status",
"signal": 8,
"on-click": "launch_redshift.sh toggle && pkill -RTMIN+8 waybar",
"format-icons": {
"active": "",
"inactive": ""
},
"tooltip": false
},
"custom/btheadphones": {
"format": "{}",
"return-type": "json",
"max-length": 40,
// Icons currently not used since colors are better
"format-icons": [
"",
"",
"",
"",
""
],
"escape": true,
"exec": "$HOME/scripts/bt_headphones.py 00:1B:66:C1:83:4A --listen -vvv",
"on-click": "$HOME/scripts/bt_headphones.py 00:1B:66:C1:83:4A --toggle",
"on-click-right": "$HOME/scripts/bt_headphones.py 00:1B:66:C1:83:4A --power-off",
"tooltip": true
},
"idle_inhibitor": {
"format": "{icon}",
"format-icons": {
"activated": "",
"deactivated": ""
}
}
}

View File

@ -0,0 +1,19 @@
@define-color background #282828;
@define-color foreground #d5c4a1;
@define-color cursor #d5c4a1;
@define-color color0 #282828;
@define-color color1 #fb4934;
@define-color color2 #b8bb26;
@define-color color3 #fabd2f;
@define-color color4 #83a598;
@define-color color5 #d3869b;
@define-color color6 #8ec07c;
@define-color color7 #d5c4a1;
@define-color color8 #665c54;
@define-color color9 #fb4934;
@define-color color10 #b8bb26;
@define-color color11 #fabd2f;
@define-color color12 #83a598;
@define-color color13 #d3869b;
@define-color color14 #8ec07c;
@define-color color15 #fbf1c7;

View File

@ -0,0 +1,149 @@
@import "./gruvbox.css";
* {
background-color: @background;
color: @foreground;
border: none;
border-radius: 0;
font-family: Hack Nerd Font;
font-size: 14px;
min-height: 0;
}
/* Dont forget commas after each module! */
#clock,
#battery,
#cpu,
#memory,
#network,
#pulseaudio,
#tray,
#backlight,
#temperature,
#custom-media,
#custom-pacman,
#custom-redshift,
#custom-btheadphones,
#idle_inhibitor
{
background-color: @background;
padding: 0 5px;
margin: 0 2px;
color: @foreground;
}
/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */
#workspaces button:hover {
background: @background;
box-shadow: inherit;
border-bottom: 1px solid #ffffff;
}
#workspaces button {
padding: 0 5px;
color: @foreground;
}
#workspaces button.focused {
color: @color3;
border-bottom: 1px solid @color3;
}
#mode {
color: @color9;
}
@keyframes blink {
to {
color: black;
}
}
#battery.warning:not(.charging) {
color: @color3;
}
#battery.critical:not(.charging) {
color: @color1;
}
#battery.charging{
color: @color2;
}
#cpu {
color: @foreground;
}
#cpu.warning{
color: @color3;
}
#cpu.critical{
color: @color1;
}
#temperature {
color: @foreground;
}
#temperature.critical{
color: @color1;
}
#memory {
color: @foreground;
}
#memory.warning {
color: @color3;
}
#memory.critical {
color: @color1;
}
#network {
color: @foreground;
}
#idle_inhibitor.activated {
color: @color3;
}
#pulseaudio {
color: @foreground;
}
#custom-media.custom-spotify {
color: @color2;
}
#custom-btheadphones.bat-good {
color: @color2;
}
#custom-btheadphones.bat-warning {
color: @color3;
}
#custom-btheadphones.bat-critical {
color: @color1;
}
#custom-btheadphones.bat-unknown {
color: @color6;
}
#custom-btheadphones.blocked {
color: @color1;
}
/*
* Available but unset
#custom-btheadphones.disconnected {
}
*/
/* IDEA: Instead of using a separate icon,
* use same as for backlight control and make it change
* the color based on this class.
* Not clear how to do this in css,
*/
#custom-redshift.active{
color: @color3;
}

29
.mkshrc Normal file
View File

@ -0,0 +1,29 @@
# Alias
[ -r ~/.aliases ] && . ~/.aliases
# Historial
export HISTFILE=$HOME/.mksh_history # Ubicación historial shell mksh
export HISTSIZE=4096 # Tamaño historial shell mksh
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls -CF --color=auto'
alias dir='dir --color=auto'
alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
# Prompt
PS1=$'\1\r $(if [ $USER = "root" ]; then print "\1\e[31;1m\1""#"; else print "\1\e[37;1m\1""$"; fi)\1\e[0m\1 \1\e[30;1m\1$(if [ $PWD = "$HOME" ]; then print "~"; else print ${PWD##*/}; fi)\1\e[0m\1 '
export XDG_RUNTIME_DIR="/tmp"

50
.profile Normal file
View File

@ -0,0 +1,50 @@
##!/bin/sh
# Si no se ejecuta de forma interactiva, no haga nada
case $- in
*i*) ;;
*) return;;
esac
set -o allexport
PAGER="less" # Paginador predeterminado
EDITOR="nvim" # Editor de texto predeterminado
TERM="st" # Emulador de consola predeterminado
VISUAL="$EDITOR" # Igual valor que EDITOR
BROWSER="firefox-bin" # Navegador web predeterminado
READER="zathura" # Lector de documentos predeterminado
IMAGEVIEWER="imv" # Visor de imanenes predeterminado
FILE="nnn" # Gestor de archivos
PATH="/home/loftur/.local/bin:$PATH"
#Variables de entorno para NNN
NNN_OPENER="xdg-open"
NNN_FALLBACK_OPENER="xdg-open" # Apertura de archivos
NNN_OPTS="dU" # Parámetros para ejecutar NNN
NNN_PLUG="n:nuke;p:preview-tabbed;m:nmount;i:imgview;a:mtpmount" # Plugins
NNN_USE_EDITOR=1 # Usar el $EDITOR para abrir archivos de texto
NNN_TRASH=1 # Mover archivos a papelera en lugar de eliminar definitivamente
NNN_READER="zathura" # Lector de documentos predeterminado
NNN_FIFO=/tmp/nnn.fifo # Pluggin para vista previa
NNN_ARCHIVE="\\.(7z|a|ace|alz|arc|arj|bz|bz2|cab|cpio|deb|gz|jar|lha|lz|lzh|lzma|lzo|rar|rpm|rz|t7z|tar|tbz|tbz2|tgz|tlz|txz|tZ|tzo|war|xpi|xz|Z|zip)$"
#autologin on tty1
if [ -z "$DISPLAY" ] && [ "$(tty)" = "/dev/tty1" ]; then
exec startx
fi
# D-Bus session active
if which dbus-launch >/dev/null && test -z "$DBUS_SESSION_BUS_ADDRESS"; then
eval `dbus-launch --sh-syntax --exit-with-session`
fi
#autologin on tty1
if [ -z "$DISPLAY" ] && [ "$(tty)" = "/dev/tty1" ]; then
exec startx
fi
# D-Bus session active
if which dbus-launch >/dev/null && test -z "$DBUS_SESSION_BUS_ADDRESS"; then
eval `dbus-launch --sh-syntax --exit-with-session`
fi
. "$HOME/.cargo/env"

4
.xinitrc Normal file
View File

@ -0,0 +1,4 @@
#!/bin/sh
[ -f ~/.xprofile ] && . ~/.xprofile
[ -f ~/.Xresources ] && xrdb -merge ~/.Xresources
exec dwm

16
.xprofile Executable file
View File

@ -0,0 +1,16 @@
# Fondo de escritorio
feh --bg-scale ~/Downloads/void.png &
#Iniciar compositor
xcompmgr &
# Barra de estado
slstatus &
# Teclado numérico encendico
numlockx &
#inicializar fonts folder
#xset fp rehash &
#xset fp+ /home/loftur/.fonts &
#Battery daemon
#battery.sh &
source .fonts/i_linux.sh
# Teclado en ingles
setxkbmap en &

9
pkg_list.txt Normal file
View File

@ -0,0 +1,9 @@
AlsaMixer.app alsa-firmware alsa-plugins alsa-plugins-ffmpeg alsa-utils
autotiling base-system cava cmus cryptsetup dwm emptty exfat-utils
firefox font-awesome5 fuse-exfat git grub-i386-efi grub-x86_64-efi
herbe htop imv intel-video-accel libva-intel-driver light lvm2 mdadm
mesa-dri mesa-intel-dri mesa-vaapi mesa-vdpau mesa-vulkan-intel mksh
mpv neofetch neovim ngetty nnn ntfs-3g opendoas pam_rundir pcmanfm
pipe-viewer pkgconf pmount python3-pip qutebrowser rofi scrot seatd
slstatus st telegram-desktop telegram-tg void-docs-browse wpa_gui xclip
xdotool xf86-video-intel xorg-fonts xorg-minimal xtools

7
void-packages/etc/conf Normal file
View File

@ -0,0 +1,7 @@
XBPS_ALLOW_RESTRICTED=yes
XBPS_CHROOT_CMD=uchroot
XBPS_CFLAGS="-march=native -O2 -pipe"
XBPS_CXXFLAGS="${XBPS_CFLAGS}"
XBPS_LDFLAGS="${XBPS_CFLAGS}"
XBPS_MAKEJOBS=$(nproc)
XBPS_PKG_OPTIONS="alsa,vaapi,~vdpau,vulkan,~sndio,~jack,~libpulseaudio,~pulseaudio,~wayland"

View File

@ -0,0 +1,166 @@
/* See LICENSE file for copyright and license details. */
#include <X11/XF86keysym.h>
/* appearance */
static const unsigned int borderpx = 1; /* border pixel of windows */
static const unsigned int snap = 32; /* snap pixel */
static const int showbar = 1; /* 0 means no bar */
static const int topbar = 1; /* 0 means bottom bar */
static const char *fonts[] = { "Hack Nerd Font:Style=Regular:size=14:pixelsize=14" };
static const char dmenufont[] = "Hack Nerd Font:Style=Regular:size=12";
static const char col_gray1[] = "#222222";
static const char col_gray2[] = "#444444";
static const char col_gray3[] = "#bbbbbb";
static const char col_gray4[] = "#eeeeee";
static const char col_cyan[] = "#005577";
static const char col_black[] = "#000000";
static const char col_red[] = "#ff0000";
static const char col_yellow[] = "#ffff00";
static const char col_white[] = "#ffffff";
/* my colors*/
static const char col_1[] = "#181c24";
static const char col_2[] = "#000000";
static const char col_3[] = "#d7d7d7";
static const char col_4[] = "#5E8485";
static const char *colors[][3] = {
/* fg bg border */
[SchemeNorm] = { col_3, col_1, col_1 },
[SchemeSel] = { col_3, col_2, col_3 },
};
/* tagging */
static const char *tags[] = { "1:", "2:", "3:", "4:", "5:","6:","7:","8:", "9:" };
static const Rule rules[] = {
/* xprop(1):
* WM_CLASS(STRING) = instance, class
* WM_NAME(STRING) = title
*/
/* class instance title tags mask isfloating monitor */
{ "Gimp", NULL, NULL, 0, 1, -1 },
/* { "Firefox", NULL, NULL, 1 << 8, 0, -1 },*/
{ "firefox", NULL, NULL, 1 << 3, 0, -1 },
{ "TelegramDesktop", NULL, NULL, 1 << 4, 0, -1 },
};
/* layout(s) */
static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
static const int nmaster = 1; /* number of clients in master area */
/*static const int resizehints = 1; */ /* 1 means respect size hints in tiled resizals */
static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
static const int resizehints = 0; /* 1 means respect size hints in tiled resizals */
static const Layout layouts[] = {
/* symbol arrange function */
{ "[]=", tile }, /* first entry is default */
{ "><>", NULL }, /* no layout function means floating behavior */
{ "[M]", monocle },
};
/* key definitions */
#define MODKEY Mod4Mask
#define TAGKEYS(KEY,TAG) \
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \
{ MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
{ MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
{ MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
/* helper for spawning shell commands in the pre dwm-5.0 fashion */
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
/* commands */
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
static const char *roficmd[] = { "rofi", "-show", "run", NULL };
static const char *termcmd[] = { "st", NULL };
static const char *mutevol[] = { "amixer", "set", "Master", "toggle", NULL };
static const char *downvol[] = { "amixer", "-q","sset","Master","5%-", NULL };
static const char *upvol[] = { "amixer", "-q","sset","Master","3%+", NULL };
static const char *dmenurecord[] = { "/home/loftur/.local/bin/grabar.sh", NULL };
static const char *dmenuapagar[] = { "/home/loftur/.local/bin/sesion.sh", NULL };
static const char *nnncmd[] = { "st","-t", "nnn - Gestor de archivos", "-e", "nnn","-dU", NULL };
static const char *downbright[] = { "xbacklight", "-dec","10", NULL };
static const char *upbright[] = { "xbacklight", "-inc","10", NULL };
static Key keys[] = {
/* modifier key function argument */
{ MODKEY, XK_d, spawn, {.v = roficmd } },
{ MODKEY, XK_Return, spawn, {.v = termcmd } },
{ MODKEY, XK_b, togglebar, {0} },
{ MODKEY|ShiftMask, XK_j, rotatestack, {.i = +1 } },
{ MODKEY|ShiftMask, XK_k, rotatestack, {.i = -1 } },
{ MODKEY, XK_j, focusstack, {.i = +1 } },
{ MODKEY, XK_k, focusstack, {.i = -1 } },
{ MODKEY, XK_i, incnmaster, {.i = +1 } },
{ MODKEY|ShiftMask, XK_i, incnmaster, {.i = -1 } },
{ MODKEY, XK_h, setmfact, {.f = -0.05} },
{ MODKEY, XK_l, setmfact, {.f = +0.05} },
{ MODKEY|ShiftMask, XK_Return, zoom, {0} },
{ MODKEY, XK_Tab, view, {0} },
{ MODKEY|ShiftMask, XK_q, killclient, {0} },
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
{ MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
{ MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
{ MODKEY|ShiftMask, XK_f, fullscreen, {0} },
{ MODKEY, XK_space, setlayout, {0} },
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
{ MODKEY, XK_0, view, {.ui = ~0 } },
{ MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
{ MODKEY, XK_comma, focusmon, {.i = -1 } },
{ MODKEY, XK_period, focusmon, {.i = +1 } },
{ MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
{ MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
TAGKEYS( XK_1, 0)
TAGKEYS( XK_2, 1)
TAGKEYS( XK_3, 2)
TAGKEYS( XK_4, 3)
TAGKEYS( XK_5, 4)
TAGKEYS( XK_6, 5)
TAGKEYS( XK_7, 6)
TAGKEYS( XK_8, 7)
TAGKEYS( XK_9, 8)
{ MODKEY|ShiftMask, XK_e, quit, {0} },
/* Comandos personalizados */
{ MODKEY, XK_n, spawn, {.v = nnncmd } },
{ MODKEY, XK_r, spawn, {.v = dmenurecord } },
{ MODKEY, XK_s, spawn, {.v = dmenuapagar } },
/* Atajos Multimedia */
{ 0, XF86XK_AudioLowerVolume, spawn, {.v = downvol } },
{ 0, XF86XK_AudioRaiseVolume, spawn, {.v = upvol } },
{ 0, XF86XK_AudioMute, spawn, {.v = mutevol } },
{ 0, XF86XK_MonBrightnessUp, spawn, {.v = upbright } },
{ 0, XF86XK_MonBrightnessDown, spawn, {.v = downbright } },
/* Modos de captura de pantalla */
{ 0, XK_Print, spawn, SHCMD("scrot /tmp/'%F_%T.png' -e 'xclip -selection c -t image/png < $f'; sleep 1; exec herbe 'Pantalla en portapapeles'") }, // Captura de pantalla al portapapeles
{ ControlMask, XK_Print, spawn, SHCMD("scrot -u /tmp/'%F_%T.png' -e 'xclip -selection c -t image/png < $f'; sleep 1; exec herbe 'Ventana en portapapeles'") }, // Ventana seleccionada al portapapeles
{ ShiftMask, XK_Print, spawn, SHCMD("sleep 1; scrot -s /tmp/'%F_%T.png' -e 'xclip -selection c -t image/png < $f'; sleep 1; exec herbe 'Área en portapapeles'") }, // Area seleccionada al portapapeles
{ MODKEY, XK_Print, spawn, SHCMD("scrot 'c_%F_%H%M%S_$wx$h.png' -e 'mv $f /home/loftur/Pictures/screenshots/'; sleep 1; exec herbe 'Pantalla en ~/Capturas'") },//Captura de pantalla
{ MODKEY|ControlMask, XK_Print, spawn, SHCMD("scrot -u 'v_%F_%H%M%S_$wx$h.png' -e 'mv $f /home/loftur/Pictures/screenshots/'; sleep 1; exec herbe 'Ventana en ~/Capturas'") } ,//Captura de ventana
{ MODKEY|ShiftMask, XK_Print, spawn, SHCMD("sleep 1; scrot -s 'a_%F_%H%M%S_$wx$h.png' -e 'mv $f /home/loftur/Pictures/screenshots/'; exec herbe 'Área en ~/Capturas'") },// Captura de Area
};
/* button definitions */
/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
static Button buttons[] = {
/* click event mask button function argument */
{ ClkTagBar, MODKEY, Button1, tag, {0} },
{ ClkTagBar, MODKEY, Button3, toggletag, {0} },
{ ClkWinTitle, 0, Button2, zoom, {0} },
{ ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
{ ClkClientWin, MODKEY, Button1, movemouse, {0} },
{ ClkClientWin, MODKEY, Button2, togglefloating, {0} },
{ ClkClientWin, MODKEY, Button3, resizemouse, {0} },
{ ClkTagBar, 0, Button1, view, {0} },
{ ClkTagBar, 0, Button3, toggleview, {0} },
{ ClkTagBar, MODKEY, Button1, tag, {0} },
{ ClkTagBar, MODKEY, Button3, toggletag, {0} },
};

View File

@ -0,0 +1,7 @@
[Desktop Entry]
Encoding=UTF-8
Name=Dwm
Comment=Dynamic window manager
Exec=dwm
Icon=dwm
Type=XSession

View File

@ -0,0 +1,12 @@
diff -up dwm/dwm.c dwmmod/dwm.c
--- dwm/dwm.c 2020-06-25 00:21:30.383692180 -0300
+++ dwmmod/dwm.c 2020-06-25 00:20:35.643692330 -0300
@@ -1057,6 +1057,8 @@ manage(Window w, XWindowAttributes *wa)
updatewindowtype(c);
updatesizehints(c);
updatewmhints(c);
+ c->x = c->mon->mx + (c->mon->mw - WIDTH(c)) / 2;
+ c->y = c->mon->my + (c->mon->mh - HEIGHT(c)) / 2;
XSelectInput(dpy, w, EnterWindowMask|FocusChangeMask|PropertyChangeMask|StructureNotifyMask);
grabbuttons(c, 0);
if (!c->isfloating)

View File

@ -0,0 +1,30 @@
From f035e1e5abb19df5dced9c592ca986deac460435 Mon Sep 17 00:00:00 2001
From: bastila <20937049+silentfault@users.noreply.github.com>
Date: Thu, 23 Jul 2020 02:45:12 +0300
Subject: [PATCH] Fix overflow when window name is bigger than window width
---
dwm.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/dwm.c b/dwm.c
index 9fd0286..42cb8dd 100644
--- a/dwm.c
+++ b/dwm.c
@@ -731,8 +731,12 @@ drawbar(Monitor *m)
if ((w = m->ww - tw - x) > bh) {
if (m->sel) {
+ /* fix overflow when window name is bigger than window width */
+ int mid = (m->ww - (int)TEXTW(m->sel->name)) / 2 - x;
+ /* make sure name will not overlap on tags even when it is very long */
+ mid = mid >= lrpad / 2 ? mid : lrpad / 2;
drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]);
- drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0);
+ drw_text(drw, x, 0, w, bh, mid, m->sel->name, 0);
if (m->sel->isfloating)
drw_rect(drw, x + boxs, boxs, boxw, boxw, m->sel->isfixed, 0);
} else {
--
2.27.0

View File

@ -0,0 +1,56 @@
From 54719285bd1a984e2efce6e8a8eab184fec11abf Mon Sep 17 00:00:00 2001
From: Sermak <sermak@jarvis.com>
Date: Mon, 8 Jul 2019 01:06:44 +0200
Subject: [PATCH] Simulate toggleable fullscreen mode
---
config.def.h | 1 +
dwm.c | 14 ++++++++++++++
2 files changed, 15 insertions(+)
diff --git a/config.def.h b/config.def.h
index 1c0b587..f774cc5 100644
--- a/config.def.h
+++ b/config.def.h
@@ -76,6 +76,7 @@ static Key keys[] = {
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
{ MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
{ MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
+ { MODKEY|ShiftMask, XK_f, fullscreen, {0} },
{ MODKEY, XK_space, setlayout, {0} },
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
{ MODKEY, XK_0, view, {.ui = ~0 } },
diff --git a/dwm.c b/dwm.c
index 4465af1..04b1e06 100644
--- a/dwm.c
+++ b/dwm.c
@@ -199,6 +199,7 @@ static void sendmon(Client *c, Monitor *m);
static void setclientstate(Client *c, long state);
static void setfocus(Client *c);
static void setfullscreen(Client *c, int fullscreen);
+static void fullscreen(const Arg *arg);
static void setlayout(const Arg *arg);
static void setmfact(const Arg *arg);
static void setup(void);
@@ -1497,6 +1498,19 @@ setfullscreen(Client *c, int fullscreen)
}
}
+Layout *last_layout;
+void
+fullscreen(const Arg *arg)
+{
+ if (selmon->showbar) {
+ for(last_layout = (Layout *)layouts; last_layout != selmon->lt[selmon->sellt]; last_layout++);
+ setlayout(&((Arg) { .v = &layouts[2] }));
+ } else {
+ setlayout(&((Arg) { .v = last_layout }));
+ }
+ togglebar(arg);
+}
+
void
setlayout(const Arg *arg)
{
--
2.22.0

View File

@ -0,0 +1,31 @@
From 700b0bdea872f4c00182b2bd925b41fe03f8d222 Mon Sep 17 00:00:00 2001
From: Aidan Hall <aidan.hall@outlook.com>
Date: Tue, 2 Jun 2020 14:41:53 +0000
Subject: [PATCH] Prevents hiding the border if layout is floating.
---
dwm.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/dwm.c b/dwm.c
index 4465af1..2dd959d 100644
--- a/dwm.c
+++ b/dwm.c
@@ -1282,6 +1282,14 @@ resizeclient(Client *c, int x, int y, int w, int h)
c->oldw = c->w; c->w = wc.width = w;
c->oldh = c->h; c->h = wc.height = h;
wc.border_width = c->bw;
+ if (((nexttiled(c->mon->clients) == c && !nexttiled(c->next))
+ || &monocle == c->mon->lt[c->mon->sellt]->arrange)
+ && !c->isfullscreen && !c->isfloating
+ && NULL != c->mon->lt[c->mon->sellt]->arrange) {
+ c->w = wc.width += c->bw * 2;
+ c->h = wc.height += c->bw * 2;
+ wc.border_width = 0;
+ }
XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc);
configure(c);
XSync(dpy, False);
--
2.26.2

View File

@ -0,0 +1,102 @@
diff --git a/config.def.h b/config.def.h
index fd77a07..09737d7 100644
--- a/config.def.h
+++ b/config.def.h
@@ -64,6 +64,8 @@ static Key keys[] = {
{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
{ MODKEY, XK_b, togglebar, {0} },
+ { MODKEY|ShiftMask, XK_j, rotatestack, {.i = +1 } },
+ { MODKEY|ShiftMask, XK_k, rotatestack, {.i = -1 } },
{ MODKEY, XK_j, focusstack, {.i = +1 } },
{ MODKEY, XK_k, focusstack, {.i = -1 } },
{ MODKEY, XK_i, incnmaster, {.i = +1 } },
diff --git a/dwm.c b/dwm.c
index 421bf27..1ec8b10 100644
--- a/dwm.c
+++ b/dwm.c
@@ -165,6 +165,8 @@ static void detachstack(Client *c);
static Monitor *dirtomon(int dir);
static void drawbar(Monitor *m);
static void drawbars(void);
+static void enqueue(Client *c);
+static void enqueuestack(Client *c);
static void enternotify(XEvent *e);
static void expose(XEvent *e);
static void focus(Client *c);
@@ -194,6 +196,7 @@ static void resize(Client *c, int x, int y, int w, int h, int interact);
static void resizeclient(Client *c, int x, int y, int w, int h);
static void resizemouse(const Arg *arg);
static void restack(Monitor *m);
+static void rotatestack(const Arg *arg);
static void run(void);
static void scan(void);
static int sendevent(Client *c, Atom proto);
@@ -765,6 +768,28 @@ drawbars(void)
}
void
+enqueue(Client *c)
+{
+ Client *l;
+ for (l = c->mon->clients; l && l->next; l = l->next);
+ if (l) {
+ l->next = c;
+ c->next = NULL;
+ }
+}
+
+void
+enqueuestack(Client *c)
+{
+ Client *l;
+ for (l = c->mon->stack; l && l->snext; l = l->snext);
+ if (l) {
+ l->snext = c;
+ c->snext = NULL;
+ }
+}
+
+void
enternotify(XEvent *e)
{
Client *c;
@@ -1390,6 +1415,38 @@ restack(Monitor *m)
}
void
+rotatestack(const Arg *arg)
+{
+ Client *c = NULL, *f;
+
+ if (!selmon->sel)
+ return;
+ f = selmon->sel;
+ if (arg->i > 0) {
+ for (c = nexttiled(selmon->clients); c && nexttiled(c->next); c = nexttiled(c->next));
+ if (c){
+ detach(c);
+ attach(c);
+ detachstack(c);
+ attachstack(c);
+ }
+ } else {
+ if ((c = nexttiled(selmon->clients))){
+ detach(c);
+ enqueue(c);
+ detachstack(c);
+ enqueuestack(c);
+ }
+ }
+ if (c){
+ arrange(selmon);
+ //unfocus(f, 1);
+ focus(f);
+ restack(selmon);
+ }
+}
+
+void
run(void)
{
XEvent ev;

View File

@ -0,0 +1,23 @@
# Template file for 'dwm'
pkgname=dwm
version=6.3
revision=1
makedepends="libXinerama-devel libXft-devel freetype-devel"
short_desc="Dynamic window manager for X"
maintainer="Nathan Owens <ndowens04@gmail.com>"
license="MIT"
homepage="http://dwm.suckless.org"
distfiles="https://dl.suckless.org/dwm/dwm-${version}.tar.gz"
checksum=badaa028529b1fba1fd7f9a84f3b64f31190466c858011b53e2f7b70c6a3078d
do_build() {
[ -e ${FILESDIR}/config.h ] && cp ${FILESDIR}/config.h config.h
sed -i "/CFLAGS/s|\${CPPFLAGS}|& $CFLAGS|g" config.mk
sed -i "/LDFLAGS/s|\-s|$LDFLAGS|g" config.mk
make CC=$CC INCS="-I. -I${XBPS_CROSS_BASE}/usr/include/freetype2" LIBS="-lX11 -lXinerama -lXft -lfontconfig"
}
do_install() {
make PREFIX=/usr DESTDIR=$DESTDIR install
vinstall README 644 usr/share/doc/$pkgname
vinstall ${FILESDIR}/dwm.desktop 644 usr/share/xsessions
vlicense LICENSE
}

View File

@ -0,0 +1 @@
linux5.17/

View File

@ -0,0 +1 @@
linux5.17/

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
#!/bin/sh
mod=$1
mkdir -p usr/lib/debug/${mod%/*}
$OBJCOPY --only-keep-debug --compress-debug-sections $mod usr/lib/debug/$mod
$OBJCOPY --add-gnu-debuglink=${DESTDIR}/usr/lib/debug/$mod $mod
/usr/bin/$STRIP --strip-debug $mod
gzip -9 $mod

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,287 @@
# Template file for 'linux4.16'
pkgname=linux5.17
version=5.17.5
revision=1
wrksrc="linux-${version%.*}"
short_desc="Linux kernel and modules (${version%.*} series)"
maintainer="Érico Nogueira <ericonr@disroot.org>"
license="GPL-2.0-only"
homepage="https://www.kernel.org"
distfiles="https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-${version%.*}.tar.xz
https://cdn.kernel.org/pub/linux/kernel/v5.x/patch-${version}.xz"
checksum="555fef61dddb591a83d62dd04e252792f9af4ba9ef14683f64840e46fa20b1b1
486bf7ca199a9b2ed1acbe47a0e000404e27228d4df14fb67ecbb229c9f7b965"
skip_extraction="patch-${version}.xz"
python_version=3
# XXX Restrict archs until a proper <arch>-dotconfig is available in FILESDIR.
archs="x86_64* i686* aarch64* ppc*"
nodebug=yes # -dbg package is generated below manually
nostrip=yes
noverifyrdeps=yes
noshlibprovides=yes
preserve=yes
hostmakedepends="tar xz bc elfutils-devel flex gmp-devel kmod libmpc-devel
openssl-devel perl uboot-mkimage cpio pahole python3"
_kernver="${version}_${revision}"
triggers="kernel-hooks"
kernel_hooks_version="${_kernver}"
# These files could be modified when an external module is built.
mutable_files="
/usr/lib/modules/${_kernver}/modules.builtin.bin
/usr/lib/modules/${_kernver}/modules.builtin.alias.bin
/usr/lib/modules/${_kernver}/modules.softdep
/usr/lib/modules/${_kernver}/modules.dep
/usr/lib/modules/${_kernver}/modules.dep.bin
/usr/lib/modules/${_kernver}/modules.symbols
/usr/lib/modules/${_kernver}/modules.symbols.bin
/usr/lib/modules/${_kernver}/modules.alias
/usr/lib/modules/${_kernver}/modules.alias.bin
/usr/lib/modules/${_kernver}/modules.devname"
# reproducible build
export KBUILD_BUILD_TIMESTAMP=$(LC_ALL=C date -ud @${SOURCE_DATE_EPOCH:-0})
export KBUILD_BUILD_USER=voidlinux
export KBUILD_BUILD_HOST=voidlinux
if [ "$CROSS_BUILD" ]; then
_cross="CROSS_COMPILE=${XBPS_CROSS_TRIPLET}-"
fi
pre_patch() {
xzcat $XBPS_SRCDISTDIR/$pkgname-$version/patch-${version}.xz | patch -Np1
}
do_configure() {
# If there's a file called <arch>-dotconfig, use it to
# configure the kernel; otherwise use arch defaults and all stuff
# as modules (allmodconfig).
local arch subarch
case "$XBPS_TARGET_MACHINE" in
i686*) arch=i386;;
x86_64*) arch=x86_64;;
arm*) arch=arm;;
aarch64*) arch=arm64;;
ppc64le*) arch=powerpc; subarch=ppc64le;;
ppc64*) arch=powerpc; subarch=ppc64;;
ppc*) arch=powerpc; subarch=ppc;;
mips*) arch=mips;;
esac
if [ -f ${FILESDIR}/${subarch:-$arch}-dotconfig-custom ]; then
msg_normal "Detected a custom .config file for your arch, using it.\n"
cp -f ${FILESDIR}/${subarch:-$arch}-dotconfig-custom .config
make ${makejobs} ARCH=$arch ${_cross} oldconfig
elif [ -f ${FILESDIR}/${subarch:-$arch}-dotconfig ]; then
msg_normal "Detected a .config file for your arch, using it.\n"
cp -f ${FILESDIR}/${subarch:-$arch}-dotconfig .config
make ${makejobs} ARCH=$arch ${_cross} oldconfig
fi
# Always use our revision to CONFIG_LOCALVERSION to match our pkg version.
sed -i -e "s|^\(CONFIG_LOCALVERSION=\).*|\1\"_${revision}\"|" .config
}
do_build() {
local arch _args
case "$XBPS_TARGET_MACHINE" in
i686*) _args="bzImage modules"; arch=i386;;
x86_64*) _args="bzImage modules"; arch=x86_64;;
arm*) _args="zImage modules dtbs"; arch=arm;;
aarch64*) _args="Image modules dtbs"; arch=arm64;;
ppc*) _args="zImage modules"; arch=powerpc;;
mips*) _args="uImage modules dtbs"; arch=mips;;
esac
export LDFLAGS=
make ARCH=$arch ${_cross} ${makejobs} prepare
make ARCH=$arch ${_cross} ${makejobs} ${_args}
}
do_install() {
local arch subarch _args hdrdest
case "$XBPS_TARGET_MACHINE" in
i686*) arch=x86; subarch=i386;;
x86_64*) arch=x86; subarch=x86_64;;
arm*) arch=arm;;
aarch64*) arch=arm64;;
ppc*) arch=powerpc;;
mips*) arch=mips;;
esac
# Run depmod after compressing modules - makes depmod.sh a noop
sed -i '2iexit 0' scripts/depmod.sh
# Install kernel, firmware and modules
make ${makejobs} ARCH=${subarch:-$arch} INSTALL_MOD_PATH=${DESTDIR} ${_cross} modules_install
hdrdest=${DESTDIR}/usr/src/kernel-headers-${_kernver}
vinstall .config 644 boot config-${_kernver}
vinstall System.map 644 boot System.map-${_kernver}
case "$arch" in
x86)
vinstall arch/x86/boot/bzImage 644 boot vmlinuz-${_kernver}
;;
arm)
vinstall arch/arm/boot/zImage 644 boot
make ${makejobs} ARCH=${subarch:-$arch} INSTALL_DTBS_PATH=${DESTDIR}/boot/dtbs/dtbs-${_kernver} ${_cross} dtbs_install
;;
arm64)
vinstall arch/arm64/boot/Image 644 boot vmlinux-${_kernver}
make ${makejobs} ARCH=${subarch:-$arch} INSTALL_DTBS_PATH=${DESTDIR}/boot/dtbs/dtbs-${_kernver} ${_cross} dtbs_install
;;
powerpc)
# zImage on powerpc is useless as it won't load initramfs
# raw vmlinux is huge, and this is nostrip, so do it manually
vinstall vmlinux 644 boot vmlinux-${_kernver}
/usr/bin/$STRIP ${DESTDIR}/boot/vmlinux-${_kernver}
;;
mips)
vinstall arch/mips/boot/uImage.bin 644 boot uImage-${_kernver}
make ${makejobs} ARCH=${subarch:-$arch} INSTALL_DTBS_PATH=${DESTDIR}/boot/dtbs/dtbs-${_kernver} ${_cross} dtbs_install
;;
esac
# Switch to /usr.
vmkdir usr
mv ${DESTDIR}/lib ${DESTDIR}/usr
cd ${DESTDIR}/usr/lib/modules/${_kernver}
rm -f source build
ln -sf ../../../src/kernel-headers-${_kernver} build
cd ${wrksrc}
# Install required headers to build external modules
install -Dm644 Makefile ${hdrdest}/Makefile
install -Dm644 kernel/Makefile ${hdrdest}/kernel/Makefile
install -Dm644 .config ${hdrdest}/.config
for file in $(find . -name Kconfig\*); do
mkdir -p ${hdrdest}/$(dirname $file)
install -Dm644 $file ${hdrdest}/${file}
done
for file in $(find arch/${subarch:-$arch} scripts -name module.lds -o -name Kbuild.platforms -o -name Platform); do
mkdir -p ${hdrdest}/$(dirname $file)
install -Dm644 $file ${hdrdest}/${file}
done
mkdir -p ${hdrdest}/include
# Remove firmware stuff provided by the "linux-firmware" pkg.
rm -rf ${DESTDIR}/usr/lib/firmware
for i in acpi asm-generic clocksource config crypto drm generated linux vdso \
math-emu media net pcmcia scsi sound trace uapi video xen dt-bindings; do
if [ -d include/$i ]; then
cp -a include/$i ${hdrdest}/include
fi
done
cd ${wrksrc}
mkdir -p ${hdrdest}/arch/${arch}
cp -a arch/${arch}/include ${hdrdest}/arch/${arch}
# Remove helper binaries built for host,
# if generated files from the scripts/ directory need to be included,
# they need to be copied to ${hdrdest} before this step
if [ "$CROSS_BUILD" ]; then
make ${makejobs} ARCH=${subarch:-$arch} ${_cross} _mrproper_scripts
# remove host specific objects as well
find scripts -name '*.o' -delete
fi
# Copy files necessary for later builds, like nvidia and vmware
cp Module.symvers ${hdrdest}
cp -a scripts ${hdrdest}
mkdir -p ${hdrdest}/security/selinux
cp -a security/selinux/include ${hdrdest}/security/selinux
mkdir -p ${hdrdest}/tools/include
cp -a tools/include/tools ${hdrdest}/tools/include
mkdir -p ${hdrdest}/arch/${arch}/kernel
cp arch/${arch}/Makefile ${hdrdest}/arch/${arch}
if [ "$subarch" = "i386" ]; then
mkdir -p ${hdrdest}/arch/x86
cp arch/x86/Makefile_32.cpu ${hdrdest}/arch/x86
fi
if [ "$arch" = "x86" ]; then
mkdir -p ${hdrdest}/arch/x86/kernel
cp arch/x86/kernel/asm-offsets.s ${hdrdest}/arch/x86/kernel
elif [ "$arch" = "arm64" ]; then
mkdir -p ${hdrdest}/arch/arm64/kernel
cp -a arch/arm64/kernel/vdso ${hdrdest}/arch/arm64/kernel/
fi
# add headers for lirc package
# pci
for i in bt8xx cx88 saa7134; do
mkdir -p ${hdrdest}/drivers/media/pci/${i}
cp -a drivers/media/pci/${i}/*.h ${hdrdest}/drivers/media/pci/${i}
done
# usb
for i in cpia2 em28xx pwc; do
mkdir -p ${hdrdest}/drivers/media/usb/${i}
cp -a drivers/media/usb/${i}/*.h ${hdrdest}/drivers/media/usb/${i}
done
# i2c
mkdir -p ${hdrdest}/drivers/media/i2c
cp drivers/media/i2c/*.h ${hdrdest}/drivers/media/i2c
for i in cx25840; do
mkdir -p ${hdrdest}/drivers/media/i2c/${i}
cp -a drivers/media/i2c/${i}/*.h ${hdrdest}/drivers/media/i2c/${i}
done
# Add md headers
mkdir -p ${hdrdest}/drivers/md
cp drivers/md/*.h ${hdrdest}/drivers/md
# Add inotify.h
mkdir -p ${hdrdest}/include/linux
cp include/linux/inotify.h ${hdrdest}/include/linux
# Add wireless headers
mkdir -p ${hdrdest}/net/mac80211/
cp net/mac80211/*.h ${hdrdest}/net/mac80211
# add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
mkdir -p ${hdrdest}/drivers/media/dvb-frontends
cp drivers/media/dvb-frontends/lgdt330x.h \
${hdrdest}/drivers/media/dvb-frontends/
cp drivers/media/i2c/msp3400-driver.h ${hdrdest}/drivers/media/i2c/
# add dvb headers
mkdir -p ${hdrdest}/drivers/media/usb/dvb-usb
cp drivers/media/usb/dvb-usb/*.h ${hdrdest}/drivers/media/usb/dvb-usb/
mkdir -p ${hdrdest}/drivers/media/dvb-frontends
cp drivers/media/dvb-frontends/*.h ${hdrdest}/drivers/media/dvb-frontends/
mkdir -p ${hdrdest}/drivers/media/tuners
cp drivers/media/tuners/*.h ${hdrdest}/drivers/media/tuners/
# Add xfs and shmem for aufs building
mkdir -p ${hdrdest}/fs/xfs/libxfs
mkdir -p ${hdrdest}/mm
cp fs/xfs/libxfs/xfs_sb.h ${hdrdest}/fs/xfs/libxfs/xfs_sb.h
# Add objtool binary, needed to build external modules with dkms
case "$XBPS_TARGET_MACHINE" in
x86_64*)
mkdir -p ${hdrdest}/tools/objtool
cp tools/objtool/objtool ${hdrdest}/tools/objtool
;;
esac
# Remove unneeded architectures
case "$arch" in
i386|x86_64) _args="arm* m* p*";;
arm|arm64) _args="x86* m* p*";;
powerpc) _args="arm* m* x86* parisc";;
mips) _args="arm* x86* p*";;
esac
for arch in alpha avr32 blackfin cris frv h8300 \
ia64 s* um v850 xtensa ${_args}; do
rm -rf ${hdrdest}/arch/${arch}
done
# Keep arch/x86/ras/Kconfig as it is needed by drivers/ras/Kconfig
mkdir -p ${hdrdest}/arch/x86/ras
cp -a arch/x86/ras/Kconfig ${hdrdest}/arch/x86/ras/Kconfig
# Extract debugging symbols and compress modules
msg_normal "$pkgver: extracting debug info and compressing modules, please wait...\n"
install -Dm644 vmlinux ${DESTDIR}/usr/lib/debug/boot/vmlinux-${_kernver}
(
cd ${DESTDIR}
export DESTDIR
find ./ -name '*.ko' -print0 | \
xargs -0r -n1 -P ${XBPS_MAKEJOBS} ${FILESDIR}/mv-debug
)
# ... and run depmod again.
depmod -b ${DESTDIR}/usr -F System.map ${_kernver}
}
linux5.17-headers_package() {
preserve=yes
nostrip=yes
noshlibprovides=yes
short_desc+=" - source headers for 3rd party modules"
pkg_install() {
vmove usr/src
vmove usr/lib/modules/${_kernver}/build
}
}
linux5.17-dbg_package() {
preserve=yes
nostrip=yes
noverifyrdeps=yes
noshlibprovides=yes
repository=debug
short_desc+=" - debugging symbols"
pkg_install() {
vmove usr/lib/debug
vmove "boot/System.map-${_kernver}"
}
}

View File

@ -0,0 +1,2 @@
To use slstatus, put the following code in your ~/.xinitrc (or similar):
slstatus &

View File

@ -0,0 +1,78 @@
/* See LICENSE file for copyright and license details. */
/* interval between updates (in ms) */
const unsigned int interval = 1000;
/* text to show if no value can be retrieved */
static const char unknown_str[] = "n/a";
/* maximum output string length */
#define MAXLEN 2048
/*
* function description argument (example)
*
* battery_perc battery percentage battery name (BAT0)
* NULL on OpenBSD
* battery_state battery charging state battery name (BAT0)
* NULL on OpenBSD
* battery_remaining battery remaining HH:MM battery name (BAT0)
* NULL on OpenBSD
* cpu_perc cpu usage in percent NULL
* cpu_freq cpu frequency in MHz NULL
* datetime date and time format string (%F %T)
* disk_free free disk space in GB mountpoint path (/)
* disk_perc disk usage in percent mountpoint path (/)
* disk_total total disk space in GB mountpoint path (/")
* disk_used used disk space in GB mountpoint path (/)
* entropy available entropy NULL
* gid GID of current user NULL
* hostname hostname NULL
* ipv4 IPv4 address interface name (eth0)
* ipv6 IPv6 address interface name (eth0)
* kernel_release `uname -r` NULL
* keyboard_indicators caps/num lock indicators format string (c?n?)
* see keyboard_indicators.c
* keymap layout (variant) of current NULL
* keymap
* load_avg load average NULL
* netspeed_rx receive network speed interface name (wlan0)
* netspeed_tx transfer network speed interface name (wlan0)
* num_files number of files in a directory path
* (/home/foo/Inbox/cur)
* ram_free free memory in GB NULL
* ram_perc memory usage in percent NULL
* ram_total total memory size in GB NULL
* ram_used used memory in GB NULL
* run_command custom shell command command (echo foo)
* swap_free free swap in GB NULL
* swap_perc swap usage in percent NULL
* swap_total total swap size in GB NULL
* swap_used used swap in GB NULL
* temp temperature in degree celsius sensor file
* (/sys/class/thermal/...)
* NULL on OpenBSD
* uid UID of current user NULL
* uptime system uptime NULL
* username username of current user NULL
* vol_perc OSS/ALSA volume in percent mixer file (/dev/mixer)
* wifi_perc WiFi signal in percent interface name (wlan0)
* wifi_essid WiFi ESSID interface name (wlan0)
*/
static const char vol[] = "[ `amixer sget Master | tail -n 1 | awk '{print $6;}'` = \"[on]\" ] \
&& printf \"`amixer sget Master | tail -n 1 | awk '{print $4;}' | grep -Po '\\[\\K[^%]*'`%%\" \
|| printf 'Off'";
static const struct arg args[] = {
/* function format argument */
{ cpu_perc, " %s%% | ", NULL },
{ temp, "  %s°C | ", "/sys/devices/platform/coretemp.0/hwmon/hwmon5/temp1_input" },
{ ram_used, " %s", NULL },
{ ram_perc, "(%s%%) | ", NULL },
{ wifi_essid, " %s | ", "wlo1" },
{ battery_perc, " %s%% ", "BAT0" },
{ battery_state, "(%s) |", "BAT0" },
{ run_command, " %s | ", vol },
{ datetime, " %s", " %a %b %d -  %I:%M%p " },
};

View File

@ -0,0 +1,22 @@
# Template file for 'slstatus'
pkgname=slstatus
version=20180708
revision=1
_commit=dd7f1896aa9883f33b4d28cd192e8088db0cab5a
wrksrc="${pkgname}-${_commit}"
build_style=gnu-makefile
short_desc="Suckless status monitor for dwm"
maintainer="Dom H. <dom@hxy.io>"
license="ISC"
homepage="https://tools.suckless.org/slstatus/"
distfiles="https://github.com/drkhsh/slstatus/archive/${_commit}.tar.gz"
makedepends="alsa-lib-devel libX11-devel"
checksum=2602a7210decb265b55f1802d4baea652d782ef6c1c8d2f58a7d79bbd2d93d84
pre_build() {
[ -e ${FILESDIR}/config.h ] && cp ${FILESDIR}/config.h config.h
sed -i -e 's|^CFLAGS *=|override CFLAGS +=|g' \
-e 's|^LDFLAGS *=|override LDFLAGS +=|g' config.mk
}
post_install() {
vlicense LICENSE
}

View File

@ -0,0 +1,485 @@
/* See LICENSE file for copyright and license details. */
/*
* appearance
*
* font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html
*/
/*static char *font = "Liberation Mono:pixelsize=12:antialias=true:autohint=true";*/
/*static char *font = "mononoki:pixelsize=16:antialias=true:autohint=true";*/
static char *font = "Hack Nerd Font:style=Regular:pixelsize=16:antialias=true:autohint=true";
static int borderpx = 2;
/*
* What program is execed by st depends of these precedence rules:
* 1: program passed with -e
* 2: scroll and/or utmp
* 3: SHELL environment variable
* 4: value of shell in /etc/passwd
* 5: value of shell in config.h
*/
static char *shell = "/bin/sh";
char *utmp = NULL;
/* scroll program: to enable use a string like "scroll" */
char *scroll = NULL;
char *stty_args = "stty raw pass8 nl -echo -iexten -cstopb 38400";
/* identification sequence returned in DA and DECID */
char *vtiden = "\033[?6c";
/* Kerning / character bounding-box multipliers */
static float cwscale = 1.0;
static float chscale = 1.0;
/*
* word delimiter string
*
* More advanced example: L" `'\"()[]{}"
*/
wchar_t *worddelimiters = L" ";
/* selection timeouts (in milliseconds) */
static unsigned int doubleclicktimeout = 300;
static unsigned int tripleclicktimeout = 600;
/* alt screens */
int allowaltscreen = 1;
/* allow certain non-interactive (insecure) window operations such as:
setting the clipboard text */
int allowwindowops = 0;
/*
* draw latency range in ms - from new content/keypress/etc until drawing.
* within this range, st draws when content stops arriving (idle). mostly it's
* near minlatency, but it waits longer for slow updates to avoid partial draw.
* low minlatency will tear/flicker more, as it can "detect" idle too early.
*/
static double minlatency = 8;
static double maxlatency = 33;
/*
* blinking timeout (set to 0 to disable blinking) for the terminal blinking
* attribute.
*/
static unsigned int blinktimeout = 800;
/*
* thickness of underline and bar cursors
*/
static unsigned int cursorthickness = 2;
/*
* bell volume. It must be a value between -100 and 100. Use 0 for disabling
* it
*/
static int bellvolume = 0;
/* default TERM value */
char *termname = "st-256color";
/*
* spaces per tab
*
* When you are changing this value, don't forget to adapt the »it« value in
* the st.info and appropriately install the st.info in the environment where
* you use this st version.
*
* it#$tabspaces,
*
* Secondly make sure your kernel is not expanding tabs. When running `stty
* -a` »tab0« should appear. You can tell the terminal to not expand tabs by
* running following command:
*
* stty tabs
*/
unsigned int tabspaces = 8;
/* bg opacity */
float alpha = 0.8;
/* Terminal colors (16 first used in escape sequence) */
static const char *colorname[] = {
/* 8 normal colors */
"black",
"red3",
"green3",
"yellow3",
"blue2",
"magenta3",
"cyan3",
"gray90",
/* 8 bright colors */
"gray50",
"red",
"green",
"yellow",
"#5c5cff",
"magenta",
"cyan",
"white",
[255] = 0,
/* more colors can be added after 255 to use with DefaultXX */
"#cccccc",
"#555555",
"gray90", /* default foreground colour */
"black", /* default background colour */
};
/*
* Default colors (colorname index)
* foreground, background, cursor, reverse cursor
*/
unsigned int defaultfg = 258;
unsigned int defaultbg = 259;
unsigned int defaultcs = 256;
static unsigned int defaultrcs = 257;
/*
* Default shape of cursor
* 2: Block ("")
* 4: Underline ("_")
* 6: Bar ("|")
* 7: Snowman ("")
*/
static unsigned int cursorshape = 4;
/*
* Default columns and rows numbers
*/
static unsigned int cols = 80;
static unsigned int rows = 24;
/*
* Default colour and shape of the mouse cursor
*/
static unsigned int mouseshape = XC_xterm;
static unsigned int mousefg = 7;
static unsigned int mousebg = 0;
/*
* Color used to display font attributes when fontconfig selected a font which
* doesn't match the ones requested.
*/
static unsigned int defaultattr = 11;
/*
* Force mouse select/shortcuts while mask is active (when MODE_MOUSE is set).
* Note that if you want to use ShiftMask with selmasks, set this to an other
* modifier, set to 0 to not use it.
*/
static uint forcemousemod = ShiftMask;
/*
* Internal mouse shortcuts.
* Beware that overloading Button1 will disable the selection.
*/
static MouseShortcut mshortcuts[] = {
/* mask button function argument release */
{ ShiftMask, Button4, kscrollup, {.i = 1} },
{ ShiftMask, Button5, kscrolldown, {.i = 1} },
{ XK_ANY_MOD, Button2, selpaste, {.i = 0}, 1 },
{ ShiftMask, Button4, ttysend, {.s = "\033[5;2~"} },
{ XK_ANY_MOD, Button4, ttysend, {.s = "\031"} },
{ ShiftMask, Button5, ttysend, {.s = "\033[6;2~"} },
{ XK_ANY_MOD, Button5, ttysend, {.s = "\005"} },
};
/* Internal keyboard shortcuts. */
#define MODKEY Mod1Mask
#define TERMMOD (ControlMask|ShiftMask)
static Shortcut shortcuts[] = {
/* mask keysym function argument */
{ XK_ANY_MOD, XK_Break, sendbreak, {.i = 0} },
{ ControlMask, XK_Print, toggleprinter, {.i = 0} },
{ ShiftMask, XK_Print, printscreen, {.i = 0} },
{ XK_ANY_MOD, XK_Print, printsel, {.i = 0} },
{ TERMMOD, XK_Prior, zoom, {.f = +1} },
{ TERMMOD, XK_Next, zoom, {.f = -1} },
{ TERMMOD, XK_Home, zoomreset, {.f = 0} },
{ TERMMOD, XK_C, clipcopy, {.i = 0} },
{ TERMMOD, XK_V, clippaste, {.i = 0} },
{ TERMMOD, XK_Y, selpaste, {.i = 0} },
{ ShiftMask, XK_Insert, selpaste, {.i = 0} },
{ TERMMOD, XK_Num_Lock, numlock, {.i = 0} },
{ ShiftMask, XK_Page_Up, kscrollup, {.i = -1} },
{ ShiftMask, XK_Page_Down, kscrolldown, {.i = -1} },
};
/*
* Special keys (change & recompile st.info accordingly)
*
* Mask value:
* * Use XK_ANY_MOD to match the key no matter modifiers state
* * Use XK_NO_MOD to match the key alone (no modifiers)
* appkey value:
* * 0: no value
* * > 0: keypad application mode enabled
* * = 2: term.numlock = 1
* * < 0: keypad application mode disabled
* appcursor value:
* * 0: no value
* * > 0: cursor application mode enabled
* * < 0: cursor application mode disabled
*
* Be careful with the order of the definitions because st searches in
* this table sequentially, so any XK_ANY_MOD must be in the last
* position for a key.
*/
/*
* If you want keys other than the X11 function keys (0xFD00 - 0xFFFF)
* to be mapped below, add them to this array.
*/
static KeySym mappedkeys[] = { -1 };
/*
* State bits to ignore when matching key or button events. By default,
* numlock (Mod2Mask) and keyboard layout (XK_SWITCH_MOD) are ignored.
*/
static uint ignoremod = Mod2Mask|XK_SWITCH_MOD;
/*
* This is the huge key array which defines all compatibility to the Linux
* world. Please decide about changes wisely.
*/
static Key key[] = {
/* keysym mask string appkey appcursor */
{ XK_KP_Home, ShiftMask, "\033[2J", 0, -1},
{ XK_KP_Home, ShiftMask, "\033[1;2H", 0, +1},
{ XK_KP_Home, XK_ANY_MOD, "\033[H", 0, -1},
{ XK_KP_Home, XK_ANY_MOD, "\033[1~", 0, +1},
{ XK_KP_Up, XK_ANY_MOD, "\033Ox", +1, 0},
{ XK_KP_Up, XK_ANY_MOD, "\033[A", 0, -1},
{ XK_KP_Up, XK_ANY_MOD, "\033OA", 0, +1},
{ XK_KP_Down, XK_ANY_MOD, "\033Or", +1, 0},
{ XK_KP_Down, XK_ANY_MOD, "\033[B", 0, -1},
{ XK_KP_Down, XK_ANY_MOD, "\033OB", 0, +1},
{ XK_KP_Left, XK_ANY_MOD, "\033Ot", +1, 0},
{ XK_KP_Left, XK_ANY_MOD, "\033[D", 0, -1},
{ XK_KP_Left, XK_ANY_MOD, "\033OD", 0, +1},
{ XK_KP_Right, XK_ANY_MOD, "\033Ov", +1, 0},
{ XK_KP_Right, XK_ANY_MOD, "\033[C", 0, -1},
{ XK_KP_Right, XK_ANY_MOD, "\033OC", 0, +1},
{ XK_KP_Prior, ShiftMask, "\033[5;2~", 0, 0},
{ XK_KP_Prior, XK_ANY_MOD, "\033[5~", 0, 0},
{ XK_KP_Begin, XK_ANY_MOD, "\033[E", 0, 0},
{ XK_KP_End, ControlMask, "\033[J", -1, 0},
{ XK_KP_End, ControlMask, "\033[1;5F", +1, 0},
{ XK_KP_End, ShiftMask, "\033[K", -1, 0},
{ XK_KP_End, ShiftMask, "\033[1;2F", +1, 0},
{ XK_KP_End, XK_ANY_MOD, "\033[4~", 0, 0},
{ XK_KP_Next, ShiftMask, "\033[6;2~", 0, 0},
{ XK_KP_Next, XK_ANY_MOD, "\033[6~", 0, 0},
{ XK_KP_Insert, ShiftMask, "\033[2;2~", +1, 0},
{ XK_KP_Insert, ShiftMask, "\033[4l", -1, 0},
{ XK_KP_Insert, ControlMask, "\033[L", -1, 0},
{ XK_KP_Insert, ControlMask, "\033[2;5~", +1, 0},
{ XK_KP_Insert, XK_ANY_MOD, "\033[4h", -1, 0},
{ XK_KP_Insert, XK_ANY_MOD, "\033[2~", +1, 0},
{ XK_KP_Delete, ControlMask, "\033[M", -1, 0},
{ XK_KP_Delete, ControlMask, "\033[3;5~", +1, 0},
{ XK_KP_Delete, ShiftMask, "\033[2K", -1, 0},
{ XK_KP_Delete, ShiftMask, "\033[3;2~", +1, 0},
{ XK_KP_Delete, XK_ANY_MOD, "\033[P", -1, 0},
{ XK_KP_Delete, XK_ANY_MOD, "\033[3~", +1, 0},
{ XK_KP_Multiply, XK_ANY_MOD, "\033Oj", +2, 0},
{ XK_KP_Add, XK_ANY_MOD, "\033Ok", +2, 0},
{ XK_KP_Enter, XK_ANY_MOD, "\033OM", +2, 0},
{ XK_KP_Enter, XK_ANY_MOD, "\r", -1, 0},
{ XK_KP_Subtract, XK_ANY_MOD, "\033Om", +2, 0},
{ XK_KP_Decimal, XK_ANY_MOD, "\033On", +2, 0},
{ XK_KP_Divide, XK_ANY_MOD, "\033Oo", +2, 0},
{ XK_KP_0, XK_ANY_MOD, "\033Op", +2, 0},
{ XK_KP_1, XK_ANY_MOD, "\033Oq", +2, 0},
{ XK_KP_2, XK_ANY_MOD, "\033Or", +2, 0},
{ XK_KP_3, XK_ANY_MOD, "\033Os", +2, 0},
{ XK_KP_4, XK_ANY_MOD, "\033Ot", +2, 0},
{ XK_KP_5, XK_ANY_MOD, "\033Ou", +2, 0},
{ XK_KP_6, XK_ANY_MOD, "\033Ov", +2, 0},
{ XK_KP_7, XK_ANY_MOD, "\033Ow", +2, 0},
{ XK_KP_8, XK_ANY_MOD, "\033Ox", +2, 0},
{ XK_KP_9, XK_ANY_MOD, "\033Oy", +2, 0},
{ XK_Up, ShiftMask, "\033[1;2A", 0, 0},
{ XK_Up, Mod1Mask, "\033[1;3A", 0, 0},
{ XK_Up, ShiftMask|Mod1Mask,"\033[1;4A", 0, 0},
{ XK_Up, ControlMask, "\033[1;5A", 0, 0},
{ XK_Up, ShiftMask|ControlMask,"\033[1;6A", 0, 0},
{ XK_Up, ControlMask|Mod1Mask,"\033[1;7A", 0, 0},
{ XK_Up,ShiftMask|ControlMask|Mod1Mask,"\033[1;8A", 0, 0},
{ XK_Up, XK_ANY_MOD, "\033[A", 0, -1},
{ XK_Up, XK_ANY_MOD, "\033OA", 0, +1},
{ XK_Down, ShiftMask, "\033[1;2B", 0, 0},
{ XK_Down, Mod1Mask, "\033[1;3B", 0, 0},
{ XK_Down, ShiftMask|Mod1Mask,"\033[1;4B", 0, 0},
{ XK_Down, ControlMask, "\033[1;5B", 0, 0},
{ XK_Down, ShiftMask|ControlMask,"\033[1;6B", 0, 0},
{ XK_Down, ControlMask|Mod1Mask,"\033[1;7B", 0, 0},
{ XK_Down,ShiftMask|ControlMask|Mod1Mask,"\033[1;8B",0, 0},
{ XK_Down, XK_ANY_MOD, "\033[B", 0, -1},
{ XK_Down, XK_ANY_MOD, "\033OB", 0, +1},
{ XK_Left, ShiftMask, "\033[1;2D", 0, 0},
{ XK_Left, Mod1Mask, "\033[1;3D", 0, 0},
{ XK_Left, ShiftMask|Mod1Mask,"\033[1;4D", 0, 0},
{ XK_Left, ControlMask, "\033[1;5D", 0, 0},
{ XK_Left, ShiftMask|ControlMask,"\033[1;6D", 0, 0},
{ XK_Left, ControlMask|Mod1Mask,"\033[1;7D", 0, 0},
{ XK_Left,ShiftMask|ControlMask|Mod1Mask,"\033[1;8D",0, 0},
{ XK_Left, XK_ANY_MOD, "\033[D", 0, -1},
{ XK_Left, XK_ANY_MOD, "\033OD", 0, +1},
{ XK_Right, ShiftMask, "\033[1;2C", 0, 0},
{ XK_Right, Mod1Mask, "\033[1;3C", 0, 0},
{ XK_Right, ShiftMask|Mod1Mask,"\033[1;4C", 0, 0},
{ XK_Right, ControlMask, "\033[1;5C", 0, 0},
{ XK_Right, ShiftMask|ControlMask,"\033[1;6C", 0, 0},
{ XK_Right, ControlMask|Mod1Mask,"\033[1;7C", 0, 0},
{ XK_Right,ShiftMask|ControlMask|Mod1Mask,"\033[1;8C",0, 0},
{ XK_Right, XK_ANY_MOD, "\033[C", 0, -1},
{ XK_Right, XK_ANY_MOD, "\033OC", 0, +1},
{ XK_ISO_Left_Tab, ShiftMask, "\033[Z", 0, 0},
{ XK_Return, Mod1Mask, "\033\r", 0, 0},
{ XK_Return, XK_ANY_MOD, "\r", 0, 0},
{ XK_Insert, ShiftMask, "\033[4l", -1, 0},
{ XK_Insert, ShiftMask, "\033[2;2~", +1, 0},
{ XK_Insert, ControlMask, "\033[L", -1, 0},
{ XK_Insert, ControlMask, "\033[2;5~", +1, 0},
{ XK_Insert, XK_ANY_MOD, "\033[4h", -1, 0},
{ XK_Insert, XK_ANY_MOD, "\033[2~", +1, 0},
{ XK_Delete, ControlMask, "\033[M", -1, 0},
{ XK_Delete, ControlMask, "\033[3;5~", +1, 0},
{ XK_Delete, ShiftMask, "\033[2K", -1, 0},
{ XK_Delete, ShiftMask, "\033[3;2~", +1, 0},
{ XK_Delete, XK_ANY_MOD, "\033[P", -1, 0},
{ XK_Delete, XK_ANY_MOD, "\033[3~", +1, 0},
{ XK_BackSpace, XK_NO_MOD, "\177", 0, 0},
{ XK_BackSpace, Mod1Mask, "\033\177", 0, 0},
{ XK_Home, ShiftMask, "\033[2J", 0, -1},
{ XK_Home, ShiftMask, "\033[1;2H", 0, +1},
{ XK_Home, XK_ANY_MOD, "\033[H", 0, -1},
{ XK_Home, XK_ANY_MOD, "\033[1~", 0, +1},
{ XK_End, ControlMask, "\033[J", -1, 0},
{ XK_End, ControlMask, "\033[1;5F", +1, 0},
{ XK_End, ShiftMask, "\033[K", -1, 0},
{ XK_End, ShiftMask, "\033[1;2F", +1, 0},
{ XK_End, XK_ANY_MOD, "\033[4~", 0, 0},
{ XK_Prior, ControlMask, "\033[5;5~", 0, 0},
{ XK_Prior, ShiftMask, "\033[5;2~", 0, 0},
{ XK_Prior, XK_ANY_MOD, "\033[5~", 0, 0},
{ XK_Next, ControlMask, "\033[6;5~", 0, 0},
{ XK_Next, ShiftMask, "\033[6;2~", 0, 0},
{ XK_Next, XK_ANY_MOD, "\033[6~", 0, 0},
{ XK_F1, XK_NO_MOD, "\033OP" , 0, 0},
{ XK_F1, /* F13 */ ShiftMask, "\033[1;2P", 0, 0},
{ XK_F1, /* F25 */ ControlMask, "\033[1;5P", 0, 0},
{ XK_F1, /* F37 */ Mod4Mask, "\033[1;6P", 0, 0},
{ XK_F1, /* F49 */ Mod1Mask, "\033[1;3P", 0, 0},
{ XK_F1, /* F61 */ Mod3Mask, "\033[1;4P", 0, 0},
{ XK_F2, XK_NO_MOD, "\033OQ" , 0, 0},
{ XK_F2, /* F14 */ ShiftMask, "\033[1;2Q", 0, 0},
{ XK_F2, /* F26 */ ControlMask, "\033[1;5Q", 0, 0},
{ XK_F2, /* F38 */ Mod4Mask, "\033[1;6Q", 0, 0},
{ XK_F2, /* F50 */ Mod1Mask, "\033[1;3Q", 0, 0},
{ XK_F2, /* F62 */ Mod3Mask, "\033[1;4Q", 0, 0},
{ XK_F3, XK_NO_MOD, "\033OR" , 0, 0},
{ XK_F3, /* F15 */ ShiftMask, "\033[1;2R", 0, 0},
{ XK_F3, /* F27 */ ControlMask, "\033[1;5R", 0, 0},
{ XK_F3, /* F39 */ Mod4Mask, "\033[1;6R", 0, 0},
{ XK_F3, /* F51 */ Mod1Mask, "\033[1;3R", 0, 0},
{ XK_F3, /* F63 */ Mod3Mask, "\033[1;4R", 0, 0},
{ XK_F4, XK_NO_MOD, "\033OS" , 0, 0},
{ XK_F4, /* F16 */ ShiftMask, "\033[1;2S", 0, 0},
{ XK_F4, /* F28 */ ControlMask, "\033[1;5S", 0, 0},
{ XK_F4, /* F40 */ Mod4Mask, "\033[1;6S", 0, 0},
{ XK_F4, /* F52 */ Mod1Mask, "\033[1;3S", 0, 0},
{ XK_F5, XK_NO_MOD, "\033[15~", 0, 0},
{ XK_F5, /* F17 */ ShiftMask, "\033[15;2~", 0, 0},
{ XK_F5, /* F29 */ ControlMask, "\033[15;5~", 0, 0},
{ XK_F5, /* F41 */ Mod4Mask, "\033[15;6~", 0, 0},
{ XK_F5, /* F53 */ Mod1Mask, "\033[15;3~", 0, 0},
{ XK_F6, XK_NO_MOD, "\033[17~", 0, 0},
{ XK_F6, /* F18 */ ShiftMask, "\033[17;2~", 0, 0},
{ XK_F6, /* F30 */ ControlMask, "\033[17;5~", 0, 0},
{ XK_F6, /* F42 */ Mod4Mask, "\033[17;6~", 0, 0},
{ XK_F6, /* F54 */ Mod1Mask, "\033[17;3~", 0, 0},
{ XK_F7, XK_NO_MOD, "\033[18~", 0, 0},
{ XK_F7, /* F19 */ ShiftMask, "\033[18;2~", 0, 0},
{ XK_F7, /* F31 */ ControlMask, "\033[18;5~", 0, 0},
{ XK_F7, /* F43 */ Mod4Mask, "\033[18;6~", 0, 0},
{ XK_F7, /* F55 */ Mod1Mask, "\033[18;3~", 0, 0},
{ XK_F8, XK_NO_MOD, "\033[19~", 0, 0},
{ XK_F8, /* F20 */ ShiftMask, "\033[19;2~", 0, 0},
{ XK_F8, /* F32 */ ControlMask, "\033[19;5~", 0, 0},
{ XK_F8, /* F44 */ Mod4Mask, "\033[19;6~", 0, 0},
{ XK_F8, /* F56 */ Mod1Mask, "\033[19;3~", 0, 0},
{ XK_F9, XK_NO_MOD, "\033[20~", 0, 0},
{ XK_F9, /* F21 */ ShiftMask, "\033[20;2~", 0, 0},
{ XK_F9, /* F33 */ ControlMask, "\033[20;5~", 0, 0},
{ XK_F9, /* F45 */ Mod4Mask, "\033[20;6~", 0, 0},
{ XK_F9, /* F57 */ Mod1Mask, "\033[20;3~", 0, 0},
{ XK_F10, XK_NO_MOD, "\033[21~", 0, 0},
{ XK_F10, /* F22 */ ShiftMask, "\033[21;2~", 0, 0},
{ XK_F10, /* F34 */ ControlMask, "\033[21;5~", 0, 0},
{ XK_F10, /* F46 */ Mod4Mask, "\033[21;6~", 0, 0},
{ XK_F10, /* F58 */ Mod1Mask, "\033[21;3~", 0, 0},
{ XK_F11, XK_NO_MOD, "\033[23~", 0, 0},
{ XK_F11, /* F23 */ ShiftMask, "\033[23;2~", 0, 0},
{ XK_F11, /* F35 */ ControlMask, "\033[23;5~", 0, 0},
{ XK_F11, /* F47 */ Mod4Mask, "\033[23;6~", 0, 0},
{ XK_F11, /* F59 */ Mod1Mask, "\033[23;3~", 0, 0},
{ XK_F12, XK_NO_MOD, "\033[24~", 0, 0},
{ XK_F12, /* F24 */ ShiftMask, "\033[24;2~", 0, 0},
{ XK_F12, /* F36 */ ControlMask, "\033[24;5~", 0, 0},
{ XK_F12, /* F48 */ Mod4Mask, "\033[24;6~", 0, 0},
{ XK_F12, /* F60 */ Mod1Mask, "\033[24;3~", 0, 0},
{ XK_F13, XK_NO_MOD, "\033[1;2P", 0, 0},
{ XK_F14, XK_NO_MOD, "\033[1;2Q", 0, 0},
{ XK_F15, XK_NO_MOD, "\033[1;2R", 0, 0},
{ XK_F16, XK_NO_MOD, "\033[1;2S", 0, 0},
{ XK_F17, XK_NO_MOD, "\033[15;2~", 0, 0},
{ XK_F18, XK_NO_MOD, "\033[17;2~", 0, 0},
{ XK_F19, XK_NO_MOD, "\033[18;2~", 0, 0},
{ XK_F20, XK_NO_MOD, "\033[19;2~", 0, 0},
{ XK_F21, XK_NO_MOD, "\033[20;2~", 0, 0},
{ XK_F22, XK_NO_MOD, "\033[21;2~", 0, 0},
{ XK_F23, XK_NO_MOD, "\033[23;2~", 0, 0},
{ XK_F24, XK_NO_MOD, "\033[24;2~", 0, 0},
{ XK_F25, XK_NO_MOD, "\033[1;5P", 0, 0},
{ XK_F26, XK_NO_MOD, "\033[1;5Q", 0, 0},
{ XK_F27, XK_NO_MOD, "\033[1;5R", 0, 0},
{ XK_F28, XK_NO_MOD, "\033[1;5S", 0, 0},
{ XK_F29, XK_NO_MOD, "\033[15;5~", 0, 0},
{ XK_F30, XK_NO_MOD, "\033[17;5~", 0, 0},
{ XK_F31, XK_NO_MOD, "\033[18;5~", 0, 0},
{ XK_F32, XK_NO_MOD, "\033[19;5~", 0, 0},
{ XK_F33, XK_NO_MOD, "\033[20;5~", 0, 0},
{ XK_F34, XK_NO_MOD, "\033[21;5~", 0, 0},
{ XK_F35, XK_NO_MOD, "\033[23;5~", 0, 0},
};
/*
* Selection types' masks.
* Use the same masks as usual.
* Button1Mask is always unset, to make masks match between ButtonPress.
* ButtonRelease and MotionNotify.
* If no match is found, regular selection is used.
*/
static uint selmasks[] = {
[SEL_RECTANGULAR] = Mod1Mask,
};
/*
* Printable characters in ASCII, used to estimate the advance width
* of single wide characters.
*/
static char ascii_printable[] =
" !\"#$%&'()*+,-./0123456789:;<=>?"
"@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"
"`abcdefghijklmnopqrstuvwxyz{|}~";

View File

@ -0,0 +1,146 @@
diff --git a/config.def.h b/config.def.h
index 91ab8ca..6af616e 100644
--- a/config.def.h
+++ b/config.def.h
@@ -93,6 +93,9 @@ char *termname = "st-256color";
*/
unsigned int tabspaces = 8;
+/* bg opacity */
+float alpha = 0.8;
+
/* Terminal colors (16 first used in escape sequence) */
static const char *colorname[] = {
/* 8 normal colors */
diff --git a/config.mk b/config.mk
index 4c4c5d5..0114bad 100644
--- a/config.mk
+++ b/config.mk
@@ -16,7 +16,7 @@ PKG_CONFIG = pkg-config
INCS = -I$(X11INC) \
`$(PKG_CONFIG) --cflags fontconfig` \
`$(PKG_CONFIG) --cflags freetype2`
-LIBS = -L$(X11LIB) -lm -lrt -lX11 -lutil -lXft \
+LIBS = -L$(X11LIB) -lm -lrt -lX11 -lutil -lXft -lXrender\
`$(PKG_CONFIG) --libs fontconfig` \
`$(PKG_CONFIG) --libs freetype2`
diff --git a/st.h b/st.h
index 519b9bd..8bb533d 100644
--- a/st.h
+++ b/st.h
@@ -126,3 +126,4 @@ extern unsigned int tabspaces;
extern unsigned int defaultfg;
extern unsigned int defaultbg;
extern unsigned int defaultcs;
+extern float alpha;
diff --git a/x.c b/x.c
index 8a16faa..ddf4178 100644
--- a/x.c
+++ b/x.c
@@ -105,6 +105,7 @@ typedef struct {
XSetWindowAttributes attrs;
int scr;
int isfixed; /* is fixed geometry? */
+ int depth; /* bit depth */
int l, t; /* left and top offset */
int gm; /* geometry mask */
} XWindow;
@@ -243,6 +244,7 @@ static char *usedfont = NULL;
static double usedfontsize = 0;
static double defaultfontsize = 0;
+static char *opt_alpha = NULL;
static char *opt_class = NULL;
static char **opt_cmd = NULL;
static char *opt_embed = NULL;
@@ -736,7 +738,7 @@ xresize(int col, int row)
XFreePixmap(xw.dpy, xw.buf);
xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h,
- DefaultDepth(xw.dpy, xw.scr));
+ xw.depth);
XftDrawChange(xw.draw, xw.buf);
xclear(0, 0, win.w, win.h);
@@ -796,6 +798,13 @@ xloadcols(void)
else
die("could not allocate color %d\n", i);
}
+
+ /* set alpha value of bg color */
+ if (opt_alpha)
+ alpha = strtof(opt_alpha, NULL);
+ dc.col[defaultbg].color.alpha = (unsigned short)(0xffff * alpha);
+ dc.col[defaultbg].pixel &= 0x00FFFFFF;
+ dc.col[defaultbg].pixel |= (unsigned char)(0xff * alpha) << 24;
loaded = 1;
}
@@ -1118,11 +1127,23 @@ xinit(int cols, int rows)
Window parent;
pid_t thispid = getpid();
XColor xmousefg, xmousebg;
+ XWindowAttributes attr;
+ XVisualInfo vis;
if (!(xw.dpy = XOpenDisplay(NULL)))
die("can't open display\n");
xw.scr = XDefaultScreen(xw.dpy);
- xw.vis = XDefaultVisual(xw.dpy, xw.scr);
+
+ if (!(opt_embed && (parent = strtol(opt_embed, NULL, 0)))) {
+ parent = XRootWindow(xw.dpy, xw.scr);
+ xw.depth = 32;
+ } else {
+ XGetWindowAttributes(xw.dpy, parent, &attr);
+ xw.depth = attr.depth;
+ }
+
+ XMatchVisualInfo(xw.dpy, xw.scr, xw.depth, TrueColor, &vis);
+ xw.vis = vis.visual;
/* font */
if (!FcInit())
@@ -1132,7 +1153,7 @@ xinit(int cols, int rows)
xloadfonts(usedfont, 0);
/* colors */
- xw.cmap = XDefaultColormap(xw.dpy, xw.scr);
+ xw.cmap = XCreateColormap(xw.dpy, parent, xw.vis, None);
xloadcols();
/* adjust fixed window geometry */
@@ -1152,19 +1173,15 @@ xinit(int cols, int rows)
| ButtonMotionMask | ButtonPressMask | ButtonReleaseMask;
xw.attrs.colormap = xw.cmap;
- if (!(opt_embed && (parent = strtol(opt_embed, NULL, 0))))
- parent = XRootWindow(xw.dpy, xw.scr);
xw.win = XCreateWindow(xw.dpy, parent, xw.l, xw.t,
- win.w, win.h, 0, XDefaultDepth(xw.dpy, xw.scr), InputOutput,
+ win.w, win.h, 0, xw.depth, InputOutput,
xw.vis, CWBackPixel | CWBorderPixel | CWBitGravity
| CWEventMask | CWColormap, &xw.attrs);
memset(&gcvalues, 0, sizeof(gcvalues));
gcvalues.graphics_exposures = False;
- dc.gc = XCreateGC(xw.dpy, parent, GCGraphicsExposures,
- &gcvalues);
- xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h,
- DefaultDepth(xw.dpy, xw.scr));
+ xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h, xw.depth);
+ dc.gc = XCreateGC(xw.dpy, xw.buf, GCGraphicsExposures, &gcvalues);
XSetForeground(xw.dpy, dc.gc, dc.col[defaultbg].pixel);
XFillRectangle(xw.dpy, xw.buf, dc.gc, 0, 0, win.w, win.h);
@@ -2019,6 +2036,9 @@ main(int argc, char *argv[])
case 'a':
allowaltscreen = 0;
break;
+ case 'A':
+ opt_alpha = EARGF(usage());
+ break;
case 'c':
opt_class = EARGF(usage());
break;

View File

@ -0,0 +1,351 @@
diff --git a/config.def.h b/config.def.h
index 6f05dce..93cbcc0 100644
--- a/config.def.h
+++ b/config.def.h
@@ -199,6 +199,8 @@ static Shortcut shortcuts[] = {
{ TERMMOD, XK_Y, selpaste, {.i = 0} },
{ ShiftMask, XK_Insert, selpaste, {.i = 0} },
{ TERMMOD, XK_Num_Lock, numlock, {.i = 0} },
+ { ShiftMask, XK_Page_Up, kscrollup, {.i = -1} },
+ { ShiftMask, XK_Page_Down, kscrolldown, {.i = -1} },
};
/*
diff --git a/st.c b/st.c
index ebdf360..817cc47 100644
--- a/st.c
+++ b/st.c
@@ -35,6 +35,7 @@
#define ESC_ARG_SIZ 16
#define STR_BUF_SIZ ESC_BUF_SIZ
#define STR_ARG_SIZ ESC_ARG_SIZ
+#define HISTSIZE 2000
/* macros */
#define IS_SET(flag) ((term.mode & (flag)) != 0)
@@ -42,6 +43,9 @@
#define ISCONTROLC1(c) (BETWEEN(c, 0x80, 0x9f))
#define ISCONTROL(c) (ISCONTROLC0(c) || ISCONTROLC1(c))
#define ISDELIM(u) (u && wcschr(worddelimiters, u))
+#define TLINE(y) ((y) < term.scr ? term.hist[((y) + term.histi - \
+ term.scr + HISTSIZE + 1) % HISTSIZE] : \
+ term.line[(y) - term.scr])
enum term_mode {
MODE_WRAP = 1 << 0,
@@ -115,6 +119,9 @@ typedef struct {
int col; /* nb col */
Line *line; /* screen */
Line *alt; /* alternate screen */
+ Line hist[HISTSIZE]; /* history buffer */
+ int histi; /* history index */
+ int scr; /* scroll back */
int *dirty; /* dirtyness of lines */
TCursor c; /* cursor */
int ocx; /* old cursor col */
@@ -184,8 +191,8 @@ static void tnewline(int);
static void tputtab(int);
static void tputc(Rune);
static void treset(void);
-static void tscrollup(int, int);
-static void tscrolldown(int, int);
+static void tscrollup(int, int, int);
+static void tscrolldown(int, int, int);
static void tsetattr(const int *, int);
static void tsetchar(Rune, const Glyph *, int, int);
static void tsetdirt(int, int);
@@ -416,10 +423,10 @@ tlinelen(int y)
{
int i = term.col;
- if (term.line[y][i - 1].mode & ATTR_WRAP)
+ if (TLINE(y)[i - 1].mode & ATTR_WRAP)
return i;
- while (i > 0 && term.line[y][i - 1].u == ' ')
+ while (i > 0 && TLINE(y)[i - 1].u == ' ')
--i;
return i;
@@ -528,7 +535,7 @@ selsnap(int *x, int *y, int direction)
* Snap around if the word wraps around at the end or
* beginning of a line.
*/
- prevgp = &term.line[*y][*x];
+ prevgp = &TLINE(*y)[*x];
prevdelim = ISDELIM(prevgp->u);
for (;;) {
newx = *x + direction;
@@ -543,14 +550,14 @@ selsnap(int *x, int *y, int direction)
yt = *y, xt = *x;
else
yt = newy, xt = newx;
- if (!(term.line[yt][xt].mode & ATTR_WRAP))
+ if (!(TLINE(yt)[xt].mode & ATTR_WRAP))
break;
}
if (newx >= tlinelen(newy))
break;
- gp = &term.line[newy][newx];
+ gp = &TLINE(newy)[newx];
delim = ISDELIM(gp->u);
if (!(gp->mode & ATTR_WDUMMY) && (delim != prevdelim
|| (delim && gp->u != prevgp->u)))
@@ -571,14 +578,14 @@ selsnap(int *x, int *y, int direction)
*x = (direction < 0) ? 0 : term.col - 1;
if (direction < 0) {
for (; *y > 0; *y += direction) {
- if (!(term.line[*y-1][term.col-1].mode
+ if (!(TLINE(*y-1)[term.col-1].mode
& ATTR_WRAP)) {
break;
}
}
} else if (direction > 0) {
for (; *y < term.row-1; *y += direction) {
- if (!(term.line[*y][term.col-1].mode
+ if (!(TLINE(*y)[term.col-1].mode
& ATTR_WRAP)) {
break;
}
@@ -609,13 +616,13 @@ getsel(void)
}
if (sel.type == SEL_RECTANGULAR) {
- gp = &term.line[y][sel.nb.x];
+ gp = &TLINE(y)[sel.nb.x];
lastx = sel.ne.x;
} else {
- gp = &term.line[y][sel.nb.y == y ? sel.nb.x : 0];
+ gp = &TLINE(y)[sel.nb.y == y ? sel.nb.x : 0];
lastx = (sel.ne.y == y) ? sel.ne.x : term.col-1;
}
- last = &term.line[y][MIN(lastx, linelen-1)];
+ last = &TLINE(y)[MIN(lastx, linelen-1)];
while (last >= gp && last->u == ' ')
--last;
@@ -850,6 +857,9 @@ void
ttywrite(const char *s, size_t n, int may_echo)
{
const char *next;
+ Arg arg = (Arg) { .i = term.scr };
+
+ kscrolldown(&arg);
if (may_echo && IS_SET(MODE_ECHO))
twrite(s, n, 1);
@@ -1061,13 +1071,53 @@ tswapscreen(void)
}
void
-tscrolldown(int orig, int n)
+kscrolldown(const Arg* a)
+{
+ int n = a->i;
+
+ if (n < 0)
+ n = term.row + n;
+
+ if (n > term.scr)
+ n = term.scr;
+
+ if (term.scr > 0) {
+ term.scr -= n;
+ selscroll(0, -n);
+ tfulldirt();
+ }
+}
+
+void
+kscrollup(const Arg* a)
+{
+ int n = a->i;
+
+ if (n < 0)
+ n = term.row + n;
+
+ if (term.scr <= HISTSIZE-n) {
+ term.scr += n;
+ selscroll(0, n);
+ tfulldirt();
+ }
+}
+
+void
+tscrolldown(int orig, int n, int copyhist)
{
int i;
Line temp;
LIMIT(n, 0, term.bot-orig+1);
+ if (copyhist) {
+ term.histi = (term.histi - 1 + HISTSIZE) % HISTSIZE;
+ temp = term.hist[term.histi];
+ term.hist[term.histi] = term.line[term.bot];
+ term.line[term.bot] = temp;
+ }
+
tsetdirt(orig, term.bot-n);
tclearregion(0, term.bot-n+1, term.col-1, term.bot);
@@ -1077,17 +1127,28 @@ tscrolldown(int orig, int n)
term.line[i-n] = temp;
}
- selscroll(orig, n);
+ if (term.scr == 0)
+ selscroll(orig, n);
}
void
-tscrollup(int orig, int n)
+tscrollup(int orig, int n, int copyhist)
{
int i;
Line temp;
LIMIT(n, 0, term.bot-orig+1);
+ if (copyhist) {
+ term.histi = (term.histi + 1) % HISTSIZE;
+ temp = term.hist[term.histi];
+ term.hist[term.histi] = term.line[orig];
+ term.line[orig] = temp;
+ }
+
+ if (term.scr > 0 && term.scr < HISTSIZE)
+ term.scr = MIN(term.scr + n, HISTSIZE-1);
+
tclearregion(0, orig, term.col-1, orig+n-1);
tsetdirt(orig+n, term.bot);
@@ -1097,7 +1158,8 @@ tscrollup(int orig, int n)
term.line[i+n] = temp;
}
- selscroll(orig, -n);
+ if (term.scr == 0)
+ selscroll(orig, -n);
}
void
@@ -1126,7 +1188,7 @@ tnewline(int first_col)
int y = term.c.y;
if (y == term.bot) {
- tscrollup(term.top, 1);
+ tscrollup(term.top, 1, 1);
} else {
y++;
}
@@ -1291,14 +1353,14 @@ void
tinsertblankline(int n)
{
if (BETWEEN(term.c.y, term.top, term.bot))
- tscrolldown(term.c.y, n);
+ tscrolldown(term.c.y, n, 0);
}
void
tdeleteline(int n)
{
if (BETWEEN(term.c.y, term.top, term.bot))
- tscrollup(term.c.y, n);
+ tscrollup(term.c.y, n, 0);
}
int32_t
@@ -1735,11 +1797,11 @@ csihandle(void)
break;
case 'S': /* SU -- Scroll <n> line up */
DEFAULT(csiescseq.arg[0], 1);
- tscrollup(term.top, csiescseq.arg[0]);
+ tscrollup(term.top, csiescseq.arg[0], 0);
break;
case 'T': /* SD -- Scroll <n> line down */
DEFAULT(csiescseq.arg[0], 1);
- tscrolldown(term.top, csiescseq.arg[0]);
+ tscrolldown(term.top, csiescseq.arg[0], 0);
break;
case 'L': /* IL -- Insert <n> blank lines */
DEFAULT(csiescseq.arg[0], 1);
@@ -2251,7 +2313,7 @@ eschandle(uchar ascii)
return 0;
case 'D': /* IND -- Linefeed */
if (term.c.y == term.bot) {
- tscrollup(term.top, 1);
+ tscrollup(term.top, 1, 1);
} else {
tmoveto(term.c.x, term.c.y+1);
}
@@ -2264,7 +2326,7 @@ eschandle(uchar ascii)
break;
case 'M': /* RI -- Reverse index */
if (term.c.y == term.top) {
- tscrolldown(term.top, 1);
+ tscrolldown(term.top, 1, 1);
} else {
tmoveto(term.c.x, term.c.y-1);
}
@@ -2474,7 +2536,7 @@ twrite(const char *buf, int buflen, int show_ctrl)
void
tresize(int col, int row)
{
- int i;
+ int i, j;
int minrow = MIN(row, term.row);
int mincol = MIN(col, term.col);
int *bp;
@@ -2511,6 +2573,14 @@ tresize(int col, int row)
term.dirty = xrealloc(term.dirty, row * sizeof(*term.dirty));
term.tabs = xrealloc(term.tabs, col * sizeof(*term.tabs));
+ for (i = 0; i < HISTSIZE; i++) {
+ term.hist[i] = xrealloc(term.hist[i], col * sizeof(Glyph));
+ for (j = mincol; j < col; j++) {
+ term.hist[i][j] = term.c.attr;
+ term.hist[i][j].u = ' ';
+ }
+ }
+
/* resize each row to new width, zero-pad if needed */
for (i = 0; i < minrow; i++) {
term.line[i] = xrealloc(term.line[i], col * sizeof(Glyph));
@@ -2569,7 +2639,7 @@ drawregion(int x1, int y1, int x2, int y2)
continue;
term.dirty[y] = 0;
- xdrawline(term.line[y], x1, y, x2);
+ xdrawline(TLINE(y), x1, y, x2);
}
}
@@ -2590,8 +2660,9 @@ draw(void)
cx--;
drawregion(0, 0, term.col, term.row);
- xdrawcursor(cx, term.c.y, term.line[term.c.y][cx],
- term.ocx, term.ocy, term.line[term.ocy][term.ocx]);
+ if (term.scr == 0)
+ xdrawcursor(cx, term.c.y, term.line[term.c.y][cx],
+ term.ocx, term.ocy, term.line[term.ocy][term.ocx]);
term.ocx = cx;
term.ocy = term.c.y;
xfinishdraw();
diff --git a/st.h b/st.h
index fa2eddf..adda2db 100644
--- a/st.h
+++ b/st.h
@@ -81,6 +81,8 @@ void die(const char *, ...);
void redraw(void);
void draw(void);
+void kscrolldown(const Arg *);
+void kscrollup(const Arg *);
void printscreen(const Arg *);
void printsel(const Arg *);
void sendbreak(const Arg *);

View File

@ -0,0 +1,25 @@
From b5d3351a21442a842e01e8c0317603b6890b379c Mon Sep 17 00:00:00 2001
From: asparagii <michele.lambertucci1@gmail.com>
Date: Thu, 27 Jan 2022 15:44:02 +0100
Subject: [PATCH] st-scrollback-mouse
---
config.def.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/config.def.h b/config.def.h
index e3b469b..c217315 100644
--- a/config.def.h
+++ b/config.def.h
@@ -176,6 +176,8 @@ static uint forcemousemod = ShiftMask;
*/
static MouseShortcut mshortcuts[] = {
/* mask button function argument release */
+ { ShiftMask, Button4, kscrollup, {.i = 1} },
+ { ShiftMask, Button5, kscrolldown, {.i = 1} },
{ XK_ANY_MOD, Button2, selpaste, {.i = 0}, 1 },
{ ShiftMask, Button4, ttysend, {.s = "\033[5;2~"} },
{ XK_ANY_MOD, Button4, ttysend, {.s = "\031"} },
--
2.34.1

View File

@ -0,0 +1,7 @@
case "${ACTION}" in
post)
tic -sx usr/share/terminfo/s/st.terminfo
;;
esac

View File

@ -0,0 +1,11 @@
case "${ACTION}" in
pre)
rm usr/share/terminfo/s/st
rm usr/share/terminfo/s/st-bs
rm usr/share/terminfo/s/st-bs-256color
rm usr/share/terminfo/s/st-mono
rm usr/share/terminfo/s/st-meta
rm usr/share/terminfo/s/st-meta-256color
rm usr/share/terminfo/s/st-256color
;;
esac

View File

@ -0,0 +1,33 @@
# Template file for 'st'
pkgname=st
version=0.8.5
revision=1
build_style=gnu-makefile
make_use_env=compliant
hostmakedepends="pkg-config"
makedepends="fontconfig-devel libX11-devel libXft-devel"
depends="ncurses st-terminfo-${version}_${revision}"
short_desc="Simple terminal implementation for X"
maintainer="Orphaned <orphan@voidlinux.org>"
license="MIT"
homepage="https://st.suckless.org"
distfiles="https://dl.suckless.org/${pkgname}/${pkgname}-${version}.tar.gz"
checksum=ea6832203ed02ff74182bcb8adaa9ec454c8f989e79232cb859665e2f544ab37
pre_build() {
sed -i 's|Liberation Mono|Monospace|g' config.def.h
[ -e ${FILESDIR}/config.h ] && cp ${FILESDIR}/config.h config.h
# We will use tic after install. See INSTALL.
vsed -i Makefile -e '/tic/d'
}
post_install() {
vinstall st.info 644 usr/share/terminfo/s st.terminfo
vdoc README
vlicense LICENSE
}
st-terminfo_package() {
short_desc+=" - terminfo data"
depends="ncurses"
pkg_install() {
vmove usr/share/terminfo
}
}