You are not authenticated, login.
text: sort by
tags: modified
type: chronology
hide / / print
ref: -0 tags: gtk.css scrollbar resize linux qt5 date: 10-28-2021 18:47 gmt revision:3 [2] [1] [0] [head]

Put this in ~/.config/gtk-3.0/gtk.css make scrollbars larger on high-DPI screens. ref

.scrollbar {
  -GtkScrollbar-has-backward-stepper: 1;
  -GtkScrollbar-has-forward-stepper: 1;
  -GtkRange-slider-width: 16;
  -GtkRange-stepper-size: 16;
scrollbar slider {
    /* Size of the slider */
    min-width: 16px;
    min-height: 16px;
    border-radius: 16px;

    /* Padding around the slider */
    border: 2px solid transparent;

.scrollbar.vertical slider,
scrollbar.vertical slider {
    min-height: 16px;
    min-width: 16px;

scrollbar.horizontal slider {
min-width: 16px;
min-height: 16px;

/* Scrollbar trough squeezes when cursor hovers over it. Disabling that

.scrollbar.vertical.dragging:dir(ltr) {
    margin-left: 0px;

.scrollbar.vertical.dragging:dir(rtl) {
    margin-right: 0px;

.scrollbar.horizontal.slider.dragging {
    margin-top: 0px;
undershoot.top, undershoot.right, undershoot.bottom, undershoot.left { background-image: none; }
undershoot.top, undershoot.right, undershoot.bottom, undershoot.left { background-image: none; }

Also add:

to your ~/.bashrc

To make the scrollbars a bit easier to see in QT5 applications, run qt5ct (after apt-getting it), and add in a new style sheet, /usr/share/qt5ct/qss/scrollbar-simple-backup.qss

/* SCROLLBARS (NOTE: Changing 1 subcontrol means you have to change all of them)*/
  background: palette(alternate-base);
  margin: 0px 0px 0px 0px;
  margin: 0px 0px 0px 0px;
  background: #816891;
  border: 1px solid transparent;
  border-radius: 1px;
QScrollBar::handle:hover, QScrollBar::add-line:hover, QScrollBar::sub-line:hover{
  background: palette(highlight);
subcontrol-origin: none;
QScrollBar::add-line:vertical, QScrollBar::sub-line:vertical{
height: 0px;
QScrollBar::add-line:horizontal, QScrollBar::sub-line:horizontal{
width: 0px;
subcontrol-origin: none;

hide / / print
ref: notes-0 tags: perl one-liner svn strip lines count resize date: 03-22-2011 16:37 gmt revision:13 [12] [11] [10] [9] [8] [7] [head]

to remove lines beginning with a question mark (e.g. from subversion)

svn status | perl -nle 'print if !/^?/' 

here's another example, for cleaning up the output of ldd:

ldd kicadocaml.opt | perl -nle '$_ =~ /^(.*?)=>/; print $1 ;' 

and one for counting the lines of non-blank source code:

cat *.ml | perl -e '$n = 0; while ($k = <STDIN>) {if($k =~ /\w+/){$n++;}} print $n . "\n";'

By that metric, kicadocaml (check it out!), which I wrote in the course of learning Ocaml, has about 7500 lines of code.

Here is one for resizing a number of .jpg files in a directory into a thumb/ subdirectory:

ls -lah | perl -nle 'if( $_ =~ /(\w+)\.jpg/){ `convert $1.jpg -resize 25% thumb/$1.jpg`;}'
or, even simpler:
ls *.JPG | perl -nle '`convert $_ -resize 25% thumb/$_`;'

Note that -e command line flag tells perl to evaluate the expression, -n causes the expression to be evaluated once per input line from standard input, and -l puts a line break after every print statement. reference

For replacing charaters in a file, do something like:

cat something |  perl -nle '$_ =~ s/,/\t/g; print $_'