Fedora-Fr - Communauté francophone Fedora - Linux

Communauté francophone des utilisateurs de la distribution Linux Fedora.

  

Dernière news : Rencontrez Borsalinux-fr aux RMLL à Strasbourg du 7 au 12 juillet

#1 07/12/2015 02:56:43

Heldwin
Charlie
Inscription : 07/10/2008
Messages : 4 076

[MATE] script pour lecture DVD

Hello,

J'ai fait un script qui fonctionne pas trop mal, qui évolue en fonction du matériel que j'ai eu ou possède, mais j'en n'ai pas beaucoup chez moi :)
C'est principalement pour regarder des films ou stream sur ma TV que je lance depuis mon  PC (reliée par un cable HDMI avec adapteur HDMI->DVI ou directement en HDMI, il détecte les 2)
(j'ai mis que 2 écrans, car je n'en ai pas plus pour regarder ce que ça donne avec ça, et j'ai pas le besoin, mais c'est modifiable)

Je le lance depuis 2 lanceurs que j'ai sur mon panel: 1 pour désactiver et l'autre pour l'activer (les utilisateurs l'ont en lecteur seule)

J'ai un doute pour la partie de la gestion Pulseaudio (qui est d'ailleurs incomplète), ainsi que sur la détection des écrans.
Je ne sais pas si juste gérer les 2 sinks suffit (est-ce que les speakers internes sont toujours sur le default-sink 0 ?)
et j'ai peur que l'affichage se mette sur un écran qui a disparu (ça deviendrait peut-être embêtant :) mais je pense que Mate sait rétablir)

Vous voyez des améliorations à faire ?
Peut-être la gestion des portables si sur batterie, mais je sais pas si c'est vraiment utile, car il devrait être sur ac dans ce cas ?

Fichier: dvd-time

#!/bin/bash
# Usage: dvd-time -s 0|1 [-m same|2|3] [-c soundcard_name -p profile] [-v] [-u]


# ----------------------------------------------------------------------------------------
# Liste des cartes voulues - remplacez par les votres ici
# pactl list cards, pour les noms des cartes sons et les profiles voulus
# 1er: speakers, 2ème: sortie hdmi, 3ème: carte son externe
cards=("alsa_card.pci-0000_00_1b.0" "alsa_card.pci-0000_01_00.1" "alsa_card.usb-Denon_DJ_DS1-00")
profiles=("analog-surround-51" "hdmi-stereo" "analog-surround-40")

# Indications des résolution/fréquences/etc. 
# Il faut indiquer quel est l'écran principal dans la gestion d'affichage du système
# scaling semble faire bugger mes écrans...

resolution_screen1="1920x1080;60"
resolution_screen2="1920x1080;50"
#resolution_screen2="1280x720;50"
scale_screen2="2.0x2.0"
resolution_screen3="1920x1080;60"
scale_screen3="2.0x2.0"

# Pour permettre d'exclure un écran (fantome ou non)
excluded_screen="VGA-2-1"

# ----------------------------------------------------------------------------------------


# Default variables
display="same_image"                       # valeur par défaut (voir -m)

# Variables
RED='\033[0;31m'
#DRED='\033[1;31m'
GREEN='\033[0;32m'
#DGREEN='\033[1;32m'
YELLOW='\033[0;33m'
#DYELLOW='\033[1;33m'
BLUE='\033[0;34m'
#DBLUE='\033[1;34m'
#MAGENTA='\033[0;35m'
#DMAGENTA='\033[1;35m'
#CYAN='\033[0;36m'
#DCYAN='\033[1;36m'
NC='\033[0m' 


# Functions
function getScreens {

	local cmd_screens=$(xrandr)
	ls_screens=($(printf '%s\n' "$cmd_screens" | gawk '/ connected/ && !/'"$excluded_screen"'/ { print $1 }'))
	nbr_screens="${#ls_screens[@]}"
	ls_primary=$(printf '%s\n' "$cmd_screens"| gawk '/ primary/ { print $1 }')

	if [[ "$nbr_screens" -eq 2 ]]; then
		ls_secondary=$(printf '%s\n' "$cmd_screens" | gawk '/ connected/ && !/ primary/ && !/'"$excluded_screen"'/ { print $1 }')

	# TODO
	elif [[ "$nbr_screens" -eq 3 ]]; then
		ls_secondary=$(printf '%s\n' "$cmd_screens"| gawk '/ connected/ && !/ primary/ && !/'"$excluded_screen"'/ { print $1 }' | head -n 1)
		ls_tierce=$(printf '%s\n' "$cmd_screens"| gawk '/ connected/ && !/ primary/ && !/'"$excluded_screen"'/ { print $1 }' | tail -n 1)
	fi
	
	check_secondary=$(printf '%s\n' "${ls_screens[@]}" |  grep "$ls_secondary")
	check_tierce=$(printf '%s\n' "${ls_screens[@]}" |  grep "$ls_tierce")
}

function calculatePos {

	local -r resolution1_temp=$(printf '%s' "$1" | gawk -F"x" '{ print $1 }')
	local -r resolution2_temp=$(printf '%s' "$3" | gawk -F"x" '{ print $1 }')
	local -r scale=$(printf '%s' "$2" | gawk -F"x" '{ print $1 }')

	position2="$resolution1_temp"
	if [[ "$nbr_screens" -eq 3 ]]; then
		position3=$(echo "$resolution1_temp + ($resolution2_temp * $scale)" | bc -l | gawk -F"." '{ print $1 }')
	fi
}

function getPulse {

	isPulse=$(pgrep -u "$(whoami)" 'pulseaudio')
	if [[ -n $isPulse ]]; then
		nbr_sinks=$(pactl list short sinks | wc -l)
		nbr_sources=$(pactl list short sources | grep -c "alsa_output")
	fi
}

function findSink {

	pactl set-card-profile "$card_index" "output:$profile"
	local source=$(printf '%s' "$1" | sed 's|alsa_card|alsa_output|')
	sink_found=$(pactl list short sinks | grep "$source")
	sink_index=$(printf '%s' "$sink_found" | gawk '{ print $1 }')
	sink_name=$(printf '%s' "$sink_found" | gawk '{ print $2 }')
}

function findSource {

	pactl set-card-profile "$card_index" "output:${profile}"
	local source=$(printf '%s' "$1" | sed 's|alsa_card|alsa_input|')
	source_found=$(pactl list short sources | grep "$source")
	source_index=$(printf '%s' "$source_found" | gawk '{ print $1 }')
	source_name=$(printf '%s' "$source_found" | gawk '{ print $2 }')
}

function findCardNumber {

	card_found=$(pactl list short cards | grep "$1")
	card_index=$(printf '%s' "$card_found" | gawk '{ print $1 }')
}

function listCardProfiles {

	next_card_index=$((card_index + 1))
	ls_profiles=($(LANG=C pactl list cards | gawk '/Card #'"$card_index"'/{flag=1;next}/Card #'"$next_card_index"'/{flag=0}flag' \
		             | gawk '/Profiles/{flag=1;next}/Active Profile/{flag=0}flag' | gawk -F":" '/output:/{ print $2 }'))
	nbr_profiles="${#ls_profiles[@]}"
}

function moveAllSounds {

	local sinkindex="$1"
	local output=$(printf '%s' "$2" | sed 's|alsa_card|alsa_output|')
	inputs=($(pactl list short sink-inputs | gawk '{ print $1 }'))
	snd_count=0
	for sound in "${inputs[@]}"; do pactl move-sink-input "$sound" "$sinkindex"; (( snd_count++ )); done
	sink_status=$(pactl list short sinks | grep -i "$output" | gawk '{ print $7 }')
}

function getDE {

	isMate=$(pgrep -u "$(whoami)" 'mate-session')
}

function switch_powerDisplay {

	if [[ "$status" -eq 1 ]]; then 
		printf '%s' "Deactivation power display             "
		display_ac="0"
	elif [[ "$status" -eq 0 ]]; then
		printf '%s' "Activation power display (30 min)      "
		display_ac="1800"
	fi
	gsettings set org.mate.power-manager sleep-display-ac "$display_ac"
}

function switch_screensaver {

	if [[ "$status" -eq 1 ]]; then 
		printf '%s' "Deactivation screensaver               "
		idle_enabled="false"
		lock_enabled="false"
	elif [[ "$status" -eq 0 ]]; then
		printf '%s' "Activation screensaver                 "
		idle_enabled="true"
		lock_enabled="true"
	fi
	gsettings set org.mate.screensaver idle-activation-enabled "$idle_enabled"
	gsettings set org.mate.screensaver lock-enabled "$lock_enabled"
}

function switch_inactivity {

	if [[ "$status" -eq 1 ]]; then 
		printf '%s' "Setting session idle delay (2 hours)   "
		idle_delay="120"
	elif [[ "$status" -eq 0 ]]; then
		printf '%s' "Setting session idle delay (10 min)    "
		idle_delay="10"
	fi
	gsettings set org.mate.session idle-delay "$idle_delay"
}

function switch_screenOutput {

	getScreens

	#for screen_index in $(seq 1 "$nbr_screens"); do
	#	eval temp="resolution_screen${screen_index}"
	#	eval resolution${screen_index}=$(eval printf "%s" "\$$temp" | gawk -F";" '{ print $1 }')
	#	eval frequency${screen_index}=$(eval printf  "%s" "\$$temp" | gawk -F";" '{ print $2 }')
	#done

	resolution1=$(printf '%s' "$resolution_screen1" | gawk -F";" '{ print $1 }')
	frequency1=$(printf  '%s' "$resolution_screen1" | gawk -F";" '{ print $2 }')
	resolution2=$(printf '%s' "$resolution_screen2" | gawk -F";" '{ print $1 }')
	frequency2=$(printf  '%s' "$resolution_screen2" | gawk -F";" '{ print $2 }')
	resolution3=$(printf '%s' "$resolution_screen3" | gawk -F";" '{ print $1 }')
	frequency3=$(printf  '%s' "$resolution_screen3" | gawk -F";" '{ print $2 }')

	xrandr -s 0
	if [[ "$nbr_screens" -eq 1 ]]; then 
		if [[ -z $check_scecondary && -z $check_tierce ]]; then
			printf '%s' "Forcing primary even if only 1 screen  "
			screen="$ls_primary"

		elif [[ -z $check_primary && -z $check_tierce ]]; then
			printf '%s' "Forcing secondary even if only 1 screen"
			screen="$ls_secondary"

		else
			printf '%s' "Forcing tierce even if only 1 screen"
			screen="$ls_tierce"
		fi
		xrandr --output "$screen" --auto --rotate normal 

	elif [[ "$nbr_screens" -eq 2 ]]; then 

		if [[ "$status" -eq 1 ]]; then 

			if [[ "$display" == same_image ]]; then
				printf '%s' "Activation same image on 2 screens     "
				position2="same as primary"
				xrandr --output "$ls_primary" --primary --mode "$resolution1" --rate "$frequency1"  --rotate normal \
				       --output "$ls_secondary" --mode "$resolution2" --rate "$frequency2" --rotate normal --same-as "$ls_primary"
			
			elif [[ "$display" == "2_screens" ]]; then
				printf '%s' "Activation display on 2 screens        "
				calculatePos "$resolution1" "$scale_screen2"

				if [[ "$resolution1" == resolution2 ]]; then
					xrandr --output "$ls_primary" --primary --mode "$resolution1" --rate "$frequency1" --rotate normal \
				       	       --output "$ls_secondary" --mode "$resolution2" --rate "$frequency2" --rotate normal --right-of "$ls_primary"
					#xrandr --output "$ls_primary" --primary --mode "$resolution1" --rate "$frequency1" --scale 1.0x1.0 --pos 0x0 --rotate normal \
				       	#       --output --fb "3941x1080" "$ls_secondary" --prefered  --rotate normal
				       	       #--output "$ls_secondary" --mode "$resolution2" --rate "$frequency2" --scale 1.0x1.0 --pos "${position2}x0" --rotate normal
				else
					xrandr --output "$ls_primary" --primary --mode "$resolution1" --rate "$frequency1" --scale 1.0x1.0 --pos 0x0 --rotate normal \
				       	       --output "$ls_secondary" --mode "$resolution2" --rate "$frequency2" --scale "$scale_screen2" --pos "${position2}x0" --rotate normal
					#xrandr --fb "$resolution1" --output "$ls_secondary" --scale 2.5x2.5 --output "$ls_primary" --pos 0x0 --panning 1920x1080+0+0/1920x1080+0+0/32/32/32/32
				fi

			else 
				printf '%s' "Action switch display                  "
				return 1
			fi

		elif [[ "$status" -eq 0 ]]; then
			printf '%s' "Activation only 1 screen (2 detected)  "
			position2="none"
			xrandr --output "$ls_primary" --primary --mode "$resolution1" --rate "$frequency1" --rotate normal --output "$ls_secondary" --off
		fi

	elif [[ "$nbr_screens" -eq 3 ]]; then 

		if [[ "$status" -eq 1 ]]; then 

			# TODO and CHECK when 3 screens will be found
                        if [[ "$display" == "3_screens" ]]; then
                                printf '%s' "Activation display on 3 screens        "
                                calculatePos "$resolution1" "$scale_screen2" "$resolution2"

                                if [[ "$resolution1" == resolution2 && "$resolution1" == resolution3 ]]; then
                                        xrandr --output "$ls_primary" --primary --mode "$resolution1" --rate "$frequency1" --rotate normal \
                                               --output "$ls_secondary" --mode "$resolution2" --rate "$frequency2" --rotate normal --right-of "$ls_primary" \
                                               --output "$ls_tierce" --mode "$resolution3" --rate "$frequency3" --rotate normal --right-of "$ls_secondary"
                                else
                                        xrandr --output "$ls_primary" --primary --mode "$resolution1" --rate "$frequency1" --scale 1.0x1.0 --pos 0x0 --rotate normal \
                                               --output "$ls_secondary" --mode "$resolution2" --rate "$frequency2" --scale "$scale_screen2" --pos "${position2}x0" --rotate normal \
                                               --output "$ls_tierce" --mode "$resolution3" --rate "$frequency3" --scale "$scale_screen3" --pos "${position3}x0" --rotate normal

                                        #xrandr --fb "$resolution1" --output "$ls_secondary" --scale 2.5x2.5 --output "$ls_primary" --pos 0x0 --panning 1920x1080+0+0/1920x1080+0+0/32/32/32/32
                                fi

			elif [[ "$display" == "2_screens" ]]; then
				printf '%s' "2_screens is not supported for 3 screens   "
				return 1
			elif [[ "$display" == "same_image" ]]; then
				printf '%s' "same_image is not supported for 3 screens  "
				return 1
			fi

		elif [[ "$status" -eq 0 ]]; then
			printf '%s' "Activation only 1 screen (3 detected)  "
			xrandr --output "$ls_primary" --primary --mode "$resolution1" --rate "$frequency1" --rotate normal --output "$ls_secondary" --off
		fi

		
	elif [[ "$nbr_screens" -eq 0 ]]; then 
		printf '%s' "Bug ? no screen found                      "
		return 1
		
	else 
		printf '%s' "Whatever you have is not supported         "
		return 1
	fi
}

function switch_audioOutput {

	getPulse
	if [[ -n $isPulse ]]; then

		# cards[0]: "alsa_card.pci-0000_00_1b.0" 
		# cards[1]: "alsa_card.pci-0000_01_00.1" 
		# cards[2]: "alsa_card.usb-Denon_DJ_DS1-00" 
		if [[ "$status" -eq 1 ]]; then 

			if [[ "$nbr_screens" -eq 1  &&  -z $ls_secondary ]]; then
				printf '%s' "Switching sound output to Internal     "
				card="${cards[0]}"
				profile="${profiles[0]}"
			else 
				printf '%s' "Switching sound output to External     "
				if [[ "$nbr_sources" -eq 1 ]]; then
					card="${cards[0]}"
				else 
					card="${cards[1]}"
				fi
				profile="${profiles[1]}"
			fi

		elif [[ "$status" -eq 0 ]]; then
			printf '%s' "Switching sound output to Internal     "
			card="${cards[0]}"
			profile="${profiles[0]}"
		fi

		if [[ -n $card_output && -n $profile_output ]]; then 
			card="$card_output"
			profile="$profile_output"
		fi

		findCardNumber "$card"
		listCardProfiles
		findSink "$card"
		
		if [[ -n $sink_index ]]; then
			moveAllSounds "$sink_index" "$card"
			pactl set-sink-mute "$sink_index" 0
		
			#findSource "$card"

		else
			printf '%s' ": Please check the cards names at top of script"
			return 1
		fi

	else
		printf '%s\n' "No pulseaudio sound detected           "
		return 1
	fi
}

function getIndex_functions {

       	index="not_last"
	for i in "${!ls_functions[@]}"; do
		last_index=$((${#ls_functions[@]} - 1))
		if [[ "${ls_functions[$i]}" == "$1" && "$i" -eq $last_index ]]; then index="last"; fi
	done
}

function writeTree {

	getIndex_functions "$2"
	if [[ "$index" == not_last ]]; then
		if [[ "$1" == tree ]];           then printf '%s' " ├─> "
		elif [[ "$1"  == subtree ]];     then printf '%s' " │   ├─ "
		elif [[ "$1"  == subtree_end ]]; then printf '%s' " │   └─ "
		fi	
	elif [[ "$index" == last ]]; then
		if [[ "$1" == tree ]];           then printf '%s' " └─> "
		elif [[ "$1"  == subtree ]];     then printf '%s' "     ├─ "
		elif [[ "$1"  == subtree_end ]]; then printf '%s' "     └─ "
		fi
	fi
}

function checkSuccess {

	[[ "$?" == 0 ]] && printf '%b\n' ": ${GREEN}OK${NC}" || printf '%b\n' ": ${RED}Fail${NC}"
}

function show_usage {

	printf '\n%s\n'   "To use this script, you need to give as argument:"
	printf '%s\n'     "	-s: 1 (activate) or 0 (deactivate), for the DVD mode needed	(obligatory)"
	printf '%s\n'     "	-m: same, 2 or 3, for the screens mode needed (default: same)	(optional)"
	printf '%s\n'     "	-c: sound card name, without the profile. -p is needed          (optional)"
	printf '%s\n'     "	-p: sound profile name. In this case, -c is needed              (optional)"
	printf '%s\n'     "	-v: for verbose mode						(optional)"
	printf '%s\n\n'   "	-u: to show this usage						(optional)"
}

function run {

	ls_functions=( )
	ls_functions=("switch_powerDisplay" "switch_screensaver" "switch_inactivity" "switch_screenOutput" "switch_audioOutput")

	for function in "${ls_functions[@]}"; do
		writeTree "tree" "$function"
		"$function"
		checkSuccess

		if [[ "$debug" == "true" ]]; then

			if [[ "$function" == switch_powerDisplay ]]; then
				writeTree "subtree_end" "$function"
				printf 'sleep-display-ac         : %s\n' "$display_ac seconds"
			fi

			if [[ "$function" == switch_screensaver ]]; then
				writeTree "subtree" "$function"
				printf 'idle-activation-enabled  : %s\n' "$idle_enabled"
				writeTree "subtree_end" "$function"
				printf 'lock-enabled             : %s\n' "$lock_enabled"
			fi

			if [[ "$function" == switch_inactivity ]]; then
				writeTree "subtree_end" "$function"
				printf 'idle-delay               : %s\n' "$idle_delay minutes"
			fi

			if [[ "$function" == switch_screenOutput ]]; then
				writeTree "subtree" "$function"
				printf 'number of screens        : %s\n' "$nbr_screens"
				writeTree "subtree" "$function"
				printf "${BLUE}primary                  ${NC}: ${BLUE}%s${NC}\n" "$ls_primary"
				writeTree "subtree" "$function"
				printf 'resolution1              : %s\n' "$resolution1"
				writeTree "subtree" "$function"
				printf 'frequency1               : %s Hz\n' "$frequency1"

				if [[ "$nbr_screens" -ge 2 ]]; then
					writeTree "subtree" "$function"
					if [[ "$status" -eq 1 ]];   then printf "${BLUE}secondary${NC}                : ${BLUE}%s${NC}\n" "$ls_secondary"
					elif [[ "$status" -eq 0 ]]; then printf 'secondary                : %s\n' "$ls_secondary"; fi
					writeTree "subtree" "$function"
					printf 'resolution2              : %s\n' "$resolution2"
					writeTree "subtree" "$function"
					printf 'position2                : %s\n' "$position2"
					
					if [[ "$nbr_screens" -eq 2 ]]; then
						writeTree "subtree_end" "$function"
						printf 'frequency2               : %s Hz\n' "$frequency2"

					elif [[ "$nbr_screens" -eq 3 ]]; then
						writeTree "subtree" "$function"
						printf 'frequency2               : %s Hz\n' "$frequency2"
						writeTree "subtree" "$function"
						printf 'resolution3              : %s\n' "$resolution3"
						writeTree "subtree" "$function"
						printf 'position3                : %s\n' "$position3"
						writeTree "subtree_end" "$function"
						printf 'frequency3               : %s Hz\n' "$frequency3"
					fi
				fi
			fi

			if [[ "$function" == switch_audioOutput ]]; then
				writeTree "subtree" "$function"
				printf 'number of sources        : %s\n' "$nbr_sources"
				writeTree "subtree" "$function"
				printf 'number of sinks          : %s\n' "$nbr_sinks"
				writeTree "subtree" "$function"
				printf "${BLUE}card name${NC}                : ${BLUE}%s${NC}\n" "$card"
				writeTree "subtree" "$function"
				printf "${BLUE}profile name${NC}             : ${BLUE}%s${NC}\n" "$profile"
				writeTree "subtree" "$function"
				printf "${BLUE}source name${NC}              : ${BLUE}%s${NC}\n" "$source_name"
				writeTree "subtree" "$function"
				printf "${BLUE}sink name${NC}                : ${BLUE}%s${NC}\n" "$sink_name"
				writeTree "subtree" "$function"
				printf 'card index               : %s\n' "$card_index"
				writeTree "subtree" "$function"
				printf 'sink index               : %s\n' "$sink_index"
				writeTree "subtree" "$function"
				printf 'number of profiles       : %s\n' "$nbr_profiles"
				writeTree "subtree" "$function"
				printf 'sound moved              : %s\n' "$snd_count"
				writeTree "subtree_end" "$function"
				printf 'sink status              : %s\n' "$sink_status"
			fi
		fi
	done
}


# MAIN

if [[ "$UID" -eq 0 ]]; then
	printf '\n%s\n\n' "!! This script shouldn't be run as root -- Stopping"
	exit 0
fi

getDE
if [[ -z $isMate ]]; then
	printf '\n%s\n\n' "!! This script only works for Mate desktop -- sorry"
	exit 0
fi 

while getopts "s:m:c:p:vhu" option; do
	case "$option" in
		s)   status="${OPTARG}" ;;
		m)   mode="${OPTARG}"  ;;
		c)   card_output="${OPTARG}"  ;;
		p)   profile_output="${OPTARG}"  ;;
		v)   debug="true" ;; 
 		h|u) show_usage; exit 0 ;;
 		*) show_usage; exit 1 ;;
 	esac
done

case "$mode" in 
	same) display="same_image" ;;
	2)    display="2_screens"  ;;
	3)    display="3_screens"  ;;
esac

if [[ -n $card_output && -z $profile_output ]]  || [[ -z $card_output && -n $profile_output ]]; then
	printf '\n%s\n\n' "!! If you give a soundcard with '-c' as argument, you need to also give a profile with '-p'"
	show_usage
	exit 1
fi

case "$status" in
	1) printf "\n${YELLOW}%s${NC}\n" "[+] Activation mode DVD"; run ;;
	0) printf "\n${YELLOW}%s${NC}\n" "[-] Deactivation mode DVD"; run ;;
	*) show_usage; exit 1 ;;
esac

echo " "
exit 0

Dernière modification par Heldwin (24/06/2018 22:06:31)


"The only way to achieve the impossible is to believe it’s possible"

Hors ligne

#2 08/12/2015 20:45:34

Heldwin
Charlie
Inscription : 07/10/2008
Messages : 4 076

Re : [MATE] script pour lecture DVD

J'ai corrigé un typo durant la copie (je sais pas où a disparu un '{')

Et j'ai remarqué :
* un problème de détection avec les sinks pulseaudio en le lançant sur d'autres machines.
* que --primary n'est pas toujours utilisé, surtout quand la personne n'utilise pas mate >= 1.12 (ou qu'elle n'a pas précisé quel était son écran principal avec la nouvelle modification)

Vais corriger (même si personne ne s'y intéresse :))

PS: Si vous le lancez, il n'y a rien de destructeur là-dedans, MAIS je me dégage de toute responsabilité :)

EDIT: j'ai un peu corrigé pour pulseaudio, mais la détection des écrans ne me semble pas bonne dans certains cas

Dernière modification par Heldwin (10/12/2015 08:37:30)


"The only way to achieve the impossible is to believe it’s possible"

Hors ligne

#3 29/10/2017 19:08:32

Heldwin
Charlie
Inscription : 07/10/2008
Messages : 4 076

Re : [MATE] script pour lecture DVD

Bon, le point 1 concernant pulseaudio semble être corrigé, maintenant que j'ai 3 cartes sons (à voir quand même sur le long terme...)
Cela change aussi l'output des applications en cours (ça évite de devoir les rouvrir)

Il faut toutefois inscrire les cartes sons dans le script, et qu'elles soient fonctionnelles et pas en dummy.

Reste le point 2, pour quand j'aurai plus d'écrans ^^
Et cela ne gère que des écrans en 1920x1080, pas testé sur des autres résolutions

EDIT: et quelques corrections supplémentaires. mais faudrait que je mette une détection pour voir si le 2ème écran indiqué est bien le bon,
(car j'ai dû mettre ça dans le cas où je déconnectais le 2ème alors qu'il y avait un son lancé dessus), voir pour les cartes sons aussi

Dernière modification par Heldwin (05/11/2017 00:31:34)


"The only way to achieve the impossible is to believe it’s possible"

Hors ligne

#4 14/11/2017 23:23:44

Heldwin
Charlie
Inscription : 07/10/2008
Messages : 4 076

Re : [MATE] script pour lecture DVD

Bon, sur les portables bizarres avec qu'une seule carte listée, mais où les sorties peuvent arriver sur des enceintes différentes, cela marche aussi maintenant...

On m'a fait remarquer que bash n'était peut-être pas le mieux pour faire ça, surtout que le script grossit tout le temps... ^^
(mais j'aime bien bash)

Dernière modification par Heldwin (18/11/2017 20:15:54)


"The only way to achieve the impossible is to believe it’s possible"

Hors ligne

Pied de page des forums