Commit of 2.2.0 Release

This commit is contained in:
linuxer 2021-02-20 18:45:07 +02:00
parent d4d08cc6e6
commit 8f9e579702
Signed by: linuxer.gr
GPG Key ID: CCD2779140DF9E58
18 changed files with 716 additions and 483 deletions

View File

@ -2,12 +2,12 @@ object Form2: TForm2
Left = 2120 Left = 2120
Height = 409 Height = 409
Top = 688 Top = 688
Width = 817 Width = 847
BorderIcons = [biSystemMenu] BorderIcons = [biSystemMenu]
BorderStyle = bsSingle BorderStyle = bsSingle
Caption = 'About' Caption = 'About'
ClientHeight = 409 ClientHeight = 409
ClientWidth = 817 ClientWidth = 847
Icon.Data = { Icon.Data = {
BE2500000000010001003030000001002000A825000016000000280000003000 BE2500000000010001003030000001002000A825000016000000280000003000
0000600000000100200000000000002400006400000064000000000000000000 0000600000000100200000000000002400006400000064000000000000000000
@ -7984,7 +7984,7 @@ object Form2: TForm2
Left = 0 Left = 0
Height = 170 Height = 170
Top = 182 Top = 182
Width = 258 Width = 296
Picture.Data = { Picture.Data = {
0A544A706567496D616765CCF50000FFD8FFE000104A46494600010101004800 0A544A706567496D616765CCF50000FFD8FFE000104A46494600010101004800
480000FFE117FC45786966000049492A000800000006001A0105000100000056 480000FFE117FC45786966000049492A000800000006001A0105000100000056
@ -9960,17 +9960,17 @@ object Form2: TForm2
Left = 302 Left = 302
Height = 260 Height = 260
Top = 5 Top = 5
Width = 509 Width = 538
Font.Height = -14 Font.Height = -14
Font.Name = 'Sans' Font.Name = 'Sans'
ItemHeight = 0 ItemHeight = 0
ParentFont = False ParentFont = False
ScrollWidth = 505 ScrollWidth = 536
TabOrder = 0 TabOrder = 0
TopIndex = -1 TopIndex = -1
end end
object Label1: TLabel object Label1: TLabel
Left = 266 Left = 312
Height = 17 Height = 17
Top = 273 Top = 273
Width = 48 Width = 48
@ -9981,7 +9981,7 @@ object Form2: TForm2
ParentFont = False ParentFont = False
end end
object Label2: TLabel object Label2: TLabel
Left = 266 Left = 312
Height = 17 Height = 17
Top = 305 Top = 305
Width = 48 Width = 48
@ -9995,14 +9995,14 @@ object Form2: TForm2
Left = 0 Left = 0
Height = 36 Height = 36
Top = 366 Top = 366
Width = 817 Width = 840
Caption = 'Close' Caption = 'Close'
OnClick = Button2Click OnClick = Button2Click
ParentFont = False ParentFont = False
TabOrder = 1 TabOrder = 1
end end
object Label3: TLabel object Label3: TLabel
Left = 266 Left = 312
Height = 20 Height = 20
Top = 337 Top = 337
Width = 44 Width = 44
@ -10011,14 +10011,14 @@ object Form2: TForm2
ParentFont = False ParentFont = False
end end
object Image: TImage object Image: TImage
Left = 739 Left = 776
Height = 64 Height = 64
Top = 287 Top = 287
Width = 64 Width = 64
end end
object StaticText1: TStaticText object StaticText1: TStaticText
Cursor = crHandPoint Cursor = crHandPoint
Left = 351 Left = 397
Height = 17 Height = 17
Top = 273 Top = 273
Width = 261 Width = 261
@ -10035,7 +10035,7 @@ object Form2: TForm2
end end
object StaticText2: TStaticText object StaticText2: TStaticText
Cursor = crHandPoint Cursor = crHandPoint
Left = 351 Left = 397
Height = 17 Height = 17
Top = 304 Top = 304
Width = 365 Width = 365
@ -10050,7 +10050,7 @@ object Form2: TForm2
end end
object StaticText3: TStaticText object StaticText3: TStaticText
Cursor = crHandPoint Cursor = crHandPoint
Left = 349 Left = 395
Height = 17 Height = 17
Top = 337 Top = 337
Width = 296 Width = 296
@ -10066,7 +10066,7 @@ object Form2: TForm2
object ImageList: TImageList object ImageList: TImageList
Height = 64 Height = 64
Width = 64 Width = 64
Left = 758 Left = 792
Top = 301 Top = 301
Bitmap = { Bitmap = {
4C7A0700000040000000400000008CBB00000000000078DACCBC07585EE9792D 4C7A0700000040000000400000008CBB00000000000078DACCBC07585EE9792D

View File

@ -398,7 +398,7 @@ install:
<CodeGeneration> <CodeGeneration>
<TargetOS Value="linux"/> <TargetOS Value="linux"/>
<Optimizations> <Optimizations>
<OptimizationLevel Value="3"/> <OptimizationLevel Value="4"/>
</Optimizations> </Optimizations>
</CodeGeneration> </CodeGeneration>
<Linking> <Linking>

View File

@ -21,6 +21,7 @@
<HasResources Value="True"/> <HasResources Value="True"/>
<ResourceBaseClass Value="Form"/> <ResourceBaseClass Value="Form"/>
<EditorIndex Value="3"/> <EditorIndex Value="3"/>
<TopLine Value="45"/>
<CursorPos X="127" Y="19"/> <CursorPos X="127" Y="19"/>
<UsageCount Value="279"/> <UsageCount Value="279"/>
<Loaded Value="True"/> <Loaded Value="True"/>
@ -47,7 +48,8 @@
<HasResources Value="True"/> <HasResources Value="True"/>
<ResourceBaseClass Value="Form"/> <ResourceBaseClass Value="Form"/>
<EditorIndex Value="5"/> <EditorIndex Value="5"/>
<CursorPos X="127" Y="19"/> <TopLine Value="55"/>
<CursorPos X="104" Y="107"/>
<UsageCount Value="279"/> <UsageCount Value="279"/>
<Loaded Value="True"/> <Loaded Value="True"/>
<LoadedDesigner Value="True"/> <LoadedDesigner Value="True"/>
@ -74,11 +76,10 @@
<ResourceBaseClass Value="Form"/> <ResourceBaseClass Value="Form"/>
<UnitName Value="Main"/> <UnitName Value="Main"/>
<IsVisibleTab Value="True"/> <IsVisibleTab Value="True"/>
<TopLine Value="20"/> <TopLine Value="139"/>
<CursorPos Y="47"/> <CursorPos X="82" Y="170"/>
<UsageCount Value="279"/> <UsageCount Value="279"/>
<Loaded Value="True"/> <Loaded Value="True"/>
<LoadedDesigner Value="True"/>
</Unit> </Unit>
<Unit> <Unit>
<Filename Value="OutputForm.pas"/> <Filename Value="OutputForm.pas"/>
@ -101,6 +102,7 @@
<HasResources Value="True"/> <HasResources Value="True"/>
<ResourceBaseClass Value="Form"/> <ResourceBaseClass Value="Form"/>
<EditorIndex Value="9"/> <EditorIndex Value="9"/>
<TopLine Value="16"/>
<CursorPos X="127" Y="19"/> <CursorPos X="127" Y="19"/>
<UsageCount Value="279"/> <UsageCount Value="279"/>
<Loaded Value="True"/> <Loaded Value="True"/>
@ -114,6 +116,7 @@
<HasResources Value="True"/> <HasResources Value="True"/>
<ResourceBaseClass Value="Form"/> <ResourceBaseClass Value="Form"/>
<EditorIndex Value="10"/> <EditorIndex Value="10"/>
<TopLine Value="3"/>
<CursorPos X="127" Y="19"/> <CursorPos X="127" Y="19"/>
<UsageCount Value="279"/> <UsageCount Value="279"/>
<Loaded Value="True"/> <Loaded Value="True"/>
@ -159,7 +162,7 @@
<FRMtype Value="0"/> <FRMtype Value="0"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<EditorIndex Value="2"/> <EditorIndex Value="2"/>
<CursorPos X="26" Y="31"/> <CursorPos X="3" Y="19"/>
<UsageCount Value="224"/> <UsageCount Value="224"/>
<Loaded Value="True"/> <Loaded Value="True"/>
<DefaultSyntaxHighlighter Value="Bash"/> <DefaultSyntaxHighlighter Value="Bash"/>
@ -168,155 +171,141 @@
<Filename Value="libnotify.pas"/> <Filename Value="libnotify.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<EditorIndex Value="1"/> <EditorIndex Value="1"/>
<CursorPos Y="4"/> <TopLine Value="118"/>
<UsageCount Value="35"/> <CursorPos X="3" Y="59"/>
<UsageCount Value="191"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit> </Unit>
<Unit> <Unit>
<Filename Value="/usr/local/codetyphon/typhon/components/pl_lclextensions/source/include/delphicompat_gtk3.inc"/> <Filename Value="../../../bin/CameraControl/CameraControl/ReleasesPacks/camera-control-webcam-switch-indicator/main.pas"/>
<FRMtype Value="0"/> <FRMtype Value="0"/>
<UnitName Value="Main"/>
<EditorIndex Value="-1"/> <EditorIndex Value="-1"/>
<TopLine Value="13"/> <TopLine Value="1973"/>
<CursorPos X="2" Y="41"/> <CursorPos X="11" Y="2408"/>
<UsageCount Value="4"/> <UsageCount Value="10"/>
</Unit>
<Unit>
<Filename Value="/usr/local/codetyphon/typhon/lcl/interfaces/gtk3/alllclintfunits.pas"/>
<FRMtype Value="0"/>
<UnitName Value="AllLCLIntfUnits"/>
<EditorIndex Value="-1"/>
<CursorPos X="3" Y="19"/>
<UsageCount Value="4"/>
</Unit>
<Unit>
<Filename Value="/usr/local/codetyphon/typhon/components/pl_LuiControls/source/luicontrols/presentationmanager.pas"/>
<FRMtype Value="0"/>
<UnitName Value="PresentationManager"/>
<EditorIndex Value="-1"/>
<CursorPos Y="6"/>
<UsageCount Value="9"/>
</Unit> </Unit>
</Units> </Units>
<JumpHistory HistoryIndex="29"> <JumpHistory HistoryIndex="29">
<Position> <Position>
<Filename Value="main.pas"/> <Filename Value="main.pas"/>
<Caret Line="1762" Column="11" TopLine="1737"/> <Caret Line="1346" Column="88" TopLine="1295"/>
</Position> </Position>
<Position> <Position>
<Filename Value="main.pas"/> <Filename Value="main.pas"/>
<Caret Line="1769" Column="6" TopLine="1743"/> <Caret Line="1359" Column="63" TopLine="1304"/>
</Position>
<Position>
<Filename Value="RebootDialog.pas"/>
<Caret Line="12" Column="81" TopLine="8"/>
</Position> </Position>
<Position> <Position>
<Filename Value="main.pas"/> <Filename Value="main.pas"/>
<Caret Line="2058" Column="39" TopLine="2015"/> <Caret Line="1538" Column="85" TopLine="1483"/>
</Position> </Position>
<Position> <Position>
<Filename Value="main.pas"/> <Filename Value="main.pas"/>
<Caret Line="279" Column="27" TopLine="205"/> <Caret Line="1539" Column="53" TopLine="1484"/>
</Position> </Position>
<Position> <Position>
<Filename Value="main.pas"/> <Filename Value="main.pas"/>
<Caret Line="288" Column="11" TopLine="275"/> <Caret Line="1573" Column="78" TopLine="1518"/>
</Position> </Position>
<Position> <Position>
<Filename Value="main.pas"/> <Filename Value="main.pas"/>
<Caret Line="25" Column="63" TopLine="16"/> <Caret Line="1574" Column="39" TopLine="1519"/>
</Position> </Position>
<Position> <Position>
<Filename Value="main.pas"/> <Filename Value="main.pas"/>
<Caret Line="23" Column="10" TopLine="17"/> <Caret Line="1634" Column="69" TopLine="1602"/>
</Position> </Position>
<Position> <Position>
<Filename Value="main.pas"/> <Filename Value="main.pas"/>
<Caret Line="2236" TopLine="2210"/> <Caret Line="1662" Column="72" TopLine="1613"/>
</Position> </Position>
<Position> <Position>
<Filename Value="main.pas"/> <Filename Value="main.pas"/>
<Caret Line="296" Column="19" TopLine="289"/> <Caret Line="1078" Column="12" TopLine="1024"/>
</Position> </Position>
<Position> <Position>
<Filename Value="main.pas"/> <Filename Value="main.pas"/>
<Caret Line="253" TopLine="212"/> <Caret Line="2365" Column="25" TopLine="2311"/>
</Position> </Position>
<Position> <Position>
<Filename Value="main.pas"/> <Filename Value="main.pas"/>
<Caret Line="227" TopLine="186"/> <Caret Line="525" TopLine="495"/>
</Position> </Position>
<Position> <Position>
<Filename Value="main.pas"/> <Filename Value="main.pas"/>
<Caret Line="219" Column="7" TopLine="184"/> <Caret Line="1327" Column="45" TopLine="1296"/>
</Position> </Position>
<Position> <Position>
<Filename Value="main.pas"/> <Filename Value="main.pas"/>
<Caret Line="205" Column="5" TopLine="187"/> <Caret Line="1346" Column="88" TopLine="1296"/>
</Position> </Position>
<Position> <Position>
<Filename Value="main.pas"/> <Filename Value="main.pas"/>
<Caret Line="362" Column="111" TopLine="317"/> <Caret Line="1359" Column="63" TopLine="1304"/>
</Position> </Position>
<Position> <Position>
<Filename Value="main.pas"/> <Filename Value="main.pas"/>
<Caret Line="360" Column="34" TopLine="333"/> <Caret Line="1538" Column="85" TopLine="1483"/>
</Position> </Position>
<Position> <Position>
<Filename Value="main.pas"/> <Filename Value="main.pas"/>
<Caret Line="52" Column="33" TopLine="17"/> <Caret Line="1539" Column="53" TopLine="1484"/>
</Position> </Position>
<Position> <Position>
<Filename Value="main.pas"/> <Filename Value="main.pas"/>
<Caret Line="49" TopLine="23"/> <Caret Line="1573" Column="78" TopLine="1518"/>
</Position> </Position>
<Position> <Position>
<Filename Value="main.pas"/> <Filename Value="main.pas"/>
<Caret Line="225" TopLine="203"/> <Caret Line="1574" Column="39" TopLine="1519"/>
</Position> </Position>
<Position> <Position>
<Filename Value="main.pas"/> <Filename Value="main.pas"/>
<Caret Line="117" Column="24" TopLine="104"/> <Caret Line="1634" Column="49" TopLine="1590"/>
</Position> </Position>
<Position> <Position>
<Filename Value="main.pas"/> <Filename Value="main.pas"/>
<Caret Line="442" Column="20" TopLine="293"/> <Caret Line="1649" Column="49" TopLine="1603"/>
</Position> </Position>
<Position> <Position>
<Filename Value="main.pas"/> <Filename Value="main.pas"/>
<Caret Line="432" Column="141" TopLine="425"/> <Caret Line="1665" Column="82" TopLine="1625"/>
</Position> </Position>
<Position> <Position>
<Filename Value="main.pas"/> <Filename Value="main.pas"/>
<Caret Line="431" Column="125" TopLine="422"/> <Caret Line="1634" Column="58" TopLine="1609"/>
</Position> </Position>
<Position> <Position>
<Filename Value="main.pas"/> <Filename Value="main.pas"/>
<Caret Line="239" Column="7" TopLine="219"/> <Caret Line="1662" Column="74" TopLine="1608"/>
</Position> </Position>
<Position> <Position>
<Filename Value="main.pas"/> <Filename Value="main.pas"/>
<Caret Line="1868" Column="92" TopLine="1817"/> <Caret Line="1663" Column="42" TopLine="1608"/>
</Position> </Position>
<Position> <Position>
<Filename Value="main.pas"/> <Filename Value="main.pas"/>
<Caret Line="363" Column="114" TopLine="330"/> <Caret Line="1716" Column="24" TopLine="1707"/>
</Position>
<Position>
<Filename Value="libnotify.pas"/>
<Caret Line="25" Column="23"/>
</Position> </Position>
<Position> <Position>
<Filename Value="main.pas"/> <Filename Value="main.pas"/>
<Caret Line="363" Column="114" TopLine="315"/> <Caret Line="1915" Column="79" TopLine="1860"/>
</Position> </Position>
<Position> <Position>
<Filename Value="main.pas"/> <Filename Value="main.pas"/>
<Caret Line="434" Column="15" TopLine="360"/> <Caret Line="2417" Column="32" TopLine="2405"/>
</Position> </Position>
<Position> <Position>
<Filename Value="main.pas"/> <Filename Value="main.pas"/>
<Caret Line="7" Column="14"/> <Caret Line="47" TopLine="16"/>
</Position>
<Position>
<Filename Value="main.pas"/>
<Caret Line="2417" Column="32" TopLine="2408"/>
</Position>
<Position>
<Filename Value="main.pas"/>
<Caret Line="2431" Column="75" TopLine="2408"/>
</Position> </Position>
</JumpHistory> </JumpHistory>
<RunParams> <RunParams>

BIN
CameraControl.res Normal file

Binary file not shown.

View File

@ -1,7 +1,8 @@
#!/usr/bin/bash #!/usr/bin/bash
export MYSECRET='sudopasswordtexxt' #export MYSECRET='sudopasswordtext' has been depreciated, it uses polkit instead
package_type=$(command -v pacman || command -v apt || command -v yum) gsettings set com.canonical.notify-osd gravity 2
package_type=$(command -v pacman || command -v apt || command -v yum || command -v xbps-fetch)
export $(dbus-launch)
distropack=${package_type:9} distropack=${package_type:9}
if [[ ${package_type:9} == "apt" ]]; if [[ ${package_type:9} == "apt" ]];
@ -10,6 +11,10 @@ if [[ ${package_type:9} == "apt" ]];
elif [[ ${package_type:9} == "pacman" ]]; elif [[ ${package_type:9} == "pacman" ]];
then then
distro='Arch' distro='Arch'
elif [[ ${package_type:5} == "xbps-fetch" ]];
then
distro='Void'
distropack=${package_type:5}
else else
distro='RPM' distro='RPM'
fi fi
@ -17,23 +22,16 @@ fi
#echo $distropack #echo $distropack
#echo $distro #echo $distro
cd $HOME/FPC\ Projects/CameraControl/build
session_type=$XDG_SESSION_TYPE session_type=$XDG_SESSION_TYPE
#QT_QPA_PLATFORM selection for xcb / wayland #QT_QPA_PLATFORM selection for xcb / wayland
if [[ ${session_type} -eq "x11" ]]; then if [[ ${session_type} -eq "x11" ]]; then
QT_QPA_PLATFORM=xcb /opt/CameraControl/cameracontrol.bin -$distro >/dev/null pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY QT_QPA_PLATFORM=xcb QT_STYLE_OVERRIDE=kvantum /opt/CameraControl/cameracontrol.bin -$distro >/dev/null
exit 0 exit 0
fi fi
if [[ ${session_type} -eq "wayland" ]]; then if [[ ${session_type} -eq "wayland" ]]; then
QT_QPA_PLATFORM=wayland /opt/CameraControl/cameracontrol.bin >/dev/null pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY QT_QPA_PLATFORM=xcb QT_STYLE_OVERRIDE=kvantum /opt/CameraControl/cameracontrol.bin -$distro >/dev/null
exit 0 exit 0
fi fi
#qt_session=$QT_QPA_PLATFORM
# So use the line below for execution
#QT_QPA_PLATFORM=xcb /opt/CameraControl/cameracontrol.bin -$distro >/dev/null

View File

@ -1,11 +1,13 @@
object Form7: TForm7 object Form7: TForm7
Left = 533 Left = 533
Height = 165 Height = 215
Top = 45 Top = 45
Width = 452 Width = 589
BorderStyle = bsToolWindow BorderIcons = [biSystemMenu]
ClientHeight = 165 BorderStyle = bsSingle
ClientWidth = 452 ClientHeight = 215
ClientWidth = 589
DesignTimePPI = 125
Icon.Data = { Icon.Data = {
BE2500000000010001003030000001002000A825000016000000280000003000 BE2500000000010001003030000001002000A825000016000000280000003000
0000600000000100200000000000002400006400000064000000000000000000 0000600000000100200000000000002400006400000064000000000000000000
@ -314,44 +316,44 @@ object Form7: TForm7
Position = poScreenCenter Position = poScreenCenter
LCLVersion = '7.2' LCLVersion = '7.2'
object Button1: TButton object Button1: TButton
Left = 328 Left = 427
Height = 36 Height = 47
Top = 128 Top = 167
Width = 122 Width = 159
Caption = 'Ok' Caption = 'Ok'
OnClick = Button1Click OnClick = Button1Click
ParentFont = False ParentFont = False
TabOrder = 0 TabOrder = 0
end end
object Image: TImage object Image: TImage
Left = 7 Left = 9
Height = 64 Height = 83
Top = 10 Top = 13
Width = 64 Width = 83
end end
object Label1: TLabel object Label1: TLabel
Left = 80 Left = 104
Height = 20 Height = 26
Top = 16 Top = 21
Width = 44 Width = 57
Caption = 'Label1' Caption = 'Label1'
ParentColor = False ParentColor = False
ParentFont = False ParentFont = False
end end
object Edit1: TEdit object Edit1: TEdit
Left = 80 Left = 104
Height = 36 Height = 42
Top = 61 Top = 79
Width = 384 Width = 500
OnEditingDone = Button1Click OnEditingDone = Button1Click
ParentFont = False ParentFont = False
TabOrder = 1 TabOrder = 1
end end
object Button2: TButton object Button2: TButton
Left = 80 Left = 104
Height = 36 Height = 47
Top = 128 Top = 167
Width = 127 Width = 165
Caption = 'Cancel' Caption = 'Cancel'
OnClick = Button2Click OnClick = Button2Click
ParentFont = False ParentFont = False
@ -360,8 +362,8 @@ object Form7: TForm7
object ImageList: TImageList object ImageList: TImageList
Height = 64 Height = 64
Width = 64 Width = 64
Left = 24 Left = 31
Top = 24 Top = 31
Bitmap = { Bitmap = {
4C7A080000004000000040000000A2C200000000000078DAECBC05749C779AEE 4C7A080000004000000040000000A2C200000000000078DAECBC05749C779AEE
D9333DDD31C44E9CC461C7714C31C7EC989959B2645916333333339558AA1233 D9333DDD31C44E9CC461C7714C31C7EC989959B2645916333333339558AA1233

View File

@ -1,12 +1,13 @@
object Form3: TForm3 object Form3: TForm3
Left = 468 Left = 468
Height = 438 Height = 570
Top = 45 Top = 45
Width = 722 Width = 940
BorderStyle = bsToolWindow BorderStyle = bsSingle
Caption = 'Events Logged' Caption = 'Events Logged'
ClientHeight = 438 ClientHeight = 570
ClientWidth = 722 ClientWidth = 940
DesignTimePPI = 125
Icon.Data = { Icon.Data = {
BE2500000000010001003030000001002000A825000016000000280000003000 BE2500000000010001003030000001002000A825000016000000280000003000
0000600000000100200000000000002400006400000064000000000000000000 0000600000000100200000000000002400006400000064000000000000000000
@ -316,9 +317,9 @@ object Form3: TForm3
LCLVersion = '7.2' LCLVersion = '7.2'
object Button1: TButton object Button1: TButton
Left = 0 Left = 0
Height = 36 Height = 47
Top = 399 Top = 520
Width = 722 Width = 940
Caption = 'Close' Caption = 'Close'
OnClick = Button1Click OnClick = Button1Click
ParentFont = False ParentFont = False
@ -326,9 +327,9 @@ object Form3: TForm3
end end
object StringGrid1: TStringGrid object StringGrid1: TStringGrid
Left = 1 Left = 1
Height = 384 Height = 500
Top = 10 Top = 13
Width = 720 Width = 938
AutoAdvance = aaDown AutoAdvance = aaDown
Color = clDefault Color = clDefault
ColCount = 4 ColCount = 4
@ -337,14 +338,14 @@ object Form3: TForm3
RowCount = 1 RowCount = 1
ScrollBars = ssAutoVertical ScrollBars = ssAutoVertical
TabOrder = 1 TabOrder = 1
TitleFont.Height = -13 TitleFont.Height = -17
TitleFont.Name = 'Sans' TitleFont.Name = 'Sans'
TitleImageList = Form1.ImageListStatus TitleImageList = Form1.ImageListStatus
ColWidths = ( ColWidths = (
36 47
175 228
335 436
163 212
) )
Cells = ( Cells = (
4 4

View File

@ -1,11 +1,13 @@
object Form8: TForm8 object Form8: TForm8
Left = 533 Left = 533
Height = 287 Height = 374
Top = 45 Top = 45
Width = 374 Width = 487
BorderStyle = bsToolWindow BorderIcons = [biSystemMenu]
ClientHeight = 287 BorderStyle = bsSingle
ClientWidth = 374 ClientHeight = 374
ClientWidth = 487
DesignTimePPI = 125
Icon.Data = { Icon.Data = {
BE2500000000010001003030000001002000A825000016000000280000003000 BE2500000000010001003030000001002000A825000016000000280000003000
0000600000000100200000000000002400006400000064000000000000000000 0000600000000100200000000000002400006400000064000000000000000000
@ -315,25 +317,25 @@ object Form8: TForm8
LCLVersion = '7.2' LCLVersion = '7.2'
object Button1: TButton object Button1: TButton
Left = 0 Left = 0
Height = 36 Height = 47
Top = 246 Top = 320
Width = 373 Width = 486
Caption = 'Ok' Caption = 'Ok'
OnClick = Button1Click OnClick = Button1Click
ParentFont = False ParentFont = False
TabOrder = 0 TabOrder = 0
end end
object Image: TImage object Image: TImage
Left = 6 Left = 8
Height = 64 Height = 83
Top = 12 Top = 16
Width = 64 Width = 83
end end
object Label1: TLabel object Label1: TLabel
Left = 80 Left = 104
Height = 20 Height = 26
Top = 16 Top = 21
Width = 44 Width = 57
Caption = 'Label1' Caption = 'Label1'
Font.Style = [fsBold] Font.Style = [fsBold]
ParentColor = False ParentColor = False
@ -342,8 +344,8 @@ object Form8: TForm8
object ImageList: TImageList object ImageList: TImageList
Height = 64 Height = 64
Width = 64 Width = 64
Left = 24 Left = 31
Top = 32 Top = 42
Bitmap = { Bitmap = {
4C7A0A000000400000004000000052DA00000000000078DAECBC05749C779AEE 4C7A0A000000400000004000000052DA00000000000078DAECBC05749C779AEE
D9333DDD31C44E9CC461C7714C31C7EC989959B2645916333333339558AA1233 D9333DDD31C44E9CC461C7714C31C7EC989959B2645916333333339558AA1233

View File

@ -1,11 +1,13 @@
object Form6: TForm6 object Form6: TForm6
Left = 533 Left = 533
Height = 410 Height = 534
Top = 45 Top = 45
Width = 464 Width = 604
BorderStyle = bsToolWindow BorderIcons = [biSystemMenu]
ClientHeight = 410 BorderStyle = bsSingle
ClientWidth = 464 ClientHeight = 534
ClientWidth = 604
DesignTimePPI = 125
Icon.Data = { Icon.Data = {
BE2500000000010001003030000001002000A825000016000000280000003000 BE2500000000010001003030000001002000A825000016000000280000003000
0000600000000100200000000000002400006400000064000000000000000000 0000600000000100200000000000002400006400000064000000000000000000
@ -315,36 +317,36 @@ object Form6: TForm6
LCLVersion = '7.2' LCLVersion = '7.2'
object Button1: TButton object Button1: TButton
Left = 0 Left = 0
Height = 36 Height = 47
Top = 368 Top = 479
Width = 465 Width = 605
Caption = 'Ok' Caption = 'Ok'
OnClick = Button1Click OnClick = Button1Click
ParentFont = False ParentFont = False
TabOrder = 0 TabOrder = 0
end end
object ListBox: TListBox object ListBox: TListBox
Left = 80 Left = 104
Height = 353 Height = 460
Top = 10 Top = 13
Width = 384 Width = 500
ItemHeight = 0 ItemHeight = 0
ParentFont = False ParentFont = False
ScrollWidth = 380 ScrollWidth = 498
TabOrder = 1 TabOrder = 1
TopIndex = -1 TopIndex = -1
end end
object Image: TImage object Image: TImage
Left = 8 Left = 10
Height = 64 Height = 83
Top = 10 Top = 13
Width = 64 Width = 83
end end
object ImageList: TImageList object ImageList: TImageList
Height = 64 Height = 64
Width = 64 Width = 64
Left = 24 Left = 31
Top = 32 Top = 42
Bitmap = { Bitmap = {
4C7A07000000400000004000000009A400000000000078DAECBC05749C779AEE 4C7A07000000400000004000000009A400000000000078DAECBC05749C779AEE
D9333DDD31C44E9CC461C7714C31C7EC989959B2645916333333339558AA1233 D9333DDD31C44E9CC461C7714C31C7EC989959B2645916333333339558AA1233

View File

@ -1,20 +1,22 @@
object Form9: TForm9 object Form9: TForm9
Left = 584 Left = 584
Height = 205 Height = 267
Top = 48 Top = 48
Width = 218 Width = 284
BorderStyle = bsToolWindow BorderIcons = [biSystemMenu]
BorderStyle = bsSingle
Caption = 'Camera Control - Killed Pids ' Caption = 'Camera Control - Killed Pids '
ClientHeight = 205 ClientHeight = 267
ClientWidth = 218 ClientWidth = 284
DesignTimePPI = 125
Font.Style = [fsBold] Font.Style = [fsBold]
Position = poScreenCenter Position = poScreenCenter
LCLVersion = '7.2' LCLVersion = '7.2'
object Button1: TButton object Button1: TButton
Left = 0 Left = 0
Height = 36 Height = 47
Top = 164 Top = 214
Width = 216 Width = 281
Caption = 'Οκ' Caption = 'Οκ'
Font.Style = [fsBold] Font.Style = [fsBold]
OnClick = Button1Click OnClick = Button1Click
@ -23,9 +25,9 @@ object Form9: TForm9
end end
object Image1: TImage object Image1: TImage
Left = 0 Left = 0
Height = 64 Height = 83
Top = 10 Top = 13
Width = 64 Width = 83
Picture.Data = { Picture.Data = {
07544269746D61708A3F0000424D8A3F0000000000008A0000007C0000004000 07544269746D61708A3F0000424D8A3F0000000000008A0000007C0000004000
00003F0000000100200003000000003F0000130B0000130B0000000000000000 00003F0000000100200003000000003F0000130B0000130B0000000000000000
@ -539,39 +541,39 @@ object Form9: TForm9
} }
end end
object Label1: TLabel object Label1: TLabel
Left = 87 Left = 113
Height = 20 Height = 26
Top = 45 Top = 59
Width = 34 Width = 45
Caption = 'None' Caption = 'None'
Font.Style = [fsBold] Font.Style = [fsBold]
ParentColor = False ParentColor = False
ParentFont = False ParentFont = False
end end
object ScrollBar1: TScrollBar object ScrollBar1: TScrollBar
Left = 204 Left = 266
Height = 148 Height = 193
Top = 10 Top = 13
Width = 13 Width = 13
Kind = sbVertical Kind = sbVertical
PageSize = 0 PageSize = 0
TabOrder = 1 TabOrder = 1
end end
object Label2: TLabel object Label2: TLabel
Left = 67 Left = 87
Height = 20 Height = 26
Top = 10 Top = 13
Width = 93 Width = 122
Caption = 'Pids Numbers' Caption = 'Pids Numbers'
Font.Style = [fsBold] Font.Style = [fsBold]
ParentColor = False ParentColor = False
ParentFont = False ParentFont = False
end end
object Bevel1: TBevel object Bevel1: TBevel
Left = 61 Left = 79
Height = 12 Height = 16
Top = 31 Top = 40
Width = 106 Width = 138
Shape = bsBottomLine Shape = bsBottomLine
Style = bsRaised Style = bsRaised
end end

View File

@ -1,14 +1,18 @@
# `Camera Control for Linux in System Tray (Notification Area)` # `Camera Control for Linux in System Tray (Notification Area)`
- A small utility to switch your webcam on/off, microphone mute/unmute for Linux Desktops ([Qt5](https://gitlab.com/psposito/camera-control-webcam-switch-indicator/issues/5), [Gtk3 maybe in the future](https://gitlab.com/psposito/camera-control-webcam-switch-indicator/issues/4)) - A small utility to switch your webcam on/off, microphone mute/unmute for Linux Desktops ([Qt5](https://gitlab.com/linuxer.gr/camera-control-webcam-switch-indicator/issues/5), [Gtk3 maybe in the future](https://gitlab.com/inuxer.gr/camera-control-webcam-switch-indicator/issues/4))
- This project replaces the ([camera monitor](https://launchpad.net/cameramonitor)), for having the full webcam status on tray and provides for both camera and microphone switch functions aditionally. - This project replaces the [camera monitor](https://launchpad.net/cameramonitor), for having the full webcam status on tray and provides for both camera and microphone switch functions aditionally.
- In addition, it provides Security Control, by Logs, Popup notifiers and Shield Icon on tray for Malware or Intrusion Detection. - In addition, it provides Security Control, by Logs, Popup notifiers and Shield Icon on tray for Malware or Intrusion Detection.
- For all of the above to be succeded, `the sudo password is necessary to be provided on a copy of /opt/CameraControl.sh to your Home folder`, edited as shown here with the correct sudo password at the sudopasswordtext field. - Polkit integration prevents leakage of sensitive data, as from 2.2.0 release and on
![Screenshot](https://i.imgur.com/iJzG3z3.png) ![Screenshot](https://imgur.com/9qNDcYz.png)
- so the CameraControl.sh, has been modified accordingly
[![Screenshot](https://imgur.com/xea7CYZ.png)
- RPM is not valid yet. I do not have any feedback and testing from such distributions. - RPM is not valid yet. I do not have any feedback and testing from such distributions.
@ -98,14 +102,17 @@
(click on the links to open) (click on the links to open)
- Forced to Reboot if Kernel module V4L2 produces 59 lines by switching the Camera, [from On/Off and from Off/On, when Hacking Events occur](https://gitlab.com/psposito/camera-control-webcam-switch-indicator/-/wikis/Project-History-and-other-Details#found-v4l2-limitations-forcing-for-reboot-when-v4l2-video-on-comes-to-number-60-it-is-mandatory-to-reboot-because-kernel-does-not-generate-more-devices-and-video-capture-is-not-possible) - Forced to Reboot if Kernel module V4L2 produces 59 lines by switching the Camera, [from On/Off and from Off/On, when Hacking Events occur](https://gitlab.com/inuxer.gr/camera-control-webcam-switch-indicator/-/wikis/Project-History-and-other-Details#found-v4l2-limitations-forcing-for-reboot-when-v4l2-video-on-comes-to-number-60-it-is-mandatory-to-reboot-because-kernel-does-not-generate-more-devices-and-video-capture-is-not-possible)
![Screenshot](https://imgur.com/bUjoU0j.png) ![Screenshot](https://imgur.com/bUjoU0j.png)
### Video Demos: ### Video Demos:
- #### The second major release 2.2.0 polkit and notify-osd in action
- #### The Big Release 2.0.2 Demo - [![Release 2.2.0 Demo](http://img.youtube.com/vi/_Z6MtPDJi9Y/0.jpg)](https://www.youtube.com/watch?v=_Z6MtPDJi9Y)
- #### The first major Release 2.0.2 Demo
- [![Release 2.0.2 Demo](http://img.youtube.com/vi/8b2H3lYPNc8/0.jpg)](http://www.youtube.com/watch?v=8b2H3lYPNc8) - [![Release 2.0.2 Demo](http://img.youtube.com/vi/8b2H3lYPNc8/0.jpg)](http://www.youtube.com/watch?v=8b2H3lYPNc8)
@ -135,7 +142,7 @@
- ##### `qt5gtk2` may be needed for correct popup (baloons) messages - ##### `qt5gtk2` may be needed for correct popup (baloons) messages
- ##### `gnome-shell-extension-topicons-plus` [AUR](https://aur.archlinux.org/packages/gnome-shell-extension-topicons-plus) - ##### `gnome-shell-extension-topicons-plus` [AUR](https://aur.archlinux.org/packages/gnome-shell-extension-topicons-plus)
### For All Distributions, add `lsof`, if is not installed at distribution's default installation. ### For All Distributions, add `lsof` and `libnotify`, if are not installed at distribution's default installation.
#### Select the name(s) from the above list, by the name of your Distribution (either major or derived from), respectively. #### Select the name(s) from the above list, by the name of your Distribution (either major or derived from), respectively.

View File

@ -1,12 +1,14 @@
object Form4: TForm4 object Form4: TForm4
Left = 455 Left = 455
Height = 213 Height = 277
Top = 45 Top = 45
Width = 303 Width = 395
BorderStyle = bsToolWindow BorderIcons = [biSystemMenu]
BorderStyle = bsSingle
Caption = 'Sytem Reboot' Caption = 'Sytem Reboot'
ClientHeight = 213 ClientHeight = 277
ClientWidth = 303 ClientWidth = 395
DesignTimePPI = 125
Icon.Data = { Icon.Data = {
BE2500000000010001003030000001002000A825000016000000280000003000 BE2500000000010001003030000001002000A825000016000000280000003000
0000600000000100200000000000002400006400000064000000000000000000 0000600000000100200000000000002400006400000064000000000000000000
@ -313,34 +315,32 @@ object Form4: TForm4
767F 767F
} }
Position = poScreenCenter Position = poScreenCenter
LCLVersion = '7.2' LCLVersion = '7.3'
object ListBox1: TListBox object ListBox1: TListBox
Left = 0 Left = 0
Height = 159 Height = 207
Top = 10 Top = 13
Width = 302 Width = 393
Font.Style = [fsBold] Font.Style = [fsBold]
ItemHeight = 0 ItemHeight = 0
ParentFont = False ParentFont = False
ScrollWidth = 298
TabOrder = 0 TabOrder = 0
TopIndex = -1
end end
object Button1: TButton object Button1: TButton
Left = 36 Left = 47
Height = 36 Height = 47
Top = 174 Top = 227
Width = 74 Width = 96
Caption = 'Reboot' Caption = 'Reboot'
OnClick = Button1Click OnClick = Button1Click
ParentFont = False ParentFont = False
TabOrder = 1 TabOrder = 1
end end
object Button2: TButton object Button2: TButton
Left = 184 Left = 240
Height = 36 Height = 47
Top = 174 Top = 227
Width = 74 Width = 96
Caption = 'Cancel' Caption = 'Cancel'
OnClick = Button2Click OnClick = Button2Click
ParentFont = False ParentFont = False

View File

@ -104,7 +104,8 @@ begin
CmdString := ''; CmdString := '';
Password := Form4.Password; Password := Form4.Password;
FileDestDir := '/etc/modprobe.d/blacklistuvcvideo.conf'; FileDestDir := '/etc/modprobe.d/blacklistuvcvideo.conf';
CmdString := Concat(Concat(Concat('echo ', Password), ' | sudo -S rm -f '), FileDestDir); //CmdString := Concat(Concat(Concat('echo ', Password), ' | sudo -S rm -f '), FileDestDir);
CmdString := Concat(Concat('sudo rm -f '), FileDestDir);
S := FpSystem(CmdString); S := FpSystem(CmdString);
if (S <> 0) then if (S <> 0) then
begin begin
@ -130,7 +131,8 @@ begin
HomeDir := expandfilename('~/'); HomeDir := expandfilename('~/');
FileString := Concat(HomeDir,'.blacklistuvcvideo '); FileString := Concat(HomeDir,'.blacklistuvcvideo ');
FileDestDir := '/etc/modprobe.d/blacklistuvcvideo.conf'; FileDestDir := '/etc/modprobe.d/blacklistuvcvideo.conf';
CmdString := Concat(Concat(Concat(Concat('echo ', Password), ' | sudo -S cp '), FileString), FileDestDir); //CmdString := Concat(Concat(Concat(Concat('echo ', Password), ' | sudo -S cp '), FileString), FileDestDir);
CmdString := Concat(Concat(Concat('sudo cp '), FileString), FileDestDir);
S := FpSystem(CmdString); S := FpSystem(CmdString);
if (S <> 0) then if (S <> 0) then
begin begin
@ -190,7 +192,8 @@ begin
begin begin
Line := Copy(Form4.AudioStringList.Strings[n], 11, Length(Form4.AudioStringList.Strings[n])); Line := Copy(Form4.AudioStringList.Strings[n], 11, Length(Form4.AudioStringList.Strings[n]));
//ShowMessage(Line); //ShowMessage(Line);
CmdString := Concat(Concat(Concat('echo ', Password), ' | sudo -S modprobe '), Line); //CmdString := Concat(Concat(Concat('echo ', Password), ' | sudo -S modprobe '), Line);
CmdString := Concat(Concat('sudo modprobe '), Line);
S := FpSystem(CmdString); S := FpSystem(CmdString);
Inc(n); Inc(n);
end; end;
@ -213,7 +216,8 @@ begin
FileDestDir := ''; FileDestDir := '';
Password := Form4.Password; Password := Form4.Password;
FileDestDir := '/etc/modprobe.d/blacklistaudio.conf'; FileDestDir := '/etc/modprobe.d/blacklistaudio.conf';
CmdString := Concat(Concat(Concat('echo ', Password), ' | sudo -S rm -f '), FileDestDir); //CmdString := Concat(Concat(Concat('echo ', Password), ' | sudo -S rm -f '), FileDestDir);
CmdString := Concat(Concat('sudo rm -f '), FileDestDir);
S := FpSystem(CmdString); S := FpSystem(CmdString);
if (S <> 0) then if (S <> 0) then
@ -238,7 +242,8 @@ begin
HomeDir := expandfilename('~/'); HomeDir := expandfilename('~/');
FileString := Concat(HomeDir,'.blacklistaudio '); FileString := Concat(HomeDir,'.blacklistaudio ');
FileDestDir := '/etc/modprobe.d/blacklistaudio.conf '; FileDestDir := '/etc/modprobe.d/blacklistaudio.conf ';
CmdString := Concat(Concat(Concat(Concat('echo ', Password), ' | sudo -S cp '), FileString), FileDestDir); //CmdString := Concat(Concat(Concat(Concat('echo ', Password), ' | sudo -S cp '), FileString), FileDestDir);
CmdString := Concat(Concat(Concat('sudo cp '), FileString), FileDestDir);
S := FpSystem(CmdString); S := FpSystem(CmdString);
if (S <> 0) then if (S <> 0) then
begin begin

View File

@ -1,12 +1,14 @@
object Form5: TForm5 object Form5: TForm5
Left = 533 Left = 533
Height = 294 Height = 383
Top = 45 Top = 45
Width = 365 Width = 475
BorderStyle = bsToolWindow BorderIcons = [biSystemMenu]
BorderStyle = bsSingle
Caption = 'Reboot or Quit Application' Caption = 'Reboot or Quit Application'
ClientHeight = 294 ClientHeight = 383
ClientWidth = 365 ClientWidth = 475
DesignTimePPI = 125
Icon.Data = { Icon.Data = {
BE2500000000010001003030000001002000A825000016000000280000003000 BE2500000000010001003030000001002000A825000016000000280000003000
0000600000000100200000000000002400006400000064000000000000000000 0000600000000100200000000000002400006400000064000000000000000000
@ -315,10 +317,10 @@ object Form5: TForm5
Position = poScreenCenter Position = poScreenCenter
LCLVersion = '7.2' LCLVersion = '7.2'
object Button1: TButton object Button1: TButton
Left = 21 Left = 27
Height = 36 Height = 47
Top = 256 Top = 333
Width = 118 Width = 154
Caption = 'Reboot' Caption = 'Reboot'
Default = True Default = True
OnClick = Button1Click OnClick = Button1Click
@ -326,31 +328,31 @@ object Form5: TForm5
TabOrder = 0 TabOrder = 0
end end
object Button2: TButton object Button2: TButton
Left = 200 Left = 260
Height = 36 Height = 47
Top = 256 Top = 333
Width = 118 Width = 154
Caption = 'Quit' Caption = 'Quit'
OnClick = Button2Click OnClick = Button2Click
ParentFont = False ParentFont = False
TabOrder = 1 TabOrder = 1
end end
object ListBox1: TListBox object ListBox1: TListBox
Left = 5 Left = 7
Height = 215 Height = 280
Top = 10 Top = 13
Width = 358 Width = 466
ItemHeight = 0 ItemHeight = 0
ParentFont = False ParentFont = False
ScrollWidth = 354 ScrollWidth = 464
TabOrder = 2 TabOrder = 2
TopIndex = -1 TopIndex = -1
end end
object StaticText1: TStaticText object StaticText1: TStaticText
Left = 57 Left = 74
Height = 17 Height = 22
Top = 231 Top = 301
Width = 243 Width = 316
Caption = 'V4L2 limitations, forcing for Reboot' Caption = 'V4L2 limitations, forcing for Reboot'
Font.Color = clBlue Font.Color = clBlue
Font.Style = [fsItalic, fsUnderline] Font.Style = [fsItalic, fsUnderline]

118
main.frm
View File

@ -1,20 +1,20 @@
object Form1: TForm1 object Form1: TForm1
Left = 612 Left = 612
Height = 629 Height = 701
Top = 251 Top = 251
Width = 755 Width = 930
Caption = 'Form1' Caption = 'Form1'
ClientHeight = 629 ClientHeight = 701
ClientWidth = 755 ClientWidth = 930
DesignTimePPI = 125 DesignTimePPI = 125
OnCreate = FormCreate OnCreate = FormCreate
PopupMenu = PopupMenu1 PopupMenu = PopupMenu1
LCLVersion = '7.2' LCLVersion = '7.3'
object VpClock1: TVpClock object VpClock1: TVpClock
Left = 306 Left = 392
Height = 39 Height = 30
Top = 553 Top = 552
Width = 177 Width = 136
Active = False Active = False
ClockMode = cmClock ClockMode = cmClock
DigitalOptions.MilitaryTime = True DigitalOptions.MilitaryTime = True
@ -45,8 +45,8 @@ object Form1: TForm1
object ImageListMic: TImageList object ImageListMic: TImageList
Height = 64 Height = 64
Width = 64 Width = 64
Left = 473 Left = 542
Top = 20 Top = 32
Bitmap = { Bitmap = {
4C7A030000004000000040000000875D00000000000078DADC7D075814D7FA3E 4C7A030000004000000040000000875D00000000000078DADC7D075814D7FA3E
4DC01ABBB16BA2C61A5BC4DE22187B8988A0284A1790DECB0E55AA48EFBD4AEF 4DC01ABBB16BA2C61A5BC4DE22187B8988A0284A1790DECB0E55AA48EFBD4AEF
@ -2912,14 +2912,14 @@ object Form1: TForm1
Hint = 'Camera Menu' Hint = 'Camera Menu'
Visible = True Visible = True
OnClick = TrayIcon1Click OnClick = TrayIcon1Click
Left = 634 Left = 703
Top = 104 Top = 116
end end
object ImageListCam: TImageList object ImageListCam: TImageList
Height = 64 Height = 64
Width = 64 Width = 64
Left = 634 Left = 703
Top = 20 Top = 32
Bitmap = { Bitmap = {
4C7A040000004000000040000000984F00000000000078DAED7D075814D7F736 4C7A040000004000000040000000984F00000000000078DAED7D075814D7F736
02028A1514517AEFBDF7DE51E9BD1751C0120B764D8C3DB624C6DE7BAFB13710 02028A1514517AEFBDF7DE51E9BD1751C0120B764D8C3DB624C6DE7BAFB13710
@ -5880,8 +5880,8 @@ object Form1: TForm1
Hint = 'Microphone Status & Menu' Hint = 'Microphone Status & Menu'
Visible = True Visible = True
OnClick = TrayIcon2Click OnClick = TrayIcon2Click
Left = 473 Left = 542
Top = 104 Top = 116
end end
object ProcessUTF8_1: TProcessUTF8 object ProcessUTF8_1: TProcessUTF8
Active = False Active = False
@ -5896,11 +5896,11 @@ object Form1: TForm1
WindowTop = 0 WindowTop = 0
WindowWidth = 0 WindowWidth = 0
FillAttribute = 0 FillAttribute = 0
Left = 20 Left = 96
Top = 547 Top = 547
end end
object PopupMenu1: TPopupMenu object PopupMenu1: TPopupMenu
Left = 174 Left = 243
Top = 547 Top = 547
object MenuItem1: TMenuItem object MenuItem1: TMenuItem
Caption = 'Camera' Caption = 'Camera'
@ -5959,8 +5959,8 @@ object Form1: TForm1
object ImageListStatus: TImageList object ImageListStatus: TImageList
Height = 64 Height = 64
Width = 64 Width = 64
Left = 333 Left = 402
Top = 20 Top = 32
Bitmap = { Bitmap = {
4C7A050000004000000040000000BB6A00000000000078DAEC7D05781457F7FE 4C7A050000004000000040000000BB6A00000000000078DAEC7D05781457F7FE
46D1E2B4D0022D85D296162AD48D16EAEE022DA5A54829EE1A926009114284B8 46D1E2B4D0022D85D296162AD48D16EAEE022DA5A54829EE1A926009114284B8
@ -9535,12 +9535,12 @@ object Form1: TForm1
Hint = 'Events Log Status' Hint = 'Events Log Status'
Visible = True Visible = True
OnClick = TrayIcon3Click OnClick = TrayIcon3Click
Left = 333 Left = 402
Top = 104 Top = 116
end end
object PopupMenu2: TPopupMenu object PopupMenu2: TPopupMenu
Left = 333 Left = 402
Top = 174 Top = 186
object MenuItem12: TMenuItem object MenuItem12: TMenuItem
Caption = 'Show Logs' Caption = 'Show Logs'
Bitmap.Data = { Bitmap.Data = {
@ -10271,8 +10271,8 @@ object Form1: TForm1
end end
end end
object PopupMenu3: TPopupMenu object PopupMenu3: TPopupMenu
Left = 473 Left = 542
Top = 174 Top = 186
object MenuItem18: TMenuItem object MenuItem18: TMenuItem
Caption = '-' Caption = '-'
end end
@ -11162,8 +11162,8 @@ object Form1: TForm1
end end
end end
object PopupMenu4: TPopupMenu object PopupMenu4: TPopupMenu
Left = 634 Left = 703
Top = 174 Top = 186
object MenuItem14: TMenuItem object MenuItem14: TMenuItem
Caption = 'Camera' Caption = 'Camera'
Bitmap.Data = { Bitmap.Data = {
@ -12193,14 +12193,14 @@ object Form1: TForm1
Hint = 'System Actions and Main Menu' Hint = 'System Actions and Main Menu'
Visible = True Visible = True
OnClick = TrayIcon4Click OnClick = TrayIcon4Click
Left = 174 Left = 243
Top = 104 Top = 116
end end
object ImageListSystem: TImageList object ImageListSystem: TImageList
Height = 64 Height = 64
Width = 64 Width = 64
Left = 174 Left = 243
Top = 20 Top = 32
Bitmap = { Bitmap = {
4C7A010000004000000040000000C70C00000000000078DAED9A0B6C95E519C7 4C7A010000004000000040000000C70C00000000000078DAED9A0B6C95E519C7
DB721BCEDB70C1CCCC6D2E19DBD42C71CBB22C8CCCB96432350885404B5D3142 DB721BCEDB70C1CCCC6D2E19DBD42C71CBB22C8CCCB96432350885404B5D3142
@ -12641,8 +12641,8 @@ object Form1: TForm1
} }
end end
object PopupMenu5: TPopupMenu object PopupMenu5: TPopupMenu
Left = 174 Left = 243
Top = 174 Top = 186
object MenuItem40: TMenuItem object MenuItem40: TMenuItem
Caption = 'System Camera' Caption = 'System Camera'
Bitmap.Data = { Bitmap.Data = {
@ -20866,14 +20866,14 @@ object Form1: TForm1
Hint = 'Camera Status' Hint = 'Camera Status'
Visible = True Visible = True
OnClick = TrayIcon5Click OnClick = TrayIcon5Click
Left = 27 Left = 96
Top = 104 Top = 116
end end
object ImageListCam1: TImageList object ImageListCam1: TImageList
Height = 64 Height = 64
Width = 64 Width = 64
Left = 27 Left = 96
Top = 20 Top = 32
Bitmap = { Bitmap = {
4C7A030000004000000040000000C15400000000000078DAD59D059895D5F6FF 4C7A030000004000000040000000C15400000000000078DAD59D059895D5F6FF
09958B5DD7BAA220DDDD39C00CCC0C534C7777173330450C357437D229212021 09958B5DD7BAA220DDDD39C00CCC0C534C7777173330450C357437D229212021
@ -24181,8 +24181,8 @@ object Form1: TForm1
TitleFont.Name = 'Roboto' TitleFont.Name = 'Roboto'
TitleFont.Style = [fsBold] TitleFont.Style = [fsBold]
Visible = False Visible = False
Left = 634 Left = 703
Top = 240 Top = 252
end end
object PopupNotifier2: TPopupNotifier object PopupNotifier2: TPopupNotifier
Color = clBlack Color = clBlack
@ -24653,8 +24653,8 @@ object Form1: TForm1
TitleFont.Style = [fsBold] TitleFont.Style = [fsBold]
Visible = False Visible = False
OnClose = PopupNotifier2Close OnClose = PopupNotifier2Close
Left = 634 Left = 703
Top = 293 Top = 320
end end
object PopupNotifier3: TPopupNotifier object PopupNotifier3: TPopupNotifier
Color = clBlack Color = clBlack
@ -24784,8 +24784,8 @@ object Form1: TForm1
TitleFont.Name = 'Roboto' TitleFont.Name = 'Roboto'
TitleFont.Style = [fsBold] TitleFont.Style = [fsBold]
Visible = False Visible = False
Left = 473 Left = 542
Top = 240 Top = 252
end end
object PopupNotifier4: TPopupNotifier object PopupNotifier4: TPopupNotifier
Color = clBlack Color = clBlack
@ -24923,8 +24923,8 @@ object Form1: TForm1
TitleFont.Name = 'Roboto' TitleFont.Name = 'Roboto'
TitleFont.Style = [fsBold] TitleFont.Style = [fsBold]
Visible = False Visible = False
Left = 473 Left = 542
Top = 293 Top = 320
end end
object PopupNotifier5: TPopupNotifier object PopupNotifier5: TPopupNotifier
Color = clBlack Color = clBlack
@ -25391,8 +25391,8 @@ object Form1: TForm1
TitleFont.Name = 'Roboto' TitleFont.Name = 'Roboto'
TitleFont.Style = [fsBold] TitleFont.Style = [fsBold]
Visible = False Visible = False
Left = 27 Left = 96
Top = 240 Top = 252
end end
object PopupNotifier6: TPopupNotifier object PopupNotifier6: TPopupNotifier
Color = clBlack Color = clBlack
@ -25862,8 +25862,8 @@ object Form1: TForm1
TitleFont.Name = 'Roboto' TitleFont.Name = 'Roboto'
TitleFont.Style = [fsBold] TitleFont.Style = [fsBold]
Visible = False Visible = False
Left = 27 Left = 96
Top = 293 Top = 320
end end
object PopupNotifier7: TPopupNotifier object PopupNotifier7: TPopupNotifier
Color = clBlack Color = clBlack
@ -26330,8 +26330,8 @@ object Form1: TForm1
TitleFont.Name = 'Roboto' TitleFont.Name = 'Roboto'
TitleFont.Style = [fsBold] TitleFont.Style = [fsBold]
Visible = False Visible = False
Left = 27 Left = 96
Top = 366 Top = 393
end end
object PopupNotifier8: TPopupNotifier object PopupNotifier8: TPopupNotifier
Color = clBlack Color = clBlack
@ -26689,8 +26689,8 @@ object Form1: TForm1
TitleFont.Name = 'Roboto' TitleFont.Name = 'Roboto'
TitleFont.Style = [fsBold] TitleFont.Style = [fsBold]
Visible = False Visible = False
Left = 333 Left = 402
Top = 240 Top = 252
end end
object PopupNotifier9: TPopupNotifier object PopupNotifier9: TPopupNotifier
Color = clBlack Color = clBlack
@ -27048,12 +27048,12 @@ object Form1: TForm1
TitleFont.Name = 'Roboto' TitleFont.Name = 'Roboto'
TitleFont.Style = [fsBold] TitleFont.Style = [fsBold]
Visible = False Visible = False
Left = 333 Left = 402
Top = 293 Top = 320
end end
object PopupMenu6: TPopupMenu object PopupMenu6: TPopupMenu
Left = 27 Left = 96
Top = 174 Top = 186
object MenuItem13: TMenuItem object MenuItem13: TMenuItem
Caption = 'Kill Capturing (User Mode)' Caption = 'Kill Capturing (User Mode)'
Bitmap.Data = { Bitmap.Data = {

359
main.pas
View File

@ -167,7 +167,7 @@ type
end; end;
var var
ReleaseNo : String = '2.1.0'; ReleaseNo : String = '2.2.0'; // skipped subversions, from 2.1.0, cause of the major change of operation with polkit and notify-osd
Form1 : TForm1; Form1 : TForm1;
S : LongInt; S : LongInt;
MicSwitchStr : String; MicSwitchStr : String;
@ -282,57 +282,57 @@ begin
inherited Create(); inherited Create();
end; end;
procedure RunsAsRoot(CommandLine:String); //procedure RunsAsRoot(CommandLine:String);
var //var
Proc: TProcess; // Proc: TProcess;
CharBuffer: array [0..511] of char; // CharBuffer: array [0..511] of char;
ReadCount: integer; // ReadCount: integer;
ExitCode: integer; // ExitCode: integer;
SudoPassword: string; // SudoPassword: string;
//
begin //begin
WriteLn('Please enter the sudo password:'); // WriteLn('Please enter the sudo password:');
Readln(SudoPassword); // Readln(SudoPassword);
ExitCode := -1; //Start out with failure, let's see later if it works // ExitCode := -1; //Start out with failure, let's see later if it works
Proc := TProcess.Create(nil); //Create a new process // Proc := TProcess.Create(nil); //Create a new process
try // try
Proc.Options := [poUsePipes, poStderrToOutPut]; //Use pipes to redirect program stdin,stdout,stderr // Proc.Options := [poUsePipes, poStderrToOutPut]; //Use pipes to redirect program stdin,stdout,stderr
Proc.CommandLine := CommandLine; //Run ls /root as root using sudo // Proc.CommandLine := CommandLine; //Run ls /root as root using sudo
// -S causes sudo to read the password from stdin. // // -S causes sudo to read the password from stdin.
Proc.Execute; //start it. sudo will now probably ask for a password // Proc.Execute; //start it. sudo will now probably ask for a password
//
// write the password to stdin of the sudo program: // // write the password to stdin of the sudo program:
SudoPassword := SudoPassword + LineEnding; // SudoPassword := SudoPassword + LineEnding;
Proc.Input.Write(SudoPassword[1], Length(SudoPassword)); // Proc.Input.Write(SudoPassword[1], Length(SudoPassword));
SudoPassword := '%*'; //short string, hope this will scramble memory a bit; note: using PChars is more fool-proof // SudoPassword := '%*'; //short string, hope this will scramble memory a bit; note: using PChars is more fool-proof
SudoPassword := ''; // and make the program a bit safer from snooping?!? // SudoPassword := ''; // and make the program a bit safer from snooping?!?
//
// main loop to read output from stdout and stderr of sudo // // main loop to read output from stdout and stderr of sudo
while Proc.Running or (Proc.Output.NumBytesAvailable > 0) or // while Proc.Running or (Proc.Output.NumBytesAvailable > 0) or
(Proc.Stderr.NumBytesAvailable > 0) do // (Proc.Stderr.NumBytesAvailable > 0) do
begin // begin
// read stdout and write to our stdout // // read stdout and write to our stdout
while Proc.Output.NumBytesAvailable > 0 do // while Proc.Output.NumBytesAvailable > 0 do
begin // begin
ReadCount := Min(512, Proc.Output.NumBytesAvailable); //Read up to buffer, not more // ReadCount := Min(512, Proc.Output.NumBytesAvailable); //Read up to buffer, not more
Proc.Output.Read(CharBuffer, ReadCount); // Proc.Output.Read(CharBuffer, ReadCount);
Write(StdOut, Copy(CharBuffer, 0, ReadCount)); // Write(StdOut, Copy(CharBuffer, 0, ReadCount));
end; // end;
// read stderr and write to our stderr // // read stderr and write to our stderr
while Proc.Stderr.NumBytesAvailable > 0 do // while Proc.Stderr.NumBytesAvailable > 0 do
begin // begin
ReadCount := Min(512, Proc.Stderr.NumBytesAvailable); //Read up to buffer, not more // ReadCount := Min(512, Proc.Stderr.NumBytesAvailable); //Read up to buffer, not more
Proc.Stderr.Read(CharBuffer, ReadCount); // Proc.Stderr.Read(CharBuffer, ReadCount);
Write(StdErr, Copy(CharBuffer, 0, ReadCount)); // Write(StdErr, Copy(CharBuffer, 0, ReadCount));
end; // end;
end; // end;
ExitCode := Proc.ExitStatus; // ExitCode := Proc.ExitStatus;
//
finally // finally
Proc.Free; // Proc.Free;
Halt(ExitCode); // Halt(ExitCode);
end; // end;
end; //end;
procedure AdjustBalloonPosition; procedure AdjustBalloonPosition;
var var
@ -504,24 +504,24 @@ begin
{$ENDIF} {$ENDIF}
end; end;
procedure GetDistrName; // This will be altered after testing on different distros, so to eliminate the $distro on CameraControl.sh //procedure GetDistrName; // This will be altered after testing on different distros, so to eliminate the $distro on CameraControl.sh
var //var
AStringList : TStringList; // AStringList : TStringList;
AProcess : TProcess; // AProcess : TProcess;
begin //begin
AProcess := TProcess.Create(nil); // AProcess := TProcess.Create(nil);
AProcess.Executable := '/bin/sh'; // AProcess.Executable := '/bin/sh';
AProcess.Parameters.Add('-c'); // AProcess.Parameters.Add('-c');
AProcess.Parameters.Add('cat /etc/lsb-release | grep DISTRIB_ID='); // AProcess.Parameters.Add('cat /etc/lsb-release | grep DISTRIB_ID=');
AProcess.Options := AProcess.Options + [poWaitOnExit, poUsePipes]; // AProcess.Options := AProcess.Options + [poWaitOnExit, poUsePipes];
AProcess.Execute; // AProcess.Execute;
AStringList := TStringList.Create; // AStringList := TStringList.Create;
AStringList.LoadFromStream(AProcess.Output); // AStringList.LoadFromStream(AProcess.Output);
DistrNameStr := Copy(AStringList.Strings[AstringList.Count-1], 12, Length(AStringList.Strings[AstringList.Count-1])); // DistrNameStr := Copy(AStringList.Strings[AstringList.Count-1], 12, Length(AStringList.Strings[AstringList.Count-1]));
//
AStringList.Free; // AStringList.Free;
AProcess.Free; // AProcess.Free;
end; //end;
procedure GetMicCaptureStatus; procedure GetMicCaptureStatus;
var var
@ -623,7 +623,8 @@ begin
j := 0; j := 0;
while j <= AStringList.Count - 1 do while j <= AStringList.Count - 1 do
begin begin
S := FpSystem(Concat('echo ', Password2, ' | sudo -S kill -KILL ' , AStringList.Strings[j])); //S := FpSystem(Concat('echo ', Password2, ' | sudo -S kill -KILL ' , AStringList.Strings[j]));
S := FpSystem(Concat('sudo kill -KILL ' , AStringList.Strings[j]));
Inc(j); Inc(j);
end; end;
@ -656,10 +657,10 @@ begin
CaptureAppName := ''; CaptureAppName := '';
//StrLength := 0; //StrLength := 0;
if (Length(Password2) > 0) and (HasPassword = true) then // Full test command is: lsof /dev | grep video && ls /dev/ | grep v4l //if (Length(Password2) > 0) and (HasPassword = true) then // Full test command is: lsof /dev | grep video && ls /dev/ | grep v4l
Str2 := Concat('echo ', Password2, ' | sudo -S sh -c "lsof /dev | grep video"') // Str2 := Concat('echo ', Password2, ' | sudo -S sh -c "lsof /dev | grep video"')
else //else
Str2 := Concat('lsof /dev/ ' , '|' , ' grep video'); Str2 := Concat('sudo lsof /dev/ ' , '|' , ' grep video');
Str := Str2; Str := Str2;
AStringList := TStringList.Create; AStringList := TStringList.Create;
@ -927,51 +928,51 @@ begin
end; end;
procedure GetCapturePassword; //procedure GetCapturePassword;
begin //begin
if (HasPassword = false) and (WantsPassword = true) then // if (HasPassword = false) and (WantsPassword = true) then
begin // begin
PasswordInputQuery; // PasswordInputQuery;
if InputForm.Form7.CancelOk = false then // if InputForm.Form7.CancelOk = false then
begin // begin
S := FpSystem(Concat('echo ', Password2, ' | sudo -S sh -c "ls /root"')); // S := FpSystem(Concat('echo ', Password2, ' | sudo -S sh -c "ls /root"'));
if S <> 0 then // if S <> 0 then
begin // begin
WantsPassword := false; // WantsPassword := false;
Form1.MenuItem38.Visible := true; // Form1.MenuItem38.Visible := true;
HasPassword := false; // HasPassword := false;
Password2 := ''; // Password2 := '';
NoCapturePassword; // NoCapturePassword;
end // end
else // else
begin // begin
if (HasPassword = false) and (Length(Password2) > 0) then // if (HasPassword = false) and (Length(Password2) > 0) then
Password := Password2; // Password := Password2;
WantsPassword := false; // WantsPassword := false;
Form1.MenuItem38.Visible := false; // Form1.MenuItem38.Visible := false;
HasPassword := true; // HasPassword := true;
//
MessageForm.Form8.Caption := 'Camera Control for Linux'; // MessageForm.Form8.Caption := 'Camera Control for Linux';
MessageForm.Form8.Button1.Caption := 'Ok'; // MessageForm.Form8.Button1.Caption := 'Ok';
MessageForm.Form8.Label1.Caption := 'Password is Correct' + LineEnding + // MessageForm.Form8.Label1.Caption := 'Password is Correct' + LineEnding +
' ' + LineEnding + // ' ' + LineEnding +
'Now Kill Capturing (Sudo) is available' + LineEnding + // 'Now Kill Capturing (Sudo) is available' + LineEnding +
'on the Camera Indicator Menu' + LineEnding + // 'on the Camera Indicator Menu' + LineEnding +
' ' + LineEnding + // ' ' + LineEnding +
'Got correct password from User' + LineEnding + // 'Got correct password from User' + LineEnding +
'Input'; // 'Input';
MessageForm.Form8.ImageList.GetBitmap(7, MessageForm.Form8.Image.Picture.Bitmap); // MessageForm.Form8.ImageList.GetBitmap(7, MessageForm.Form8.Image.Picture.Bitmap);
MessageForm.Form8.ShowModal; // MessageForm.Form8.ShowModal;
//
//ShowMessage( 'Password is Correct' + sLineBreak + // //ShowMessage( 'Password is Correct' + sLineBreak +
// 'Now Kill Capturing (Sudo) is available' + sLineBreak + // // 'Now Kill Capturing (Sudo) is available' + sLineBreak +
// 'on the Camera Indicator Menu'); // // 'on the Camera Indicator Menu');
end; // end;
end // end
else // else
NoCapturePassword; // NoCapturePassword;
end; // end;
end; //end;
procedure TForm1.FormCreate(Sender: TObject); procedure TForm1.FormCreate(Sender: TObject);
@ -1009,6 +1010,7 @@ begin
LogsDateString := FormatDateTime('DD/MM/YYYY-hh:mm:ss',now); LogsDateString := FormatDateTime('DD/MM/YYYY-hh:mm:ss',now);
LogsFileNameDir := HomeDir + '.cameracontrol-' + LogsDateString + '.log'; LogsFileNameDir := HomeDir + '.cameracontrol-' + LogsDateString + '.log';
SavedLogsFilenameDir := '.cameracontrol-' + LogsDateString + '.log'; SavedLogsFilenameDir := '.cameracontrol-' + LogsDateString + '.log';
HasPassword := true;
LogsStringList.Clear; LogsStringList.Clear;
//Logs.Form3.StringGrid1.Clean; //Logs.Form3.StringGrid1.Clean;
@ -1259,7 +1261,8 @@ begin
else else
begin begin
AskPassword; AskPassword;
S := FpSystem(Concat('echo ', Password, ' | sudo -S ls /root ')); //S := FpSystem(Concat('echo ', Password, ' | sudo -S ls /root '));
S := FpSystem(Concat('sudo ls /root '));
if S <> 0 then if S <> 0 then
begin begin
MessageForm.Form8.Caption := 'Camera Control for Linux'; MessageForm.Form8.Caption := 'Camera Control for Linux';
@ -1320,7 +1323,8 @@ begin
if (HasPassword = false) then if (HasPassword = false) then
begin begin
MenuPasswordInputQuery; MenuPasswordInputQuery;
S := FpSystem(Concat('echo ', Password, ' | sudo -S sh -c "ls /root"')); //S := FpSystem(Concat('echo ', Password, ' | sudo -S sh -c "ls /root"'));
S := FpSystem('sudo ls /root');
if S <> 0 then if S <> 0 then
begin begin
Form1.MenuItem38.Visible := true; Form1.MenuItem38.Visible := true;
@ -1531,7 +1535,8 @@ begin
CmdString := Concat(Concat(Concat('echo ', BlackListStr),' >> '), FileString); CmdString := Concat(Concat(Concat('echo ', BlackListStr),' >> '), FileString);
S := FpSystem(CmdString); S := FpSystem(CmdString);
CmdString := Concat(Concat(Concat(Concat('echo ', Password), ' | sudo -S cp '), FileString), FileDestDir); //CmdString := Concat(Concat(Concat(Concat('echo ', Password), ' | sudo -S cp '), FileString), FileDestDir);
CmdString := Concat(Concat(Concat('sudo cp '), FileString), FileDestDir);
S := FpSystem(CmdString); S := FpSystem(CmdString);
CheckSStatus; CheckSStatus;
@ -1565,7 +1570,8 @@ begin
begin begin
AskPassword; AskPassword;
end; end;
CmdString := Concat(Concat(Concat('echo ', Password), ' | sudo -S rm '), FileDestDir); //CmdString := Concat(Concat(Concat('echo ', Password), ' | sudo -S rm '), FileDestDir);
CmdString := Concat('sudo rm ', FileDestDir);
S := FpSystem(CmdString); S := FpSystem(CmdString);
CheckSStatus; CheckSStatus;
if (S = 0) then if (S = 0) then
@ -1624,7 +1630,8 @@ begin
begin begin
AskPassword; AskPassword;
end; end;
CmdString := Concat(Concat(Concat(Concat('echo ', Password), ' | sudo -S cp '), FileString), FileDestDir); //CmdString := Concat(Concat(Concat(Concat('echo ', Password), ' | sudo -S cp '), FileString), FileDestDir);
CmdString := Concat('sudo cp ', FileString, FileDestDir);
S:= FpSystem(CmdString); S:= FpSystem(CmdString);
CheckSStatus; CheckSStatus;
if (S = 0) and (HasPassword = true) then if (S = 0) and (HasPassword = true) then
@ -1652,7 +1659,8 @@ begin
CmdString := ''; CmdString := '';
AskPassword; AskPassword;
FileString := '/etc/modprobe.d/blacklistaudio.conf'; FileString := '/etc/modprobe.d/blacklistaudio.conf';
CmdString := Concat(Concat(Concat('echo ', Password), ' | sudo -S rm '), FileString); //CmdString := Concat(Concat(Concat('echo ', Password), ' | sudo -S rm '), FileString);
CmdString := Concat(Concat('sudo -S rm '), FileString);
if (FileExists(FileString) = true) then if (FileExists(FileString) = true) then
begin begin
@ -1697,14 +1705,15 @@ end;
procedure CameraOn; procedure CameraOn;
begin begin
S := FpSystem(Concat('echo ', Password, ' | sudo -S modprobe uvcvideo')); //S := FpSystem(Concat('echo ', Password, ' | sudo -S modprobe uvcvideo'));
S := FpSystem('sudo -S modprobe uvcvideo');
CheckSStatus; CheckSStatus;
end; end;
procedure CameraOff; procedure CameraOff;
begin begin
S := FpSystem(Concat('echo ', Password, ' | sudo -S rmmod -f uvcvideo')); //S := FpSystem(Concat('echo ', Password, ' | sudo -S rmmod -f uvcvideo'));
//S := FpSystem(Concat('echo ', Password, ' | sudo -S modprobe -rf uvcvideo')); S := FpSystem('sudo modprobe -rf uvcvideo');
CheckSStatus; CheckSStatus;
end; end;
@ -2254,7 +2263,7 @@ begin
PopUpWebcamHacked; PopUpWebcamHacked;
Logs.Form3.StringGrid1.InsertRowWithValues ( GridLine, [IntToStr(GridLine), FormatDateTime('dd/mm/yyyy, ', HackedTime) Logs.Form3.StringGrid1.InsertRowWithValues ( GridLine, [IntToStr(GridLine), FormatDateTime('dd/mm/yyyy, ', HackedTime)
+ RightStr(DateTimeToStr(VPClock1.Time), 8), 'Camera Hacked from Captuting to Off', IntToStr(VideoDevicesNumber)]); + RightStr(DateTimeToStr(VPClock1.Time), 8), 'Camera Hacked from Capturing to Off', IntToStr(VideoDevicesNumber)]);
ImageListStatus.GetIcon(1, TrayIcon3.Icon); ImageListStatus.GetIcon(1, TrayIcon3.Icon);
ImageListCam1.GetIcon(0, TrayIcon5.Icon); ImageListCam1.GetIcon(0, TrayIcon5.Icon);
@ -2405,55 +2414,55 @@ begin
end; end;
procedure CheckCapturePassword; //procedure CheckCapturePassword;
begin //begin
//Password2 := RightStr(Password2, Length(Password2) - 1); // //Password2 := RightStr(Password2, Length(Password2) - 1);
//ShowMessage(Password2 + ', ' + IntToStr(Length(Password2))); // //ShowMessage(Password2 + ', ' + IntToStr(Length(Password2)));
S := FpSystem(Concat('echo ', Password2, ' | sudo -S sh -c "ls /root"')); // S := FpSystem(Concat('echo ', Password2, ' | sudo -S sh -c "ls /root"'));
if S <> 0 then // if S <> 0 then
begin // begin
Form1.MenuItem13.Visible := true; // Form1.MenuItem13.Visible := true;
Form1.MenuItem37.Visible := false; // Form1.MenuItem37.Visible := false;
Form1.MenuItem38.Visible := true; // Form1.MenuItem38.Visible := true;
HasPassword := false; // HasPassword := false;
Password2 := ''; // Password2 := '';
NoCapturePassword; // NoCapturePassword;
WantsPassword := true; // WantsPassword := true;
Form1.MenuItem13.Visible := true; // Form1.MenuItem13.Visible := true;
end // end
else // else
begin // begin
Password := Password2; // Password := Password2;
Form1.MenuItem13.Visible := false; // Form1.MenuItem13.Visible := false;
Form1.MenuItem37.Visible := true; // Form1.MenuItem37.Visible := true;
Form1.MenuItem38.Visible := false; // Form1.MenuItem38.Visible := false;
HasPassword := true; // HasPassword := true;
//
MessageForm.Form8.Caption := 'Camera Control for Linux'; // MessageForm.Form8.Caption := 'Camera Control for Linux';
MessageForm.Form8.Button1.Caption := 'Ok'; // MessageForm.Form8.Button1.Caption := 'Ok';
MessageForm.Form8.Label1.Caption := 'Password is Correct' + LineEnding + // MessageForm.Form8.Label1.Caption := 'Password is Correct' + LineEnding +
' ' + LineEnding + // ' ' + LineEnding +
'Now Kill Capturing (Sudo) is available' + LineEnding + // 'Now Kill Capturing (Sudo) is available' + LineEnding +
'on the Camera Indicator Menu' + LineEnding + // 'on the Camera Indicator Menu' + LineEnding +
' ' + LineEnding + // ' ' + LineEnding +
'Got correct password from startup' + LineEnding + // 'Got correct password from startup' + LineEnding +
'parameter'; // 'parameter';
MessageForm.Form8.ImageList.GetBitmap(7, MessageForm.Form8.Image.Picture.Bitmap); // MessageForm.Form8.ImageList.GetBitmap(7, MessageForm.Form8.Image.Picture.Bitmap);
MessageForm.Form8.ShowModal; // MessageForm.Form8.ShowModal;
//
WantsPassword := false; // WantsPassword := false;
end; // end;
//
end; //end;
procedure TForm1.VpClock1SecondChange(Sender: TObject); procedure TForm1.VpClock1SecondChange(Sender: TObject);
begin begin
if (FromMain = true) and (CompareText(RightStr(Password2, Length(Password2) - 1), '') > 0) and (HasPassword = false) then //if (FromMain = true) and (CompareText(RightStr(Password2, Length(Password2) - 1), '') > 0) and (HasPassword = false) then
CheckCapturePassword // CheckCapturePassword
else //else
if (FromMain = true) and (CompareText(RightStr(Password2, Length(Password2) - 1), '') = 0) and (HasPassword = false) then // if (FromMain = true) and (CompareText(RightStr(Password2, Length(Password2) - 1), '') = 0) and (HasPassword = false) then
GetCapturePassword; // GetCapturePassword;
CheckEvents; CheckEvents;
end; end;

124
notifier.pas Normal file
View File

@ -0,0 +1,124 @@
unit notifier;
{$mode objfpc}{$H+}
{ Copyright (C) 2017-2020 David Bannon
License:
This code is licensed under BSD 3-Clause Clear License, see file License.txt
or https://spdx.org/licenses/BSD-3-Clause-Clear.html
------------------
A trivial unit that uses libnotify on Linux and a timed out TPopupNotify on other platforms.
Does very little, on linux it just calls libnotify, https://github.com/ik5/libnotify-fpc
On Non-Linux, it calls TPopupNotifier, sets a timer and removes the Popup after the set
time (in mS). In both cases, it then destroys itself !
Yes, you call create but YOU DO NOT FREE it !
To use it, grab libnotify.pas, add it and this unit to your Lazarus project and do
something like this -
procedure TForm1.Button2Click(Sender: TObject);
var
Notifier : TNotifier;
begin
Notifier := TNotifier.Create;
Notifier.ShowTheMessage('This is Title', 'and this is the message', 15000); // 15 seconds
// Note, don't free it, it frees itself.
end;
On Linux, multitheading must be enabled, in the project (lpr) file, add
{$DEFINE UseCThreads} immediatly above the first "uses" line.
On Linux, to compile you need the dev version of libnotify but at run time all
that is needed is libnotify and it appears to be installed on most if not all distros.
On tomboy-ng, my model is that "oh, you might like to know" type notifications take the common
6 seconds. Things the end user might really need to know, such as sync drive not being available
I give 12 seconds. Something, really urgent (I don't have any) might get longer. Its incorrect
to leave messages that really don't need user action there for very long.
}
interface
uses
Classes, SysUtils, fpTimer{$ifdef Linux}, libnotify{$else}, PopupNotifier {$endif} ;
Type
{ TNotifier }
TNotifier = class
private
{$ifdef LINUX}
LNotifier : PNotifyNotification;
{$else}
LocalTimer : TFPTimer;
PopupNotifier: TPopupNotifier;
procedure TimerFinished( Sender : TObject );
{$endif}
public
procedure ShowTheMessage(const Title, Message : string; ShowTime : integer = 6000);
destructor Destroy; Override;
constructor Create();
end;
implementation
procedure TNotifier.ShowTheMessage(const Title, Message : string; ShowTime : integer);
begin
{$ifdef LINUX}
notify_init(argv[0]);
LNotifier := notify_notification_new (pchar(Title), pchar(Message), pchar('dialog-information'));
notify_notification_set_timeout(LNotifier, ShowTime); // figure is mS
notify_notification_show (LNotifier, nil);
notify_uninit;
Destroy;
// Should also check for errors and use TPopupNotifier if Notify won't work
// But that will have to wait until I find a Linux where it does not work .....
{$else}
// Non Linux must use TPopupNotifier
PopupNotifier := TPopupNotifier.Create(nil);
PopupNotifier.Text := Message;
PopupNotifier.Title := Title;
PopupNotifier.show;
LocalTimer := TFPTimer.create(nil);
LocalTimer.Interval := ShowTime;
LocalTimer.OnTimer:= @TimerFinished;
LocalTimer.Enabled := True;
{$endif}
end;
{$ifndef LINUX}
procedure TNotifier.TimerFinished( Sender : TObject );
begin
// writeln('Timer finished');
LocalTimer.Enabled := false;
PopupNotifier.hide;
Destroy;
end;
{$endif}
destructor TNotifier.Destroy;
begin
{$ifndef LINUX}
freeandnil(PopupNotifier);
freeandnil(LocalTimer);
{$endif}
inherited Destroy;
end;
constructor TNotifier.Create();
begin
inherited Create();
end;
end.

View File

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
"http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
<policyconfig>
<vendor>Camera Control</vendor>
<vendor_url>https://artixlinux.org</vendor_url>
<icon_name>cameracontrol</icon_name>
<action id="org.artixlinux.cameracontrol">
<description>Run Camera Control as root</description>
<description xml:lang="ar">شغّل مُقسِّم‌ج بصلاحية الجذر</description>
<description xml:lang="be">Запусціць Camera Control ад імя суперкарыстальніка</description>
<description xml:lang="cs">Spouštět Camera Control pod uživatelem root</description>
<description xml:lang="da">Kør Camera Control som root</description>
<description xml:lang="de">Camera Control als Root-Benutzer ausführen</description>
<description xml:lang="el">Εκτέλεση Camera Control ως root</description>
<description xml:lang="en_GB">Run Camera Control as root</description>
<description xml:lang="eo">Ruli Camera Control kiel root</description>
<description xml:lang="es">Ejecutar Camera Control como root</description>
<description xml:lang="eu">Exekutatu Camera Control 'root' gisa</description>
<description xml:lang="fi">Suorita Camera Control root-käyttäjänä</description>
<description xml:lang="fr">Lancer Camera Control en tant quutilisateur root</description>
<description xml:lang="fur">Eseguìs Camera Control come root</description>
<description xml:lang="hr">Pokreni Camera Control kao korijenskog korisnika</description>
<description xml:lang="hu">Camera Control futtatása rendszergazdaként</description>
<description xml:lang="id">Jalankan Camera Control sebagai root</description>
<description xml:lang="is">Keyra Camera Control sem kerfisstjóri/root</description>
<description xml:lang="it">Esegui Camera Control come root</description>
<description xml:lang="kk">Camera Control қолданбасын әкімші ретінде жөнелту</description>
<description xml:lang="ko">루트 권한으로 Camera Control 실행</description>
<description xml:lang="lt">Vykdyti Camera Control root teisėmis</description>
<description xml:lang="lv">Palaist Camera Control kā root</description>
<description xml:lang="nl">Camera Control uitvoeren als systeembeheerder (root)</description>
<description xml:lang="pl">Uruchomienie programu Camera Control jako administrator</description>
<description xml:lang="pt_BR">Execute Camera Control como root</description>
<description xml:lang="ro">Rulează Camera Control ca root</description>
<description xml:lang="ru">Запустить Camera Control с правами root</description>
<description xml:lang="sk">Spustiť Camera Control ako správca</description>
<description xml:lang="sr">Покрените Гпартед као администратор</description>
<description xml:lang="sr@latin">Pokrenite Gparted kao administrator</description>
<description xml:lang="sv">Kör Camera Control som root</description>
<description xml:lang="tr">Camera Controlʼi kök olarak çalıştır</description>
<description xml:lang="vi">Chạy Camera Control với tư cách siêu quản trị</description>
<description xml:lang="zh_TW">以 root 執行 Camera Control</description>
<message>Authentication is required to run the Camera Control Partition Editor as root</message>
<message xml:lang="be">Для запуску Camera Control ад імя суперкарыстальніка патрабуецца аўтэнтыфікацыя</message>
<message xml:lang="cs">Ke spuštění editoru oddílů Camera Control pod uživatelem root je vyžadováno ověření</message>
<message xml:lang="da">Godkendelse er krævet for at køre partitioneringsprogrammet Camera Control som root</message>
<message xml:lang="de">Legitimierung ist erforderlich, um Camera Control als Root-Benutzer auszuführen</message>
<message xml:lang="en_GB">Authentication is required to run the Camera Control Partition Editor as root</message>
<message xml:lang="eo">Necesas aŭtentigo por ruli Camera Control Subdiskoredaktilo kiel root</message>
<message xml:lang="es">Se necesita autenticación para ejecutar el editor de particiones Camera Control como root</message>
<message xml:lang="eu">Camera Control partizioen editorea 'root' pribilegiorekin exekutatzeko beharrezkoa da autentifikatzea</message>
<message xml:lang="fi">Tunnistautuminen vaaditaa Camera Control-osiomuokkaimen suorittamiseksi root-käyttäjänä</message>
<message xml:lang="fr">Il est nécessaire de sauthentifier pour lancer léditeur de partitions Camera Control en tant quutilisateur root</message>
<message xml:lang="fur">La autenticazion e je necessarie par eseguî come root l'editôr di partizions Camera Control</message>
<message xml:lang="hr">Potrebna je ovjera za pokretanje Camera Control uređivača particija kao korijenskog korisnika</message>
<message xml:lang="hu">Hitelesítés szükséges a Camera Control partíciószerkesztő rendszergazdaként való futtatásához</message>
<message xml:lang="id">Otentikasi diperlukan untuk menjalankan Penyunting Partisi Camera Control sebagai root</message>
<message xml:lang="is">Auðkenningar er krafist til að keyra Camera Control disksneiðingarstjórann sem kerfisstjóri (root)</message>
<message xml:lang="it">È richiesto autenticarsi per eseguire «Editor di partizioni Camera Control» come root</message>
<message xml:lang="kk">Camera Control бөлімдер түзеткішін әкімші ретінде жөнелту үшін аутентификация керек</message>
<message xml:lang="ko">Camera Control 분할 영역 편집기를 루트 권한으로 실행하려면 인증이 필요합니다</message>
<message xml:lang="lt">Reikia patvirtinti tapatybę norint vykdyti Camera Control skirsnių redaktorių root teisėmis</message>
<message xml:lang="lv">Nepieciešama autentificēšana, lai palaistu Camera Control nodalījumu redaktoru ar root tiesībām</message>
<message xml:lang="nl">Authenticatie is vereist om Camera Control partitiebewerker uit te voeren als systeembeheerder (root)</message>
<message xml:lang="pl">Wymagane jest uwierzytelnienie, aby uruchomić edytora partycji Camera Control jako administrator</message>
<message xml:lang="pt_BR">Autenticação é necessária para executar o Editor de Partições Camera Control como root</message>
<message xml:lang="ro">Autentificarea este necesară pentru a rula Editorul de partiții Camera Control ca root</message>
<message xml:lang="ru">Требуется авторизация для запуска редактора разделов Camera Control с правами root</message>
<message xml:lang="sk">Na spustenie editora oddielov Camera Control ako správca sa vyžaduje overenie totožnosti</message>
<message xml:lang="sr">Потребно је потврђивање идентитета за покретање Гпартеда као администратор</message>
<message xml:lang="sr@latin">Potrebno je potvrđivanje identiteta za pokretanje Gparteda kao administrator</message>
<message xml:lang="sv">Autentisering krävs för att köra Camera Control partitionsredigerare som root</message>
<message xml:lang="tr">Camera Control Disk Bölümü Düzenleyicisiʼni kök olarak çalıştırmak içinyetkilendirme gereklidir</message>
<message xml:lang="vi">Cần xác thực để chạy bộ Sửa phân vùng đĩa Camera Control dưới tư cách siêu quản trị</message>
<message xml:lang="zh_TW">需要驗證才能以 root 執行 Camera Control 分割區編輯器</message>
<defaults>
<allow_any>auth_admin</allow_any>
<allow_inactive>auth_admin</allow_inactive>
<allow_active>auth_admin</allow_active>
</defaults>
<annotate key="org.freedesktop.policykit.exec.path">/usr/bin/notify-send</annotate>
<annotate key="org.freedesktop.policykit.exec.path">/opt/CameraControl/cameracontrol.bin</annotate>
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
</action>
</policyconfig>