Instalar software desde el código fuente (stterm).

25 envíos / 0 nuevos
Último envío
Dom, 13/09/2020 - 14:31
Berbellon
Imagen de Berbellon
Desconectado/a
colaborador
se unió: 04/05/16


$udevil mount …

o


$mounter

1:/dev/sda1 *
2:/dev/sdb1

what would you like to mount or un-mount? [1-8]1

/dev/sda1

(m)mount, (u)un-mount or (r)remount? [m,u,r]

Sólo he modificado algunas lineas de dos herramientas de AntiX, todo el mérito es para AntiX.

Dom, 13/09/2020 - 14:32
Berbellon
Imagen de Berbellon
Desconectado/a
colaborador
se unió: 04/05/16


#!/usr/bin/env python

import gtk
import gettext
import os
import sys
#Variables
ButtonWidth = 150
ButtonHeight = 120

ICONS = "/usr/share/icons/antix-numix-bevel"
#ICONS = "/usr/share/icons/antiX-numix-square"
#ICONS = "/usr/share/icons/antiX-papirus"
#ICONS = "/usr/share/icons/antiX-faenza"
#ICONS = "/usr/share/icons/antiX-moka"
#End

class mainWindow():
def build_button_box(self,image,text):

self.button_box = gtk.HBox(False, 2)
self.button_box.set_spacing(8)
button_label = gtk.Label(_(text))

pixbuf = gtk.gdk.pixbuf_new_from_file(image)
button_icon = gtk.Image()
button_icon.set_from_pixbuf(pixbuf)

button_icon.set_size_request(-1, 60)
self.button_box.pack_start(button_icon, False)
self.button_box.pack_start(button_label, False)

self.button_box.show_all()

def button_clicked(self, widget, command):
os.system(command)
sys.exit()

def build_button(self,image,text,command,side):
self.build_button_box(image,text)
Button = gtk.Button()
Button.add(self.button_box)
Button.connect("clicked", self.button_clicked, command)
#Button.set_size_request(ButtonWidth, ButtonHeight)
if side == "left":
self.leftbox.pack_start(Button, expand=True, fill=True, padding=0)
elif side == "right":
self.rightbox.pack_start(Button, expand=True, fill=True, padding=0)
else:
self.mainbox.pack_start(Button, expand=True, fill=True, padding=0)
Button.show()

def __init__(self):
window = gtk.Window(gtk.WINDOW_TOPLEVEL)
window.set_title("Mount/Umount devices")
window.connect("destroy", lambda w: gtk.main_quit())
window.set_position(gtk.WIN_POS_CENTER)
window.set_default_size(400,0)

self.mainbox = gtk.VBox()
window.add(self.mainbox)
self.mainbox.show()

self.packbox = gtk.HBox()
self.mainbox.pack_start(self.packbox)
self.packbox.show()

self.leftbox = gtk.VBox()
self.packbox.pack_start(self.leftbox)
self.leftbox.show()

self.rightbox = gtk.VBox()
self.packbox.pack_start(self.rightbox)
self.rightbox.show()

self.build_button(ICONS+"/drive-removable-media.png","Mount Seagate","$HOME/bin/desktop-mount-umount -L","left")
self.build_button(ICONS+"/usb-creator-kde.png","Mount Hitachi","$HOME/bin/desktop-mount-umount -R","left")
self.build_button(ICONS+"/rox-filer.png","Access USB flash","$HOME/bin/desktop-mount-umount -S","left")

self.build_button(ICONS+"/mountbox.png","Umount Seagate","$HOME/bin/desktop-mount-umount -l","right")
self.build_button(ICONS+"/mountbox.png","Umount Hitachi","$HOME/bin/desktop-mount-umount -r","right")
self.build_button(ICONS+"/drive-removable-media-usb.png","Umount USB flash","$HOME/bin/desktop-mount-umount -s","right")

window.show()

gettext.install(domain = "$HOME/bin/desktop-mount-umount", unicode = False, codeset = 'utf-8')
mainWindow()
gtk.main()

Dom, 13/09/2020 - 14:34
Berbellon
Imagen de Berbellon
Desconectado/a
colaborador
se unió: 04/05/16

/* Habitualmente uso dos dispositivos USB para respaldar mis documentos */


#!/bin/bash
#mount-umount with udevil, bash backend

MOUNTPOINTSDA="/media/$USER/Datos_60GB"
MOUNTPOINTSDB="/media/$USER/Multimedia_400GB"
MOUNTPOINTSDC="/media/$USER/FAT32_30G"
MOUNTPOINTSDD="/media/$USER/FAT32_16G"
UUID="306F-EF63"
PARTITION=`/usr/bin/readlink -f /dev/disk/by-uuid/$UUID`

help() {
echo "Usage:"
echo "-L | --mount_sda Montar Seagate";
echo "-l | --umount_sda Desmontar Seagate";
echo "-R | --mount_sdb Montar Hitachi";
echo "-r | --umount_sdb Desmontar Hitachi";
echo "-S | --rox_usb Acceso datos FAT32_32G/FAT32_16G con rox";
echo "-s | --umount_usb Desmontar dispositivos USB";
}

case $1 in
-L|--mount_sda)
/usr/bin/udevil mount -t ntfs /dev/sda1
/usr/bin/rox $MOUNTPOINTSDA
;;
-l|--umount_sda)
/usr/bin/udevil umount $MOUNTPOINTSDA
;;
h|--help)
help
;;
-R|--mount_sdb)
/usr/bin/udevil mount -t ntfs /dev/sdb1
/usr/bin/rox $MOUNTPOINTSDB
;;
-r|--umount_sdb)
/usr/bin/udevil umount $MOUNTPOINTSDB
;;
-S|--rox_usb)
/usr/bin/rox $MOUNTPOINTSDC
/usr/bin/rox $MOUNTPOINTSDD
;;
-s|--umount_usb)
if grep -qs $PARTITION /proc/mounts; then
/usr/bin/udevil --unmount $MOUNTPOINTSDC
/usr/bin/udevil --unmount $MOUNTPOINTSDD
else
unplugdrive.sh &
exit
fi
;;
*)
if [ "$DISPLAY" ]; then
$desktop_session_exit_gui &
exit
else
echo "$1 Not an option"
help;
fi
;;
esac

Dom, 13/09/2020 - 14:36
Berbellon
Imagen de Berbellon
Desconectado/a
colaborador
se unió: 04/05/16

/* Devmon, monta automáticamente los dispositivos externos */
/* $ls -l /sbin/mount.ntfs
lrwxrwxrwx 1 root root 13 mar 21 2019 /sbin/mount.ntfs -> mount.ntfs-3g
$ls -l /sbin/mount.ntfs-3g
lrwxrwxrwx 1 root root 12 mar 21 2019 /sbin/mount.ntfs-3g -> /bin/ntfs-3g

El driver predeterminado es ntfs-3g para particiones NTFS */