Browse Source

Slock configured a little bit

main
Yiğit Çolakoğlu 4 years ago
parent
commit
bb8a736c79
55 changed files with 2516 additions and 208 deletions
  1. +19
    -3
      arch-setup/AUR.txt
  2. +2
    -0
      arch-setup/chroot.sh
  3. +1
    -1
      arch-setup/fetch_keys.sh
  4. +99
    -3
      arch-setup/nonAUR.txt
  5. +6
    -6
      config/X11/xinitrc
  6. +1
    -1
      config/tmux/tmux.conf
  7. +0
    -4
      config/zathura/a
  8. +0
    -1
      config/zathura/zathurarc
  9. +1823
    -0
      config/zsh/.zcompdump.tatooine.345706
  10. +1
    -1
      config/zsh/profile
  11. +3
    -10
      install.sh
  12. +1
    -1
      local/bin/daily-update
  13. +1
    -1
      local/bin/devmon
  14. +1
    -1
      local/bin/dmenu-udevil
  15. +1
    -1
      local/bin/dmenu-wallabag
  16. +1
    -1
      local/bin/dmenu_surf
  17. +1
    -1
      local/bin/fastfetch
  18. +1
    -1
      local/bin/kbmap_toggle
  19. +1
    -1
      local/bin/keyboard
  20. +1
    -1
      local/bin/lock
  21. +1
    -1
      local/bin/menu-surfraw
  22. +1
    -1
      local/bin/newmail.sh
  23. +1
    -1
      local/bin/nextcloud-sync
  24. +1
    -1
      local/bin/nm_sendmail.sh
  25. +1
    -1
      local/bin/pacontrol.sh
  26. +1
    -1
      local/bin/password_manager
  27. +1
    -1
      local/bin/purge_hist
  28. +1
    -1
      local/bin/start-spotifyd
  29. +1
    -1
      local/bin/status-bar/bluetooth
  30. +1
    -1
      local/bin/status-bar/clipboard
  31. +1
    -1
      local/bin/status-bar/dunst
  32. +1
    -1
      local/bin/status-bar/keyboard
  33. +1
    -1
      local/bin/status-bar/mail
  34. +1
    -1
      local/bin/status-bar/mconnect
  35. +1
    -1
      local/bin/status-bar/memory
  36. +1
    -1
      local/bin/status-bar/screensaver
  37. +1
    -1
      local/bin/status-bar/volume
  38. +1
    -1
      local/bin/stop-spotifyd
  39. +1
    -1
      local/bin/tedportal
  40. +1
    -1
      local/bin/toggle_monitor.sh
  41. +1
    -1
      local/bin/toggle_touchpad.sh
  42. +1
    -1
      local/bin/update_events.sh
  43. +1
    -1
      local/bin/weechat_start
  44. +1
    -1
      local/bin/ytfzf_dmenu
  45. +1
    -1
      local/bin/zaread
  46. +5
    -5
      root/kdialog
  47. +12
    -2
      suckless/slock/config.h
  48. +33
    -0
      suckless/slock/slock.c
  49. +13
    -12
      suckless/st/config.h
  50. +351
    -0
      suckless/st/patches/st-scrollback-0.8.4.diff
  51. +13
    -0
      suckless/st/patches/st-scrollback-mouse-20191024-a2c479c.diff
  52. +0
    -90
      suckless/st/patches/st-universcroll-0.8.4.diff
  53. +98
    -32
      suckless/st/st.c
  54. +2
    -1
      suckless/st/st.h
  55. +0
    -2
      suckless/st/x.c

+ 19
- 3
arch-setup/AUR.txt View File

@ -1,13 +1,13 @@
activitywatch-bin
aic94xx-firmware
antibody
betterdiscord
betterdiscord-git
betterdiscordctl-git
betterlockscreen
bfg
bitwarden
bitwarden-cli
brave-bin
brave-nightly-bin
canto-next-git
checkupdates+aur
checkupdates-aur
@ -23,12 +23,18 @@ google-chrome
google-cloud-sdk
googler
gtk2_prefs
haskell-haddock-library1.9
i3lock-color
ifuse
jellyfin-mpv-shim
jetbrains-toolbox
lf
libsvg
libsvg-cairo
libxft-bgra
ly
mailspring
mpd-mpris
mpris-ctl
mpv-mpris-git
mutt-wizard
@ -39,16 +45,25 @@ notion-enhancer
numix-icon-theme-git
nvm
pam-gnupg
parcel-bundler
peaclock
perl-any-moose
perl-checkupdates-aur
perl-date-holidayparser
perl-www-aur
pipes.sh
pistol-git
plymouth-git
plymouth-theme-cubes-git
plymouth-theme-darth-vader-git
postman-bin
python-click-spinner
python-delorean
python-jellyfin-apiclient
python-mpv
python-mpv-jsonipc
qt5-styleplugins
r8152-dkms
readability-cli
renpy-sdk
rofi-bluetooth-git
@ -61,7 +76,6 @@ spotifyd-full-git
sselp
sublime-text-3
surf
tela-icon-theme
terminal_dimensions-git
termpdf-git
tmsu-bin
@ -72,12 +86,14 @@ vtop
vue-cli
wallabag-client
wd719x-firmware
webkitgtk-bin
whatsapp-nativefier-dark
xbanish-timeout-git
xchat-se
xkb-switch
xkblayout-state-git
xmenu
xsvg
yaft
ytfzf
zoom

+ 2
- 0
arch-setup/chroot.sh View File

@ -128,6 +128,8 @@ pacman -R nano # uninstall nano, eww
rm -rf /etc/sudoers.d/nopwd
echo "%wheel ALL=(ALL) ALL" >> /etc/sudoers.d/wheel
rm -rf /bin/sh
ln -sf /bin/dash /bin/sh
echo "SETUP COMPLETE"
bash

+ 1
- 1
arch-setup/fetch_keys.sh View File

@ -15,7 +15,7 @@ sudo chmod +x /usr/bin/jsteg
sudo wget -O /usr/bin/slink https://minio.yigitcolakoglu.com/dotfiles/slink-linux-amd64 > /dev/null 2> /dev/null
sudo chmod +x /usr/bin/slink
~/.local/bin/jsteg reveal $loc > /tmp/out.zip.gpg
~/.local/share/bin/jsteg reveal $loc > /tmp/out.zip.gpg
echo "Please enter your passphrase: "
gpg -d /tmp/out.zip.gpg > /tmp/out.zip


+ 99
- 3
arch-setup/nonAUR.txt View File

@ -28,12 +28,14 @@ atkmm
atool
attica
attr
audiofile
audit
autoconf
autoconf-archive
autoconf2.13
automake
avahi
babl
baobab
base
bash
@ -63,6 +65,7 @@ ca-certificates
ca-certificates-mozilla
ca-certificates-utils
cairo
cairo-perl
cairomm
calcurse
calibre
@ -70,13 +73,16 @@ cantarell-fonts
canto-curses
capnproto
capstone
catdoc
cbindgen
cblas
cdparanoia
ceph-libs
cheese
chmlib
chromaprint
chrony
cifs-utils
cinnamon-desktop
clang
clipnotify
@ -89,8 +95,8 @@ code
cogl
colord
compiler-rt
conky
coreutils
cpanminus
cpupower
cracklib
cronie
@ -132,6 +138,7 @@ electron6
elinks
enchant
engrampa
ethtool
exa
exempi
exfat-utils
@ -154,6 +161,7 @@ firefox-developer-edition
flac
fltk
fluidsynth
fmt
fontconfig
fontforge
foremost
@ -179,6 +187,7 @@ gdk-pixbuf-xlib
gdk-pixbuf2
gdl
gdm
gegl
geoclue
geocode-glib
gettext
@ -186,12 +195,14 @@ ghc-libs
ghostscript
giblib
giflib
gimp
girara
git
gjs
gksu
glew
glib-networking
glib-perl
glib2
glib2-docs
glibc
@ -249,6 +260,7 @@ gstreamer
gtk-doc
gtk-update-icon-cache
gtk2
gtk2-perl
gtk3
gtkmm3
gtkspell3
@ -314,7 +326,6 @@ haskell-errors
haskell-file-embed
haskell-glob
haskell-haddock-library
haskell-haddock-library1.9
haskell-hashable
haskell-hourglass
haskell-hslua
@ -410,9 +421,11 @@ imagemagick
imake
imlib2
inetutils
iniparser
inkscape
intel-ucode
intltool
iperf
iproute2
iptables
iputils
@ -484,7 +497,9 @@ l-smash
lame
lapack
lcms2
ldb
ldns
lensfun
less
lhasa
lib32-gcc-libs
@ -503,6 +518,7 @@ lib32-zstd
libabw
libaec
libaio
libao
libarchive
libass
libassuan
@ -515,6 +531,7 @@ libavtp
libblockdev
libbluray
libbs2b
libbsd
libbytesize
libcaca
libcanberra
@ -606,12 +623,14 @@ liblqr
liblrdf
libluv
libmad
libmanette
libmatroska
libmaxminddb
libmediainfo
libmfx
libmicrodns
libmicrohttpd
libmikmod
libmm-glib
libmms
libmng
@ -619,15 +638,18 @@ libmnl
libmodplug
libmpc
libmpcdec
libmpdclient
libmpeg2
libmspub
libmtp
libmwaw
libmypaint
libndp
libnet
libnetfilter_conntrack
libnewt
libnfnetlink
libnfs
libnftnl
libnghttp2
libnice
@ -672,6 +694,7 @@ libsasl
libseccomp
libsecret
libshout
libsidplayfp
libsigc++
libsigsegv
libsm
@ -697,11 +720,13 @@ libtiff
libtirpc
libtommath
libtool
libtorrent-rasterbar
libuninameslist
libunistring
libunrar
libunwind
libupnp
liburing
libusb
libusb-compat
libusbmuxd
@ -718,6 +743,7 @@ libvterm
libwacom
libwebp
libwmf
libwnck3
libwpd
libwpe
libwpg
@ -737,7 +763,6 @@ libxfce4ui
libxfce4util
libxfixes
libxfont2
libxft
libxi
libxinerama
libxkbcommon
@ -750,6 +775,7 @@ libxnvctrl
libxpm
libxrandr
libxrender
libxres
libxshmfence
libxslt
libxss
@ -793,6 +819,7 @@ mailcap
make
mallard-ducktype
man-db
man-pages
mariadb
mariadb-clients
mariadb-libs
@ -804,6 +831,7 @@ media-player-info
mediainfo
mesa
meson
metis
minizip
mjpegtools
mkinitcpio
@ -813,6 +841,8 @@ mlocate
mobile-broadband-provider-info
mono
mozilla-common
mpc
mpd
mpfr
mpg123
mpv
@ -821,8 +851,10 @@ msmtp
mtdev
mujs
mutter
mypaint-brushes1
mysql-workbench
nasm
ncmpcpp
ncurses
ncurses5-compat-libs
ndctl
@ -852,6 +884,7 @@ nspr
nss
ntfs-3g
nuspell
oath-toolkit
odt2txt
oniguruma
openal
@ -878,6 +911,7 @@ pambase
pamixer
pandoc
pango
pango-perl
pangomm
parted
pass
@ -887,9 +921,21 @@ pciutils
pcre
pcre2
perl
perl-b-hooks-endofscope
perl-class-load
perl-class-load-xs
perl-clone
perl-cpan-meta-check
perl-data-optlist
perl-devel-globaldestruction
perl-dist-checkconflicts
perl-encode-locale
perl-error
perl-eval-closure
perl-exporter-tiny
perl-extutils-config
perl-extutils-helpers
perl-extutils-installpaths
perl-file-listing
perl-file-next
perl-file-remove
@ -907,21 +953,47 @@ perl-io-html
perl-io-socket-ssl
perl-json
perl-libwww
perl-list-moreutils
perl-list-moreutils-xs
perl-locale-gettext
perl-lwp-mediatypes
perl-lwp-protocol-https
perl-mailtools
perl-module-build
perl-module-build-tiny
perl-module-implementation
perl-module-install
perl-module-runtime
perl-module-scandeps
perl-moose
perl-mouse
perl-mro-compat
perl-namespace-autoclean
perl-namespace-clean
perl-net-http
perl-net-ssleay
perl-package-deprecationmanager
perl-package-stash
perl-package-stash-xs
perl-par-dist
perl-params-util
perl-parse-yapp
perl-sub-exporter
perl-sub-exporter-progressive
perl-sub-identify
perl-sub-install
perl-sub-name
perl-task-weaken
perl-test-checkdeps
perl-test-fatal
perl-timedate
perl-try-tiny
perl-uri
perl-variable-magic
perl-www-robotrules
perl-xml-parser
perl-yaml-tiny
phonon-qt4
phonon-qt5
phonon-qt5-gstreamer
php
@ -932,11 +1004,13 @@ pipewire-media-session
pixman
pkgconf
playerctl
pngquant
podofo
polkit
polkit-gnome
polkit-qt5
poppler
poppler-data
poppler-glib
popt
portaudio
@ -970,6 +1044,7 @@ python-beautifulsoup4
python-bleach
python-cachecontrol
python-cairo
python-capstone
python-cchardet
python-cffi
python-chardet
@ -994,6 +1069,7 @@ python-docutils
python-entrypoints
python-exifread
python-feedparser
python-filebytes
python-gnupg
python-gobject
python-gpgme
@ -1063,6 +1139,7 @@ python-pycparser
python-pycryptodome
python-pycups
python-pycurl
python-pydantic
python-pyexiftool
python-pygments
python-pykwalify
@ -1088,6 +1165,7 @@ python-requests-toolbelt
python-resolvelib
python-retrying
python-rfc3986
python-ropper
python-ruamel-yaml
python-ruamel.yaml.clib
python-scandir
@ -1118,6 +1196,7 @@ python-toml
python-tornado
python-tqdm
python-traitlets
python-typing_extensions
python-tzlocal
python-unidecode
python-unrardll
@ -1127,6 +1206,7 @@ python-vobject
python-watchdog
python-wcwidth
python-webencodings
python-websocket-client
python-wheel
python-wrapt
python-xlib
@ -1176,14 +1256,18 @@ python2-toml
python2-urllib3
python2-webencodings
python2-zipp
qbittorrent
qpdf
qt4
qt5-base
qt5-declarative
qt5-graphicaleffects
qt5-imageformats
qt5-location
qt5-multimedia
qt5-quickcontrols
qt5-quickcontrols2
qt5-script
qt5-speech
qt5-svg
qt5-tools
@ -1194,6 +1278,7 @@ qt5-websockets
qt5-x11extras
qt5ct
qtkeychain-qt5
qutebrowser
radare2
ranger
rapidjson
@ -1229,6 +1314,7 @@ ruby-thor
rubygems
run-parts
rust
samba
sbc
sbsigntools
scdoc
@ -1246,7 +1332,9 @@ shaderc
shadow
shared-mime-info
shotwell
simplescreenrecorder
slang
smbclient
snappy
solid
sonic-visualiser
@ -1266,7 +1354,9 @@ sshfs
startup-notification
stegoveritas
stfl
strace
sudo
suitesparse
svt-av1
svt-hevc
sxiv
@ -1280,6 +1370,8 @@ t1lib
taglib
talloc
tar
task
taskwarrior-tui
tbb
tcl
tcsh
@ -1287,6 +1379,7 @@ tdb
telegram-desktop
termite
termite-terminfo
tevent
texinfo
thermald
thin-provisioning-tools
@ -1294,6 +1387,7 @@ thunar
thunderbird
thunderbird-extension-enigmail
tidy
tk
tlp
tmate
tmux
@ -1315,6 +1409,7 @@ twine
twolame
tzdata
uchardet
udevil
udisks2
ueberzug
unclutter
@ -1376,6 +1471,7 @@ xcb-util-renderutil
xcb-util-wm
xcb-util-xrm
xclip
xcompmgr
xdg-dbus-proxy
xdg-utils
xf86-input-libinput


+ 6
- 6
config/X11/xinitrc View File

@ -19,10 +19,10 @@ export SSH_AUTH_SOCK
clipmenud > /tmp/clipmenud.out 2> /tmp/clipmenud.err &
rm -f ~/.surf/tabbed-surf.xid
/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &
~/.local/bin/daily-update
~/.local/bin/keyboard > /tmp/keyboard.out 2> /tmp/keyboard.err
xrdb ~/.Xresources &
~/.local/bin/mailsync &
~/.local/share/bin/daily-update
~/.local/share/bin/keyboard > /tmp/keyboard.out 2> /tmp/keyboard.err
xrdb ~/.config/X11/Xresources &
~/.local/share/bin/mailsync &
if [ "$NEXTCLOUD" = true ] ; then
nextcloud --background &
@ -43,7 +43,7 @@ fi
mpd &
mpd-mpris &
touch ~/.cache/nextcloud-track
xss-lock -- /home/yigit/.local/bin/lock &
xss-lock -- /home/yigit/.local/share/bin/lock &
echo "on" > ~/.cache/screensaver
dbus-update-activation-environment --systemd DISPLAY
picom --no-fading-openclose &
@ -57,7 +57,7 @@ pactl load-module module-x11-bell sample=x11-bell display=$DISPLAY
xset b 100
xset dpms 600 600 600
~/.local/bin/devmon --exec-on-drive "/sbin/notify-send '禍 drive mounted' '%l (%f) at %d '" \
~/.local/share/bin/devmon --exec-on-drive "/sbin/notify-send '禍 drive mounted' '%l (%f) at %d '" \
--exec-on-remove "/sbin/notify-send '禍 drive removed' '%l (%f) from %d '" \
--exec-on-unmount "/sbin/notify-send '禍 drive unmounted' '%l (%f) from %d '" \
--no-unmount --no-gui &


+ 1
- 1
config/tmux/tmux.conf View File

@ -155,5 +155,5 @@ set -g @tmux_power_show_web_reachable true
if "test ! -d ~/.local/share/tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.local/share/tmux/plugins/tpm && ~/.local/share/tmux/plugins/tpm/bin/install_plugins'"
run '~/.local/share/tmux/plugins/tpm/tpm'
run -b '~/.local/share/tmux/plugins/tpm/tpm'

+ 0
- 4
config/zathura/a View File

@ -1,4 +0,0 @@
set synctex true
set synctex-editor-command "vim +%{line} %{input}"
map <C-i> recolor

+ 0
- 1
config/zathura/zathurarc View File

@ -9,7 +9,6 @@ set pages-per-row 1
#stop at page boundries
set scroll-page-aware "true"
set smooth-scroll "true"
set scroll-full-overlap 0.01
set scroll-step 100


+ 1823
- 0
config/zsh/.zcompdump.tatooine.345706
File diff suppressed because it is too large
View File


+ 1
- 1
config/zsh/profile View File

@ -15,4 +15,4 @@ export EDITOR=vim
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:$FLUTTER_HOME/bin
export PATH="$PATH:/home/yigit/.local/bin:/home/yigit/.gem/ruby/2.7.0/bin:$GOPATH/bin:$GOPATH/binexport:/home/yigit/.local/bin"
export PATH="$PATH:/home/yigit/.local/share/bin:/home/yigit/.gem/ruby/2.7.0/bin:$GOPATH/bin:$GOPATH/binexport:/home/yigit/.local/share/bin"

+ 3
- 10
install.sh View File

@ -11,7 +11,7 @@ mvie(){
# Configuring for your username
if [ ! "$username" = "yigit" ]; then
grep -rl "/home/$username/.dotfiles" | xargs sed -i "s/\/home\/yigit/\/home\/$username/g"
grep -rl "yigit" | xargs sed -i "s/yigit/$username/g"
fi
# Install packages
@ -52,15 +52,8 @@ for d in ~/.dotfiles/local/share/* ; do
ln -s $d ~/.local/share
done
# Binaries
mkdir -p ~/.local/bin
mkdir -p ~/.dotfiles_backup/local/bin
for d in ~/.dotfiles/local/bin/* ; do
filename=$(echo "$d" | rev | cut -d"/" -f 1 | rev)
mvie ~/.local/bin/$filename ~/.dotfiles_backup/local/bin
ln -s $d ~/.local/bin
done
mvie ~/.local/share/bin ~/.dotfiles_backup/local/share/bin
ln -s ~/.dotfiles/local/bin ~/.local/share/bin
mvie ~/.local/backgrounds ~/.dotfiles_backup/local/backgrounds
ln -s ~/.dotfiles/local/backgrounds ~/.local/backgrounds


+ 1
- 1
local/bin/daily-update View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
hour=$(date +"%-H")


+ 1
- 1
local/bin/devmon View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
# Script Name: devmon http://igurublog.wordpress.com/downloads/script-devmon/
# Requires: udevil bash>=4 Recommended: eject spacefm|zenity
# Optional: udisks v1 may be substituted for udevil


+ 1
- 1
local/bin/dmenu-udevil View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
DMENU=${DMENU:-dmenu}


+ 1
- 1
local/bin/dmenu-wallabag View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
itemcache="${XDG_DATA_HOME:-$HOME/.cache}/wallabag-dmenu"


+ 1
- 1
local/bin/dmenu_surf View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
lines=12
blacklist='google'


+ 1
- 1
local/bin/fastfetch View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
if [ ! -f "$HOME/.cache/neofetch" ]; then
mkdir -p "$HOME/.cache"


+ 1
- 1
local/bin/kbmap_toggle View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
layout=$(xkb-switch -p)


+ 1
- 1
local/bin/keyboard View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
setxkbmap "us,tr" -option caps:escape # Set keyboard layout. map CapsLock to Esc
xset r rate 180 40


+ 1
- 1
local/bin/lock View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
curl 'http://yeetclock/setcolor?R=2000&G=10&B=000&O=0' &
/home/yigit/.local/bin/pacontrol.sh open-mute
/home/yigit/.local/bin/dunst_toggle.sh -s


+ 1
- 1
local/bin/menu-surfraw View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
# Menu Surfraw: https://github.com/TomboFry/menu-surfraw


+ 1
- 1
local/bin/newmail.sh View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
mbsync $1
notmuch new
notmuch tag --batch --input=/home/yigit/.notmuch_tag

+ 1
- 1
local/bin/nextcloud-sync View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
source $HOME/.config/nextcloud/nextcloud


+ 1
- 1
local/bin/nm_sendmail.sh View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
# Put the message, send to stdin, in a variable
m="$(cat -)"


+ 1
- 1
local/bin/pacontrol.sh View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
# pacontrol.sh
#


+ 1
- 1
local/bin/password_manager View File

@ -1,3 +1,3 @@
#!/bin/bash
#!/bin/sh
bitwarden-dmenu --dmenu-args='-i -l 10' --dmenu-pswd-args="-P -nf white" --clear-clipboard 30 --session-timeout 96600 --sync-vault-after 48300 --on-error 'xargs notify-send --urgency=low'

+ 1
- 1
local/bin/purge_hist View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
cat ~/.surf/history.txt > ~/.surf/history.txt
cat ~/.surf/history.txt | sort | uniq >~/.surf/history.txt


+ 1
- 1
local/bin/start-spotifyd View File

@ -1,3 +1,3 @@
#!/bin/bash
#!/bin/sh
systemctl start --user spotifyd

+ 1
- 1
local/bin/status-bar/bluetooth View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
power=$(bluetoothctl show | grep "Powered: yes" | wc -w)


+ 1
- 1
local/bin/status-bar/clipboard View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
clp=$(sselp)


+ 1
- 1
local/bin/status-bar/dunst View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
stats=$(dunstctl is-paused)


+ 1
- 1
local/bin/status-bar/keyboard View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
layout=$(xkb-switch -p | cut -d "(" -f1)


+ 1
- 1
local/bin/status-bar/mail View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
mcount=$(cat ~/.cache/mcount)
msync=$(cat ~/.cache/msync)


+ 1
- 1
local/bin/status-bar/mconnect View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
source ~/.config.env


+ 1
- 1
local/bin/status-bar/memory View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
MEM=$(free | grep Mem | awk '{printf("%d", $3/$2 * 100.0)}')


+ 1
- 1
local/bin/status-bar/screensaver View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
stats=$(<~/.cache/screensaver)


+ 1
- 1
local/bin/status-bar/volume View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
SINK=$(pactl list short sinks | grep -n RUNNING | cut -d":" -f1)
if [ "$SINK" = "" ]; then


+ 1
- 1
local/bin/stop-spotifyd View File

@ -1,3 +1,3 @@
#!/bin/bash
#!/bin/sh
systemctl stop --user spotifyd

+ 1
- 1
local/bin/tedportal View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
selection=$(cat ~/.cache/tedportal | dmenu -i -l 8)
echo $selection


+ 1
- 1
local/bin/toggle_monitor.sh View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
extern=HDMI1
if xrandr | grep -v "$extern disconnected"; then


+ 1
- 1
local/bin/toggle_touchpad.sh View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
if xinput list-props "MSFT0001:00 06CB:7E7E Touchpad" | grep "Device Enabled ([0-9]*):.*1" >/dev/null
then
xinput disable "MSFT0001:00 06CB:7E7E Touchpad"


+ 1
- 1
local/bin/update_events.sh View File

@ -1,3 +1,3 @@
#!/bin/bash
#!/bin/sh
echo $((($(khal list -f \"{uid}\" | wc -l) - 1))) > /home/yigit/.cache/events

+ 1
- 1
local/bin/weechat_start View File

@ -1,3 +1,3 @@
#!/bin/bash
#!/bin/sh
st -e weechat

+ 1
- 1
local/bin/ytfzf_dmenu View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
export YTFZF_EXTMENU=' dmenu -i -l 12'
action=$(echo "" | dmenu -p "Search YouTube")


+ 1
- 1
local/bin/zaread View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
## zaread - a simple script created by paoloap.
# default variables


+ 5
- 5
root/kdialog View File

@ -7,11 +7,11 @@ do
then ((i++))
filename=${!i};
fi
if [ ${!i} = "--version" ]
if [ ${!i} = "--version" ]
then
echo "someversion"
exit
echo "someversion"
exit
fi
done;
@ -20,7 +20,7 @@ path=$( echo ${filename%/*} )
file=$( echo ${filename##/*/} )
rm /tmp/ranger-chrome-choosed
st -c ranger -n ranger -e "ranger" -t file-chooser-ranger
st -c ranger -n ranger -e ranger --choosefiles=/tmp/ranger-chrome-choosed
selected=$(cat /tmp/ranger-chrome-choosed 2> /dev/null)
if [ ! $? = 0 ]
then


+ 12
- 2
suckless/slock/config.h View File

@ -1,6 +1,16 @@
/* user and group to drop privileges to */
static const char *user = "nobody";
static const char *group = "nobody";
/* Drop privilegs to a regular user, very insecure but hey, it works for now */
static const char *user = "yigit";
static const char *group = "yigit";
static const char *lights_on[] = { "/bin/curl", "http://yeetclock/setcolor?R=136&G=192&B=208&O=1", NULL };
static const char *lights_off[] = { "/bin/curl", "http://yeetclock/setcolor?R=0&G=0&B=0&O=0", NULL };
static const char *notifications_on[] = { "/home/yigit/.local/bin/dunst_toggle.sh", "-e", NULL };
static const char *notifications_off[] = { "/home/yigit/.local/bin/dunst_toggle.sh", "-s", NULL };
static const char **prelock[] = {lights_off, notifications_off};
static const char **postlock[] = {lights_on, notifications_on};
static const char *colorname[NUMCOLS] = {
[INIT] = "black", /* after initialization */


+ 33
- 0
suckless/slock/slock.c View File

@ -18,12 +18,15 @@
#include <X11/extensions/Xinerama.h>
#include <X11/keysym.h>
#include <X11/Xlib.h>
#include <signal.h>
#include <X11/Xutil.h>
#include <X11/XKBlib.h>
#include "arg.h"
#include "util.h"
#define LENGTH(X) (sizeof X / sizeof X[0])
char *argv0;
/* global count to prevent repeated error messages */
@ -63,6 +66,7 @@ die(const char *errstr, ...)
exit(1);
}
#ifdef __linux__
#include <fcntl.h>
#include <linux/oom.h>
@ -409,6 +413,24 @@ usage(void)
die("usage: slock [-v] [-f] [-m message] [cmd [arg ...]]\n");
}
void runprelock(){
for(int i = 0; i < LENGTH(prelock); i++){
if(fork() == 0)
execvp(prelock[i][0], (char **)prelock[i]);
}
}
void runpostlock(){
signal(SIGUSR1,runpostlock);
printf("running post lock");
for(int i = 0; i < LENGTH(prelock); i++){
if(fork() == 0)
execvp(postlock[i][0], (char **)postlock[i]);
}
exit(0);
}
int
main(int argc, char **argv) {
struct xrandr rr;
@ -454,6 +476,7 @@ main(int argc, char **argv) {
errno ? strerror(errno) : "group entry not found");
dgid = grp->gr_gid;
#ifdef __linux__
dontkillme();
#endif
@ -466,6 +489,14 @@ main(int argc, char **argv) {
if (!(dpy = XOpenDisplay(NULL)))
die("slock: cannot open display\n");
runprelock();
int postlock_p = fork();
if ( postlock_p == 0 ) {
signal(SIGUSR1,runpostlock);
while(1);
}
/* drop privileges */
if (setgroups(0, NULL) < 0)
die("slock: setgroups: %s\n", strerror(errno));
@ -474,6 +505,7 @@ main(int argc, char **argv) {
if (setuid(duid) < 0)
die("slock: setuid: %s\n", strerror(errno));
/* check for Xrandr support */
rr.active = XRRQueryExtension(dpy, &rr.evbase, &rr.errbase);
@ -511,6 +543,7 @@ main(int argc, char **argv) {
/* everything is now blank. Wait for the correct password */
readpw(dpy, &rr, locks, nscreens, hash);
kill(postlock_p, SIGUSR1);
return 0;
}

+ 13
- 12
suckless/st/config.h View File

@ -181,12 +181,8 @@ static uint forcemousemod = ShiftMask;
static MouseShortcut mshortcuts[] = {
/* mask button function argument release */
{ 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"} },
{ XK_NO_MOD, Button4, ttysend, {.s = "\033[1;3A"}, 0, -1 },
{ XK_NO_MOD, Button5, ttysend, {.s = "\033[1;3B"}, 0, -1 },
{ ShiftMask, Button4, kscrollup, {.i = 5} },
{ ShiftMask, Button5, kscrolldown, {.i = 5} },
};
/* Internal keyboard shortcuts. */
@ -216,15 +212,19 @@ static Shortcut shortcuts[] = {
{ ShiftMask, XK_Insert, selpaste, {.i = 0} },
{ TERMMOD, XK_Num_Lock, numlock, {.i = 0} },
{ TERMMOD, XK_I, iso14755, {.i = 0} },
{ ALTMOD, XK_Up, zoom, {.f = +1} },
{ ALTMOD, XK_Down, zoom, {.f = -1} },
{ ALTMOD, XK_K, zoom, {.f = +1} },
{ ALTMOD, XK_J, zoom, {.f = -1} },
{ ALTMOD, XK_U, zoom, {.f = +2} },
{ ALTMOD, XK_D, zoom, {.f = -2} },
{ ALTMOD, XK_Up, zoom, {.f = +1} },
{ ALTMOD, XK_Down, zoom, {.f = -1} },
{ ALTMOD, XK_K, zoom, {.f = +1} },
{ ALTMOD, XK_J, zoom, {.f = -1} },
{ ALTMOD, XK_U, zoom, {.f = +2} },
{ ALTMOD, XK_D, zoom, {.f = -2} },
{ MODKEY, XK_l, externalpipe, {.v = openurlcmd } },
{ MODKEY, XK_y, externalpipe, {.v = copyurlcmd } },
{ MODKEY, XK_o, externalpipe, {.v = copyoutput } },
{ MODKEY, XK_u, kscrollup, {.i = -1} },
{ MODKEY, XK_d, kscrolldown, {.i = -1} },
{ MODKEY, XK_k, kscrollup, {.i = 2} },
{ MODKEY, XK_j, kscrolldown, {.i = 2} },
};
/*
@ -264,6 +264,7 @@ 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},


+ 351
- 0
suckless/st/patches/st-scrollback-0.8.4.diff 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 76b7e0d..edec064 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(int *, int);
static void tsetchar(Rune, Glyph *, int, int);
static void tsetdirt(int, int);
@@ -414,10 +421,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;
@@ -526,7 +533,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;
@@ -541,14 +548,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)))
@@ -569,14 +576,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;
}
@@ -607,13 +614,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;
@@ -848,6 +855,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);
@@ -1059,13 +1069,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);
@@ -1075,17 +1125,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);
@@ -1095,7 +1156,8 @@ tscrollup(int orig, int n)
term.line[i+n] = temp;
}
- selscroll(orig, -n);
+ if (term.scr == 0)
+ selscroll(orig, -n);
}
void
@@ -1124,7 +1186,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++;
}
@@ -1289,14 +1351,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
@@ -1733,11 +1795,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);
@@ -2241,7 +2303,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);
}
@@ -2254,7 +2316,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);
}
@@ -2464,7 +2526,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;
@@ -2501,6 +2563,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));
@@ -2559,7 +2629,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);
}
}
@@ -2580,8 +2650,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 3d351b6..f44e1d3 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 *);

+ 13
- 0
suckless/st/patches/st-scrollback-mouse-20191024-a2c479c.diff View File

@ -0,0 +1,13 @@
diff --git a/config.def.h b/config.def.h
index ec1b576..4b3bf15 100644
--- a/config.def.h
+++ b/config.def.h
@@ -163,6 +163,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 },
{ XK_ANY_MOD, Button4, ttysend, {.s = "\031"} },
{ XK_ANY_MOD, Button5, ttysend, {.s = "\005"} },

+ 0
- 90
suckless/st/patches/st-universcroll-0.8.4.diff View File

@ -1,90 +0,0 @@
From 9726b1e58352126252412e101432e64d46fc51ca Mon Sep 17 00:00:00 2001
From: Dennis Lee <dennis@dennislee.xyz>
Date: Sun, 28 Jun 2020 23:01:03 -0700
Subject: [PATCH] universcroll: mouse wheel only scroll in all modes
Scroll normally via scroll(1), without Shift, when outside of
`MODE_ALTSCREEN`. Inside an alt screen, continue to scroll normally
without Shift; in this mode, your scrolling is automatically translated
into ^Y and ^E. It just werks!
Based on the existing mouse-altscreen patch
https://st.suckless.org/patches/scrollback/
adapted for st(1) 0.8.4 and scroll(1).
---
config.def.h | 10 +++++-----
st.c | 5 +++++
st.h | 1 +
x.c | 2 ++
4 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/config.def.h b/config.def.h
index 6f05dce..62e87da 100644
--- a/config.def.h
+++ b/config.def.h
@@ -173,11 +173,11 @@ static uint forcemousemod = ShiftMask;
* Beware that overloading Button1 will disable the selection.
*/
static MouseShortcut mshortcuts[] = {
- /* mask button function argument release */
- { XK_ANY_MOD, Button2, selpaste, {.i = 0}, 1 },
- { ShiftMask, Button4, ttysend, {.s = "\033[5;2~"} },
+ /* mask button function argument release alt */
+ { XK_ANY_MOD, Button2, selpaste, {.i = 0}, 1 },
+ { XK_ANY_MOD, Button4, ttysend, {.s = "\033[5;2~"}, 0, -1 },
{ XK_ANY_MOD, Button4, ttysend, {.s = "\031"} },
- { ShiftMask, Button5, ttysend, {.s = "\033[6;2~"} },
+ { XK_ANY_MOD, Button5, ttysend, {.s = "\033[6;2~"}, 0, -1 },
{ XK_ANY_MOD, Button5, ttysend, {.s = "\005"} },
};
diff --git a/st.c b/st.c
index 76b7e0d..1f65453 100644
--- a/st.c
+++ b/st.c
@@ -1047,6 +1047,11 @@ tnew(int col, int row)
treset();
}
+int tisaltscr(void)
+{
+ return IS_SET(MODE_ALTSCREEN);
+}
+
void
tswapscreen(void)
{
diff --git a/st.h b/st.h
index 3d351b6..39cc054 100644
--- a/st.h
+++ b/st.h
@@ -87,6 +87,7 @@ void sendbreak(const Arg *);
void toggleprinter(const Arg *);
int tattrset(int);
+int tisaltscr(void);
void tnew(int, int);
void tresize(int, int);
void tsetdirtattr(int);
diff --git a/x.c b/x.c
index 210f184..210dde9 100644
--- a/x.c
+++ b/x.c
@@ -34,6 +34,7 @@ typedef struct {
void (*func)(const Arg *);
const Arg arg;
uint release;
+ int altscrn; /* 0: don't care, -1: not alt screen, 1: alt screen */
} MouseShortcut;
typedef struct {
@@ -446,6 +447,7 @@ mouseaction(XEvent *e, uint release)
for (ms = mshortcuts; ms < mshortcuts + LEN(mshortcuts); ms++) {
if (ms->release == release &&
ms->button == e->xbutton.button &&
+ (!ms->altscrn || (ms->altscrn == (tisaltscr() ? 1 : -1))) &&
(match(ms->mod, state) || /* exact or forced */
match(ms->mod, state & ~forcemousemod))) {
ms->func(&(ms->arg));
--
2.27.0

+ 98
- 32
suckless/st/st.c View File

@ -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(int *, int);
static void tsetchar(Rune, Glyph *, int, int);
static void tsetdirt(int, int);
@ -414,10 +421,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;
@ -526,7 +533,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;
@ -541,14 +548,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)))
@ -569,14 +576,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;
}
@ -607,13 +614,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;
@ -855,6 +862,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);
@ -1054,11 +1064,6 @@ tnew(int col, int row)
treset();
}
int tisaltscr(void)
{
return IS_SET(MODE_ALTSCREEN);
}
void
tswapscreen(void)
{
@ -1071,13 +1076,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);
@ -1087,17 +1132,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);
@ -1107,7 +1163,8 @@ tscrollup(int orig, int n)
term.line[i+n] = temp;
}
selscroll(orig, -n);
if (term.scr == 0)
selscroll(orig, -n);
}
void
@ -1136,7 +1193,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++;
}
@ -1301,14 +1358,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
@ -1745,11 +1802,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);
@ -2336,7 +2393,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);
}
@ -2349,7 +2406,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);
}
@ -2559,7 +2616,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;
@ -2596,6 +2653,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));
@ -2654,7 +2719,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);
}
}
@ -2675,8 +2740,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();


+ 2
- 1
suckless/st/st.h View File

@ -83,13 +83,14 @@ void draw(void);
void iso14755(const Arg *);
void externalpipe(const Arg *);
void kscrolldown(const Arg *);
void kscrollup(const Arg *);
void printscreen(const Arg *);
void printsel(const Arg *);
void sendbreak(const Arg *);
void toggleprinter(const Arg *);
int tattrset(int);
int tisaltscr(void);
void tnew(int, int);
void tresize(int, int);
void tsetdirtattr(int);


+ 0
- 2
suckless/st/x.c View File

@ -34,7 +34,6 @@ typedef struct {
void (*func)(const Arg *);
const Arg arg;
uint release;
int altscrn; /* 0: don't care, -1: not alt screen, 1: alt screen */
} MouseShortcut;
typedef struct {
@ -453,7 +452,6 @@ mouseaction(XEvent *e, uint release)
for (ms = mshortcuts; ms < mshortcuts + LEN(mshortcuts); ms++) {
if (ms->release == release &&
ms->button == e->xbutton.button &&
(!ms->altscrn || (ms->altscrn == (tisaltscr() ? 1 : -1))) &&
(match(ms->mod, state) || /* exact or forced */
match(ms->mod, state & ~forcemousemod))) {
ms->func(&(ms->arg));


Loading…
Cancel
Save