Du bist nicht angemeldet.
So.. dann will ich auch mal wieder....
### convert any video/audio file to ogg
function ogg()
{
for file in *;
do
ffmpeg -i $file -vn -aq 6 -ac 2 -acodec libvorbis $file.ogg ;
done
mkdir ogg
mv *.ogg ./ogg
cd ogg
for file in *;
do
mv -v -- "$file" "${file%.*.*}.${file##*.}";
done
}
### Change spaces to underscores
function rem_space()
{
for file in *;
do
mv "$file" `echo $file | tr ' ' '_'` ;
done
}
### Setze id3-Tag/ogg-Tag "Titel" aus Dateiname
function fn2tag()
{
case "$1" in
### MP3-Title
-m|--mp3)
TAGTOOL="id3v2"
FILEEXTLC="mp3"
FILEEXTUC="MP3"
option=fn2tagopt
;;
-o|--ogg)
TAGTOOL="oggted"
FILEEXTLC="ogg"
FILEEXTUC="OGG"
option=fn2tagopt
;;
*)
echo 'Usage: fn2tag [FILETYPE] <0-9> [OPTIONS] "Prefix/Postfix" "Postfix"'
echo ""
echo "Filetypes: "
echo ""
echo "-m | --mp3 set input file type to mp3"
echo "-o | --ogg set input file type to ogg"
echo ""
echo "Options: "
echo ""
echo "-P | --prefix Using a prefix given at col 4"
echo "-p | --postfix Using a postfix given at col 4"
echo "-B | --both Using prefix given at col 4 and postfix at col 5"
echo "-h | --help Show this help message"
echo ""
echo "Examples:"
echo "- To cut off first 3 chars of file name"
echo " fn2tag 4"
echo ""
echo " Output example for File named 01_Title.mp3: Title"
echo ""
echo ""
echo "- To cut off first 3 chars of file name and add (LIVE) to tag"
echo ' fn2tag 4 --postfix "(LIVE)"'
echo ""
echo " Output example for File named 01_Title.mp3: Title (Live)"
echo ""
echo ""
echo "- To cut off first 3 chars of file name and add prefix (1984) to tag"
echo ' fn2tag 4 --prefix "(1984)"'
echo ""
echo " Output example for File named 01_Title.mp3: (1984) Title"
echo ""
echo ""
echo "- To cut off first 3 chars of file name and add prefix (1984) and postfix (Live) to tag"
echo ' fn2tag 4 --both "(1984)" "(Live)"'
echo ""
echo " Output example for File named 01_Title.mp3: (1984) Title (Live)"
;;
esac
if [[ $option = fn2tagopt ]]; then
case "$2" in
[0-9]*)
case "$3" in
# Using Prefix
-P|--prefix)
for file in *.{$FILEEXTLC,$FILEEXTUC};
do sfile1=`echo "$file" | cut -c $2-`;
sfile2=`echo "$sfile1" | cut -d'.' -f1`;
sfile3=`echo $sfile2 | tr '_' ' '` ;
$TAGTOOL -t "$4 $sfile3" $file;
done
;;
# Using Postfix
-p|--postfix)
for file in *.{$FILEEXTLC,$FILEEXTUC};
do sfile1=`echo "$file" | cut -c $2-`;
sfile2=`echo "$sfile1" | cut -d'.' -f1`;
sfile3=`echo $sfile2 | tr '_' ' '` ;
$TAGTOOL -t "$sfile3 $4" $file;
done
;;
# Using Prefix and Postfix
-B|--both)
for file in *.{$FILEEXTLC,$FILEEXTUC};
do sfile1=`echo "$file" | cut -c $2-`;
sfile2=`echo "$sfile1" | cut -d'.' -f1`;
sfile3=`echo $sfile2 | tr '_' ' '` ;
$TAGTOOL -t "$4 $sfile3 $5" $file;
done
;;
# no option given
*)
for file in *.{$FILEEXTLC,$FILEEXTUC};
do sfile1=`echo "$file" | cut -c $2-`;
sfile2=`echo "$sfile1" | cut -d'.' -f1`;
sfile3=`echo $sfile2 | tr '_' ' '` ;
$TAGTOOL -t "$sfile3" $file;
done
;;
esac
;;
esac
fi
}
### Setze id3-Tag "Titelnummer" aus Dateiname
function id3trackno()
{
for file in *.mp3;
do sfile1=`echo "$file" | cut -c -2`;
id3 -T $sfile1 $file;
done
}
### Schneide die ersten n Zeichen des Dateinamens ab.
function cutfn()
{
case "$1" in
[0-9]*)
for file in *$2;
do sfile1=`echo "$file" | cut -c $1-`;
mv $file $sfile1;
done
;;
*)
echo "Usage: cutfn <0-9> <file extension>"
echo ""
echo "Example: To cut off first 3 chars of file name (don't use Wildcards!)"
echo "cutfn 4 .txt"
echo ""
echo 'Renames every file with ending ".txt" of current folder'
echo "1234test_EXAMPLE.txt > test_EXAMPLE.txt"
;;
esac
}
.. ich weiss.. lange Liste..
Weil ich diese doppelte Pflegearbeit ziemlich umständlich fand, hab ich mir dieses Skript gemacht.
Verständlich. Ich bin da eher von mir ausgegangen, bei mir ändert sich die pacman.conf eigentlich kaum.
Ich fände es einfacher, gleich eine eigene /etc/pacman-testing.conf zu haben (mit den Anmerkungen von Stefan), und diese dann mit @TheRealPacman zu verwenden, ggf. sogar mit einem eigenen Sync-Datenbank-Verzeichniss. Zur Not noch nen Alias auf das Ganze.
Genau das hatte ich vorher und es hat mich ehrlich gesagt ziemlich genervt, meine pacman-Konfiguration immer in zwei Dateien pflegen zu müssen und jedes mal zu kontrollieren, ob die zweite Konfigurationsdatei auch schon alle Änderungen der ersten übernommen hat.
Weil ich diese doppelte Pflegearbeit ziemlich umständlich fand, hab ich mir dieses Skript gemacht.
Dieser Code
sed 's|core|testing|' | sed 's|community|community-testing|'
ist nicht ganz akkurat, obwohl es wohl eher die seltenen Fälle sind, in denen es zu Problemen kommen kann. Der unterstützte Weg, [testing] oder [community-testing] zu aktivieren, ist, sie vor den stabilen Repos einzubinden, aber diese Repos aktiviert zu lassen. Es kann theoretisch durchaus sein, dass ein Paket aus [testing] als neue Abhängigkeit ein Paket aus [core] benötigt, das aber selbst nicht in [testing] ist.
Danke, ich hab's entsprechend abgeändert.
Leider ist das Skript jetzt viel länger und enthält viel repititiven Code. Ich weiß aber im Moment nicht, wie es sich noch besser refaktoren ließe...
Variante #1 schreibt die mirror-Liste von [core] unter [testing], die von [community] unter [community-testing], und falls [multilib] aktiv ist die von [multilib] unter [multilib-testing].
pac-testing.sh
---------------------------
#!/bin/bash
[[ -z "$@" ]] && pacman -h | sed "s|pacman|$0|g" && exit 0
declare TMP_CONFIG_DIR="$(mktemp --tmpdir -d XXXXXXXX)"
declare TMP_CONFIG_FILE="$(mktemp ${TMP_CONFIG_DIR}/XXXXXXXX)"
declare -a PAC_CONF
mapfile < /etc/pacman.conf PAC_CONF
declare IFS=$'\n'
for INDEX in ${!PAC_CONF[@]}; do
if [[ "${PAC_CONF[$INDEX]}" =~ ^\[core\] ]]; then
echo "[testing]" >> ${TMP_CONFIG_FILE}
echo "${PAC_CONF[$(( $INDEX + 1 ))]}" >> ${TMP_CONFIG_FILE}
echo -n "${PAC_CONF[$INDEX]}" >> ${TMP_CONFIG_FILE}
elif [[ "${PAC_CONF[$INDEX]}" =~ ^\[community\] ]]; then
echo "[community-testing]" >> ${TMP_CONFIG_FILE}
echo "${PAC_CONF[$(( $INDEX + 1 ))]}" >> ${TMP_CONFIG_FILE}
echo -n "${PAC_CONF[$INDEX]}" >> ${TMP_CONFIG_FILE}
elif [[ "${PAC_CONF[$INDEX]}" =~ ^\[multilib\] ]]; then
echo "[multilib-testing]" >> ${TMP_CONFIG_FILE}
echo "${PAC_CONF[$(( $INDEX + 1 ))]}" >> ${TMP_CONFIG_FILE}
echo -n "${PAC_CONF[$INDEX]}" >> ${TMP_CONFIG_FILE}
else
echo -n "${PAC_CONF[$INDEX]}" >> ${TMP_CONFIG_FILE}
fi
done
pacman --config ${TMP_CONFIG_FILE} $@
rm -r ${TMP_CONFIG_DIR}
Variante #2 aktiviert einfach die bereits vorhandenen, aber auskommentierten Einträge.
#!/bin/bash
[[ -z "$@" ]] && pacman -h | sed "s|pacman|$0|g" && exit 0
declare TMP_CONFIG_DIR="$(mktemp --tmpdir -d XXXXXXXX)"
declare TMP_CONFIG_FILE="$(mktemp ${TMP_CONFIG_DIR}/XXXXXXXX)"
declare PAC_CONF_FILE='/etc/pacman.conf'
declare -a PAC_CONF
mapfile < ${PAC_CONF_FILE} PAC_CONF
declare IFS=$'\n'
for INDEX in ${!PAC_CONF[@]}; do
if [[ "${PAC_CONF[$INDEX]}" =~ ^\#\[testing\] ]]; then
echo -n "${PAC_CONF[$INDEX]:1}" >> ${TMP_CONFIG_FILE}
echo "${PAC_CONF[$(( $INDEX + 1 ))]:1}" >> ${TMP_CONFIG_FILE}
elif [[ "${PAC_CONF[$INDEX]}" =~ ^\#\[community-testing\] ]]; then
echo -n "${PAC_CONF[$INDEX]:1}" >> ${TMP_CONFIG_FILE}
echo "${PAC_CONF[$(( $INDEX + 1 ))]:1}" >> ${TMP_CONFIG_FILE}
elif [[ "${PAC_CONF[$INDEX]}" =~ ^\#\[multilib-testing\] ]]; then
if grep -q -E '^\[multilib\]' ${PAC_CONF_FILE}; then
echo -n "${PAC_CONF[$INDEX]:1}" >> ${TMP_CONFIG_FILE}
echo "${PAC_CONF[$(( $INDEX + 1 ))]:1}" >> ${TMP_CONFIG_FILE}
fi
else
echo -n "${PAC_CONF[$INDEX]}" >> ${TMP_CONFIG_FILE}
fi
done
pacman --config ${TMP_CONFIG_FILE} $@
rm -r ${TMP_CONFIG_DIR}
Ich konnte mich nicht entscheiden, aber wahrscheinlich ist Variante #2 besser...
Wenn man sich schnell mal was aus den testing-repos installieren möchte:
Ich fände es einfacher, gleich eine eigene /etc/pacman-testing.conf zu haben (mit den Anmerkungen von Stefan), und diese dann mit @TheRealPacman zu verwenden, ggf. sogar mit einem eigenen Sync-Datenbank-Verzeichniss. Zur Not noch nen Alias auf das Ganze.
Dieser Code
sed 's|core|testing|' | sed 's|community|community-testing|'
ist nicht ganz akkurat, obwohl es wohl eher die seltenen Fälle sind, in denen es zu Problemen kommen kann. Der unterstützte Weg, [testing] oder [community-testing] zu aktivieren, ist, sie vor den stabilen Repos einzubinden, aber diese Repos aktiviert zu lassen. Es kann theoretisch durchaus sein, dass ein Paket aus [testing] als neue Abhängigkeit ein Paket aus [core] benötigt, das aber selbst nicht in [testing] ist.
Wenn man sich schnell mal was aus den testing-repos installieren möchte:
pac-testing.sh
------------------------------
#!/bin/bash
[[ -z "$@" ]] && pacman -h | sed "s|pacman|$0|g" && exit 0
declare CONFIG_DIR="$(mktemp --tmpdir -d XXXXXXXX)"
declare CONFIG_FILE="$(mktemp ${CONFIG_DIR}/XXXXXXXX)"
cat /etc/pacman.conf | sed 's|core|testing|' | sed 's|community|community-testing|' \
> ${CONFIG_FILE}
pacman --config ${CONFIG_FILE} $@
rm -r ${CONFIG_DIR}
Beispiel:
$ pac-testing.sh -Ss virtualbox
community-testing/virtualbox 5.2.10-1 [installed: 5.2.8-1]
...
# pac-testing -S virtualbox
resolving dependencies...
looking for conflicting packages...
...
--> installiert virtualbox aus [community-testing]
[ot]
Ob es sinnvoll wäre, ein Thema namens "Eure brauchbarsten Skripte" zu erstellen? o.O
[/ot]
Upgrade-Skript für (systemd-basierte) Dual-/Multi-Boot-Systeme.
Wenn man neben Arch noch weitere Linux-Installationen auf der Platte hat, die man vielleicht selten braucht, oder die aus irgendeinem Grund halt dort herumliegen, ist es imo etwas nervig, wenn man jedes mal neu booten muss, nur um diese anderen Systeme upgrade-frisch zu halten.
Darum habe ich mir ein kleines Wrapper-Skript gemacht, welches eine andere systemd-basierte Linux-Installation in einen systemd-nspawn Container lädt, dort das Upgrade durchführt und den Container danach wieder schließt.
Hier am Beispiel eines daneben installierten LinuxMint':
#!/bin/bash
declare DEVICE='/dev/mapper/VG0_SSD-linuxmint'
declare MOUNTPOINT='/home/user/mnt/linuxmint'
declare UPGRADE_COMMAND='mintupdate-tool -k -l12345 upgrade'
# handle mount point
declare -i DONT_UMOUNT=0
if mount | grep -qE "${DEVICE} on ${MOUNTPOINT}"; then
let DONT_UMOUNT++
else
mount "${DEVICE}" "${MOUNTPOINT}" || exit 1
fi
# handle dns resolution
declare NAMESERVER=$(grep -m1 ^nameserver /etc/resolv.conf)
# run upgrade inside container
systemd-nspawn -D "${MOUNTPOINT}" /bin/bash << EOF
if ! grep -q ^nameserver /etc/resolv.conf; then
if [[ -h /etc/resolv.conf ]]; then
if ! [[ -e \$(\\ls -l /etc/resolv.conf | cut -f12- -d' ') ]]; then
install -D /dev/null \$(\\ls -l /etc/resolv.conf | cut -f12- -d' ')
fi
echo "${NAMESERVER}" > \$(\\ls -l /etc/resolv.conf | cut -f12- -d' ')
else
echo "${NAMESERVER}" > /etc/resolv.conf
fi
fi
${UPGRADE_COMMAND}
df -Th | \\grep -E "(Filesystem|${DEVICE})"
EOF
# handle mount point
if [[ ${DONT_UMOUNT} -eq 0 ]]; then
umount "${MOUNTPOINT}"
fi
Firefox 57+ hat ein dunkles Theme, das man unter "Anpassen…" auswählen kann. Leider aber sind das Seitenpanel, die Startseite und die Neuer-Tab-Seite nicht daran angepasst, was ich ergänzt/geändert habe.
Anpassungen an das dunkle Theme von Firefox 57+
Seitenpanels (Lesezeichen, Chronik):
~/.mozilla/firefox/<Profilname>/chrome/userChrome.css
/* Do not remove the @namespace line – it's required for correct functioning */
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
@namespace html url("http://www.w3.org/1999/xhtml"); /* namespace for HTML elements */
/* =============================== Sidebar ============================ */
/* :::::::::::::::::::::::::: Version 2017-12-11 :::::::::::::::::::::: */
#sidebar, #sidebar-header, #bookmarksPanel, #bookmarks-view,
#history-panel, #historyTree, #viewButton {
background: #2e2e2e !important;
color: #f7f7f7 !important;
}
#sidebar-header,
.sidebar-header {
font-size: 1.15em !important;
font-weight: normal !important;
}
.sidebar-placesTreechildren::-moz-tree-cell(hover),chrome://browser/content/history/history-panel.xul
.sidebar-placesTreechildren::-moz-tree-row(selected),
.sidebar-placesTreechildren::-moz-tree-cell-text(hover),
.sidebar-placesTreechildren::-moz-tree-cell-text(selected),
#viewButton:hover {
background: #474749 !important;
color: #d1d1d1 !important;
}
#sidebar-splitter {
opacity: 0.2 !important;
width: 1px !important;
border: 0 !important;
}
treechildren::-moz-tree-image(title, container),
treechildren::-moz-tree-image(title, open) {
list-style-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4QwLFwAK+oFUbAAAAKZJREFUOMvtk7EJw0AMRV+CVbgKXHO7ZIC0LryD5/AQ17twfa0H0AyewgTcGFy4UIoQcCCESy5lPqgRvCeQEOSmaZoTYI/y3lvf9+dkgYhch2EwVTVVtRCCOees67pLCn8ATFWfmuM40rYt0zS9G8y2ba8FKVmWhaqq7oKcHRYAMcav4LquOeZe8S/4gaAQEeZ5pizLj8B1XRERAExEbP9QKbVj8nIDQYtGe9TGy2QAAAAASUVORK5CYII=') !important;
}
@-moz-document url("chrome://browser/content/bookmarks/bookmarksPanel.xul"),
url("chrome://browser/content/history/history-panel.xul") {
#search-box > hbox {
height: 1.9em !important;
color: #d1d1d1 !important;
background: #474747 !important;
}
textbox {
-moz-appearance: none !important;
cursor: text !important;
margin: 2px 4px !important;
padding: 2px 2px 3px !important;
padding-inline-start: 4px !important;
background-color: #474747 !important;
color: #474747 !important;
border: 1px solid #111111 !important;
}
textbox:hover {
border: 1px solid #4AA6D7 !important;
box-shadow:0 1px 2px rgba(12, 12, 13, 0.6) !important;
}
}
Startseite und Neuer Tab:
~/.mozilla/firefox/<Profilname>/chrome/userContent.css
/* ======================= about:newtab about:home ====================== */
/* ::::::::::::::::::::::::: Version 2017-12-13 ::::::::::::::::::::::::: */
@-moz-document url(about:newtab), url(about:home) {
body {
background-size: cover !important;
background-color: #262626 !important;
overflow: auto !important;
color: #d1d1d1 !important;
}
#newtab-customize-overlay {
background: #2e2e2e !important;
}
.card,
.prefs-pane .sidebar {
background: #2e2e2e !important;
color: #f7f7f7 !important;
}
.prefs-pane .actions {
background: #2e2e2e !important;
border-left: 1px solid #ededed;
}
.prefs-pane-button button {
border: 1px solid #ededed !important;
}
.prefs-pane-button button:hover {
background-color: none !important;
fill: rgba(12, 12, 13, 0.6) !important;
}
.prefs-pane .prefs-modal-inner-wrapper .options {
background: none !important;
}
.context-menu, .section-top-bar .info-option {
background: #444 !important;
color: #ededed !important;
font-size: 13px !important;
}
#onboarding-notification-bar.onboarding-opened {
display: none !important; /* Keine Reklame auf der Startseite */
}
#snippets-container {
background: #bababa !important;
opacity: 1 !important;
}
.section-title span {
color: #d1d1d1 !important;
fill: #737373 !important;
vertical-align: middle !important;
}
.icon,
.icon.icon-topsites,
.icon.icon-pocket,
.info-option-icon,
.icon.icon-highlights {
fill: #d1d1d1 !important;
}
.card {
background: #474747 !important;
}
.topic,
.card-host-name,
.card-context,
.data-reactid,
.empty-state-message,
.card-outer,
.card-text,
.card-title {
color: #d1d1d1 !important;
}
.card-outer .card-text:not(.no-description) .card-title {
color: inherit !important;
}
.modal {
background: #535353 !important;
}
.tile {
background: #d1d1d1 !important;
}
.actions button:not(.done) {
background: #777777 !important;
border: 1px solid #B1B1B3;
border-radius: 4px;
color: #d1d1d1 !important;
cursor: pointer;
white-space: nowrap;
}
.section-top-bar .info-option-manage button,
.section-top-bar .info-option-manage button::after,
.edit-topsites-wrapper .edit-topsites-button button,
.topic .topic-read-more,
.topic .topic-read-more::after,
.data-reactid,
.info-option-link,
.topic-link {
color: #4AA6D7 !important;
fill: #4AA6D7 !important;
background: transparent !important;
}
.search-wrapper input {
border: 1px solid #111111 !important;
background: #474747 !important;
}
.search-wrapper:active input,
.search-wrapper input:focus {
border-color: #4AA6D7 !important;
box-shadow: none !important;
}
.search-wrapper .search-label,
.search-wrapper .search-button {
fill: #919191 !important;
}
}
Ein ergänzender Tipp:
Ich weiß ja nicht, wie‘s euch damit geht – ich jedenfalls finde den Pocketkram und "Wichtigste Seiten" auf der Startseite ebenso unnütz wie störend. Aber das Anpinnen von Seiten als Schnellstart finde ich durchaus brauchbar.
Die Anzahl der angezeigten Schnellstartkästchen läßt sich beliebig erhöhen: Shift+F2 (Entwickler-Symbolleiste), Wert reinkopieren, Leerzeichen, Enter
pref set browser.newtabpage.activity-stream.topSitesCount 42
Wenn die automatisch nachrückenden Seiten der zahlenden Kundschaft stören:
pref set browser.newtabpage.activity-stream.default.sites https://bbs.archlinux.de/index.php,https://www.archlinux.de/packages
(Damit eine Scrollbar eingeblendet wird, falls die erweiterte Schnellstartseite nicht mehr in‘s Fenster passt, habe ich in userContent.css auf "overflow: auto;"" korrigiert.)
Weil mich die ewige Tipperei nervt, wenn ich mal eine gerade öfters relevante Kollektion von Servicen checken will:
#!/bin/bash
declare -a SERVICES=(
'named.service'
'pdnsd.service'
'dnscrypt-proxy.socket'
'dnscrypt-proxy.service'
)
declare -a IS_ACTIVE
declare Si
declare -i INC=0
for Si in ${SERVICES[@]}; do
IS_ACTIVE[$INC]="$(systemctl is-active $Si)"
INC+=1
done
declare IAi
INC=0
for IAi in ${IS_ACTIVE[@]}; do
if [[ "$IAi" == "active" ]]; then
printf " %-28s %s \033[1;32m%s\033[0m\n" "${SERVICES[$INC]}" ":" "${IS_ACTIVE[$INC]}"
elif [[ "$IAi" == "inactive" ]]; then
printf " %-28s %s \033[0;31m%s\033[0m\n" "${SERVICES[$INC]}" ":" "${IS_ACTIVE[$INC]}"
else
printf " %-28s %s %s\n" "${SERVICES[$INC]}" ":" "${IS_ACTIVE[$INC]}"
fi
INC+=1
done
Das schöne ist, dass hier nur der Inhalt des Arrays nach den eigenen aktuellen Bedürfnissen angepasst werden muss.
Und ganz wichtig: die Ausgabe kommt bunt und in Farbe.
Der CSS-Code modifiziert die Firefox-Searchbar in‘s Listenformat, in etwa so, wie die Suchmaschinenliste früher war.
Funktioniert sowohl mit hellen als auch dunklen GTK3-Themes ab Firefox 45.
~/.mozilla/firefox/PROFILNAME/chrome/userChrome.css
/* ======================= Firefox Searchbar als Liste ====================== */
/* ::::::::::::::: Basis: chrome://browser/skin/searchbar.css :::::::::::::::: */
/* Version 2018.04.29 */
/* Listenformat Suchmaschinen */
.searchbar-engine-one-off-item[tooltiptext] {
width: 100% !important;
height: 24px !important;
background-image: none !important;
padding-left: 6px !important;
box-sizing: content-box !important;
line-height: 1em !important;
color: inherit !important;
}
/* Leere Felder und animiertes "Mit Soundso suchen" verbergen */
.searchbar-engine-one-off-item:not([tooltiptext]), .search-panel-current-input {
display: none !important;
}
/* Trennlinien zwischen Listeneinträgen */
.searchbar-engine-one-off-item[tooltiptext], .addengine-item,
.searchbar-engine-one-off-item.last-of-row:not(.dummy) {
border-bottom: 1px solid #cccccc !important;
margin-top: -1px !important; /* Korrektur border 2px (top+bottom) */
}
.search-setting-button, .search-setting-button:not(.last-row) {
border: none !important;
}
/* Namen der Suchmaschinen */
.searchbar-engine-one-off-item[tooltiptext]::after {
content: attr(tooltiptext);
display: block !important;
margin: 5px 6px 0px !important;
}
/* Icons der Suchmaschinen */
.searchbar-engine-one-off-item > .button-box {
display: inline-flex !important;
width: 16px !important;
max-width: 16px !important;
margin-top: 4px !important;
}
/* Vertikale Mindesthöhe Suchvorschläge 4 Einträge zu 1.5em */
.search-panel-tree > .autocomplete-treebody {
min-height: 6em !important;
}
/* Anpassung Schriftfarbe an jeweiliges GTK3-Theme */
.search-panel-header {
border: none !important;
color: inherit !important;
background-color: inherit !important;
}
.search-panel-header[selected],
.search-panel-header:hover {
background-color: Highlight !important;
}
.search-panel-header > label {
font-style: italic !important;
}
.searchbar-engine-one-off-item[selected], .search-setting-button[selected] {
color: HighlightText !important;
}
.search-panel-one-offs {
border-top: 1px solid #cccccc !important;
background-color: inherit !important;
}
/* ------------------------------- Optional ----------------------------------*/
/* Bei Bedarf vertikale Höhe der Schrift nachjustieren (default 6px): */
.searchbar-engine-one-off-item[tooltiptext]::after {
margin-top: 6px !important;
}
Update – Voransichten nachgereicht: Default helles und dunkles Theme | Modifiziertes helles und dunkles Theme
Update – Getestet bis Firefox 59
Update – Ich habe die Option zum Ausblenden von 'Suchmaschine hinzufügen' entfernt, weil die entsprechende Funktion ab FF 57 in den Sucheinstellungen entfernt worden ist.
Update – Automatische Anpassung der Schriftfarbe an das Dark Theme ab Firefox 61 (zum Zeitpunkt der Änderung noch Nightly)
Update – Verbesserungen beim Zusammenspiel von Firefox- und GTK3-Themes ab Firefox 59 – 29.04.2018
OK, vergesst die letzte Funktion von mir - hier nochmal ein Update derselbigen zwecks saubererer Umgang mit Variablen:
hello ()
{
[[ -z "$RHOST" ]] && RHOST="archlinux.org";
[[ -n $1 ]] && RHOST="$1";
declare P_OUT;
declare -i N=2;
until [[ $N -eq 0 ]]; do
echo -e ".\c";
P_OUT=$(ping -c1 $RHOST 2> /dev/null);
N=$?;
[[ N -eq 0 ]] || sleep 1s;
done;
echo -e "\b$P_OUT"
}
Kurz zur Erklärung:
Die Variable RHOST verbleibt im Scope der ausführenden Shell.
Wenn ich also einmal
$ hello google.de
verwendet habe, merkt sich das die Shell und ich brauche beim nächsten mal nur noch
$ hello
aufzurufen und erhalte das gleiche Ergebnis.
Alle anderen Variablen verbleiben jedoch im Scope der Funktion, so dass es da keine Beeinflussung zwischen Shell und Funktion gibt.
Steht die Internetverbindung schon?
hello ()
{
RHOST="archlinux.org"
[[ -n $1 ]] && RHOST="$1"
declare -i N=2;
until [[ $N -eq 0 ]]; do
echo -e ".\c";
STDOUT=$(ping -c1 $RHOST 2> /dev/null);
N=$?;
[[ N -eq 0 ]] || sleep 1s;
done;
echo -e "\b$STDOUT"
}
liefert:
$ hello
.......................PING archlinux.org (66.211.214.131) 56(84) bytes of data.
64 bytes from gudrun.archlinux.org (66.211.214.131): icmp_seq=1 ttl=54 time=123 ms
--- archlinux.org ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 123.950/123.950/123.950/0.000 ms
$
und mit Argument:
$ hello debian.org
.....PING debian.org (5.153.231.4) 56(84) bytes of data.
64 bytes from senfter.debian.org (5.153.231.4): icmp_seq=1 ttl=51 time=48.5 ms
--- debian.org ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 48.592/48.592/48.592/0.000 ms
$
... wegen staendig auftretender Fehlermeldung beim Abmelden/schliessen des Terminals
alias :q='exit'
Um Bilder zu scannen...
### Scan Image
function scanimg()
{
if [[ "$1" ]]; then
case "$1" in
*.png) scanimage -x 210 -y 297 --format=png > "$1" ;;
*.jpg) scanimage -x 210 -y 297 --format=jpg > "$1" ;;
*.tiff) scanimage -x 210 -y 297 --format=tiff > "$1" ;;
*) echo "'"$1"' Error. Please go away" ;;
esac
else
echo "Usage: scanimg FILE.png | FILE.jpg | FILE.tiff"
fi
}
... und um Netzlaufwerke einzubinden (inkl. Start des NAS)
function wnas()
{
if [ "$(ls -A /mnt/sshfs/daten)" ]; then
echo "...bereits eingebunden"
else
PING=$(ping -c 1 -W 3 XXX.XXX.XXX.XXX && echo 1)
if [ "$PING" = "1" ]; then
mount /mnt/sshfs/daten &&
mount /mnt/sshfs/musik &&
echo "... erledigt"
else
wol XX:XX:XX:XX:XX:XX &&
echo "warte 10 Sekunden auf Festplattenstart" &&
sleep 10 &&
mount /mnt/sshfs/daten &&
mount /mnt/sshfs/musik &&
echo "... erledigt"
fi
fi
}
}
Da war doch noch was ^^